using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace KstCMS.KstCMS_Manager
{
    public partial class Default : KstCmsBase.WebPage.BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            ShowMonito();

        }

        private void ShowMonito()
        {
            string js_str = "var nWidth = screen.availWidth - 10;" +
            "var nHeight = screen.availHeight - 28;" +
            "var strPro = \"height=\" + nHeight.toString() + \", border=none, width=\" + nWidth.toString() + \",top=0,left=0,\";" +
            "strPro += \"toolbar=no,menubar=no, scrollbars=yes,resizable=yes, location=no, status=no\";" +
            "var strRandom = (parseInt(Math.random() * 1000)).toString();" +
            "var objWin = window.open(\"index.aspx\", \"KstCMS\"+strRandom, strPro);" +
            "if(objWin == null){" +

                    "window.alert(\"错误：系统拦截了弹出窗口，未能以全屏打开本系统，请按如下方式关闭拦截功能：\\r\\n1.IE菜单“工具”->弹出窗口阻止程序->关闭弹出窗口阻止程序；\\r\\n2.如安装了雅虎、Google等工具条，请关闭工具条上的拦截功能。\");location.href=\"index.aspx\";}else{" +
                    "window.opener=null; //加此代码将不会弹出关闭提示\r\n" +
                    "window.open(\"\",\"_self\");" +
                    "window.close();}";
            Response.Write("<script>" + js_str + "</script>");
        }
    }
}