
    //	++++++++++++++++++	CONFIGURATION AREA BELOW	++++++++++++++++++	
    // 	++++++++++++++++++	jason@rainbowspuppiessunshine.com	++++++++++++++++++


var lt_interval=23.74;				// number of seconds between updates of people in live presentations counter (--3153600 seconds per year divided by 1315370)
var pm_interval=8640;				// number of seconds between updates of presentations made counter

var imgdir="http://www.rachelschallenge.org/kc/img/templateV2/counter/";		// directory where images of numbers are

var currtime = new Date();							// current time
var starttime=new Date("1/1/" + currtime.getFullYear());				// time when count begin, default is 12:01 January 1st of current year

var lt_count=0;								// holds current count of lives touched counter, will be initialized below  
var pm_count=0;								// holds current count of presentations made counter, will be initialized below  


    //	++++++++++++++++++	CONFIGURATION AREA ABOVE	++++++++++++++++++	
    //	++++++++++++++++++	DATA INITIALIZATION BELOW	++++++++++++++++++	


var numpic=new Array();							// holds location of images used in displaying counter

lt_count+=Math.round(((currtime.getTime()-starttime.getTime())/1000)/lt_interval);	// calculates what current lives touched count should start at based on time and interval
lt_count+=Math.round(((currtime.getTimezoneOffset()-420)*60)/lt_interval);		// offsets lives touched count so that it always reflects Mountain Time

pm_count+=Math.round(((currtime.getTime()-starttime.getTime())/1000)/pm_interval);	// calculates what current presentations made count should start at based on time and interval
pm_count+=Math.round(((currtime.getTimezoneOffset()-420)*60)/pm_interval);		// offsets presentations made count so that it always reflects Mountain Time

for (var i=0; i<10; ++i)
    // loads all number images into array for easy use by counters
	{numpic[i]=new Image();
	numpic[i].src=imgdir + i + ".png";
	}


    //	++++++++++++++++++	DATA INITIALIZATION ABOVE	++++++++++++++++++
    //	++++++++++++++++++	COUNTER FUNCTIONS BELOW	++++++++++++++++++	


function lt_counter()							    // updates the lives touched counter every lt_interval seconds  
	{++lt_count;
	var tcount=lt_count;
	for (var i=0; i<7; ++i) 
    // for every digit of the counter it sets what number image to show
		{var d=tcount%10;
		tcount=(tcount-d)/10;
		document.getElementById("ltc" + i).src=numpic[d].src;
		}
	setTimeout ("lt_counter()", lt_interval*1000);
    // sets this function to run again in lt_interval seconds
	return false;
	}


function pm_counter()							    // updates the presentations made counter every pm_interval seconds  
	{++pm_count;
	var pcount=pm_count;
	for (var j=0; j<7; ++j) 
    // for every digit of the counter it sets what number image to show
		{var p=pcount%10;
		pcount=(pcount-p)/10;
		document.getElementById("pmc" + j).src=numpic[p].src;
		}
	setTimeout ("pm_counter()", pm_interval*1000);
    // sets this function to run again in pm_interval seconds
	return false;
	}


function start_counter()							    // function used in html file to start the counters    
	{lt_counter();
	pm_counter();
	}






