
Banner = new CreateBanner()

// Duration of crossfade (seconds)
var crossFadeDuration = 1;

function CreateBanner()
{
 this.Frequenz = 4000;

 this.img 			= ''; 
 this.imgZoom		= '';
 this.i 			= 0;
 this.Imgs 			= new Array(); 
 this.Links 		= new Array();
 this.ImgsWidth	 	= new Array();
 this.ImgsHeight	= new Array();
 

 this.Add = Banner_Add;
 this.Next = Banner_Next;
 this.Previews = Banner_Previews;
 this.Start = Banner_Start;
 this.onclick = Banner_onclick;
 this.initi = Banner_initi;
}

// Add Item
function Banner_Add(s,l,w,h) { 
	this.Imgs[this.Imgs.length] = s; 
  	this.Links[this.Links.length] = l; 
	this.ImgsWidth[this.ImgsWidth.length] = w; 
	this.ImgsHeight[this.ImgsHeight.length] = h; 
}

// Get Next Item
function Banner_Next() {
	this.i++; if(this.i >= this.Imgs.length){this.i = 0
	}

   // Add Filter [Cross fader wird ausgeschalten]
   //#if (document.all){
   //#   document[this.img].style.filter="blendTrans(duration=2)"
   //#   document[this.img].style.filter="blendTrans(duration=crossFadeDuration)"
   //#   document[this.img].filters.blendTrans.Apply()      
   //#}
   
 //document[this.img].style.cursor='url(images/icons/zoom.cur)';
 document[this.img].src = this.Imgs[this.i];
 
 // Play Slideshow  
//# if (document.all){
//#      document.images.SlideShow.filters.blendTrans.Play()
//# }
 
 // Wird beim automatischen durchlauf aufgerufen //
 //#//window.setTimeout('Banner.Next()',this.Frequenz);
}

// Get Next Item
function Banner_Previews() {
	this.i--; if(this.i < 0){ this.i = this.Imgs.length-1 }
	document[this.img].src = this.Imgs[this.i];
}

function Banner_Start(){ this.initi(); /*this.Next();*/ }

// Initialize Banner
function Banner_initi() { 
	if (this.img) {
		document[this.imgZoom].onclick = Banner.onclick; 
	}
}

// Open New Win 
function Banner_onclick() { 
	WinOpenDia(Banner.Links[Banner.i], Banner.ImgsWidth[Banner.i], Banner.ImgsHeight[Banner.i]);
}

// Open a new browser window
function WinOpen(strSrc, width, height) {
	if (width.length!='') { myWidth = (parseInt(width) + 40); } else { myWidth = 620; }
	if (height.length!='') { myHeight = (parseInt(height) + 60); } else { myHeight = 520; }
	MyWin = window.open("zoom_img.php?data=" + strSrc, "ZoomWin", "width=" + myWidth + ",height=" + myHeight + ",scrollbars=yes,screenX=0,screenY=0,left=" + (screen.availWidth/2-(myWidth/2)) + ",top=" + (screen.availHeight/2-(myHeight/2)) + ",resizable=yes, status=yes");
}

// Open a new browser window for diashow //
function WinOpenDia(strSrc, width, height) {
	if (width.length!='') { myWidth = (parseInt(width) + 200); } else { myWidth = 620; }
	if (height.length!='') { myHeight = (parseInt(height) + 200); } else { myHeight = 520; }
	
	MyWin = window.open("diashow.php?data=" + strSrc, "ZoomWin", "width=" + myWidth + ",height=" + myHeight + ",scrollbars=yes,screenX=0,screenY=0,left=" + (screen.availWidth/2-(myWidth/2)) + ",top=" + (screen.availHeight/2-(myHeight/2)) + ",resizable=yes, status=yes");
}


