menu = {timer : null, current : null};
menu.getStyle = function(name){
	if(document.getElementById) return document.getElementById(name).style;
	else if(document.all) return document.all[name].style;
	else if(document.layers) return document.layers[name];
}
menu.show = function(name){
	if(this.timer) clearTimeout(this.timer);
	this.getStyle(name).visibility = "visible";
	this.current = name;
}
menu.hide = function(){
	this.timer = setTimeout("menu.doHide()",600);
}
menu.doHide = function(){
	if(this.current){
		this.getStyle(this.current).visibility = "hidden";
		this.current = null;
	}
}

function blurAnchors() {
  if(document.getElementsByTagName) {
    var a = document.getElementsByTagName("a");
    for(var i = 0; i < a.length; i++) {
      a[i].onfocus = function(){this.blur()};
    }
  }
}

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 = function() {
	blurAnchors();
	externalLinks();
}
