function slide_show(anfang,ende,zeit,bug,test,width,height,name,ext,border,vspace,name2){

this.name = "Slide"+(slide_show.count++)
this.id = ""
this.width = width
this.height = height
this.BildName = name
	if(arguments.length<8 )this.BildName="Img"	//Standart Bildname Img[zahl]
this.BildBorder = border
	if(arguments.length<9 )this.BildBorder=0	// Rahmen um die Bilder, standart: ja
this.BildVspace = vspace	
	if(arguments.length<10 )this.BildVspace = 4	// Vspace, standart: 4
this.BildAnfangName = name2	
	if(name2){ this.check=true}else{this.check=false}
	if(arguments.length<11 )this.BildAnfangName = "img/Img0.gif"	// Anfangs Bild
this.test = test
this.ext = ext
this.num = 0
this.Bild = new Array(4);
this.time = 1500 + slide_show.timeoffset
this.time_end = zeit
this.BildEnde = ende
this.BildAnfang = anfang
this.BildAnzahl = 2 + this.BildEnde - this.BildAnfang
this.debug = bug
this.build = SlideBuild
this.init = slideinit
this.Bild = new Array(2)
this.show = Bildwechsel
this.num = 0
this.repeat = nocheinmal
slide_show.timeoffset += 200

}
slide_show.count=0
slide_show.timeoffset=0


function slideinit()
{
	
	if(this.BildBorder="")this.BildBorder=1
	if(this.BildVspace="")this.BildVspace=4
	
	this.Bild[0]=new Image
	this.Bild[0].src = this.BildAnfangName //hier wird das 1. Bild gesetzt; transparent.
	
	
	
	
for (i=1; i<this.BildAnzahl; i++){
	if (this.BildName=="")this.BildName="Img"
	source="img/"
	source+=this.BildName
	source+=this.BildAnfang
	source+="."+this.ext
	this.Bild[i]=new Image;
	this.Bild[i].src = source;
	this.Bild[i].name = this.BildName+this.BildAnfang
	this.BildAnfang++;
	}
	
	
if(this.debug){
	for (i=0; i<this.BildAnzahl; i++){
	alert("Pfad "+this.Bild[i].src+" Anzahl:"+this.BildAnzahl+" pos: "+i)
		}
	}
this.show()
}

function Bildwechsel()
{
	if(this.num==this.BildAnzahl-1){window.location="http://www.poth.ch/content/start.htm"}
		
			if(this.debug==true) status=("bildwechsel nummer:"+this.num+" src= :"+this.Bild[this.num]+"Anzahl: "+this.BildAnzahl)
			
			number=document.images.length 
					for (i=0;i<number;i++){
						bildname=document.images[i].name
						if(bildname==this.name){
							 if(this.debug)alert("Name :"+bildname+" ID:"+i)
							this.id=i
							}
						}
							 
	if(this.Bild[this.num].complete){	
			this.time=this.time_end
					if(is.ie){	
							if (this.check)document.images[this.id].src=this.Bild[this.num].src
							this.check=false
							if(this.debug) status = ("bild "+this.Bild[this.num].name+"  geladen")
							document.images[this.id].filters.blendTrans.Apply();
		 					document.images[this.id].src = this.Bild[this.num].src;
 							document.images[this.id].filters.blendTrans.Play();
			 			}
 					if(is.ns){ 	document.images[this.id].src=this.Bild[this.num].src;} 
					}	
	else{ if(this.debug) status = ("bild "+this.Bild[this.num].name+" noch nicht geladen")
			this.time=1000
					}
	this.num++;
	this.repeat()
		
}

function nocheinmal(){	window.setTimeout(this.test+'.'+'show()',this.time);	}

function SlideBuild(){
	this.TAG='<img name="'+this.name+'" id="'+this.name+'"src="'+this.BildAnfangName+'" style=" filter:blendTrans(Duration=2)"  width='+this.width+' height='+this.height+' border="'+this.BildBorder+'" vspace="'+this.BildVspace+'" hspace="0">'
	if (this.debug) alert("Slide Build: "+this.TAG)
}
function writeTAG(str,showAlert) {
	str = str
	document.write(str)
}
