<!-- Begin
function OpenWindow(url, winName, w, h, x, y) {
    // Generic popup window function
    // Mandatory parameters: url.  The rest can be null.
    if (winName != null) {
        winName = winName.replace(/ /g,'');  // Get rid of spaces.
    }
    var height = (h == null) ? window.screen.availHeight : h;
    var width = (w == null) ?  window.screen.availWidth : w;
    var xOffset = (x == null) ? 50 : x;
    var yOffset = (y == null) ? 50 : y;
    var features = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes";
    features += ",screenX="+xOffset+",left="+xOffset+",screenY="+yOffset+",top="+yOffset+",height="+height+"width="+width;
    var w = window.open(url, winName, features);
    w.resizeTo(width, height);
    w.focus();
}

function OpenCenteredWindow(url, winName, w, h) {
    var moz = (document.getElementById && !document.all) ? 1 : 0;
    var win_width  = (moz) ? window.top.innerWidth  : window.top.document.body.clientWidth;
    var win_height = (moz) ? window.top.innerHeight : window.top.document.body.clientHeight;

    try {
        var height = (h == null) ? window.screen.availHeight : h;
        var width = (w == null) ?  window.screen.availWidth : w;
        if (moz) {
            var left=screen.left + ((win_width - width) / 2);
            var top =screen.top + ((win_height - height) / 2);
        } else {
            var left=window.top.screenLeft + ((win_width - width) / 2);
            var top =window.top.screenTop + ((win_height - height) / 2);
        }

        var params='resizable=yes,scrollbars=yes,status=yes,width=' + width + ',height=' + height;
        params += ',screenX='+left+',left=' + left + ',screenY=' + top + ',top=' + top;

        var w=window.open(url,winName,params);
        w.resizeTo(width, height);
        w.moveTo(left, top);
        w.focus();
        return w;
    } catch (e) {
        alert('Unable to open window: ' + e.message);
    }

}

function CenterAndResize(w, h) {
    var moz = (document.getElementById && !document.all) ? 1 : 0;
    var win_width  =  window.screen.availWidth;
    var win_height = window.screen.availHeight;

    try {
        var height = (h == null) ? window.screen.availHeight : h;
        var width = (w == null) ?  window.screen.availWidth : w;
        var left=((win_width - width) / 2);
        var top =((win_height - height) / 2);
        window.moveTo(left, top);
        window.resizeTo(width, height);
        window.moveTo(left, top);
        window.resizeTo(width, height);
    } catch (e) {
        // do nothing
    }
}

// End -->
