// JavaScript for opening external links in XHTML document



function setVal(objID, selIndex, URLvalue) {
  var obj = document.getElementById(objID);
  obj.selectedIndex = selIndex;
  if(selIndex!=0){
  window.location.href=URLvalue;
  }
}

function setForm() {
	//alert(navigator.appName)
	if(navigator.appVersion.substring(75,81) == "Safari"){
		return;
	}
  var s = document.getElementById("homePageDropDowns").getElementsByTagName('select');
  for (var i=0; i<s.length; i++) {
	selectReplacement(s[i]);
	document.getElementById("homePageDropDowns").getElementsByTagName('DIV')[i].style.zIndex = 100 - i*2;
  }
}

sfHover_dropDown = function(menu) {
	//alert("DD")
	var sfEls = menu.getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
			//alert(this.className)
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

// JavaScript for suckerfish drop-downs <http://www.htmldog.com/articles/suckerfish/>
sfHover = function() {
	var sfEls = document.getElementById("navMain").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}


// JavaScript for loading above functions into the page
var PageInitializer = {
    start : function(){
        PageInitializer.addLoadEvent(function(){
            //Add Functions Here
			sfHover();
			if(document.getElementsByTagName("BODY")[0].className == "homePage"){
				setForm();
			}
        });
    },
    addLoadEvent:function(f){var w=window;var o=w.onload;if(typeof w.onload!='function'){w.onload=f;}else{w.onload=function(){o();f();}}}
}
PageInitializer.start();