function initpop() {

  var windowAttributes='width=375,height=535,left=0,top=0,scrollbars=no,location=no';

  if(!window.opener) {
    var as,i,popfun
    as=document.getElementsByTagName('a');

    for (i=0; i<as.length; i++) {

      if(as[i].target) {

        popfun=function() {
          window.open(this.href,'',windowAttributes);
          return false;
        };

        as[i].onclick=popfun;
        as[i].onkeypress=popfun;
      }
    }
  } 
}

function addEvent(obj, evType, fn) {

  if (obj.addEventListener) { 
    obj.addEventListener(evType, fn, true); 
    return true; 
  } else if (obj.attachEvent) { 
    var r = obj.attachEvent("on"+evType, fn); 
    return r; 
  } else { 
    return false; 
  } 
}

if (document.getElementById && document.createTextNode) {
  addEvent(window,'load',initpop);
}
