<!--
var secs
var timerID = null
var timerRunning = false
var delay = 1000
var _defTimerSecs = 0;

function InitializeTimer(defTimerSecs)
{
    // Set the length of the timer, in seconds
    secs = defTimerSecs
    _defTimerSecs = defTimerSecs
    StopTheClock()
    StartTheTimer()
}

function StopTheClock()
{
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}

function StartTheTimer()
{
    if (secs<1)
    {
        //StopTheClock()
        // Here's where you put something useful that's
        // supposed to happen after the allotted time.
        // For example, you could display a message:
        timerTimesUp();
        secs = _defTimerSecs; //reset
        StopTheClock()
        StartTheTimer()
    }
    else
    {
        secs = secs - 1
        timerRunning = true
        timerID = self.setTimeout("StartTheTimer()", delay)
    }

}
//-->
