/*****

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

var d_11942=document, imgs_11942 = new Array(), zInterval_11942 = null, current_11942=0, pause_11942=false;

so_init_11942();

function so_init_11942() {
	if(!d_11942.getElementById || !d_11942.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_11942 = d_11942.getElementById("imageContainer_11942").getElementsByTagName("img");
	for(i=1;i<imgs_11942.length;i++) imgs_11942[i].xOpacity_11942 = 0;
	imgs_11942[0].style.display = "block";
	imgs_11942[0].xOpacity_11942 = .99;
	
	timeout_11942 = setTimeout(so_xfade_11942,tbetween_11942);
}

function so_xfade_11942() {
	cOpacity_11942 = imgs_11942[current_11942].xOpacity_11942;
	nIndex_11942 = imgs_11942[current_11942+1]?current_11942+1:0;

	nOpacity_11942 = imgs_11942[nIndex_11942].xOpacity_11942;
	
	cOpacity_11942-=opschritt_11942; 
	nOpacity_11942+=opschritt_11942;
	
	imgs_11942[nIndex_11942].style.display = "block";
	imgs_11942[current_11942].xOpacity_11942 = cOpacity_11942;
	imgs_11942[nIndex_11942].xOpacity_11942 = nOpacity_11942;
	
	setOpacity_11942(imgs_11942[current_11942]); 
	setOpacity_11942(imgs_11942[nIndex_11942]);
	
	if(cOpacity_11942<=0) {
		imgs_11942[current_11942].style.display = "none";
		current_11942 = nIndex_11942;
		timeout_11942 = setTimeout(so_xfade_11942,tbetween_11942);
	} else {
		timeout_11942 = setTimeout(so_xfade_11942,t50_11942);
	}
	
	function setOpacity_11942(obj) {
		if(obj.xOpacity_11942>.99) {
			obj.xOpacity_11942 = .99;
			return;
		}
		if(obj.xOpacity_11942<0) {
			obj.xOpacity_11942 = 0;
			return;
		}
		obj.style.opacity = obj.xOpacity_11942;
		obj.style.MozOpacity = obj.xOpacity_11942;
		obj.style.filter = "alpha(opacity=" + (obj.xOpacity_11942*100) + ")";
	}
	
}

