window.addEventListener?window.addEventListener("load",so_init,false):window.attachEvent("onload",so_init);

var pc;
var timer;
var d=document, imgs = new Array(), zInterval = null, current=0, pause=false;

function so_init() {
	if(!d.getElementById || !d.createElement)return;

	imgs = d.getElementById("imageContainer").getElementsByTagName("div");	
	pc = true;
	timer = setTimeout(so_xfade,10000);
}

function so_xfade() {
    if(pc){
	    nIndex = imgs[current+1]?current+1:0;
	    imgs[nIndex].style.display = "block";
	    imgs[current].style.display = "none";
	    current = nIndex;
	    timer = setTimeout(so_xfade,10000);	
	}
}

function mopcstop(){
    pc = false;
    clearTimeout(timer)
}

function mopcstart(){
    pc = true;
    clearTimeout(timer);
    timer = setTimeout(so_xfade,10000);	
}