window.addEventListener?window.addEventListener("load",so_init,false):window.attachEvent("onload",so_init);
var d=document, divs = new Array(), zInterval = null, current=0, pause=false;

function so_init() {
	
	if (document.getElementById("divContainerLogo")){
		if(!d.getElementById || !d.createElement)return;
	
		divs = d.getElementById("divContainerLogo").getElementsByTagName("div");
		for(i=1;i<divs.length;i++) {
			divs[i].xOpacity = 0;
		}
		divs[0].style.display = "block";
		divs[0].xOpacity = .99;
		
		setTimeout(so_xfade,3000);
	}
}

function so_xfade() {
	cOpacity = divs[current].xOpacity;
	nIndex = divs[current+1]?current+1:0;

	nOpacity = divs[nIndex].xOpacity;
	
	cOpacity-=.05; 
	nOpacity+=.05;
	
	divs[nIndex].style.display = "block";
	divs[current].xOpacity = cOpacity;
	divs[nIndex].xOpacity = nOpacity;
	
	setOpacity(divs[current]); 
	setOpacity(divs[nIndex]);
	
	if(cOpacity<=0) {
		divs[current].style.display = "none";
		current = nIndex;
		setTimeout(so_xfade,3000);
	} else {
		setTimeout(so_xfade,50);
	}
	
	function setOpacity(obj) {
		if(obj.xOpacity>.99) {
			obj.xOpacity = .99;
			return;
		}
		obj.style.opacity = obj.xOpacity;
		obj.style.MozOpacity = obj.xOpacity;
		obj.style.filter = "alpha(opacity=" + (obj.xOpacity*100) + ")";
	}
}
