// Script by Thomas Stich
// http://www.stichpunkt.de/beitrag/popup.html
// use it if you like it
// 
// __Text im html.datei für pop-up-Funktion:
//
// <a href="html-or.jpg" onclick="return popup(this,123,456)" title="..."></a>
// or
// <a href="html-or.jpg" onclick="return popup(this)" title="..."></a>


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 : 600;  // 600px*600px is the default size
  h = (h) ? h += 25 : 600;
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;
  var args = 'width='+w+',height='+h+',top='+wint+',left='+winl+', resizable,scrollbars';
  popdown();
  pop = window.open(url,'',args);
  return (pop) ? false : true;
}

window.onunload = popdown;
window.onfocus = popdown;