<!-- Begin

/*********************************************************************
* HBJ Abortion Counter
* Visit http://www.homewardboundjournal.com/abortion_counter.htm
**********************************************************************/

// The following function truncates numbers
Number.prototype.round = function( places, truncate )
{
    var factor = Math.pow( 10, places );
    return Math[Boolean(truncate)?'floor':'round']( this * factor ) / factor;
}


// NRLC Statistics (3/8/2006) taken from http://www.nrlc.org/abortion/facts/abortionstats.html
// I have updated Michael Bronson's work here, with a list of the actual statistics
// in variables and added to together.  The use can simply check the NRLC site to
// get information on the source of the statitics.

 v1973=744600
 v1974=898600
 v1975=1034200
 v1976=1179300
 v1977=1316700
 v1978=1409600
 v1979=1497700
 v1980=1553900
 v1981=1577300
 v1982=1573900
 v1983=1575000
 v1984=1577200
 v1985=1588600
 v1986=1574000
 v1987=1559100
 v1988=1590800
 v1989=1566900
 v1990=1608600
 v1991=1556500
 v1992=1528900
 v1993=1495000
 v1994=1423000
 v1995=1359690
 v1996=1360730
 v1997=1335000
 v1998=1319000
 v1999=1314000
 v2000=1312990
 v2001=1303000
 v2002=1293000 // NRLC base estimate
 v2003=1293000 // NRLC base estimate   
 v2004=1293000 // NRLC base estimate   
 v2005=1293000 // NRLC base estimate
 v2006=1293000 // NRLC base estimate

 vDecade1970=v1973+v1974+v1975+v1976+v1977+v1978+v1979
 vDecade1980=v1980+v1981+v1982+v1983+v1984+v1985+v1986+v1987+v1988+v1989
 vDecade1990=v1990+v1991+v1992+v1993+v1994+v1995+v1996+v1997+v1998+v1999
 vDecade2000=v2000+v2001+v2002+v2003+v2004+v2005+v2006

 vDecadesTotal=vDecade1970+vDecade1980+vDecade1990+vDecade2000

// The following gets the abortion rate and converts it to calculation numbers
  secondsYear=31536000   // number of seconds in a year
 //abortionsYear=850000   // current numberof abortions a year
 abortionsYear=1293300   // current numberof abortions a year
  abortionsSecond=abortionsYear/secondsYear
  abortionsBaseline=vDecadesTotal  // number of abortions as of December 31 2006 at midnight
  
// The following code gets the current date and time
  now = new Date();
  nowYear = now.getFullYear();
  nowMonth = now.getMonth();
  nowDate = now.getDate();
  nowHour = now.getHours();
  nowMinute = now.getMinutes();
  nowSecond = now.getSeconds();
  nowMilSec = now.getMilliseconds();
 
// Compares the current date and time with January 1 2007 at 1201 AM
  numYears=nowYear-2007
  numMonths=nowMonth  //  getMonth command makes the Jan = 0 instead of 1
                                           //  This is what we need though
  numDays=nowDate-1     //  Back date back by 1 so that day would not be counted
  numHours=nowHour
  numMinutes=nowMinute
  numSeconds=nowSecond
  numMilSec=nowMilSec
  
// Calculates the number of NEW abortions deaths since January 1 2007 at 1201 AM
  abortionYears=numYears*abortionsSecond*60*60*24*365
  abortionMonths=numMonths*abortionsSecond*60*60*24*30
  abortionDays=numDays*abortionsSecond*60*60*24
  abortionHours=numHours*abortionsSecond*60*60
  abortionMinutes=numMinutes*abortionsSecond*60
  abortionSeconds=numSeconds*abortionsSecond  
  abortionMilSec=numMilSec*abortionsSecond/1000
 
newAbortions=abortionYears+abortionMonths+abortionDays+abortionHours+abortionMinutes+abortionSeconds+abortionMilSec
  startnumber=abortionsBaseline+newAbortions.round( 0, true )
   
// Numbers to the second decimal place
// It uses the round truncate function from above
  raw=newAbortions                      // example 123.456789
  round0=raw.round( 0, true )                // example 123
  round10=raw.round( 0, true )*10            // example 1230
  round100=raw*10                       // example 1234.56789
  round100=round100.round( 0, true )*10      // example 12340
  extended10=raw*10                     // example 1234.56789
  extended10=extended10.round( 0, true )          // example 1234
  extended100=raw*100                   // example 12345.6789
  extended100=extended100.round( 0, true )        // example 12345
  difference10=extended10-round10            // example 1234-1230 = 4
  difference100=extended100-round100         // example 12345-12340 = 5
  
// The following code sets the variables for the counter
  var milisec=difference10                   // Starting point for the first decimal
  var seconds=startnumber
  var microsec=difference100            // Starting point for the second decimal
  var microsec2=0
  
// The folowing code is for the counter
  document.d.d2.value='0'
  function display(){
  if (microsec>=9){
  microsec=0
  milisec+=1

  if (milisec>=10){
  milisec=0
  seconds+=1
  }

  }
  else
  microsec+=1


// The following code puts commas into the final number
 Number.prototype.insertComma = function(){
  var s = this.toString();
  var temp = '';
  for (var i=s.length-1;i>=0;i-=3){
    if ((i-3)>=0) temp = "," + s.substr(i-2, 3) + temp;
    else temp = s.substring(0, i+1) + temp;
  }
  return temp;
}

document.d.d2.value = seconds.insertComma() + "." + milisec + microsec 
setTimeout("display()",10/abortionsSecond)

}

display()

//  End -->
