// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
// With modifications by JPM - SIMBIOSE
function canManipulateImages()
{
    if (document.images)
        return true;
    else
        return false;
}

function loadSlide(imageURL)
{
    if (gImageCapableBrowser)
    {
        document.getElementById("imager").src = imageURL;
        return false;
    }
    else {
        return true;
    }
}

function fadeShow(timeModifier)
{
    //speed for each frame
    var speed = Math.round(33);
    var timer = 0;

    for(i = 100; i >= 0; i--)
    {
        setTimeout("changeOpac(" + i + ")",(timer * speed));
        timer++;
    }

    setTimeout("nextSlide()", 3300);

    for(i = 0; i <= 100; i++)
    {
        setTimeout("changeOpac(" + i + ")",(timer * speed));
        timer++;
    }

    setTimeout("fadeShow("+timeModifier+")",timeModifier * 11000);
}

function changeOpac(opacity)
{
    var object = document.getElementById("imager").style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}

function nextSlide()
{
    gCurrentImage = (gCurrentImage + 1) % gNumberOfImages;
    loadSlide(gImages[gCurrentImage]);
}

gImageCapableBrowser = canManipulateImages();
var gCurrentImage = 0;

setTimeout("fadeShow("+gSlideshowInterval+")",gSlideshowInterval * 5500);
