// JavaScript Document
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;

//Source: http://www.sitepoint.com/article/standards-compliant-world/3
//Put this in the head of the code <script type="text/javascript" src="/external.js"><script>
// rel = "external" needs to be put into the link tag on the page


/* <script type="text/javascript" src="external.js"> </script>

on link a rel="external" */