﻿
//弹出格式化窗口居中
function OpenStatue(w, h) {
    var l = (screen.width - w) / 2;
    var t = (screen.height - h) / 2;
    var s = 'width=' + w + ', height=' + h + ', top=' + t + ', left=' + l;
    s += ', toolbar=no, scrollbars=yes, menubar=no, location=no, resizable=yes';
    return s;
}

function Show(url, w, h) {
    window.open(url, "", OpenStatue(w, h));
}
function ShowDialog(url, w, h) {
    ShowDialogStatue(url, w, h);
}
//模态窗口
function ShowDialogStatue(w, h) {
    var l = (screen.width - w) / 2;
    var t = (screen.height - h) / 2;
    var s = 'dialogWidth=' + w + 'px, dialogHeight =' + h + 'px';
    s += ',center:Yes; help:No; resizable:Yes; status:No;scroll:Yes';
    return s;
}
var Open = function(url) {
    Show(url, 760, 600);
}
function reinitIframe(id) {
    var iframe = document.getElementById(id);
    try {
        var bHeight = iframe.contentWindow.document.body.scrollHeight;
        var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
        var height = Math.max(bHeight, dHeight);
        iframe.height = height;
    }
     catch (ex)
     { }
}

