﻿var present;   
var future;    
var tseconds;  
var seconds;   
var minutes;
var hours;
var days;
ID=setTimeout("countdown();", 1000);

function countdown() 
{
present = new Date();
present = present.getTime();
future = new Date("August 22, 2010 23:59:059");

tseconds = (future - present) / 1000;

days = tseconds /24/60/60;
days = Math.floor(days);
tseconds = tseconds - (days * 24 * 60 * 60);

hours = tseconds /60/60;
hours = Math.floor(hours);
tseconds = tseconds - (hours * 60 * 60);

minutes = tseconds /60;
minutes = Math.floor(minutes);
tseconds = tseconds - (minutes * 60);

seconds = tseconds;
seconds = Math.floor(seconds);

document.getElementById('days').innerText = days;  
document.getElementById('hours').innerText = hours;
document.getElementById('minutes').innerText = minutes;
document.getElementById('seconds').innerText = seconds;
ID=setTimeout("countdown();", 1000);
}
