// 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 += 0 : 500;  
  h = (h) ? h += 0 : 332;
  var args = 'width='+w+',height='+h+',toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,top=150,left=100';
  popdown();
  pop = window.open(url,'',args);
  return (pop) ? false : true;
}

window.onunload = popdown;
window.onfocus = popdown;

