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 == 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, 2007");
        var todaysdate = new Date("January 1, 2007");
        var BirthsInYear;

        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;
 
 
        // population
		verdenstal = string((secsSince) * 2.69 + 6565000000);
        danmarkstal = string((secsSince) * 0.000509069 + 5443513);
		foedtidag = string((secsToday) * 0.002036593);
        foedtiaar = string((secsSince) * 0.002036593);
        giftiaar = string((secsSince) * 0.001195);
        skiltiaar = string((secsSince) * 0.00050019);
    
	
	  
document.statistik.elements["verdenstal"].value = verdenstal;
document.statistik.elements["danmarkstal"].value = danmarkstal;
document.statistik.elements["foedtidag"].value = foedtidag;
document.statistik.elements["foedtiaar"].value = foedtiaar;
document.statistik.elements["giftiaar"].value = giftiaar;
document.statistik.elements["skiltiaar"].value = skiltiaar;
     

 var dag=today.getDate();
 var maaned=today.getMonth()+1;
 var dagen=dag+"."+maaned;
 
document.statistik.elements["navnet"].value=dage[dagen];
 document.statistik.elements["teksten"].value=dageb[dagen];

 
  
        timerID = setTimeout("timeRemaining()", 1);
        timerRunning = true;

}
 