// Script by Thomas Stich
// http://www.stichpunkt.de/beitrag/popup.html
// use it if you like it

var pop = null;

function popdown()
    {
    if (pop && !pop.closed)
        pop.close();
    }

function popup(obj, w, h, scroll)
    {
    var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;

    if (!url)
        return true;

    var ScreenWidth = screen.width;
    var ScreenHeight = screen.height;

    var xpos = (ScreenWidth / 2) - (w / 2);
    var ypos = (ScreenHeight / 2) - (h / 2);

	//if (scroll == true)	{ scroll = "yes"; }
	//else { scroll = "no";}
	
    var args = 'width=' + w + ',height=' + h + ',resizable=no,status=no,menubar=no,scrollbars=' + scroll + ',top=' + ypos + ',left=' + xpos;

    popdown();
    pop = window.open(url, '', args);
    return (pop) ? false : true;
    }

window.onunload = popdown;
