// Set the slideshow speed (in milliseconds)
var SlideShowSpeed = 6000;

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 3;

// NB: More variables defined in the code behind
// Images and captions listed in the code behind too

// =====================================
// Do not edit anything below this line!
// =====================================

var tss;
var pointSS;
var jss;

function hidePointer(innerJSS)
{
    if (innerJSS==-1){
        if (jss==2)
        {  
            innerJSS=13;
        } else {
            innerJSS=jss-1;
        }
    }
    
    if(document.getElementById("pic" + innerJSS)){
        var pointer;
        pointer = document.getElementById("pic" + innerJSS);
        pointer.style.visibility = "hidden";
    }
}

function runSlideShow(innerJSS){
    if(document.getElementById('PictureBox')){
        jss=innerJSS;
        if (tss!=null){
            clearTimeout(tss);
        }
        if (pointSS!=null){
            clearTimeout(pointSS);
        }

        if (document.all){
        document.images.PictureBox.style.filter="blendTrans(duration=2)";
        document.images.PictureBox.style.filter="blendTrans(duration=CrossFadeDuration)";
        document.images.PictureBox.filters.blendTrans.Apply();}
        document.images.PictureBox.src = preLoad[jss].src;
        //if (document.getElementById) document.getElementById("CaptionBox").innerHTML= jss;
        if (document.all) document.images.PictureBox.filters.blendTrans.Play();
        
        var pointer;
        pointer = document.getElementById("pic" + jss);
        pointer.style.visibility = "visible";
        pointSS = setTimeout('hidePointer(' + jss + ')', SlideShowSpeed);

        jss = jss + 1;
        if (jss > (pss)) jss=2;
        tss = setTimeout('runSlideShow(' + jss + ')', SlideShowSpeed);
        }
}