var pop = null;

function popdown() {
    if (pop && !pop.closed) pop.close();
}

function pf_popup(obj,w,h) {

    var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;

    if (!url) return true;

    var args = 'width='+w+',height='+h+',resizable,scrollbars';
//    var args = 'width='+w+',height='+h+',top='100',left='100',resizable,scrollbars';    
    popdown();
    pop = window.open(url,'',args);

    return (pop) ? false : true;
}

window.onunload = popdown;
window.onfocus = popdown;
