var nPics = 23;
var aSlidePicSrc = new Array(nPics);
var aText = new Array(nPics);


for (var n = 0; n < nPics; n++) 
{
   aSlidePicSrc[n] = new Array(2);
}

var n = 0;
aSlidePicSrc[n][0] = "images/fotogalerie/wasserturm05t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/wasserturm05.jpg";
aText[n] = "Der Wasserturm ist das Wahrzeichen Langeoogs.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/kutsche01t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/kutsche01.jpg";
aText[n] = "Kutschfahrten zum Vergnügen oder Gepäcktransport.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/wasserturm06t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/wasserturm06.jpg";
aText[n] = "Der Wasserturm.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/lale03t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/lale03.jpg";
aText[n] = "Lale Andersen hatte mit dem Lied \"Lili Marleen\" Weltruhm erlangt.\nEva Recker, die Langeooger Künstlerin, hat die Bronzestatue zum\n100. Geburtstag von Lale Andersen geschaffen.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/bahnhof02t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/bahnhof02.jpg";
aText[n] = "Die Inselbahn ist am Bahnhof Langeoog angekommen.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/kutsche02t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/kutsche02.jpg";
aText[n] = "Kutschfahrten ab Bahnhof Langeoog.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/duenen01t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/duenen01.jpg";
aText[n] = "Der Blick vom Strandübergang zum Wasserturm.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/duenen02t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/duenen02.jpg";
aText[n] = "Dünenübergang zum Strand.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/duenenmeer01t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/duenenmeer01.jpg";
aText[n] = "Der 14 km lange Sandstrand bietet ausreichend Platz für die\n'eigene Burg' am Strand.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/strand06t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/strand06.jpg";
aText[n] = "Strandkörbe werden während der Saison direkt am Strand beim Strandkorbservice vermietet.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/strand07t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/strand07.jpg";
aText[n] = "Mehr Strand.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/strand08t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/strand08.jpg";
aText[n] = "Und noch mehr Strand.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/spielplatz01t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/spielplatz01.jpg";
aText[n] = "Der Kinderspielplatz.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/spielplatz02t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/spielplatz02.jpg";
aText[n] = "Piratenschiff auf dem Kinderspielplatz.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/spielplatz03t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/spielplatz03.jpg";
aText[n] = "Nochmal Kinderspielplatz.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/spielplatz04t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/spielplatz04.jpg";
aText[n] = "Im Hintergrund die bunte Inselbahn.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/rathaus01t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/rathaus01.jpg";
aText[n] = "Das Rathaus.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/kircheevan01t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/kircheevan01.jpg";
aText[n] = "Die evangelische Kirche.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/hafen01t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/hafen01.jpg";
aText[n] = "Am Hafen.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/hafen02t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/hafen02.jpg";
aText[n] = "Am Hafen.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/longhorn01t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/longhorn01.jpg";
aText[n] = "Longhorn's.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/salzwiesen01t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/salzwiesen01.jpg";
aText[n] = "Kühe auf den Salzwiesen.";

n++;
aSlidePicSrc[n][0] = "images/fotogalerie/moewe02t.jpg";
aSlidePicSrc[n][1] = "images/fotogalerie/moewe02.jpg";
aText[n] = "Die Silbermöwe wird ca. 55 - 66 cm groß und ist ein Nesträuber.";


///////////////////////////////////////////////////////////////////////////////////////////////////

var aSlide = new Array(nPics);
var aPic = new Array(nPics);
var nPicsUBound = nPics - 1;
var nView;
var oAuto;
var sFlipFlopFunct = "auto";
var bFlipFlopAlight = false;
var sURLParam;
var aURLParam;
var nFirstPic = 0;
var n;

var bAutoOff = false;
if (bAutoOff == null) bAutoOff = true;

sURLParam = document.location.search;
sURLParam = sURLParam.substr(1,sURLParam.length - 1);
aURLParam = sURLParam.split("&");
if (!isNaN(parseInt(aURLParam[0])))
{
	if (parseInt(aURLParam[0]) < nPics) nFirstPic = parseInt(aURLParam[0]);
}

for (n = 0; n < nPics; n++)
{
	aSlide[n] = new Image();
	aSlide[n].src = aSlidePicSrc[n][0];
}

function Pic(n)
{
	if (aPic[n] == null)
	{
		aPic[n] = new Image();
		aPic[n].src = aSlidePicSrc[n][1];
	}
}	

