JS只弹出一个居中弹出窗口

var newWindow;//定义一个窗口,有利于窗口间的通讯
function makeNewWindow(url) {
   if (!newWindow || newWindow.closed) {
        var width = 400;
        var height = 300;
        var left = parseInt((screen.availWidth/2) - (width/2));//屏幕居中
        var top = parseInt((screen.availHeight/2) - (height/2));
        var windowFeatures = "width=" + width + ",height=" + height + ",status,resizable,left=" + left + ",top=" + top + "screenX=" + left + ",screenY=" + top;
        newWindow = window.open(url, "subWind", windowFeatures);
    } else {
        // window is already open, so bring it to the front
        newWindow.focus();
    }
}