

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) {
	//	tempnum = number - Math.round(number) +" ";
					 decimalstring= number - Math.round(number) +" ";
					 decimalstring= decimalstring.substring(1,decimalstring.length-3);
					 decimalstring= decimalstring.substring(0,decimals+1);
					 tempnum = tempnum+decimalstring;
				}
return tempnum;
}
function timeRemaining() {

        var now = new Date();                                
        var newyears = new Date("January 1, 2005");
        var todaysdate = new Date("January 1, 2005");

        newyears.setFullYear(now.getFullYear());

        secsSince = Math.round(now.getTime() - newyears.getTime())/1000;
          
        todaysdate.setMonth(now.getMonth());
        todaysdate.setDate(now.getDate());
        todaysdate.setFullYear(now.getFullYear());
        secsToday = (now.getTime()-todaysdate.getTime())/1000;

        total_dollars = string(secsSince * 537.98);
	wa_dollars = string(secsSince * 304.82);
	or_dollars = string(secsSince * 165.58);
	id_dollars = string(secsSince * 67.57);
      

	document.getElementById ("total").firstChild.nodeValue = "$"+total_dollars;
	document.getElementById ("wa").firstChild.nodeValue = "$"+wa_dollars;
	document.getElementById ("or").firstChild.nodeValue = "$"+or_dollars;
	document.getElementById ("id").firstChild.nodeValue = "$"+id_dollars;
				
        timerID = setTimeout("timeRemaining()", 1);
        timerRunning = true;

}
