// JavaScript Document

var Facts = new Array('In one hour more sunlight falls on the earth than what is used by the entire population in one year.','The United States spends about $440 billion annually for energy. Energy costs U.S. consumers $200 billion and U.S. manufacturers $100 billion annually.',
'When you use solar energy, you are making you and your home independent from rising costs of traditional forms of fuel and power cuts.',
'A solar PV system producing around half of the electrical needs of a typical family household would eliminate approximately half a ton of sulfur dioxide pollution from the air.',
'About 81 tons of mercury are emitted into the atmosphere each year as a result of electric power generation. Mercury is the most toxic heavy metal in existence.',
'America uses about 15 times more energy per person than does the typical developing country.');

var RandomFact = (Math.floor(Math.random()*Facts.length+1)) - 1;

function InitPage() {
	document.getElementById('FactMsg').appendChild(document.createTextNode(Facts[RandomFact]));
}

function ShowFact(msg) {
	if(document.getElementById('FactMsg').firstChild){
		document.getElementById('FactMsg').firstChild.nodeValue=Facts[msg];
	} else {
		document.getElementById('FactMsg').appendChild(document.createTextNode(Facts[msg]));
	}
}