function initPage() {
	var _nav = document.getElementById('nav');
	if (_nav) {
		var _nodes = _nav.getElementsByTagName('a');
		for (var i=0; i<_nodes.length; i++) {
			_nodes[i].onmousedown = function(){
				if (this.parentNode.className.indexOf('mousedown') == -1)
					this.parentNode.className += ' mousedown';
			};
			_nodes[i].onmouseup = function(){
				this.parentNode.className = this.parentNode.className.replace('mousedown','');
			}
		}
	}
}
if (window.addEventListener)
	window.addEventListener("load", initPage, false);
else if (window.attachEvent)
	window.attachEvent("onload", initPage);
	
	
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 = externalLinks;


