var theImagePrefix = "";
var numImages = 0;
var theImages = new Array(1)
var theStartingImage = 0
var theNextImage = theStartingImage;
var fade;
var fade_speed = 5000;
var fade_duration = 35;

function set_theImageOptions(prefix, imgcount) {
    theImagePrefix = prefix;
    numImages = imgcount;
    theImages = new Array(numImages - 1)
    for(i =0; i < numImages; i++) {
        theImages[i] = new Image()
        theImages[i].src = "images/" + theImagePrefix + i + ".jpg"
    }
}

function start_fade() {
    if (document.all) {
        document.images.animation0.style.filter="blendTrans(duration=fade_duration)";
        document.images.animation0.filters.blendTrans.Apply();
    }
    document.images.animation0.src = theImages[theNextImage].src;
    if (document.all) {
        document.images.animation0.filters.blendTrans.Play();
    }
    theNextImage++;
    if (theNextImage  > (numImages - 1))
        theNextImage = theStartingImage;
    fade = setTimeout('start_fade()', fade_speed);
}

function pause_fade() {
    clearInterval(fade);
}
 
function resume_fade() {
    fade = setTimeout('start_fade()', fade_speed);
}
 
