//$URL: https://svn.pvtool.net/svn/day_vwcms/trunk/contentbus/filesystem/files/apps/vwcms_common/docroot/vwcms_common/js/common.js $
//$Id: common.js 987 2004-12-02 20:16:29Z mwehner $

function openWindow(url, target, width, height, centered) {
    if (centered == true && (navigator.appName.indexOf("Netscape") > -1 && parseInt(navigator.appVersion.substring(0,1)) >=4 )
        || (navigator.appName.indexOf("Microsoft Internet Explorer") > -1 && parseInt(navigator.appVersion.substring(0,1)) >=4 )) {
        var w = (screen.width/2)-(width/2); 
        var h = (screen.height/2)-(height/2); 
        var parameter = "scrollbars=0,resizable=0";
        
        if (width != 0) {
            parameter += ',width=' + width + ', screenX=' + w + ',left=' + w;
        }
        if (height != 0) {
            parameter += ',height=' + height + ', screenY=' + h + ',top=' + h;
        }
    } else {
        var parameter = "scrollbars=0,resizable=0";
        if (width != 0) {
            parameter += ',width=' + width;
        }
        if (height != 0) {
            parameter += ',height=' + height;
        }
    }
    var win = window.open(url, target, parameter);
    if (win) {
        win.focus();
    }
}
