//this script loops through all links on the web page, and forces external links to open up in new windows

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").substring(0,7) && (anchor.getAttribute("rel") == "external" || anchor.getAttribute("rel") == "nofollow")) {
     anchor.target = "_blank";
	 anchor.title = anchor.title+" (opens in new window)"; }
   if (anchor.getAttribute("rel") == "autocard") { //autocard links
     anchor.onclick = function () {
       window.open(this.getAttribute("href"), '_magicCardDetails', 'width=910, height=670, toolbar=1, location=1, scrollbars=1, resizable=1');
	   return false;
	 }
	 anchor.title = anchor.title+" (opens in new window)"; }
 }
}
addLoadEvent(externalLinks);