/*	---------------------------
 *	Browserweiche
 *	--------------------------- */
	if(document.all)var isIE=true;
	
/*	---------------------------
 *	Konfiguration
 *	--------------------------- */
	var fotos			= new Array();
	var exakt			= false;				// false = runterskalieren | true = die exakte angegebene Größe
	var width			= 480;					// bei exakt=false sollte die width sehr hoch gesetzt werden!
	var height			= 360;
	var preview			= 3;					// anzahl der thumbnails in der manual-navi-leiste
	var time			= 5000					// 'slide'Zeit wie lange ein einzelnes Bild angezeigt wird in ms
	var thumb_height	= height/preview;
	var thumb_width		= 100000;
	var thumb_exakt		= false;
	var nav				= 0;
	var NAV				= -1;
	var Timer;
	var running			= false;
	var startHtml		= "<a onClick=\"kill()\" href=\"#\">pause</a>"
	var stopHtml		= "<a onClick=\"start()\" href=\"#\">play</a>"
/*	---------------------------
 *	Funktionen:
 *	---------------------------
 *	Initialisieren:
 *	Für jedes Bild eine Zeile
 *	anlegen
 *	--------------------------- */
	function init() {
		neu("_slides/img01.jpg", "");
		neu("_slides/img02.jpg", "");
		neu("_slides/img03.jpg", "");
		neu("_slides/img04.jpg", "");
		neu("_slides/img05.jpg", "");
		neu("_slides/img06.jpg", "");
		neu("_slides/img07.jpg", "");
		neu("_slides/img08.jpg", "");
		neu("_slides/img09.jpg", "");
		neu("_slides/img10.jpg", "");
		neu("_slides/img11.jpg", "");
		neu("_slides/img12.jpg", "");
		neu("_slides/img13.jpg", "");
		// document.getElementById("thumbs").style.height=10+height;
		// setTimeout("document.getElementById('thumbs').innerHTML=thumb_table(0)",500);
		start();
	}/*	---------------------------
 *	Funktionen:
 *	---------------------------
 *	Neu
 *	--------------------------- */
	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;
	}
/*	---------------------------
 *	Funktionen:
 *	---------------------------
 *	Skalieren
 *	--------------------------- */
	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="";
	}
/*	---------------------------
 *	Funktionen:
 *	---------------------------
 *	Thumb table
 *	--------------------------- */
	function thumb_table(offset) {
		table="";
		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+="<img "+size+" onclick=\"show('"+x+"',true)\" class='thumb' "+size+" src='"+fotos[x]["pic"].src+"' alt=\""+fotos[x]["text"]+"\">"
			}
		}
		table+="";
		return(table);
	}
/*	---------------------------
 *	Funktionen:
 *	---------------------------
 *	Navi
 *	--------------------------- */
	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();
	}
/*	---------------------------
 *	Funktionen:
 *	---------------------------
 *	Show
 *	--------------------------- */
	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="<img src=" + fotos[x]["pic"].src+" />";
			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;
	}
/*	---------------------------
 *	Funktionen:
 *	---------------------------
 *	Start
 *	--------------------------- */
	function start() {
		if(!running){
			slideshow();
			running=true;
		}
	}
/*	---------------------------
 *	Funktionen:
 *	---------------------------
 *	Slideshow
 *	--------------------------- */
	function slideshow() {
		NAV++;
		if(NAV>=fotos.length)NAV=0;
		show(NAV,true);
		Timer = setTimeout("slideshow()",time);
		document.getElementById("statusSlides").innerHTML = startHtml;
	}
/*	---------------------------
 *	Funktionen:
 *	---------------------------
 *	Kill
 *	--------------------------- */
	function kill() {
		running=false;
		document.getElementById("statusSlides").innerHTML = stopHtml;
		if(Timer)clearTimeout(Timer);
	}
