﻿//<![CDATA[

/*
son of suckerfish menu script from:
http://www.htmldog.com/articles/suckerfish/dropdowns/
 */
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
			this.style.zIndex=200; //this line added to force flyout to be above relatively positioned stuff in IE
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//EMAIL FIELD
function clearAndFocusIfNotSet(itemId, compValue) {
    if (document.getElementById(itemId).value == compValue) {
        document.getElementById(itemId).value = ''; 
        document.getElementById(itemId).focus();
    }
}
function setFieldValueIfBlank(itemId, newValue) {
    if (document.getElementById(itemId).value == '') {
        document.getElementById(itemId).value = newValue;
    }
}

//OPEN URLS IN NEW WINDOW
function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
window.onload = externalLinks;

//]]>