function startClock() {

        timeRemaining();

}

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, 2000");

        var todaysdate = new Date("January 1, 2000");

        var may4 = new Date("May 4, 1999");

         

        var currentPop;

        var BirthsInYear;



        newyears.setFullYear(now.getFullYear());



        secsSince = Math.round(now.getTime() - newyears.getTime())/1000;

        secsSincePop = Math.round(now.getTime() - may4.getTime())/1000;

          

        todaysdate.setMonth(now.getMonth());

        todaysdate.setDate(now.getDate());

        todaysdate.setFullYear(now.getFullYear());

        secsToday = (now.getTime()-todaysdate.getTime())/1000;



switch (document.title) {

   case 'STCI, Statistiques mondiales sur la population':

   {    

        // population

        current_population = string(secsSincePop * 2.69 + 5965370016);

        births_this_year = string((secsSince) * 4.11);

        births_today = string((secsToday) * 4.11);

        deaths_this_year = string((secsSince) * 1.69);

        deaths_today = string((secsToday) * 1.69);

      

        document.worldometers.elements["current_population"].value = current_population;

        document.worldometers.elements["births_this_year"].value = births_this_year;

        document.worldometers.elements["births_today"].value = births_today;

        document.worldometers.elements["deaths_this_year"].value = deaths_this_year;

        document.worldometers.elements["deaths_today"].value = deaths_today;

        break;

   }







   case 'STCI, Statistiques mondiales : economie':

   {

     // economie



     automobile_produced_this_year = string((secsSince) * 1.14);

     bicycle_produced_this_year = string((secsSince) * 3.46);

     computers_sold_this_year = string((secsSince) * 2.67);

 

     document.worldometers.elements["automobile_produced_this_year"].value = automobile_produced_this_year;

     document.worldometers.elements["bicycle_produced_this_year"].value = bicycle_produced_this_year;

     document.worldometers.elements["computers_sold_this_year"].value = computers_sold_this_year;

     break;

   }







   case 'STCI, Statistiques mondiales : education':

   {

     // education

     books_published = string((secsSince) * .03);

     newspapers_circulated = string((secsSince) * 16.6);

     movie_attendance = string((secsSince) * 403);

     internet_download = string((secsSince) * 963);



     document.worldometers.elements["books_published"].value = books_published;

     document.worldometers.elements["newspapers_circulated"].value = newspapers_circulated;

     document.worldometers.elements["movie_attendance"].value = movie_attendance;

     document.worldometers.elements["internet_download"].value = internet_download;

     break;

   }







   case 'STCI, Statistiques mondiales : environnement':

   {

     // environnement

     forest_loss = string((secsSince) * .36);

     soil_erosion = string((secsSince) * .2);

     topsoil_erosion = string((secsSince) * 747.5);

     co2_emissions = string((secsSince) * 708);

     earth_travel = string((secsSince) * 18.5);

     weight_of_earth = string(6575000+ (secsSince * .0012));

     age_of_earth = string((secsSince * .000000031)+4500642531);

     lightning_strikes = string((secsSince) * 100);

     fish_caught = string((secsSince) * 2.9);

     

     document.worldometers.elements["forest_loss"].value = forest_loss;

     document.worldometers.elements["soil_erosion"].value = soil_erosion;

     document.worldometers.elements["topsoil_erosion"].value = topsoil_erosion;

     document.worldometers.elements["co2_emissions"].value = co2_emissions;

     document.worldometers.elements["earth_travel"].value = earth_travel;

     document.worldometers.elements["weight_of_earth"].value = weight_of_earth;

     document.worldometers.elements["age_of_earth"].value = age_of_earth;

     document.worldometers.elements["lightning_strikes"].value = lightning_strikes;

     document.worldometers.elements["fish_caught"].value = fish_caught;

     break;

   }







   case 'STCI, Statistiques mondiales sur la nourriture':

   {

     // alimentation

     food_production = string((secsSince) * .08);

     calories_consumed = string((secsSince) * 197.12037);

     protein_consumed = string((secsSince) * 5.28808);

     

     document.worldometers.elements["food_production"].value = food_production;

     document.worldometers.elements["calories_consumed"].value = calories_consumed;

     document.worldometers.elements["protein_consumed"].value = protein_consumed;

     break;

   }



   case 'STCI, Statistiques mondiales sur la sante':

   {

     // sante

     deaths_communicable_diseases = string((secsSince) * .55);

     deaths_children = string((secsSince) * .35);

     infections_hiv = string((secsSince * .1)+30000000);

     deaths_aids = string((secsSince * .05)+6400000);

     deaths_cancer = string((secsSince) * .2);

     deaths_malarial = string((secsSince) * .032);

     deaths_cigarettes = string((secsSince) * .1);

     deaths_pesticide = string((secsSince) * .0006);

     teenage_moms = string((secsSince) * .5);

     healthcare_spending = string((secsSince) * .037835);

     drug_spending = string((secsSince) * .031710);



     document.worldometers.elements["deaths_communicable_diseases"].value = deaths_communicable_diseases;

     document.worldometers.elements["deaths_children"].value = deaths_children;

     document.worldometers.elements["infections_hiv"].value = infections_hiv;

     document.worldometers.elements["deaths_aids"].value = deaths_aids;

     document.worldometers.elements["deaths_cancer"].value = deaths_cancer;

     document.worldometers.elements["deaths_malarial"].value = deaths_malarial;

     document.worldometers.elements["deaths_cigarettes"].value = deaths_cigarettes;

     document.worldometers.elements["deaths_pesticide"].value = deaths_pesticide;

     document.worldometers.elements["teenage_moms"].value = teenage_moms;

     document.worldometers.elements["healthcare_spending"].value = healthcare_spending;

     document.worldometers.elements["drug_spending"].value = drug_spending;

     break;

   }

}



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

        timerRunning = true;



}