var sysETSOOSlide=[];
function ETSOOSlide(aSlides,sId,sTitleId,iInterval,iPhotoIndex)
{
	if(aSlides==null)aSlides=[];
	var iPhotoLen=aSlides.length;
	if(sId==null)sId="ETSOOSlide";
	if(sTitleId==null)sTitleId="ETSOOSlideTitle";
	if(iPhotoIndex==null)iPhotoIndex=0;
	else
	{
	    iPhotoIndex++;
	    if(iPhotoIndex>=iPhotoLen)iPhotoIndex=0;
	}
	var oPhoto=document.getElementById(sId);
	if(oPhoto&&iPhotoLen>0)
	{
		if(oPhoto.nodeName!="IMG")
		{
			var oF=oPhoto.firstChild;
			if(oF==null||oF.nodeName!="IMG")
			{
				var oImg=document.createElement("img");
				oPhoto.insertBefore(oImg,oF);
				oImg.setAttribute("src","/ETSOO/Eajax/EOEditor/Images/Blank.gif");
				oPhoto=oImg;
			}
			else
			{
				oPhoto=oF;
			}
		}
	    var bFilter=true;
	    if(oPhoto.style.filter==null)bFilter=false;
	    
	    oPhoto.onmouseover=function(){sysETSOOSlide[this.id][5]="N"};
	    oPhoto.onmouseout=function(){sysETSOOSlide[this.id][5]="Y"};
        if(iInterval==null)iInterval=5000;
        else
		{
            iInterval=parseInt(iInterval);
            if(isNaN(iInterval))iInterval=5000;
        }
        var oOne=sysETSOOSlide[sId];
        if(oOne==null)
		{
            var oTimers=setInterval("ETSOOSlideAdd('"+sId+"')", iInterval);
            sysETSOOSlide[sId]=[aSlides,sId,sTitleId,iInterval,iPhotoIndex];
        }
		else
		{
            oOne[4]=iPhotoIndex;
        }
	    if(bFilter)
		{
	        if(oPhoto.filters.revealTrans==null)oPhoto.style.filter+="revealTrans(duration=1,transition=5)";
            oPhoto.filters.revealTrans.Transition=Math.floor(Math.random()*25);
            oPhoto.filters.revealTrans.apply();
            oPhoto.filters.revealTrans.play();
	    }
	    var oImage=aSlides[iPhotoIndex];
	    var sTitle=oImage[1];
	    var sLink=oImage[2];
	    if(sLink==null)sLink="";
		var sTarget=oImage[3];
	    
	    if(bFilter)
		{
	        if(sLink=="")oPhoto.style.cursor="";
	        else oPhoto.style.cursor="hand";
	    }else
		{
	        if(oPhoto.style)
			{
	            if(sLink=="")oPhoto.style.cursor="";
	            else oPhoto.style.cursor="pointer";
	        }
	    }
	    
	    oPhoto.src=oImage[0];
	    oPhoto.title=sTitle;
	    if(sLink!="")oPhoto.onclick=function(){window.location=sLink};
	    
	    var oTitle=document.getElementById(sTitleId);
	    if(oTitle)
		{
	        if(sLink=="")oTitle.innerHTML=sTitle;
	        else
			{
				var sT='<a href="'+sLink+'"';
				if(sTarget)sT+=' target="'+sTarget+'"';
				sT+='>'+sTitle+'</a>';
				oTitle.innerHTML=sT;
			}
	    }
	}
}
function ETSOOSlideAdd(sId){
    var oOne=sysETSOOSlide[sId];
    if(oOne&&oOne[5]!="N")ETSOOSlide(oOne[0],oOne[1],oOne[2],oOne[3],oOne[4]);
}