var myWindow;
function openCenteredWindow(url, w, h) {
    var width = w;
    var height = h;
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + 
        ",status,resizable=0,left=" + left + ",top=" + top + 
        ",screenX=" + left + ",screenY=" + top + ", scrollbars";
    myWindow = window.open(url, "subWind", windowFeatures);
}