//
// Next presidential election counter
//
// Taken from http://www.tdscripts.com/jscountdown.html:
// 	Javascript Countdown
// 	Version 1.0 1/20/2000
// 	by TDavid at http://www.tdscripts.com/
//
// As well as http://www.jracademy.com/~jtucek/count.html:
// 	Speaking of Java, this particular script is (C) Copyright 2002 Jim Tucek
// 	If you wish to use my CountDown script, these comments must be left
// 	alone!  That is all.
//
// 	Visit www.jracademy.com/~jtucek/ for script information and a bit of help
// 	setting it up, or www.jracademy.com/~jtucek/email.html for contact
// 	information.
//
var now = new Date();
var event = new Date("Nov 06 2012 00:00:01");
ID=window.setTimeout("update();", 1000);

function update()
{
	now = new Date();
	time = event - now;
	
	days = (time - (time % 86400000)) / 86400000;
	time = time - (days * 86400000);
	hours = (time - (time % 3600000)) / 3600000;
	time = time - (hours * 3600000);
	mins = (time - (time % 60000)) / 60000;
	time = time - (mins * 60000);
	secs = (time - (time % 1000)) / 1000;

	if(days==1) out = "1 day, ";
	else out = days+" days, ";
	if(hours < 10) out = out+"0";
	out = out+hours+":";
	if(mins < 10) out = out+"0";
	out = out+mins+":";
	if(secs < 10) out = out+"0";
	out = out+secs;
	if(days+hours+mins+secs> 1)
		single =  out;
	else
		single = "Election day!";

	document.getElementById('countdown').innerHTML = single;

	ID=window.setTimeout("update();",1000);
}

function addParaBold()
{
	document.write('<p align="center">Obama Countdown Clock - <b id="countdown"> </b></p>');
}


