/* Function:	sfHover
 * 
 * Description:	Handler for drop-down menus in IE
 *
 * History: 	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";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);


/* 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") == "ccc") {
				anchor.target = "ccc";
				anchor.className = "ccc";
			}
		}
	}
}


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

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(initialize);
