var iCurrentFact = -1;
var iDelayMilliseconds = 10000;
var iTotalFacts = 0;

function showNextFact(iFacts) {
	
	//If the total number of facts passed, set the total facts int
	if (iFacts != null && iFacts > 0)
		iTotalFacts = iFacts;
	
	//If on the first pass, set the current fact to the last
	if (iCurrentFact < 0)
		iCurrentFact = iTotalFacts - 1
	
	//Set the current fact to not display
	document.all.fun_facts[iCurrentFact].style.display='none';
	
	//Increment to the next fact in the list
	iCurrentFact = iCurrentFact + 1;
	
	//If over the total number of facts, reset to 0
	if (iCurrentFact >= iTotalFacts)
		iCurrentFact = 0;
	
	//Show the next fact in the list
	document.all.fun_facts[iCurrentFact].style.display='block';
	
	//Run this function again after a delay
	setTimeout("showNextFact()", iDelayMilliseconds);
}
