// Script by Thomas Stich
// http://www.stichpunkt.de/beitrag/popup.html


var pop = null;

function popdown() {
  if (pop && !pop.closed) pop.close();
}

function popup(obj,w,h) {
  var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
  if (!url) return true;
  w = (w) ? w += 20 : 450;  // 450px*600px is the default size
  h = (h) ? h += 25 : 600;
  var args = 'width='+w+',height='+h+', toolbar="0",location="0",directories="0",status="0",menubar="0",scrollbars=0,resizable=0,left=0,top=50  ';
  popdown();
  pop = window.open(url,'',args);
  return (pop) ? false : true;
}

window.onunload = popdown;
window.onfocus = popdown;

