﻿// JavaScript Document

var DYKFacts = Array();
			
DYKFacts[0] = "The George Lucas Educational Foundation ranked MSU’s Teacher Preparation Program as one of the nation’s top 10.";
DYKFacts[1] = "MSU offers master’s degrees, certificates and certification programs in nearly 100 fields.";
DYKFacts[2] = "MSU offers 5 doctoral degrees.";
DYKFacts[3] = "MSU is only 14 miles from Manhattan.";
DYKFacts[4] = "MSU celebrated its 100 year anniversary in 2008.";
DYKFacts[5] = "The United States has the second largest number of higher education institutions in the world.";
DYKFacts[6] = "The United States has the highest number of higher education students in the world.";
DYKFacts[7] = "4.75% of the population of the United States are students in higher education.";
DYKFacts[8] = "17.1% of the population hold a bachelor’s degree.";
DYKFacts[9] = "9.9 % of the population holds a graduate or professional degree.";
DYKFacts[10]= "Someone with a master’s degree earns nearly $1.5 million more over his or her lifetime than a high school graduate.";
DYKFacts[11]= "MSU’s College of the Arts was twice designated a state “Center of Excellence in the Fine and Performing Arts.”";

function LoadRandomFact() {
	var OutputArea = document.getElementById("FactContent");
		if (OutputArea) {
		var iFact = Math.floor(Math.random()*DYKFacts.length);
		OutputArea.innerHTML = "<p>"+DYKFacts[iFact]+"</p>";
	}
}
			
function FactTimer() {
	LoadRandomFact();
	setTimeout("FactTimer()", 12000);
}

function OutputFacts(obj) {
	if (obj) {
		var x;
		var FactUL = document.createElement("UL");
		for (x=0;x<DYKFacts.length;x++) {
			var FactLI = document.createElement("LI");
			FactLI.innerHTML = DYKFacts[x];
			FactUL.appendChild(FactLI);
		}
		obj.appendChild(FactUL);
	}
}
