/*****

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

var d_11795=document, imgs_11795 = new Array(), zInterval_11795 = null, current_11795=0, pause_11795=false;

so_init_11795();

function so_init_11795() {
	if(!d_11795.getElementById || !d_11795.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_11795 = d_11795.getElementById("imageContainer_11795").getElementsByTagName("img");
	for(i=1;i<imgs_11795.length;i++) imgs_11795[i].xOpacity_11795 = 0;
	imgs_11795[0].style.display = "block";
	imgs_11795[0].xOpacity_11795 = .99;
	
	timeout_11795 = setTimeout(so_xfade_11795,tbetween_11795);
}

function so_xfade_11795() {
	cOpacity_11795 = imgs_11795[current_11795].xOpacity_11795;
	nIndex_11795 = imgs_11795[current_11795+1]?current_11795+1:0;

	nOpacity_11795 = imgs_11795[nIndex_11795].xOpacity_11795;
	
	cOpacity_11795-=opschritt_11795; 
	nOpacity_11795+=opschritt_11795;
	
	imgs_11795[nIndex_11795].style.display = "block";
	imgs_11795[current_11795].xOpacity_11795 = cOpacity_11795;
	imgs_11795[nIndex_11795].xOpacity_11795 = nOpacity_11795;
	
	setOpacity_11795(imgs_11795[current_11795]); 
	setOpacity_11795(imgs_11795[nIndex_11795]);
	
	if(cOpacity_11795<=0) {
		imgs_11795[current_11795].style.display = "none";
		current_11795 = nIndex_11795;
		timeout_11795 = setTimeout(so_xfade_11795,tbetween_11795);
	} else {
		timeout_11795 = setTimeout(so_xfade_11795,t50_11795);
	}
	
	function setOpacity_11795(obj) {
		if(obj.xOpacity_11795>.99) {
			obj.xOpacity_11795 = .99;
			return;
		}
		if(obj.xOpacity_11795<0) {
			obj.xOpacity_11795 = 0;
			return;
		}
		obj.style.opacity = obj.xOpacity_11795;
		obj.style.MozOpacity = obj.xOpacity_11795;
		obj.style.filter = "alpha(opacity=" + (obj.xOpacity_11795*100) + ")";
	}
	
}

