function fncImageOver(oNavImage) {
  oNavImage.src = oNavImage.src.replace("-off.","-over.");
}
function fncImageOut(oNavImage) {
  oNavImage.src = oNavImage.src.replace("-over.","-off.");
}
function fncImageOn(oNavImage) {
  oNavImage.src = oNavImage.src.replace("-off.","-on.");
}

function fncToggleNavForPage() {
  var strPageURL = window.location.href;
  strPageURL = strPageURL.toLowerCase();
  strPageURL = strPageURL.replace("http://","");
  strPageURL = strPageURL.replace("https://","");
  var strPageSection = "";
  if (strPageURL.indexOf("/") > 0) {
    var astrURLParts = strPageURL.split("/");
    if (astrURLParts.length > 1) {
      strPageSection = astrURLParts[1];
    }
  }
  if (strPageSection.length > 0) {
    if (strPageSection.indexOf(".") < 0 && strPageSection.indexOf("?") < 0 && strPageSection.indexOf("&") < 0) {
      var strNavID = "idNav_" + strPageSection;
      if (typeof(document.getElementById(strNavID)) != "undefined") {
        fncImageOn(document.getElementById(strNavID));
      }
    }
  }
}

function fncPageOnload() {
  fncToggleNavForPage();
  if (typeof(fncOnload) == "function") {
    fncOnload();
  }
}

function fncShowStudentProfile(strProfileImage) {
  var strImageHTML = '<img src="' + strProfileImage + '" width="240" height="314" border="" alt="Click to Close" />';
  if (document.getElementById('idStudentProfile')) {
    document.getElementById('idStudentProfile').innerHTML = strImageHTML;
    document.getElementById('idStudentProfile').style.display = "block";
  }
  else {
    document.body.innerHTML = document.body.innerHTML + '<div id="idStudentProfile" onclick="this.style.display=\'none\';">' + strImageHTML + '</div>';
  }
}
  
  
if (typeof window.addEventListener != 'undefined') {
	window.addEventListener('load', fncPageOnload, false);
}
else if (typeof document.addEventListener != 'undefined') {
	document.addEventListener('load', fncPageOnload, false);
}
else if (typeof window.attachEvent != 'undefined') {
	window.attachEvent('onload', fncPageOnload);
}
else {
	if(typeof window.onload == 'function') {
		var onload_existing = onload;
		window.onload = function() {
			onload_existing();
			fncPageOnload();
		};
	}
	else {
		window.onload = fncPageOnload;
	}
}