Popup = {

    open : function(url, width, height, name, toolbar, scroll, x, y)
    {
        if(name == null ) {
            var name = new Date();
            name = name.getTime();
            name = name.toString();
        }
        
        toolbar               = toolbar ? 'yes' : 'no';
        scroll                = scroll ? 'yes' : 'no';
        var features          = 'toolbar='+toolbar+',menubar='+toolbar+',location='+toolbar+',status='+toolbar+',scrollbars='+scroll+',resizable='+scroll;
        if (width) features  += ',width='+width;
        if (height) features += ',height='+height;
        if (x) features      += ',screenX='+x+',left='+x;
        if (y) features      += ',screenY='+y+',top='+y;
        this.reference        = window.open(url, name, features);
        
        if(this.reference != null && ! this.reference.closed) {
            this.reference.focus();
        }
        
        return false;
    },
    
    openCenter : function(url, width, height, name, toolbar, scroll)
    {
        var x = (width && window.screen.availWidth) ? Math.round((window.screen.availWidth - parseInt(width)) / 2) : 0;
        var y = (height && window.screen.availHeight) ? Math.round((window.screen.availHeight - parseInt(height)) / 2) : 0;
        this.open(url, width, height, name, toolbar, scroll, x, y);
        
        return false;
    }
}
