sfHover = function() {	// Function to allow drop down menu in Internet Explorer
    var sfEls = document.getElementById("nav").getElementsByTagName("LI");	// Find and place all top level nav buttons in array

    for (var i=0; i<sfEls.length; i++) {	// Loop through array
	sfEls[i].onmouseover=function() {	// attach class 'sfhover' to mouseover function
	    this.className+=" sfhover";
	}

	sfEls[i].onmouseout=function() {	// remove class 'sfhover' to mouseout function
	    this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
	}
    }
    
    extLinks();	// Call function extLinks
}

function extLinks() {	// Function to allow links to open in new window
    if (!document.getElementsByTagName) return;	// Check if browser supports the DOM feature

    var anchors = document.getElementsByTagName("a");	// Find and place all <a> links in array

    for (var i=0; i<anchors.length; i++) {	// Loop through the array
	var anchor = anchors[i];	// Specify current anchor
    
	if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external" ) {	// Check that it is a link and has the attribute [rel="external"]
	    anchor.target = "_blank";	// If so, assign target _blank
	    anchor.title = "opens in new window";
	}
    }
}

if (window.attachEvent) {	// Check if the browser uses the attachEvent method (Internet Explorer)
    window.attachEvent("onload", sfHover);
} else if (window.addEventListener) {	// Check if the browser uses the addEventListener method (Firefox, Opera, etc.)
    window.addEventListener("load", extLinks, false);
}