/*****

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

var d_12199=document, imgs_12199 = new Array(), zInterval_12199 = null, current_12199=0, pause_12199=false;

so_init_12199();

function so_init_12199() {
	if(!d_12199.getElementById || !d_12199.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_12199 = d_12199.getElementById("imageContainer_12199").getElementsByTagName("img");
	for(i=1;i<imgs_12199.length;i++) imgs_12199[i].xOpacity_12199 = 0;
	imgs_12199[0].style.display = "block";
	imgs_12199[0].xOpacity_12199 = .99;
	
	timeout_12199 = setTimeout(so_xfade_12199,tbetween_12199);
}

function so_xfade_12199() {
	cOpacity_12199 = imgs_12199[current_12199].xOpacity_12199;
	nIndex_12199 = imgs_12199[current_12199+1]?current_12199+1:0;

	nOpacity_12199 = imgs_12199[nIndex_12199].xOpacity_12199;
	
	cOpacity_12199-=opschritt_12199; 
	nOpacity_12199+=opschritt_12199;
	
	imgs_12199[nIndex_12199].style.display = "block";
	imgs_12199[current_12199].xOpacity_12199 = cOpacity_12199;
	imgs_12199[nIndex_12199].xOpacity_12199 = nOpacity_12199;
	
	setOpacity_12199(imgs_12199[current_12199]); 
	setOpacity_12199(imgs_12199[nIndex_12199]);
	
	if(cOpacity_12199<=0) {
		imgs_12199[current_12199].style.display = "none";
		current_12199 = nIndex_12199;
		timeout_12199 = setTimeout(so_xfade_12199,tbetween_12199);
	} else {
		timeout_12199 = setTimeout(so_xfade_12199,t50_12199);
	}
	
	function setOpacity_12199(obj) {
		if(obj.xOpacity_12199>.99) {
			obj.xOpacity_12199 = .99;
			return;
		}
		if(obj.xOpacity_12199<0) {
			obj.xOpacity_12199 = 0;
			return;
		}
		obj.style.opacity = obj.xOpacity_12199;
		obj.style.MozOpacity = obj.xOpacity_12199;
		obj.style.filter = "alpha(opacity=" + (obj.xOpacity_12199*100) + ")";
	}
	
}

