// ajax
var http = false;

if(navigator.appName == "Microsoft Internet Explorer") {
  http = new ActiveXObject("Microsoft.XMLHTTP");
} else {
  http = new XMLHttpRequest();
}

function externalLinks() {
  for(var i = 0; i < document.links.length; i++) {
     if(document.links[i].hostname.length < 1) 
     { continue; }
     if(document.links[i].target.length > 0)
     { continue; }
     var h = document.links[i].hostname.toLowerCase();
     if (h != location.hostname) {
     	// new win
      document.links[i].target = '_blank';
      document.links[i].onclick = function() {
      	//alert("URL: "+this.href);
      	http.open("GET", "/out?url="+escape(this.href));
      	http.send(null);
      }
    }
  }
}

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


window.onload = externalLinks;


