/*****

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

var d_473=document, imgs_473 = new Array(), zInterval_473 = null, current_473=0, pause_473=false;

so_init_473();

function so_init_473() {
	if(!d_473.getElementById || !d_473.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_473 = d_473.getElementById("imageContainer_473").getElementsByTagName("img");
	for(i=1;i<imgs_473.length;i++) imgs_473[i].xOpacity_473 = 0;
	imgs_473[0].style.display = "block";
	imgs_473[0].xOpacity_473 = .99;
	
	timeout_473 = setTimeout(so_xfade_473,tbetween_473);
}

function so_xfade_473() {
	cOpacity_473 = imgs_473[current_473].xOpacity_473;
	nIndex_473 = imgs_473[current_473+1]?current_473+1:0;

	nOpacity_473 = imgs_473[nIndex_473].xOpacity_473;
	
	cOpacity_473-=opschritt_473; 
	nOpacity_473+=opschritt_473;
	
	imgs_473[nIndex_473].style.display = "block";
	imgs_473[current_473].xOpacity_473 = cOpacity_473;
	imgs_473[nIndex_473].xOpacity_473 = nOpacity_473;
	
	setOpacity_473(imgs_473[current_473]); 
	setOpacity_473(imgs_473[nIndex_473]);
	
	if(cOpacity_473<=0) {
		imgs_473[current_473].style.display = "none";
		current_473 = nIndex_473;
		timeout_473 = setTimeout(so_xfade_473,tbetween_473);
	} else {
		timeout_473 = setTimeout(so_xfade_473,t50_473);
	}
	
	function setOpacity_473(obj) {
		if(obj.xOpacity_473>.99) {
			obj.xOpacity_473 = .99;
			return;
		}
		if(obj.xOpacity_473<0) {
			obj.xOpacity_473 = 0;
			return;
		}
		obj.style.opacity = obj.xOpacity_473;
		obj.style.MozOpacity = obj.xOpacity_473;
		obj.style.filter = "alpha(opacity=" + (obj.xOpacity_473*100) + ")";
	}
	
}

