﻿function showModal(src, width, height, showScroll)
{
    /// <summary>打开模态窗口</summary>
    /// <param name="src" type="String">要打开的地址</param>
    /// <param name="width" type="String">宽度 如: "300px"</param>
    /// <param name="height" type="String">调试 如 "400px"</param>
    if (src)
    {
        if (!width)
        {
            width = "400px";
        }
        if (!height)
        {
            height = "300px";
        }

        if (!showScroll)
        {
            showScroll = "no";
        }

        window.showModalDialog(src, "", "location:No;status:No;help:No;dialogWidth:" + width + ";dialogHeight:" + height + ";scroll:" + showScroll + ";");
    }
}

function showOpen(src, width, height, showScroll)
{
    /// <summary>打开模态窗口</summary>
    /// <param name="src" type="String">要打开的地址</param>
    /// <param name="width" type="String">宽度 如: "300"</param>
    /// <param name="height" type="String">调试 如 "400"</param>
    if (src)
    {
        if (!width)
        {
            width = 400;
        }
        if (!height)
        {
            height = 300;
        }

        if (!showScroll)
        {
            showScroll = "no";
        }

        //        window.open(src, '', 'height=' + height + ', width=' + width + ', top=0, left=0, toolbar=no, menubar=no, scrollbars=' + showScroll + ',resizable=yes,location=no, status=no');


        var iTop = (window.screen.availHeight - 30 - height) / 2; //获得窗口的垂直位置;
        var iLeft = (window.screen.availWidth - 10 - width) / 2; //获得窗口的水平位置;
        window.open(src, "", 'height=' + height + ',,innerHeight=' + height + ',width=' + width + ',innerWidth=' + width + ',top=' + iTop + ',left=' + iLeft + ',toolbar=no,menubar=no,scrollbars=' + showScroll + ',resizeable=no,location=no,status=no');





    }
}

