var strSelectedNav = "";  // This can be defined on the page as "About", "Companies", "Candidates", or "Contact" to highlight the appropriate navigation button.


// This code block creates the "onload" event for the vast majority of browsers.  We are using it to call the "fncPageLoadGeneric" function below.
if (typeof window.addEventListener != 'undefined') {
	window.addEventListener('load', fncPageLoadGeneric, false);
}
else if (typeof document.addEventListener != 'undefined') {
	document.addEventListener('load', fncPageLoadGeneric, false);
}
else if (typeof window.attachEvent != 'undefined') {
	window.attachEvent('onload', fncPageLoadGeneric);
}
else {
	if(typeof window.onload == 'function') {
		var onload_existing = onload;
		window.onload = function() {
			onload_existing();
			fncPageLoadGeneric();
		};
	}
	else {
		window.onload = fncPageLoadGeneric;
	}
}

function fncPageLoadGeneric() {
  // This function is called when a page is loaded.  If the variable "strSelectedNav" is set in the page this tries to find the appropriate navigation button and flame to show as selected.
  if (strSelectedNav.length > 0) {
    strSection = strSelectedNav;
    if (document.getElementById("idNavFlame" + strSection) && document.getElementById("idNavButton" + strSection)) {
      document.getElementById("idNavFlame" + strSection).style.visibility = "visible";
      document.getElementById("idNavButton" + strSection).src = "images/nav-" + strSection.toLowerCase() + "-on.gif";
    }
  }
}

function fncNavOver(strSection) {
  // This function is called when a user mouse-overs a navigation button - it shows the gray flame and highlights the button UNLESS it is the selected navigation button (defined by "strSelectedNav")
  if (strSection != strSelectedNav) {
    if (document.getElementById("idNavFlame" + strSection) && document.getElementById("idNavButton" + strSection)) {
      document.getElementById("idNavFlame" + strSection).src = "images/flame-nav-gray.gif";
      document.getElementById("idNavFlame" + strSection).style.visibility = "visible";
      document.getElementById("idNavButton" + strSection).src = "images/nav-" + strSection.toLowerCase() + "-on.gif";
    }
  }
}

function fncNavOut(strSection) {
  // This function is called when a user mouse-outs a navigation button - it hides the flame and un-highlights the button UNLESS it is the selected navigation button (defined by "strSelectedNav")
  if (strSection != strSelectedNav) {
    if (document.getElementById("idNavFlame" + strSection) && document.getElementById("idNavButton" + strSection)) {
      document.getElementById("idNavFlame" + strSection).src = "images/flame-nav.gif";
      document.getElementById("idNavFlame" + strSection).style.visibility = "hidden";
      document.getElementById("idNavButton" + strSection).src = "images/nav-" + strSection.toLowerCase() + "-off.gif";
    }
  }
}