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 = tStart.getTime() - tDate.getTime();
var dias, horas, minutos, segundos;

if(tDiff <= 0)
{
    document.getElementById("hora").innerHTML = "WHISTLER BABY!!";
    return;
}

dias = Arredonda(tDiff,86400000);
tDiff = (tDiff % 86400000);
horas = Arredonda(tDiff,3600000);
tDiff = (tDiff % 3600000);
minutos = Arredonda(tDiff,60000);
tDiff = (tDiff % 60000);
segundos = Arredonda(tDiff,1000);

document.getElementById("hora").innerHTML = "<b>Faltam</b><br>" + dias + " dias <br>" + horas + " horas <br>" + minutos + " minutos <br>" + segundos + " segundos";

timerID = setTimeout("UpdateTimer()", 1000);
}


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

tStart = null;
}

function Arredonda(valor, divisor)
{
return (valor - (valor % divisor))/divisor;
}

function Start()
{
	tStart = null;
	tStart   = new Date();
	tStart.setFullYear(2010,6,31);
	tStart.setHours(20,30,0,0);

	timerID  = setTimeout("UpdateTimer()", 1000);

}

