/***********************************************
Clock script
***********************************************/

<!--
// please keep these lines on when you copy the source
// made by: Nicolas - http://www.javascript-page.com

var timerID = 0;
var tStart  = null;
var bonus = 0;

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.getElementById("theTime").value = "" 
                                   + checkTime(tDate.getMinutes()) + ":" 
                                   + checkTime(tDate.getSeconds()) + "." 
																	 + checkTime(Math.ceil(tDate.getMilliseconds()/10));
   
   timerID = setTimeout("UpdateTimer()", 10);
	 
}



function Start() {
   
	 tStart   = new Date();

   //document.theTimer.theTime.value = "00:00.00";
	 document.getElementById("theTime").value = "00:00.00";
	 
   timerID  = setTimeout("UpdateTimer()", 10);
	 bonus = document.getElementById("timebonus").innerHTML;
	 setTimeout("Decrbonus()", 1000);
	 
}

function Stop() {
   if(timerID) {
      clearTimeout(timerID);
      timerID  = 0;
   }

   tStart = null;
}

function Reset() {
   tStart = null;

   document.getElementById("theTime").value = "00:00.00";
}

function checkTime(i) {
if (i<10) 
  {i="0" + i}
return i
}



function Decrbonus() {

    if (bonus > 0) {
			  temp = bonus - 1;
				bonus = temp;
				document.getElementById("timebonus").innerHTML = bonus;
				setTimeout("Decrbonus()", 1000);
    }
}

//-->