//this script is provided as a workaround for
//the lack of a href target attribute in XHTML 1.1
//this basically transfers the task to the DOM in JavaScript
//by using a rel="external" on all links that we want
//to open in a new window

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;
