<!-- 
// Script from www.1way2God.net indicating the conservative estimate of the number of 
// abortions carried out in developed nations this millenium (since 00:00:00 01 January 2001).
//
// Documentation found at http://www.1way2God.net/tho_abortion_counter.html
// 
// The following code is Copyright (c) Daniel Glynn and 1way2God.net, 2004. Please use without
//  alteration, and with appropriate attributation.

function years(day,month, year) {
    var _date = new Date(); 
    var curr_year = _date.getYear();
    if (curr_year < 2000) curr_year += 1900; //cover possible older versions
    var curr_month = _date.getMonth() + 1;
    var curr_day = _date.getDate();
    var num = curr_year - year;
    var diff = (curr_month-month)*100/12;
    diff += (curr_day-day)*100/365;
    var res = num*100 + diff;
    res = Math.round(res);
    res = res/100;
    return res;
}

function abortionCounter(_r,_d,_n,_c) {
    ns4 = (document.layers)? true:false;
    ie4 = (document.all)? true:false;
    if (ns4 == false) {
        ns6 = (document.getElementById) ? true:false;
    }  
    
    range = _r;
    display = _d;
    divname = _n;
    CSSname = _c;
      
    
    // Perform calculation
    var _date = new Date();
    var prim = _date.valueOf(); // prim == milliseconds since 1970
    var time = prim-978307200000; //time == milliseconds since 0:00:00 01 Jan 2001
    var divby = 3200;// DEFAULT (developed) one abortion per every 3.118503..., but I
                                      //   put 3.2 so as not to be accused of exaggeration)
    if (range == "allworld") divby = 700; // one abortion every 0.6860347 seconds, rounded to 0.7
    var abortions = time/divby; 
    var num1 = 10000000;
    var num2 = 1000000;
    var num3 = 100000;
    var num4 = 10000;
    var num5 = 1000;
    var num6 = 100;
    var num7 = 10;
    var num8 = 1;
    
    if (abortions > num1) var digit1 = Math.floor(abortions/num1);      var diff = num1*digit1;
    if (abortions > num2) var digit2 = Math.floor((abortions-diff)/num2);  diff = diff + num2*digit2;
    if (abortions > num3) var digit3 = Math.floor((abortions-diff)/num3);  diff = diff + num3*digit3;
    if (abortions > num4) var digit4 = Math.floor((abortions-diff)/num4);  diff = diff + num4*digit4;
    if (abortions > num5) var digit5 = Math.floor((abortions-diff)/num5);  diff = diff + num5*digit5;
    if (abortions > num6) var digit6 = Math.floor((abortions-diff)/num6);  diff = diff + num6*digit6;
    if (abortions > num7) var digit7 = Math.floor((abortions-diff)/num7);  diff = diff + num7*digit7;
    if (abortions > num8) var digit8 = Math.floor((abortions-diff)/num8);
    
    var count= "&nbsp;"+digit1+digit2 + "," + digit3+digit4+digit5 +","+digit6+digit7+digit8+ "&nbsp;";
    
    // Sort out display
    //  disp1 == standard = room for expansion here
    
    var res_str = "";
    if (CSSname != "abCSSunknown") {
        res_str += "<A HREF=http://www.1way2god.net/tho_abortion_counter.html class=";
        res_str += CSSname + " target=_blank title=\" Induced abortions";
        
        // Handle options for display and range
        if (range != "allworld") res_str += " in the developed world, ";
        else res_str += " in the world, ";
        if (display == "disp1") res_str += "so far this millennium";
        else if (display == "disp2") res_str += "in the last " + years(01,01,2001) + " years";
        else res_str += "since 1 January 2001"; //disp == disp3
        
        res_str += ". \">";
    }
    res_str += count;
    if (display == "disp1" && CSSname != "abCSSunknown") {
        res_str += "</A>";
    }
    
    // output it to the page
  if (ns4) {
    document.layers[divname].document.open();
    document.layers[divname].document.write(res_str);
    document.layers[divname].document.close();
  }
  else if (ie4) { document.all[divname].innerHTML = res_str; }
  else if (ns6) { document.getElementById(divname).innerHTML = res_str; }
   
    setTimeout("abortionCounter(range,display,divname,CSSname);", divby);
}

function var_counter(range) {
      abortionCounter(range,"disp1","_abortioncounter", "abCSSunknown");
}

function counter() {
      abortionCounter("developed","disp1","_abortioncounter", "abCSSunknown");
}





//-->