/* OPTIONS */
var autoAdvanceSecs = 5;
var fadeSpeedSecs = 1;

/* NO USER-SERVICABLE PARTS BELOW */
var imgCount = 0;
var curImg = 0;
var images = new Array();
var started = 0;

function slideShowAddImg(img)
{
    images[imgCount] = new Image();
    images[imgCount].src = img;
    imgCount++;
}

function slideShowNext()
{
    // do cross-fade if supported
    if (document.images.PictureBox.filters) {
        filters = true;
        document.images.PictureBox.style.filter = "blendTrans(duration=" + fadeSpeedSecs + ")";
    } else {
        filters = false;
    }
    if (filters) {
        cf_stat = document.images.PictureBox.filters.blendTrans.status;
        if (cf_stat != 2)
            document.images.PictureBox.filters.blendTrans.Apply();
    }
    // switch image source; degrades nicely
    document.images.PictureBox.src = images[curImg].src;
    // do cross-fade if supported
    if (filters && cf_stat != 2)
        document.images.PictureBox.filters.blendTrans.Play();
    curImg += 1;
    if (curImg >= images.length) curImg = 0;
    setTimeout('slideShowNext()', autoAdvanceSecs * 1000);
}

function slideShowStart()
{
    if (!started) {
        slideShowNext();
        started = 1;
    }
}

