// scripts.js
// desc: this code used for the elgin.edu site.
//
// list of features included:
//	- popup windows
//	- suckerfish menu - used for top navigation menu
//	- site feedback browser info - used to obtain browser info for person taking site feedback survey.

// Note: Make sure that no other javscripts assign a fuction to window.onload
// There can be only one function tied to window.onload at a time.


// -------------------------------------------------------------------------------------------------------
// site feedback browser info - used to obtain browser info for person taking site feedback survey. begin
// -------------------------------------------------------------------------------------------------------
function eccSiteFeedbackForm() {
	var eccbrowser=navigator.appName;
	var eccb_version=navigator.appVersion;
	var eccappcodename=navigator.appCodeName;
	var eccplatform=navigator.platform;
	
	document.aspnetForm.hdneccnavigator.value = eccbrowser;
	document.aspnetForm.hdneccversion.value=eccb_version;
	document.aspnetForm.hdnecccodename.value = eccappcodename;
	document.aspnetForm.hdneccplatform.value = eccplatform;
}
<!-- begin
function eccformbrowsercaps() {
	window.onerror=null;

// here is original function, but we decided to pare it down.
//	colors = window.screen.colorDepth;
//	document.aspnetForm.hdnecccolor.value = Math.pow (2, colors);
//	if (window.screen.fontSmoothingEnabled == true)
//		document.aspnetForm.hdneccfonts.value = "Yes";
//		else document.aspnetForm.hdneccfonts.value = "No";

	document.aspnetForm.hdneccnavigator.value = navigator.appName;
//	document.aspnetForm.hdneccversion.value = navigator.appVersion;
//	document.aspnetForm.hdnecccolordepth.value = window.screen.colorDepth;
//	document.aspnetForm.hdneccwidth.value = window.screen.width;
//	document.aspnetForm.hdneccheight.value = window.screen.height;
//	document.aspnetForm.hdneccmaxwidth.value = window.screen.availWidth;
//	document.aspnetForm.hdneccmaxheight.value = window.screen.availHeight;
//	document.aspnetForm.hdnecccodename.value = navigator.appCodeName;
//	document.aspnetForm.hdneccplatform.value = navigator.platform;
//	if (navigator.javaEnabled() < 1) document.aspnetForm.hdneccjava.value="No";
//	if (navigator.javaEnabled() == 1) document.aspnetForm.hdneccjava.value="Yes";


}
// end -->
// -------------------------------------------------------------------------------------------------------
// site feedback browser info - used to obtain browser info for person taking site feedback survey. end
// -------------------------------------------------------------------------------------------------------




function initPage() {
	
  initPopupLinks();

      // place here any other code you wish to run when the page loads.
}

// -------------------------------------------------------------------------------------------------------
// popup windows begin 
// -------------------------------------------------------------------------------------------------------


/* Pop-up windows, opening a new window from http://mar.anomy.net/entry/2004/02/09/12.17.47/
---------------------------------------------------------*/

var popupLinkConfig = new Array;

// popupLinkConfig["classname"] = new Array ( "targetname", "width=550,height=350,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,location=yes,menubar=yes");

popupLinkConfig["popup"] = new Array ( "", "width=600,height=700,scrollbars=yes,resizable=yes,menubar=no");
popupLinkConfig["photoalbum"] = new Array ( "", "width=640,height=540,top=10,scrollbars=no,resizable=no,menubar=no");

popupLinkConfig["larger"] = new Array ( "", "scrollbars=yes,location=yes,menubar=yes,resizable=yes");

popupLinkConfig["external"] = new Array ( "","scrollbars=yes,location=yes,menubar=yes,resizable=yes");
popupLinkConfig["pdf"] = new Array ( "", "scrollbars=yes,resizable=yes");
popupLinkConfig["doc"] = new Array ( "", "resizable=yes");
popupLinkConfig["xls"] = new Array ( "", "resizable=yes");
popupLinkConfig["ppt"] = new Array ( "", "resizable=yes");

function initPopupLinks()
{
  if (!document.getElementsByTagName) return true;
  var pageLinks = document.getElementsByTagName("a");
  for (var i = 0; i < pageLinks.length; i++) 
  {
    if (((pageLinks[i].className != null) && 
         (pageLinks[i].className != "")) ||
        ((pageLinks[i].parentNode.className != null) && 
         (pageLinks[i].parentNode.className != "")))
    {
      var linkClass = " " + pageLinks[i].className + " ";
      if ((linkClass == "  ") && (pageLinks[i].parentNode.className != ""))
      {
        linkClass = " " + pageLinks[i].parentNode.className + " ";
      }
      for (var theKey in popupLinkConfig) 
      {
        if (linkClass.indexOf(" " + theKey + " ") > -1)
        {
          if ((pageLinks[i].target == "") || (pageLinks[i].target == null))
          {
            pageLinks[i].target = (popupLinkConfig[theKey][0] != "") ? popupLinkConfig[theKey][0] : theKey;
          }
          pageLinks[i].settings = popupLinkConfig[theKey][1];
          pageLinks[i].onclick = popUp;
        }
      }
    }
  }
  return true;
}

function popUp()
{
  newWin = window.open(this.href, this.target, this.settings);
  newWin.focus();
  return false;
}

// -------------------------------------------------------------------------------------------------------
// End pop-up windows
// -------------------------------------------------------------------------------------------------------

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++






window.onload = initPage;
