/*****
Image Cross Fade Redux
steve@slayeroffice.com
*****/
window.addEventListener?window.addEventListener("load",so_initB,false):window.attachEvent("onload",so_initB);
var b=document, imgsB = new Array(), zInterval = null, currentB=0, pause=false;
function so_initB() {
	if(!b.getElementById || !b.createElement)return;
	imgsB = b.getElementById("imageContainerB").getElementsByTagName("img");
	for(q=1;q<imgsB.length;q++) imgsB[q].xOpacityB = 0;
	imgsB[0].style.display = "block";
	imgsB[0].xOpacityB = .99;
	setTimeout(so_xfadeB,4000);
}
function so_xfadeB() {
	cOpacity = imgsB[currentB].xOpacityB;
	nIndex = imgsB[currentB+1]?currentB+1:0;
	nOpacity = imgsB[nIndex].xOpacityB;
	cOpacity-=.05; 
	nOpacity+=.05;
	imgsB[nIndex].style.display = "block";
	imgsB[currentB].xOpacityB = cOpacity;
	imgsB[nIndex].xOpacityB = nOpacity;
	setOpacity(imgsB[currentB]); 
	setOpacity(imgsB[nIndex]);
	if(cOpacity<=0) {
		imgsB[currentB].style.display = "none";
		currentB = nIndex;
		setTimeout(so_xfadeB,4000);
	} else {
		setTimeout(so_xfadeB,50);
	}
	function setOpacity(obj) {
		if(obj.xOpacityB>.99) {
			obj.xOpacityB = .99;
			return;
		}
		obj.style.opacity = obj.xOpacityB;
		obj.style.MozOpacity = obj.xOpacityB;
		obj.style.filter = "alpha(opacity=" + (obj.xOpacityB*100) + ")";
	}
}