﻿
function printWin(url) {
    popWin(url, "printWin", 700, 500, true);
}

var popWin = function(url, name, width, height, center) {
    var win,
    opt = [];
    if (width || height) {
        height = height || 570;
        width = width || 770;
        opt.push('height=' + height, 'width=' + width);
        if (center === false) {
            opt.push('top=' + ((screen.width) ? (screen.width - width) / 2 : 0));
            opt.push('left=' + ((screen.height) ? (screen.height - height) / 2 : 0));
        }
        opt.push('scrollbars=yes', 'resizable', 'menubar=1');
    }
    win = window.open(url, name, opt.join(','));
    if (win) win.focus();
    return win;
}