  window.onload = function (windowonload)
  {
    var r1 = new RegExp ("external(=(\S+))?","i"),
        r2 = new RegExp ("^_+(\S+)$", "i"),
        r3 = new RegExp ("^(blank|self|parent|top)$", "i");
    return function ()
    {
      if (document.getElementsByTagName)
        {
          var anchors = document.getElementsByTagName ('a'),
              affix   = 0,
              count   = anchors.length,
              anchor, target, t;
          while (count > affix)
              if ((anchor = anchors [affix ++]).getAttribute ('href') || anchor.href)
                  if (r1.test (anchor.getAttribute ('rel') || anchor.rel || ""))
                      (target = (target = RegExp.$2)
                          ? (r2.test (target)
                              ? (r3.test (t = RegExp.$1)
                                  ? "_" + t
                                  : t)
                              : target)
                          : "_brank"),
                      ((anchor.setAttribute)
                        ? anchor.setAttribute ("target", target)
                        : (anchor.target = target));
        }
      if (windowonload)
        windowonload.apply (this, arguments);
    };
  } (window.onload);
