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=true;		//false = runterskalieren | true = die exakte angegebene größe
height=120;		//bei exakt=false sollte die width sehr hoch gesetzt werden!
width=120;

preview=0;	//anzahl der thumbnails in der manual-navi-leiste
time=5000	//'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=120;
thumb_exakt=true;

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=\"\""; 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"];

	}
	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);
}

function init(){
	neu("images/001.gif", "");
	neu("images/002.gif", "");
	neu("images/003.gif", "");
	neu("images/004.gif", "");
	neu("images/005.gif", "");
	neu("images/006.gif", "");
	neu("images/007.gif", "");
	neu("images/008.gif", "");
	neu("images/009.gif", "");
	neu("images/010.gif", "");
	neu("images/011.gif", "");
	neu("images/012.gif", "");
	neu("images/013.gif", "");
	neu("images/014.gif", "");
	document.getElementById("thumbs").style.height=0+height;
	setTimeout("document.getElementById('thumbs').innerHTML=thumb_table(0)",500);
}
