// JavaScript Document

var secs_IntSp
var timerID_IntSp = null
var timerRunning_IntSp = false
var delay_IntSp = 500


function InitializeTimer_IntSp()
{
    // Set the length of the timer, in seconds
    secs_IntSp = 10;
    StopTheClock_IntSp()
    StartTheTimer_IntSp()
}

function StopTheClock_IntSp()
{
    if(timerRunning_IntSp)
        clearTimeout(timerID_IntSp)
    timerRunning_IntSp = false
}

function StartTheTimer_IntSp()
{
    if (secs_IntSp==0)
    {
		StopTheClock_IntSp();

		goToTab('next');

        // 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.")

        //Make it start again
        InitializeTimer_IntSp()


    }
    else
    {
        //self.status = secs
        secs_IntSp = secs_IntSp - 1
        timerRunning_IntSp = true
        timerID_IntSp = self.setTimeout("StartTheTimer_IntSp()", delay_IntSp)
    }
}