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

function InitializeTimer(msg)
{
    secs = 10;
	document.getElementById('hd_div').innerHTML	= msg;
	StopTheClock();
	StartTheTimer();
}

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

function StartTheTimer()
{
    if (secs==0)
    {
        document.getElementById('hd_div').innerHTML	= "";
        // Here's where you put something useful that's
        // supposed to happen after the allotted time.
        // For example, you could display a message:
        //alert("You have just wasted 10 seconds of your life.")
    }
    else
    {
        self.status = secs
        secs = secs - 1
        timerRunning = true
        timerID = self.setTimeout("StartTheTimer()", delay)
    }
}
//-->

