﻿
function DisplayFullSizePicture(url, width, height) {

    if (width == null || width == "" || width == NaN) width = 800;
    if (height == null || height == "" || height == NaN) height = 600;

    if (width < 200) width = 200;
    if (height < 200) height = 200;    

    var sw = window.screen.availWidth;
    var sh = window.screen.availHeight - 40;

    var w = (sw < width + 40) ? sw : width + 40;
    var h = (sh < height + 100) ? sh : height + 100;

    var l = (sw - w) / 2;
    var t = (sh - h) / 2;

    url = url.replace("&amp;", "&");

    var rest = "resizable=yes,top=" + t + ",left=" + l + ",menubar=0,scrollbars=yes";
    window.open(url, 'pic', 'width=' + w + ',height=' + h + ',' + rest).focus();
}

