//Runs the ExternalLinks function
window.onload = externalLinks;

// This function checks all the links in the site,
//and if rel="external" is set, causes them to be
//opened in a blank window (or tab, based on user-settings)
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";
 }
}
