// of course Internet Explorer does not use the regular way of registering events like all the rest of the world *sigh*
// and keep in mind that IE needs the event with "on" (e.g. onload) as all the others say just the event name ("load") 
if (window.addEventListener) window.addEventListener("load", initLinks, false);
else if (window.attachEvent) window.attachEvent("onload", initLinks);

// solution to create external links by rel="external" attributes via javascript
// see more: http://www.sitepoint.com/article/standards-compliant-world/
function initLinks()
{
  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";
    }
  }
}
