
var secs
var timerID = null
var timerRunning = false
var delay = 1000

function InitializeTimer()
{
    // Set the length of the timer, in seconds
    secs = 5
    StopTheClock()
    StartTheTimer()
}

function StopTheClock()
{
    if (timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}

function StartTheTimer()
{
    if (secs <= 0)
    {
        StopTheClock()
        NextImage()
        InitializeTimer()
    }
    else
    {
        self.status = secs--
        timerRunning = true
        timerID = self.setTimeout("StartTheTimer()", delay)
    }
}

var NumberOfImages = 10

var img = new Array(NumberOfImages)

// Use the following variables to specify the image names:
img[0] = "/images/splash/splash-1.jpg"
img[1] = "/images/splash/splash-2.jpg"
img[2] = "/images/splash/splash-3.jpg"
img[3] = "/images/splash/splash-4.jpg"
img[4] = "/images/splash/splash-5.jpg"
img[5] = "/images/splash/splash-6.jpg"
img[6] = "/images/splash/splash-7.jpg"
img[7] = "/images/splash/splash-8.jpg"
img[8] = "/images/splash/splash-9.jpg"
img[9] = "/images/splash/splash-10.jpg"

var imgNumber = Math.round(10 * Math.random()) % NumberOfImages

function NextImage()
{
    imgNumber++
    if (imgNumber == NumberOfImages)
        imgNumber = 0
    document.images["splashimage"].src = img[imgNumber]
}
