
var wins = new Array();

// scrollable, resizable, status : yes/no
function popup(url, name, width, height, scrollable, resizable, status) {

    var top = (screen.width-width)/2;
    var left = (screen.height-height)/2;

    var option = "resizable=" + resizable + ", scrollbars=" + scrollable
               + ", toolbar=no, width=" + width + ", height=" + height
               + ", status=" + status + ", location=no, directory=no, menubar=no";
    var win = window.open('', name, option);
    // win.moveTo(top, left);
    win.focus();

    if( url ) win.location.href = url;

    wins[wins.length] = win;
}

function closeAll() {

    var i=0;
    for( i=0; i<wins.length; i++ ) {
        if( wins[i] ) {
            var win = wins[i];
            win.close();
        }
    }
}
