/*****

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_11941 = 5000; // Zeitspanne Millisekunden
var t50_11941 = 10; // Dauer eines einzelnen Fadeout-/Fadein-Schrittes in Millisekunden
var opschritt_11941 = 0.03;  // Helligkeitsdifferenz zwischen den Fadeout-/Fadein-Schritten
/* 									*/
/* 	ENDE: Von Wolfgang Schulner eingebaute Steuerunsparameter 	*/
/* 									*/

var d_11941=document, imgs_11941 = new Array(), zInterval_11941 = null, current_11941=0, pause_11941=false;

so_init_11941();

function so_init_11941() {
	if(!d_11941.getElementById || !d_11941.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_11941 = d_11941.getElementById("imageContainer_11941").getElementsByTagName("img");
	for(i=1;i<imgs_11941.length;i++) imgs_11941[i].xOpacity_11941 = 0;
	imgs_11941[0].style.display = "block";
	imgs_11941[0].xOpacity_11941 = .99;
	
	timeout_11941 = setTimeout(so_xfade_11941,tbetween_11941);
}

function so_xfade_11941() {
	cOpacity_11941 = imgs_11941[current_11941].xOpacity_11941;
	nIndex_11941 = imgs_11941[current_11941+1]?current_11941+1:0;

	nOpacity_11941 = imgs_11941[nIndex_11941].xOpacity_11941;
	
	cOpacity_11941-=opschritt_11941; 
	nOpacity_11941+=opschritt_11941;
	
	imgs_11941[nIndex_11941].style.display = "block";
	imgs_11941[current_11941].xOpacity_11941 = cOpacity_11941;
	imgs_11941[nIndex_11941].xOpacity_11941 = nOpacity_11941;
	
	setOpacity_11941(imgs_11941[current_11941]); 
	setOpacity_11941(imgs_11941[nIndex_11941]);
	
	if(cOpacity_11941<=0) {
		imgs_11941[current_11941].style.display = "none";
		current_11941 = nIndex_11941;
		timeout_11941 = setTimeout(so_xfade_11941,tbetween_11941);
	} else {
		timeout_11941 = setTimeout(so_xfade_11941,t50_11941);
	}
	
	function setOpacity_11941(obj) {
		if(obj.xOpacity_11941>.99) {
			obj.xOpacity_11941 = .99;
			return;
		}
		if(obj.xOpacity_11941<0) {
			obj.xOpacity_11941 = 0;
			return;
		}
		obj.style.opacity = obj.xOpacity_11941;
		obj.style.MozOpacity = obj.xOpacity_11941;
		obj.style.filter = "alpha(opacity=" + (obj.xOpacity_11941*100) + ")";
	}
	
}

