﻿// JavaScript Document

var hexinput= 255; // initial color value.

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 6 doctoral degrees.";
DYKFacts[3] = "MSU is only 14 miles from Manhattan.";
DYKFacts[4] = "MSU celebrated its 100 year anniversary in 2008.";
DYKFacts[5] = "Workers with a master's degree on average earn $200 a week more than those with only a bachelor's degree.";
DYKFacts[6] = "Workers with a master's degree on average earn $400,000 more over their lifetime than those with a bachelor's.";
DYKFacts[7] = "4.75% of the population of the United States are students in higher education.";
DYKFacts[8] = "Only 6.7% of adults have a Master's degree.";
DYKFacts[9] = "Only 1.2% of adults have a Doctoral degree.";
DYKFacts[10]= "MSU’s College of the Arts was twice designated a state “Center of Excellence in the Fine and Performing Arts.”";
DYKFacts[11]= "Forbes magazine named Montclair State University the Top Public University in New Jersey in 2009.";
DYKFacts[12]= "US News and World Report named Montclair in the top 20 in the nation for education programs in 2010.";

//Stats from Census Current Population Survey, Bureau of Labor Statistics
//http://www.bls.gov/
//http://www.census.gov/population/www/socdemo/educ-attn.html



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();
	fadingtext();
	setTimeout("FactTimer()", 8000);
}

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);
	}
}

function fadingtext()
{
	if(hexinput>0) 
	{
		hexinput -=11; // increase color value
		document.getElementById("FactContent").style.color="rgb("+hexinput+","+hexinput+","+hexinput+")"; // Set color value.
		setTimeout("fadingtext()",100);
	}
	else 
	{
		hexinput=255; //reset hex value
	}
}

