
var endDate ;
var nowDate ;
var timeTil ;

var days;
var hours; 
var mins;
var secs;

function startTime()
{
endDate =new Date(2012,2,1,23,59,59);
nowDate = new Date();
timeTil = endDate - nowDate;

days = Math.floor((timeTil.valueOf()/1000)/(60*60*24));
hours = Math.floor((timeTil.valueOf()/1000)/(60*60)) - (days*24);
mins= Math.floor((timeTil.valueOf()/1000)/60 - ((days*24*60)+(hours*60)));
secs= Math.floor((timeTil.valueOf()/1000) - ((days*24*60*60)+(hours*60*60)+(mins*60)));
// add a zero in front of numbers<10
m=checkTime(mins);
s=checkTime(secs);
if (nowDate <= endDate)
{
document.getElementById('txt').innerHTML = "<span id=\"notice\"><a href=\"http:\/\/www.archboston.org\/community\/forumdisplay.php?f=45\">Vote for the 2011 aB Awards! Polls close in...<\/a><\/span><br\/>"+
days+" <span id=\"x\">Days, <\/span>"+hours+"<span id=\"x\"> Hours, <\/span>"+m+"<span id=\"x\"> Minutes, <\/span>"+s+"<span id=\"x\"> Seconds<\/span>";
} else {
document.getElementById('txt').innerHTML = "<span id=\"results\"><a href=\"http:\/\/www.archboston.org\/community\/forumdisplay.php?f=45\">2010 ab Awards results are in!<\/a><\/span><br\/><span id=\"notice\">Thanks to all who voted this year.<\/span>";
}

t=setTimeout('startTime()',500);
}

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

