/*****

Image Cross Fade Redux
Version 1.0
Last revision: 02.15.2006
steve@slayeroffice.com

Please leave this notice intact. 

Rewrite of old code found here: http://slayeroffice.com/code/imageCrossFade/index.html


*****/


/*window.addEventListener?window.addEventListener("load",so_init,false):window.attachEvent("onload",so_init);*/
/* 									*/
/* 	BEGINN: Von Wolfgang Schulner eingebaute Steuerunsparameter 	*/
/* 									*/
var tbetween_11862 = 2000; // Zeitspanne Millisekunden
var t50_11862 = 20; // Dauer eines einzelnen Fadeout-/Fadein-Schrittes in Millisekunden
var opschritt_11862 = 0.01;  // Helligkeitsdifferenz zwischen den Fadeout-/Fadein-Schritten
/* 									*/
/* 	ENDE: Von Wolfgang Schulner eingebaute Steuerunsparameter 	*/
/* 									*/

var d_11862=document, imgs_11862 = new Array(), zInterval_11862 = null, current_11862=0, pause_11862=false;

so_init_11862();

function so_init_11862() {
	if(!d_11862.getElementById || !d_11862.createElement)return;
	
	/*css = d.createElement("link");
	css.setAttribute("href","xfade2.css");
	css.setAttribute("rel","stylesheet");
	css.setAttribute("type","text/css");
	d.getElementsByTagName("head")[0].appendChild(css);*/
	
	imgs_11862 = d_11862.getElementById("imageContainer_11862").getElementsByTagName("img");
	for(i=1;i<imgs_11862.length;i++) imgs_11862[i].xOpacity_11862 = 0;
	imgs_11862[0].style.display = "block";
	imgs_11862[0].xOpacity_11862 = .99;
	
	timeout_11862 = setTimeout(so_xfade_11862,tbetween_11862);
}

function so_xfade_11862() {
	cOpacity_11862 = imgs_11862[current_11862].xOpacity_11862;
	nIndex_11862 = imgs_11862[current_11862+1]?current_11862+1:0;

	nOpacity_11862 = imgs_11862[nIndex_11862].xOpacity_11862;
	
	cOpacity_11862-=opschritt_11862; 
	nOpacity_11862+=opschritt_11862;
	
	imgs_11862[nIndex_11862].style.display = "block";
	imgs_11862[current_11862].xOpacity_11862 = cOpacity_11862;
	imgs_11862[nIndex_11862].xOpacity_11862 = nOpacity_11862;
	
	setOpacity_11862(imgs_11862[current_11862]); 
	setOpacity_11862(imgs_11862[nIndex_11862]);
	
	if(cOpacity_11862<=0) {
		imgs_11862[current_11862].style.display = "none";
		current_11862 = nIndex_11862;
		timeout_11862 = setTimeout(so_xfade_11862,tbetween_11862);
	} else {
		timeout_11862 = setTimeout(so_xfade_11862,t50_11862);
	}
	
	function setOpacity_11862(obj) {
		if(obj.xOpacity_11862>.99) {
			obj.xOpacity_11862 = .99;
			return;
		}
		if(obj.xOpacity_11862<0) {
			obj.xOpacity_11862 = 0;
			return;
		}
		obj.style.opacity = obj.xOpacity_11862;
		obj.style.MozOpacity = obj.xOpacity_11862;
		obj.style.filter = "alpha(opacity=" + (obj.xOpacity_11862*100) + ")";
	}
	
}

