// JavaScript Document
<!--
var secs
var timerID = null
var timerRunning = false
var delay = 1000
var cpt = 2;

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

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

function StartTheTimer()
{
    if (secs==0)
    {
        StopTheClock()
        // 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.")
		var image= document.getElementById('enseignant').src;
		var newimage= image.substr(0,(image.length)-5);
		swapfade(document.getElementById('enseignant'), newimage+cpt+'.jpg', '2', 'Enseignant');
		if(cpt == 4){
			cpt = 1;	
		}else{
			cpt = cpt + 1;	
		}
		InitializeTimer();
    }
    else
    {
        self.status = secs
        secs = secs - 1
        timerRunning = true
        timerID = self.setTimeout("StartTheTimer()", delay)
    }
}
//-->

