
var counter = 0;

function factoid (iOldRandom) {
	var arrFactoid = new Array(32);

	arrFactoid[0] = "Harry Potter is eleven years old when our story begins.<br><br>&#151; <i>Harry Potter and the Sorcerer's Stone</i>";
	arrFactoid[1] = "First Year Students are required to bring 3 plain work robes to Hogwarts.<br><br>&#151; <i>Harry Potter and the Sorcerer's Stone</i>";
	arrFactoid[2] = "Mr. Weasley took his family to Egypt when he won the annual Daily Prophet Grand Prize Galleon Draw.<br><br>&#151; <i>Harry Potter and the Prisoner of Azkaban</i>";
	arrFactoid[3] = "The Firebolt racing broom can accelerate to 150 miles an hour in 10 seconds.<br><br>&#151; <i>Harry Potter and the Prisoner of Azkaban</i>";
	arrFactoid[4] = "Hogsmeade was the headquarters of the 1612 goblin rebellion.<br><br>&#151; <i>Harry Potter and the Prisoner of Azkaban</i>";
	arrFactoid[5] = "The Shrieking Shack is the most severely haunted house in Britain.<br><br>&#151; <i>Harry Potter and the Prisoner of Azkaban</i>";
	arrFactoid[6] = "To open the Monster Book of Monsters, you must stroke it.<br><br>&#151; <i>Harry Potter and the Prisoner of Azkaban</i>";
	arrFactoid[7] = "Hippogriffs look like a cross between a horse and an eagle.<br><br>&#151; <i>Harry Potter and the Prisoner of Azkaban</i>";
	arrFactoid[8] = "To conjure a patronium, concentrate on a happy memory and say <i>Expecto Patronum</i>.<br><br>&#151; <i>Harry Potter and the Prisoner of Azkaban</i>";
	arrFactoid[9] = "A dementor's kiss sucks out your soul, leaving the empty shell of your body behind.<br><br>&#151; <i>Harry Potter and the Prisoner of Azkaban</i>";
	arrFactoid[10] = "Padfoot is the nickname of Sirius Black.<br><br>&#151; <i>Harry Potter and the Prisoner of Azkaban</i>";
	arrFactoid[11] = "Wormtail is the nickname of Peter Pettigrew, one of the creators of the Marauder's Map.<br><br>&#151; <i>Harry Potter and the Prisoner of Azkaban</i>";
	arrFactoid[12] = "Hagrid is the Keeper of the Keys and Grounds at Hogwarts.<br><br>&#151; <i>Harry Potter and the Sorcerer's Stone</i>";
	arrFactoid[13] = "Albus Dumbledore is of the Order Of Merlin, First Class, Grand Sorc., Chf. Warlock, Supreme Mugwump, International Confed. Of Wizards.<br><br>&#151; <i>Harry Potter and the Sorcerer's Stone</i>";
	arrFactoid[14] = "There are 17 silver Sickles to a gold Galleon and 29 bronze Knuts to a Sickle.<br><br>&#151; <i>Harry Potter and the Sorcerer's Stone</i>";
	arrFactoid[15] = "Monkshood and wolfsbane are the same plant, which is also known as aconite.<br><br>&#151; <i>Harry Potter and the Sorcerer's Stone</i>";
	arrFactoid[16] = "The inscription of the Mirror of Erised says <i>Erised stra ehru oyt ube cafru oyt on wohsi</i>.<br><br>&#151; <i>Harry Potter and the Sorcerer's Stone</i>";
	arrFactoid[17] = "Dragon Breeding was outlawed by the Wizard's Convention of 1709.<br><br>&#151; <i>Harry Potter and the Sorcerer's Stone</i>";
	arrFactoid[18] = "The cry of a Mandrake is fatal to anyone who hears it.<br><br>&#151; <i>Harry Potter and the Chamber of Secrets</i>";
	arrFactoid[19] = "The cry of a Mandrake seedling will knock you out for several hours.<br><br>&#151; <i>Harry Potter and the Chamber of Secrets</i>";
	arrFactoid[20] = "Cornish pixies are electric blue and about eight inches high.<br><br>&#151; <i>Harry Potter and the Chamber of Secrets</i>";
	arrFactoid[21] = "Nearly Headless Nick died on October 31, 1492.<br><br>&#151; <i>Harry Potter and the Chamber of Secrets</i>";
	arrFactoid[22] = "Skele-Gro regrows bones.<br><br>&#151; <i>Harry Potter and the Chamber of Secrets</i>";
	arrFactoid[23] = "<i>Expelliarmus</i> is a Disarming Charm.<br><br>&#151; <i>Harry Potter and the Chamber of Secrets</i>";
	arrFactoid[24] = "<i>Tarantallegra</i> is a Dancing Charm.<br><br>&#151; <i>Harry Potter and the Chamber of Secrets</i>";
	arrFactoid[25] = "<i>Finite Incantatem</i> ends Charms.<br><br>&#151; <i>Harry Potter and the Chamber of Secrets</i>";
	arrFactoid[26] = "Tom Riddle had a Muggle father and a witch mother, and was an orphan.<br><br>&#151; <i>Harry Potter and the Chamber of Secrets</i>";
	arrFactoid[27] = "Tom Riddle (as Lord Voldemort) opened the Chamber of Secrets 50 years ago.<br><br>&#151; <i>Harry Potter and the Chamber of Secrets</i>";
	arrFactoid[28] = "You-know-who's supporters call themselves the Death Eaters.<br><br>&#151; <i>Harry Potter and the Goblet of Fire</i>";
	arrFactoid[29] = "Mr. And Mrs. Dursley tell people that Harry is attending St. Brutus's Secure Center for Incurably Criminal Boys.<br><br>&#151; <i>Harry Potter and the Goblet of Fire</i>";
	arrFactoid[30] = "Mr. Weasley works at the Misuse of Muggle Artifacts Office at the Ministry of Magic.<br><br>&#151; <i>Harry Potter and the Goblet of Fire</i>";
	arrFactoid[31] = "At the age of 15, Hogwarts' students take their O.W.L. examinations &#151; Ordinary Wizarding Levels.<br><br>&#151; <i>Harry Potter and the Goblet of Fire</i>";

	
	var lRand = Math.random();
	var iRandom = Math.round(32 * lRand);
	//var iRandom = rand(31)-1;
	//alert (lRand + " " + iRandom);
//	alert(iOldRandom +" "+ iRandom);
	window.status = iRandom;

	//var arrPicked = new Array();
	//arrPicked[counter] = iRandom;
	
	while ((iRandom == iOldRandom) || (iRandom > 31)) {
		iRandom = Math.round(32 * Math.random());
//		alert("N2 " + iOldRandom +" "+ iRandom);
		window.status = iRandom + " " + iOldRandom;
	}

//	counter++;


	if (document.getElementById) {
		document.getElementById("dfact").innerHTML = '<p><span style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color: #000000;"> ' + arrFactoid[iRandom] + '</span>';
	}
	else if (document.layers) {
		document.layers['dfact1'].document.layers['dfact2'].document.open();
		document.layers['dfact1'].document.layers['dfact2'].document.write('<p><span style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color: #000000"> ' + arrFactoid[iRandom] + '</span>');
		document.layers['dfact1'].document.layers['dfact2'].document.close();
	}
	document.hform.rNum.value = iRandom;

//	arrFactoid[iRandom]
}
