function countdown() {
// The current date
var currentDate = new Date();
// The target date
var targetDate = new Date();
targetDate.setUTCFullYear(2009, 7, 28);
targetDate.setUTCHours(0);
targetDate.setUTCMinutes(0);
targetDate.setUTCSeconds(0);
// The difference
var difference = Math.floor( (targetDate.getTime()-currentDate.getTime())/1000 );
var countdownDays = 0;
var countdownHours = 0;
var countdownMinutes = 0;
var countdownSeconds = 0;
if (difference > 0) {
countdownDays    = Math.floor(difference/86400);
difference      -= countdownDays*86400;
countdownHours   = Math.floor(difference/3600);
difference      -= countdownHours*3600;
countdownMinutes = Math.floor(difference/60);
difference      -= countdownMinutes*60;
countdownSeconds = difference;
}
// Write HTML
document.getElementById('CountdownDaysNumber').firstChild.nodeValue = countdownDays;
document.getElementById('CountdownHoursNumber').firstChild.nodeValue = countdownHours;
document.getElementById('CountdownMinutesNumber').firstChild.nodeValue = countdownMinutes;
document.getElementById('CountdownSecondsNumber').firstChild.nodeValue = countdownSeconds;
// Update ...
setTimeout(countdown, 1000);
}
countdown();
