﻿
function wopen(url, name, w, h) {
    // Fudge factors for window decoration space.
    // In my tests these work well on all platforms & browsers.
    //w += 32;
    //h += 96;
    wleft = (screen.width - w) / 2;
    wtop = (screen.height - h) / 2;
    nheight = screen.height - 170;
    // IE5 and other old browsers might allow a window that is
    // partially offscreen or wider than the screen. Fix that.
    // (Newer browsers fix this for us, but let's be thorough.)
    if (wleft < 0) {
        w = screen.width;
        wleft = 0;
    }
    if (wtop < 0) {
        h = screen.height;
        wtop = 0;
    }
    var win = window.open(url,
    name,
    'width=' + 920 + ', height=' + nheight + ', ' +
    'left=' + wleft + ', top=' + 0 + ', ' +
    'screenX=' + wleft + ', screenY=' + 0 + ', ' +
    'left=' + wleft + ', ' +
    'toolbar=no, scrollbars=yes, resizable=no, status=no, copyhistory=yes, location=no, menubar=yes');

    var offset = (navigator.userAgent.indexOf("Mac") != -1 ||
                  navigator.userAgent.indexOf("Gecko") != -1 ||
                  navigator.appName.indexOf("Netscape") != -1) ? 0 : 4;
    win.moveTo(wleft, -offset);
    win.resizeTo(920, screen.availHeight + (2 * offset));
    win.focus();
}



function dopen(url, name, w, h) {
    // Fudge factors for window decoration space.
    // In my tests these work well on all platforms & browsers.
    //w += 32;
    //h += 96;
    wleft = (screen.width - w) / 2;
    wtop = (screen.height - h) / 2;
    nheight = screen.height - 170;
    // IE5 and other old browsers might allow a window that is
    // partially offscreen or wider than the screen. Fix that.
    // (Newer browsers fix this for us, but let's be thorough.)
    if (wleft < 0) {
        w = screen.width;
        wleft = 0;
    }
    if (wtop < 0) {
        h = screen.height;
        wtop = 0;
    }
    var win = window.open(url,
    name,
    'width=' + 920 + ', height=' + nheight + ', ' +
    'left=' + wleft + ', top=' + 0 + ', ' +
    'screenX=' + wleft + ', screenY=' + 0 + ', ' +
    'left=' + wleft + ', ' +
    'toolbar=no, scrollbars=yes, resizable=no, status=no, copyhistory=yes, location=no, menubar=yes');

    var offset = (navigator.userAgent.indexOf("Mac") != -1 ||
                  navigator.userAgent.indexOf("Gecko") != -1 ||
                  navigator.appName.indexOf("Netscape") != -1) ? 0 : 4;
    win.moveTo(wleft, -offset);
    win.resizeTo(920, screen.availHeight + (2 * offset));
    win.focus();
}