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

function init_fader()
{
  imgs = d.getElementById("left").getElementsByTagName("img");
        for(i=0;i<imgs.length;i++) imgs[i].xOpacity = 0;
  imgs[2].xOpacity = .99;
  imgs[3].xOpacity = .99;
  imgs[4].xOpacity = .99;
  so_xfade();
}



function so_xfade() {
        cOpacity = imgs[current].xOpacity;
        if((current-1)<0) nIndex=2;else nIndex=current-1;
        //nIndex = imgs[current-1]?current-1:2;
        nOpacity = imgs[nIndex].xOpacity;
        cOpacity-=.01;
        nOpacity+=.01;
        imgs[nIndex].style.display = "block";
        imgs[current].xOpacity = cOpacity;
        imgs[nIndex].xOpacity = nOpacity;
        setOpacity(imgs[current]);
        setOpacity(imgs[nIndex]);
        if(cOpacity<=0) {
                imgs[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) + ")";
        }