function NextPic(n)
{	
	if(n < nPicsUBound && aPic[n + 1] == null)
	{
		aPic[n + 1] = new Image();
		aPic[n + 1].src = aSlidePicSrc[n + 1][1];
	}
} 
	
function LoadBtn(sName, sState)
{
	eval("document." + sName).src = "images/fotogalerie/layout/btn_" + sName + sState + ".gif";
}

function LoadFlipFlop(sFunct, bAlight)
{
	var sState;
	if (bAlight == true)
		sState = "Al";
	else
		sState = "";
		
	document.auto_stop.src = "images/fotogalerie/layout/btn_" + sFunct + sState + ".gif";
}

function SetFocus(nPic)
{
	if (document.getElementById)
	{
		for (n = 0; n < nPics; n++)
		{
			if (n == nPic) 
			{
				document.getElementById("PaddingTop" + n).style.height="5px";
				document.getElementById("i" + n).style.border="4px solid #CE4242";
				document.getElementById("PaddingBot" + n).style.height="5px";
			}
			else
			{
				document.getElementById("PaddingTop" + n).style.height="8px";
				document.getElementById("i" + n).style.border="1px solid #333333";
				document.getElementById("PaddingBot" + n).style.height="8px";
			}
		}
	}
}

function ShowPic(n)
{
	SetFocus(n);

	if (n == 0) 
	{
		LoadBtn("back", "Da");
		LoadBtn("first", "Da");
	}
	else
	{
		LoadBtn("back", "");
		LoadBtn("first", "");
	}
	
	if (n == nPicsUBound)
	{
		LoadBtn("forw", "Da");
		LoadBtn("last", "Da");
	}
	else
	{
		LoadBtn("forw", "");
		LoadBtn("last", "");
	}

	nView = n;
	Pic(n);
	document.frm.num.value = "Bild " + (n + 1) + " von " + nPics;       

	if (document.main.filters) document.main.filters.revealTrans.Apply();
	document.main.src = aPic[n].src;
	if (document.main.filters) document.main.filters.revealTrans.Play();  
	document.frm.legend.value = aText[n];
	if (document.getElementById) document.getElementById("main").style.border = "1px solid #333333";
}

function Back()
{
	if (0 < nView) 
		ShowPic(nView - 1); 
	document.getElementById("i" + (nView)).scrollIntoView();
	
}

function Forw()
{
	if (nView < nPicsUBound) 
		ShowPic(nView + 1);
	document.getElementById("i" + (nView)).scrollIntoView();
}

function Up()
{
	if (document.getElementById)
	{
		document.getElementById("i-1").scrollIntoView();
	}
	if (nView > 0) ShowPic(0);
}

function Down()
{
	if (document.getElementById)
	{
		document.getElementById("i" + (nPics - 1)).scrollIntoView();
	}
	if (nView < nPicsUBound) ShowPic(nPicsUBound);
}

function Stop()
{ 
	window.clearTimeout(oAuto);
	sFlipFlopFunct = "auto";
	ChangeCursor();
	LoadFlipFlop(sFlipFlopFunct, bFlipFlopAlight);	
	if (document.getElementById)
	{
		document.getElementById("i" + (nView)).scrollIntoView();
	}
}

function Auto()
{ 
	if (bAutoOff && nView == nPicsUBound - 1)					
	{								
		sFlipFlopFunct = "auto";
		ChangeCursor();					
		LoadFlipFlop(sFlipFlopFunct, bFlipFlopAlight);		
		Forw();							
		window.clearTimeout(oAuto);
	}
	else
	{
		if (sFlipFlopFunct == "auto")
		{
			sFlipFlopFunct = "stop";
			ChangeCursor();
			LoadFlipFlop(sFlipFlopFunct, bFlipFlopAlight);
		}
		if (nView == nPicsUBound) 
			Up();
		else 
			Forw();
		oAuto = window.setTimeout("Auto();", 4000);
	}
	document.getElementById("i" + (nView)).scrollIntoView();
}

function AutoStop()
{
	if (sFlipFlopFunct == "auto") 
		Auto();
	else 
		Stop();
}

function Halt()
{ 
	window.clearTimeout(oAuto);
	if (sFlipFlopFunct == "stop") 
	{
		sFlipFlopFunct = "auto";
		ChangeCursor();
		LoadFlipFlop(sFlipFlopFunct, bFlipFlopAlight);
	}
}

function ChangeCursor()
{
	if (document.getElementById)
	{
		if (sFlipFlopFunct == "stop") 
			document.getElementById("main").style.cursor = "pointer";
		else 
			document.getElementById("main").style.cursor = "default";
	}
}

