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

// Open external links in a new window
function handleExternalLinks(){
	//return;
	var anchors = document.getElementsByTagName("a");
	var i, href;
	for(i=0; i < anchors.length; i++) {
		if(!anchors[i].href) continue;
		href = anchors[i].href;
		if ( (href.indexOf(window.location.hostname)==-1) && (href.indexOf("javascript:") == -1) && (!anchors[i].onclick) && (href.indexOf("http://") != -1)) { 
			anchors[i].setAttribute("target","_blank");
		}
	}
}

if(document.getElementsByTagName){
	addLoadEvent(handleExternalLinks);
}


sfHover = function() {
	var sfEls = document.getElementById("menu").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" over";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" over\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

