/* script from http://www.sitepoint.com/print/1041

Uses JS to switch any A element (link) which has attribute 'rel="_blank"' to an XHTML deprecated target of _blank.
Since JS is doing it legally, this gets around strict DTD's elimination of the target attribute.

1) To open any link in a new document window, add the following attribute to the A tag:    rel="_blank"
2) Link to this script in the head of each document.

If JS is turned off or an older browser, this is ignored and the link opens 
normally in the same 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") == "_blank")
         anchor.target = "_blank";
      }
   }
   
window.onload = externalLinks;