
function startClock() {
	timeRemaining();
}
function string(number, decimals) {
	var tempnum;
	var decimals;


	tempnum= Math.round(number)+" ";
	tempnum= tempnum.substring(0,tempnum.length-1);

	if (tempnum.length >3) {
        tempnum = tempnum.substring(0,tempnum.length-3) + "," + tempnum.substring(tempnum.length-3, 99);
	}

	if (tempnum.length >7) {
		tempnum = tempnum.substring(0,tempnum.length-7) + "," + tempnum.substring(tempnum.length-7, 99);
	}

	if (tempnum.length >11) {
		tempnum = tempnum.substring(0,tempnum.length-11) + "," + tempnum.substring(tempnum.length-11, 99);
	}

	if (decimals>0) {
		decimalstring = number - Math.floor(number) +" ";
		decimalstring = decimalstring.substring(1,decimalstring.length-2);
		decimalstring = decimalstring.substring(0,decimals+1);
		tempnum = tempnum + decimalstring;
	}

return tempnum;

}

function timeRemaining() {
var deaths=1907;
var injuries=99154;
var collisions=484327;
var cost=9915360000;
var wa=.361967695
var or=.271659325
var id=.149989511
var bc=.21638347



 	var now = new Date();                                
 	var newyears = new Date("January 1, 2006");
	newyears.setFullYear(now.getFullYear());
 	secsSince = Math.round(now.getTime() - newyears.getTime())/1000;

	document.getElementById ("wadeaths").firstChild.nodeValue = string(secsSince * deaths /365/24/60/60 * wa );
	document.getElementById ("wainjuries").firstChild.nodeValue = string(secsSince * injuries /365/24/60/60 * wa ); 
	document.getElementById ("wacollisions").firstChild.nodeValue = string(secsSince * collisions /365/24/60/60 * wa );
	document.getElementById ("wacost").firstChild.nodeValue = "$"+string(secsSince * cost /365/24/60/60 * wa );

	document.getElementById ("ordeaths").firstChild.nodeValue = string(secsSince * deaths /365/24/60/60 * or );
	document.getElementById ("orinjuries").firstChild.nodeValue = string(secsSince * injuries /365/24/60/60 * or ); 
	document.getElementById ("orcollisions").firstChild.nodeValue = string(secsSince * collisions /365/24/60/60 * or );
	document.getElementById ("orcost").firstChild.nodeValue = "$"+string(secsSince * cost /365/24/60/60 * or );

	document.getElementById ("iddeaths").firstChild.nodeValue = string(secsSince * deaths /365/24/60/60 * id );
	document.getElementById ("idinjuries").firstChild.nodeValue = string(secsSince * injuries /365/24/60/60 * id ); 
	document.getElementById ("idcollisions").firstChild.nodeValue = string(secsSince * collisions /365/24/60/60 * id );
	document.getElementById ("idcost").firstChild.nodeValue = "$"+string(secsSince * cost /365/24/60/60 * id );

	document.getElementById ("bcdeaths").firstChild.nodeValue = string(secsSince * deaths /365/24/60/60 * bc );
	document.getElementById ("bcinjuries").firstChild.nodeValue = string(secsSince * injuries /365/24/60/60 * bc ); 
	document.getElementById ("bccollisions").firstChild.nodeValue = string(secsSince * collisions /365/24/60/60 * bc );

	timerID = setTimeout("timeRemaining()", 10);
	timerRunning = true;
}

loaded=1