/* Function:	startList
 * 
 * Description:	Handler for drop-down menus in IE
 *
 * History: 	http://www.alistapart.com/articles/dropdowns
 * 
 */

startList = function() {
	var isMac = navigator.userAgent.indexOf("Mac") != -1;
	
	if(document.all && document.getElementById && !isMac) {
		navRoot = document.getElementById("menubar");
		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", "");
				}
			}
		}
	}
}


/* Function:	externalLinks
 * 
 * Description:	Sets links with rel="external" tags to launch hyperlinks in separate windows
 *
 *
 */
 
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")) {
			if (anchor.getAttribute("rel") == "external") {
				anchor.target = "_blank";
				anchor.className = "external";
			} else if (anchor.getAttribute("rel") == "tow") {
				anchor.target = "tow";
				anchor.className = "tow";
			}
		}
	}
}


/* Function:	initialize
 * 
 * Description:	Calls the externalLinks and startList functions.
 *
 * History:		2004-03-25 - Initial version (atow)
 *
 */
 
initialize = function() {
	startList();
	externalLinks();
}


window.onload = initialize;
