// <!--

/* Initializations */

var counterID;
var counterRunning = false;

/* This function re-initializes the counter */
function stopCounter (){
if(counterRunning)
	clearTimeout(counterID);
counterRunning = false;
}

function startCounter () {
stopCounter();
showCounter();
}

function showCounter () {

	// set the date for 1/1/2001
	startDate = new Date(Date.UTC(2001, 1, 1, 0, 0, 0));

	// find the time for 1/1/2001 in seconds since 1/1/1970 (milliseconds/1000)
	startSeconds = startDate.getTime()/1000

	// get the current time since 1/1/1970 in seconds (milliseconds/1000)
	now = new Date();
	nowSeconds = now.getTime()/1000

	// find the seconds elapsed since 1/1/2001 at 00:00:00
	var timeElapsed = Math.round(nowSeconds - startSeconds);

	// find pets killed to date
	/* 0 is starting num for Jan
	2,400,000 divided by 365 days
	is 6575.34 per day
	274/day
	4.56/minute
	.076/second */
	var petsOct = 0
	var petsKilledSinceOct = Math.round(timeElapsed * 0.15854895991882293252156265854896);
	var petsKilledNum = petsOct + petsKilledSinceOct;

	// convert to string and find string length
	petString = petsKilledNum.toString();
	var petLength = petString.length;
	
	// add commas to pets killed
	if (petLength == 6) {
		petsKilled = petString.substring(0,3) + ',' + petString.substring(3,6);
	}

	else if (petLength == 7) {
		petsKilled = petString.substring(0,1) + ',' + petString.substring(1,4) + ',' + petString.substring(4,7);
	}

	else if (petLength == 8) {
		petsKilled = petString.substring(0,2) + ',' + petString.substring(2,5) + ',' + petString.substring(5,8);
	}

	else  {
		petsKilled = petsKilledNum;
	}


	// show pets killed in field
	document.counter.face.value = petsKilled;
	counterID = setTimeout("showCounter()",2000);
	counterRunning = true;
}


//-->
