/*****

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_11938 = 3000; // Zeitspanne Millisekunden
var t50_11938 = 20; // Dauer eines einzelnen Fadeout-/Fadein-Schrittes in Millisekunden
var opschritt_11938 = 0.01;  // Helligkeitsdifferenz zwischen den Fadeout-/Fadein-Schritten
/* 									*/
/* 	ENDE: Von Wolfgang Schulner eingebaute Steuerunsparameter 	*/
/* 									*/

var d_11938=document, imgs_11938 = new Array(), zInterval_11938 = null, current_11938=0, pause_11938=false;

so_init_11938();

function so_init_11938() {
	if(!d_11938.getElementById || !d_11938.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_11938 = d_11938.getElementById("imageContainer_11938").getElementsByTagName("img");
	for(i=1;i<imgs_11938.length;i++) imgs_11938[i].xOpacity_11938 = 0;
	imgs_11938[0].style.display = "block";
	imgs_11938[0].xOpacity_11938 = .99;
	
	timeout_11938 = setTimeout(so_xfade_11938,tbetween_11938);
}

function so_xfade_11938() {
	cOpacity_11938 = imgs_11938[current_11938].xOpacity_11938;
	nIndex_11938 = imgs_11938[current_11938+1]?current_11938+1:0;

	nOpacity_11938 = imgs_11938[nIndex_11938].xOpacity_11938;
	
	cOpacity_11938-=opschritt_11938; 
	nOpacity_11938+=opschritt_11938;
	
	imgs_11938[nIndex_11938].style.display = "block";
	imgs_11938[current_11938].xOpacity_11938 = cOpacity_11938;
	imgs_11938[nIndex_11938].xOpacity_11938 = nOpacity_11938;
	
	setOpacity_11938(imgs_11938[current_11938]); 
	setOpacity_11938(imgs_11938[nIndex_11938]);
	
	if(cOpacity_11938<=0) {
		imgs_11938[current_11938].style.display = "none";
		current_11938 = nIndex_11938;
		timeout_11938 = setTimeout(so_xfade_11938,tbetween_11938);
	} else {
		timeout_11938 = setTimeout(so_xfade_11938,t50_11938);
	}
	
	function setOpacity_11938(obj) {
		if(obj.xOpacity_11938>.99) {
			obj.xOpacity_11938 = .99;
			return;
		}
		if(obj.xOpacity_11938<0) {
			obj.xOpacity_11938 = 0;
			return;
		}
		obj.style.opacity = obj.xOpacity_11938;
		obj.style.MozOpacity = obj.xOpacity_11938;
		obj.style.filter = "alpha(opacity=" + (obj.xOpacity_11938*100) + ")";
	}
	
}

