<!--
// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com
/*
var timerID = 0;
var tStart  = null;

function UpdateTimer() {
   if(timerID) {
      clearTimeout(timerID);
      clockID  = 0;
   }

   if(!tStart)
      tStart   = new Date();

   var   tDate = new Date();
   var   tDiff = tDate.getTime() - tStart.getTime();

   tDate.setTime(tDiff);

   document.frmMac.theTime.value = "" 
									+ tDate.getHours() + ":" 
                                   + tDate.getMinutes() + ":" 
                                   + tDate.getSeconds();
   
   timerID = setTimeout("UpdateTimer()", 1000);
}

function Start() {

   tStart   = new Date();

   document.frmMac.theTime.value = "00:00:00";

   timerID  = setTimeout("UpdateTimer()", 1000);
}

function Stop() {
   if(timerID) {
      clearTimeout(timerID);
      timerID  = 0;
   }

   tStart = null;
}
*/
/*
function Reset() {
   tStart = null;
   document.frmMac.theTime.value = "00::00:00";
   Start();
}
*/
//-->
<!--
var secs
var timerID = null
var timerRunning = false
var delay = 1000

function InitializeTimer(Minutos)
{
    // Set the length of the timer, in seconds
    secs = Minutos*60
    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:
        jsResponderExamenAutomaticamente(document.frmMac);
    }
    else
    {
        //self.status = secs
        DisplayTime(secs);
        secs = secs - 1
        timerRunning = true
        timerID = self.setTimeout("StartTheTimer()", delay)
    }
}

function MaskNumber(lNumber,nLength, sChar) 
	{
	sNumber=String(lNumber);  
	while (sNumber.length < nLength) 
		{   
		sNumber = String(sChar) + sNumber;  
		}  
	return sNumber;
	}

function DisplayTime(lSegundos)
{
	lMinutos=Math.floor(lSegundos/60);
	lSegundos=lSegundos%60;
	lHoras=Math.floor(lMinutos/60);
	lMinutos=lMinutos%60;
	document.frmMac.theTime.value=MaskNumber(lHoras,2,"0")+":"+MaskNumber(lMinutos,2,"0")+":"+MaskNumber(lSegundos,2,"0");
}
//-->



