function startClock() {
        timeRemaining();
}


// make the number into a string

function string(number) {
        var tempnum;

        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 (tempnum.length == 14) {
                tempnum = "  " + tempnum + " ";
        }
		if (tempnum.length == 13) {
                tempnum = "  " + tempnum + " ";
        }
        if (tempnum.length == 11) {
                tempnum = "  " + tempnum + " ";
        }
        if (tempnum.length == 10) {
                tempnum = "   " + tempnum + " ";
        }
        if (tempnum.length == 9) {
                tempnum = "  " + tempnum + " ";
        }
        if (tempnum.length == 7) {
                tempnum = "  " + tempnum +"    ";
        }
        if (tempnum.length == 6) {
                tempnum = "    " + tempnum + "   ";
        }
        if (tempnum.length == 5) {
                tempnum = "    " + tempnum + "    ";
        }
        if (tempnum.length == 3) {
                tempnum = "     " + tempnum + "     ";
        }
        if (tempnum.length == 2) {
                tempnum = "      " + tempnum + "     ";
        }
        if (tempnum.length == 1) {
                tempnum = "      " + tempnum + "      ";
        }
        return tempnum;
}


function timeRemaining() {

        var now = new Date();                                
        var newyears = new Date("January 1, 2000");
        var todaysdate = new Date("January 1, 2000");
        var start = new Date(1996,1,1);
        var startAnimal = new Date("January 1, 2000");
		 
        var currentPop;
        var BirthsInYear;

        newyears.setFullYear(now.getFullYear());

        secsSince = Math.round(now.getTime() - newyears.getTime())/1000;
        secsSincePop = Math.round(now.getTime() - start.getTime())/1000;
        secsSinceAnimal = Math.round(now.getTime() - startAnimal.getTime())/1000;
		  
        todaysdate.setMonth(now.getMonth());
        todaysdate.setDate(now.getDate());
        todaysdate.setFullYear(now.getFullYear());
        secsToday = (now.getTime()-todaysdate.getTime())/1000;



switch (document.title) {
   case document.title:
   {    
        
        current_population = string(secsSincePop * 2.86 + 5700000000);
        deaths_this_year = string((secsSince) * 3171);
        deaths_today = string((secsToday) * 3171);
        births_today = string((secsToday) * 4.11);
		
        document.OOS.elements["current_population"].value = current_population;
        document.OOS.elements["deaths_this_year"].value = deaths_this_year;
        document.OOS.elements["deaths_today"].value = deaths_today;
        document.OOS.elements["births_today"].value = births_today;
                
        break;
   }



}

        timerID = setTimeout("timeRemaining()", 1);
        timerRunning = true;

}