// JavaScript Document

// Secondary Nav Handler Functions
var timerID;

function turnAllOff() {
	document.getElementById("nav_services").style.visibility = "hidden";
	document.getElementById("nav_careers").style.visibility = "hidden";
	document.getElementById("nav_corporate").style.visibility = "hidden";
	document.getElementById("nav_flipper").style.visibility = "hidden";
}

function turnMineOn(id) {
	clearTimeout(timerID);
	turnAllOff();
	document.getElementById("nav_"+id).style.visibility = "visible";
	document.getElementById("nav_flipper").style.visibility = "visible";
	timerID = setTimeout("turnAllOff()", 5000);
}

function countdown() {
	clearTimeout(timerID);
	timerID = setTimeout("turnAllOff()", 2000);
}

function imActive() {
	clearTimeout(timerID);
}

//**********************************************
// "Did You Know" Random Selector

var arrDYK = new Array();

arrDYK[0] = "STS Damage Prevention Specialists complete over three million successful utility locates annually.";
arrDYK[1] = "STS and its partner companies earned one-third of the national awards at the 2006 Locate Rodeo.";
arrDYK[2] = "STS has been providing technical services to the utility industry since 1977.";
arrDYK[3] = "STS has been serving the utility industry for over 30 years.";
arrDYK[4] = "STS is headquartered in Atlanta, GA, and operates Georgia and Pennsylvania.";

function writeDYKFact() {
	var i = Math.floor(Math.random()*arrDYK.length);
	document.write(arrDYK[i]);
}

