/*****

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

var d_12019=document, imgs_12019 = new Array(), zInterval_12019 = null, current_12019=0, pause_12019=false;

so_init_12019();

function so_init_12019() {
	if(!d_12019.getElementById || !d_12019.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_12019 = d_12019.getElementById("imageContainer_12019").getElementsByTagName("img");
	for(i=1;i<imgs_12019.length;i++) imgs_12019[i].xOpacity_12019 = 0;
	imgs_12019[0].style.display = "block";
	imgs_12019[0].xOpacity_12019 = .99;
	
	timeout_12019 = setTimeout(so_xfade_12019,tbetween_12019);
}

function so_xfade_12019() {
	cOpacity_12019 = imgs_12019[current_12019].xOpacity_12019;
	nIndex_12019 = imgs_12019[current_12019+1]?current_12019+1:0;

	nOpacity_12019 = imgs_12019[nIndex_12019].xOpacity_12019;
	
	cOpacity_12019-=opschritt_12019; 
	nOpacity_12019+=opschritt_12019;
	
	imgs_12019[nIndex_12019].style.display = "block";
	imgs_12019[current_12019].xOpacity_12019 = cOpacity_12019;
	imgs_12019[nIndex_12019].xOpacity_12019 = nOpacity_12019;
	
	setOpacity_12019(imgs_12019[current_12019]); 
	setOpacity_12019(imgs_12019[nIndex_12019]);
	
	if(cOpacity_12019<=0) {
		imgs_12019[current_12019].style.display = "none";
		current_12019 = nIndex_12019;
		timeout_12019 = setTimeout(so_xfade_12019,tbetween_12019);
	} else {
		timeout_12019 = setTimeout(so_xfade_12019,t50_12019);
	}
	
	function setOpacity_12019(obj) {
		if(obj.xOpacity_12019>.99) {
			obj.xOpacity_12019 = .99;
			return;
		}
		if(obj.xOpacity_12019<0) {
			obj.xOpacity_12019 = 0;
			return;
		}
		obj.style.opacity = obj.xOpacity_12019;
		obj.style.MozOpacity = obj.xOpacity_12019;
		obj.style.filter = "alpha(opacity=" + (obj.xOpacity_12019*100) + ")";
	}
	
}

