/*This script is for avoiding the target=_blank attribute for XHTML 1.0 strict compliance.
  Place this code in the <head> of a page to use:
  
  <script type="text/javascript" src="/javascript/external.js"></script>
  
  Place this code in a link to activate it as opening in a new window:
  
  rel="external"
  
  This code was found on SitePoint, courtesy of this article:
  http://www.sitepoint.com/article/standards-compliant-world/  */


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;
