/* Written by Peter Russell */
basedate = new Date("July 1, 2005 12:00:00") ;
today = new Date() ;
basemillisecs = basedate.getTime();
millisecs = today.getTime();

var PopNow = 6455658790 + (millisecs - basemillisecs)*2.37/1000;
PopNow=6000000000+Math.round(PopNow-6000000000);

var TimeoutID = null;
var countRunning = false;
var string = "5812665976";

function stopCount() {
	if(countRunning)
		clearTimeout(timeoutID);
	countRunning = false;
}

function startCount() {
	stopCount();
	updatePop();
}

function updatePop() {
	/*test browser base date is 1/1/70*/
	testdate = new Date("Dec 31, 1969 00:00:00") ;
	testmillisecs = testdate.getTime();
	if(testmillisecs<20000000){
		var pop = PopNow++;
		document.counter_world.elements[0].value = numberFormat(pop);
	}
	timeoutID = setTimeout("updatePop()", 426);
	countRunning = true;
}

function numberFormat(nStr) {
	nStr += '';
	x = nStr.split('.');
	x1 = x[0];
	x2 = x.length > 1 ? '.' + x[1] : '';
	var rgx = /(\d+)(\d{3})/;
	while (rgx.test(x1))
	x1 = x1.replace(rgx, '$1' + '.' + '$2');
	return x1 + x2;
}