﻿function openNewWindow(fileName,w,h,name) {
    w += 32;
    h += 96;
    wleft = (screen.width - w) / 2;
    wtop = (screen.height - h) / 2;
    if (wleft < 0) {
        w = screen.width;
        wleft = 0;
    }
    if (wtop < 0) {
        h = screen.height;
        wtop = 0;
    }
    if (name=="")
    {
        name="NewPopUp"
    }
    var win = window.open(fileName,
    name,
    'width=' + w + ', height=' + h + ', ' +
    'left=' + wleft + ', top=' + wtop + ', ' +
    'location=1, menubar=1, modal=yes' +
    'status=1, toolbar=1, scrollbars=1, resizable=1', 'title=no', 'resizable=1', 'directories=1', 'status=1');
    if (win != null) {
        // Just in case width and height are ignored
        win.resizeTo(w, h);
        // Just in case left and top are ignored
        win.moveTo(wleft, wtop);
        win.focus();
    }
}
function openInfoWindow(fileName, w, h, name) {
    w += 32;
    h += 96;
    wleft = (screen.width - w) / 2;
    wtop = (screen.height - h) / 2;
    if (wleft < 0) {
        w = screen.width;
        wleft = 0;
    }
    if (wtop < 0) {
        h = screen.height;
        wtop = 0;
    }
    if (name == "") {
        name = "NewInfoPopUp"
    }
    var win = window.open(fileName,
    name,
    'width=' + w + ', height=' + h + ', ' +
    'left=' + wleft + ', top=' + wtop + ', ' +
    'location=0, menubar=0, modal=0' +
    'status=0, toolbar=0, scrollbars=1, resizable=1', 'title=no', 'directories=0', 'status=0');
    if (win != null) {
        // Just in case width and height are ignored
        win.resizeTo(w, h);
        // Just in case left and top are ignored
        win.moveTo(wleft, wtop);
        win.focus();
    }
}
function showhide(id, visibility) {
    document.getElementById(id).style.display = visibility;
}
