// JavaScript Document


if(document.all)var isIE=true;

var fotos = new Array();

function neu(url,text)
{
	Neu = fotos.length;
	fotos[Neu] = new Array();
	fotos[Neu]["text"]=text;
	fotos[Neu]["pic"]=new Image()
	fotos[Neu]["pic"].src=url;
}

// editiere hier das große bild
exakt=false;		//false = runterskalieren | true = die exakte angegebene gr?e
height=300;		//bei exakt=false sollte die width sehr hoch gesetzt werden!
width=900;

preview=3;	//anzahl der thumbnails in der manual-navi-leiste
time=3500	//'slide'Zeit wie lange ein einzelnes Bild angezeigt wird in ms

function skalieren(x,h,w,e)
{
	H=fotos[x]["pic"].height;
	W=fotos[x]["pic"].width;
	W1=W;
	H1=H;
	if(!e)
	{
		if(H>h)
		{
			W1=W*h/H;
			H1=h;
		}
		if(W>w)
		{
			H1=H*w/W;
			W1=w;
		}
	}else
	{
		H1=h;
		W1=w;
	}
	var re = new Array();
	re["w"]=W1;
	re["h"]=H1;
	return(re); W1=""; H1=""; W=""; H="";
}
thumb_height=height/preview;
thumb_width=100000;
thumb_exakt=false;

function thumb_table(offset)
{
	table="<table width=100% height=100%>";
	for(var x=offset; x<=offset+preview-1; x++)
	{
		if(fotos[x])
		{
			var Size = skalieren(x,thumb_height,thumb_width,thumb_exakt);
			size="width="+Size["w"]+" height="+Size["h"];
			table+="<tr><th><img "+size+" onclick=\"show('"+x+"',true)\" class='thumb' "+size+" src='"+fotos[x]["pic"].src+"' alt=\""+fotos[x]["text"]+"\"></th></tr>"
		}
	}
	table+="</table>";
	return(table);
}


var nav=0;
function navi(v)
{
	v=Number(v);
	if(nav+v>fotos.length-preview)
	{
			V=fotos.length-preview;
	}else
	{
		if(nav+v<0)
		{
			V=0;
		}else
		{
			V=nav+v;
		}
	}
	nav=V;
	if(isIE)	document.getElementById("thumbs").filters.blendTrans.Apply();
	document.getElementById("thumbs").innerHTML=thumb_table(V);
	if(isIE)	document.getElementById("thumbs").filters.blendTrans.Play();
}
NAV=-1;
function show(x,fs)
{
	x=Number(x);
	if(fotos[x])
	{
		var Size = skalieren(x,height,width,exakt);
		if(fs){size="width="+Size["w"]+" height="+Size["h"]; alt="alt=\"[show fullsize]\""; was=false} else {size=""; alt="alt=\"[show scaled size]\""; was=true}
		if(isIE)	document.getElementById("inhalt").filters.blendTrans.Apply();
		document.getElementById("inhalt").innerHTML="<table height=100% width=100%><tr><th><b><img  onclick=\"show('"+x+"',"+was+")\" style=\"cursor:hand;\" "+size+" align=\"absmiddle\" src="+fotos[x]["pic"].src+" "+alt+"></th></tr></table>";
		if(isIE)	document.getElementById("inhalt").filters.blendTrans.Play();
		document.getElementById("name").innerHTML=fotos[x]["text"];
		document.getElementById("status").innerHTML=(x+1)+"/"+fotos.length;
	}
	NAV=x
}
var Timer; running=false;
function start()
{
	if(!running)
	{
		slideshow();
		running=true;
	}
}
function slideshow()
{
		NAV++;
		if(NAV>=fotos.length)NAV=0;
		show(NAV,true);
		Timer = setTimeout("slideshow()",time);
		document.getElementById("status2").innerHTML="[on]";
}
function kill()
{
	running=false
	document.getElementById("status2").innerHTML="[off]";
	if(Timer)clearTimeout(Timer);
}

function init()
{
 
 neu("http://www.asia-sauna.de/images/location/neu/location1.JPG",  " "  );
 neu("http://www.asia-sauna.de/images/location/neu/location2.JPG",  " "  );
 neu("http://www.asia-sauna.de/images/location/neu/location3.JPG",  " "  );
 neu("http://www.asia-sauna.de/images/location/neu/location4.JPG",  " "  );
 neu("http://www.asia-sauna.de/images/location/neu/location5.JPG",  " "  );
 neu("http://www.asia-sauna.de/images/location/neu/location6.JPG",  " "  );
 neu("http://www.asia-sauna.de/images/location/neu/location7.JPG",  " "  );
 neu("http://www.asia-sauna.de/images/location/neu/location8.JPG",  " "  );
 neu("http://www.asia-sauna.de/images/location/neu/location9.JPG",  " "  );
 neu("http://www.asia-sauna.de/images/location/neu/location10.JPG",  " "  );
 neu("http://www.asia-sauna.de/images/location/neu/location11.JPG",  " "  );
 neu("http://www.asia-sauna.de/images/location/neu/location12.JPG",  " "  );
 neu("http://www.asia-sauna.de/images/location/neu/location13.JPG",  " "  );
 neu("http://www.asia-sauna.de/images/location/neu/location14.JPG",  " "  );
 neu("http://www.asia-sauna.de/images/location/neu/sauna1.JPG",  "Sauna-Außenbereich"  );
 neu("http://www.asia-sauna.de/images/location/neu/sauna2.JPG",  "Sauna-Außenbereich "  );
 neu("http://www.asia-sauna.de/images/location/neu/sauna3.JPG",  "Sauna-Außenbereich "  );
 neu("http://www.asia-sauna.de/images/location/neu/bodyschaum1.JPG",  "Bodyschaum"  );
 neu("http://www.asia-sauna.de/images/location/neu/bodyschaum2.JPG",  "Bodyschaum"  );
 neu("http://www.asia-sauna.de/images/location/neu/bodyschaum3.JPG",  "Bodyschaum"  );


	document.getElementById("thumbs").style.height=10+height;
	setTimeout("document.getElementById('thumbs').innerHTML=thumb_table(0)",500);
}
