/*****

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

var d_11833=document, imgs_11833 = new Array(), zInterval_11833 = null, current_11833=0, pause_11833=false;

so_init_11833();

function so_init_11833() {
	if(!d_11833.getElementById || !d_11833.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_11833 = d_11833.getElementById("imageContainer_11833").getElementsByTagName("img");
	for(i=1;i<imgs_11833.length;i++) imgs_11833[i].xOpacity_11833 = 0;
	imgs_11833[0].style.display = "block";
	imgs_11833[0].xOpacity_11833 = .99;
	
	timeout_11833 = setTimeout(so_xfade_11833,tbetween_11833);
}

function so_xfade_11833() {
	cOpacity_11833 = imgs_11833[current_11833].xOpacity_11833;
	nIndex_11833 = imgs_11833[current_11833+1]?current_11833+1:0;

	nOpacity_11833 = imgs_11833[nIndex_11833].xOpacity_11833;
	
	cOpacity_11833-=opschritt_11833; 
	nOpacity_11833+=opschritt_11833;
	
	imgs_11833[nIndex_11833].style.display = "block";
	imgs_11833[current_11833].xOpacity_11833 = cOpacity_11833;
	imgs_11833[nIndex_11833].xOpacity_11833 = nOpacity_11833;
	
	setOpacity_11833(imgs_11833[current_11833]); 
	setOpacity_11833(imgs_11833[nIndex_11833]);
	
	if(cOpacity_11833<=0) {
		imgs_11833[current_11833].style.display = "none";
		current_11833 = nIndex_11833;
		timeout_11833 = setTimeout(so_xfade_11833,tbetween_11833);
	} else {
		timeout_11833 = setTimeout(so_xfade_11833,t50_11833);
	}
	
	function setOpacity_11833(obj) {
		if(obj.xOpacity_11833>.99) {
			obj.xOpacity_11833 = .99;
			return;
		}
		if(obj.xOpacity_11833<0) {
			obj.xOpacity_11833 = 0;
			return;
		}
		obj.style.opacity = obj.xOpacity_11833;
		obj.style.MozOpacity = obj.xOpacity_11833;
		obj.style.filter = "alpha(opacity=" + (obj.xOpacity_11833*100) + ")";
	}
	
}

