var myWindow;
function openWindow(url, width, height) {
    var left = parseInt((screen.availWidth) - (width)) - 50;
    var top = 50;
    var windowFeatures = "width=" + width + ",height=" + height + 
        ",status=no,toolbar=no,menubar=no,location=no,resizable,scrollbars,left=" + left + ",top=" + top + 
        ",screenX=" + left + ",screenY=" + top;
    myWindow = window.open(url, "SubWin", windowFeatures);
}
