﻿startList = function() {
if (document.all && document.getElementById) {
navRoot = document.getElementById("primaryNav");
for (i=0; i<navRoot.childNodes.length; i++) {
  node = navRoot.childNodes[i];
  if (node.nodeName=="LI") {
  node.onmouseover=function() {
  this.className+=" over";
    }
  node.onmouseout=function() {
  this.className=this.className.replace
      (" over", "");
   }
   }
  }
 }
}
window.onload=startList;

// BROWSER DETECTION START //
function openContactUsWindow() {
	VWeb=open("http://vweb.jparadiso.com/display.php?10078","displayWindow","width=700,height=540,status=no,toolbar=no,menubar=no,scrollbars=yes");
}

var detect = navigator.userAgent.toLowerCase();
var OS_str,browser_str,version_num,total,thestring;
if (checkIt('konqueror')) {
	browser_str = "Konqueror";
	OS_str = "Linux";
}
else if (checkIt('firefox')) browser_str = "FireFox";
else if (checkIt('safari')) browser_str = "Safari";
else if (checkIt('omniweb')) browser_str = "OmniWeb";
else if (checkIt('opera')) browser_str = "Opera";
else if (checkIt('webtv')) browser_str = "WebTV";
else if (checkIt('icab')) browser_str = "iCab";
else if (checkIt('msie')) browser_str = "Internet Explorer";
else if (!checkIt('compatible')) {
	browser_str = "Netscape Navigator";
	version_num = detect.charAt(8);
}
else browser_str = "An unknown browser";
if (!version_num) version_num = detect.charAt(place + thestring.length);

if (!OS_str) {
	if (checkIt('linux')) OS_str = "Linux";
	else if (checkIt('x11')) OS_str = "Unix";
	else if (checkIt('mac')) OS_str = "Mac";
	else if (checkIt('win')) OS_str = "Windows";
	else OS_str = "an unknown operating system";
}
function checkIt(string) {
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}
// BROWSER DETECTION END //


/*THE FOLLOWING TWO FUNCTIONS ARE NEEDED SO THAT WE CAN HIDE SELECT FORM ELEMENTS WHEN A CSS DIV NEEDS TO OVERLAP ONE. OTHERWISE, THE SELECTS ALWAYS OVERLAP THE CSS ITEMS REGARDLESS OF Z-DEPTH.*/
function hideSelect(){
	for (j=0; j<document.forms.length; j++) {
		var theForm = document.forms[j]
		for(i=0; i<theForm.elements.length; i++) {
			if(theForm.elements[i].type == "select-one") {
				theForm.elements[i].style.visibility = "hidden";
			}
		}
	}
	if (browser_str == "FireFox") {
		document.getElementById("flashItem").style.visibility = "hidden"; //If there's a Flash item we need to hide on the page, just name it "flashItem" and this will take care of hiding it. We needed to do so on the map page. 
	}
}

function unhideSelect(){
	for (j=0; j<document.forms.length; j++) {
		var theForm = document.forms[j]
		for(i=0; i<theForm.elements.length; i++) {
			if(theForm.elements[i].type == "select-one") {
				theForm.elements[i].style.visibility = "visible";
			}
		}
	}
	if (browser_str == "FireFox") {
		document.getElementById("flashItem").style.visibility = "visible"; 
	}
} 
