// Javascript function to calculate time left to a particular deadline date
function timeLeft()
{
var now = new Date();
var end = new Date(targetDate);
var endOffset = end.getTime() / 1000;
var startOffset = now.getTime() / 1000;
var length = Math.floor(endOffset - startOffset);
days = Math.floor(length / 86400);
length = length % 86400;
hours = Math.floor(length / 3600);
length = length % 3600;
minutes = Math.floor(length / 60);
length = length % 60;
seconds = length;
var timeRemaining = days + " days, " + hours + " hours, " + minutes +
" minutes, " + seconds + " seconds until this offer closes";
document.getElementById("countdown").innerHTML = timeRemaining;
}
//Change the date to your target date
var targetDate = "May 14, 2009 10:49 AM EDT";
window.onload = function() {
setInterval("timeLeft()", 1000);}