<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Left.aspx.cs" Inherits="MTCUN.frame.Left" %>

<%@ Import Namespace="MTCUN" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link id="linkStyle" runat="server" href="../Themes/Blue/css.css" rel="stylesheet"
        type="text/css" />
    <script src="../JScript/Cookie.js" type="text/javascript"></script>
    <style type="text/css">
        html, body, form {
            height: 100% !important;
            margin: 0px !important;
            padding: 0px !important;
        }

        .leftNavStyle {
            width: 100%;
            text-align: left;
            border-width: 1px;
            line-height: 24px;
            height: 100%;
        }

            .leftNavStyle th {
                text-align: left;
            }

            .leftNavStyle .leftTd {
                vertical-align: top;
                width: 53px;
                height: 100%;
            }

            .leftNavStyle .rightTd {
                vertical-align: top;
                height: 100%;
                border-top-width: 1px;
            }

        .iframecss {
            height: 100%;
        }

        #ifWin {
            height: 100%;
            width: 100%;
            display: block;
            border-width: 0px;
        }

        .leftNavBtnStyle {
            margin-left: 2px;
            width: 53px; /*height: 100%;*/
        }

            .leftNavBtnStyle td {
                border-style: solid;
                border-width: 0px 1px 0px 0px;
                padding: 2px;
                cursor: pointer;
                cursor: hand;
                height: 26px;
            }

            .leftNavBtnStyle .TdSelected {
                border-style: solid;
                border-width: 1px 0px 1px 1px;
                background-repeat: repeat-y;
                padding: 2px;
            }

            .leftNavBtnStyle td li {
                list-style-type: none;
                float: left;
            }

            .leftNavBtnStyle td img {
                border: 0px;
                margin-right: 1px;
            }

        .mouseover {
            border-width: 0px 1px 0px 0px !important;
        }

        .userinfo {
            height: 30px;
            margin: 5px;
        }

            .userinfo li {
                list-style-type: none;
                float: left;
                padding: 3px;
                line-height: 14px;
            }

        .userface {
            background-color: White;
            width: 20px;
            height: 20px;
            border-width: 1px;
        }

        .divfaceCursor {
            cursor: pointer;
            cursor: hand;
        }

            .divfaceCursor a {
                cursor: pointer;
                cursor: hand;
            }

        .rightbutton {
            float: right;
        }

            .rightbutton li {
                list-style-type: none;
                float: left;
                height: 20px;
                line-height: 20px;
                border-width: 1px;
                margin: 2px;
                cursor: pointer;
                cursor: hand;
            }

        .icotext {
            height: 20px;
            line-height: 20px;
            vertical-align: middle;
        }

        .StyleBtn {
            color: #474747;
            border-style: dotted;
            border-color: White;
        }

        .CurrentStyleBtn {
            font-weight: bold;
            border-color: White;
        }



        .userbutton {
            height: 30px;
            margin: 5px;
        }

            .userbutton li {
                list-style-type: none;
                display: inline-block;
                padding: 3px;
                line-height: 14px;
                background-color: White;
                width: 30px;
                height: 20px;
                border-width: 1px;
            }
    </style>

    <script type="text/javascript">



        function setStyle(index) {
            var styleName = "Blue";
            switch (index) {
                case 0:
                    styleName = "Green";
                    break;
                case 1:
                    styleName = "Blue";
                    break;
                case 2:
                    styleName = "Orange";
                    break;
                case 3:
                    styleName = "Red";
                    break;
            }

            var expdate = new Date();
            expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); //1year
            SetCookie("CurrentStyle", styleName, expdate, "/", null, false);

            BtnStyle();


            parent.document.getElementById("linkStyle").href = "../Themes/" + styleName + "/css.css";


            try {
                for (i = 0; i < parent.frames.length; i++) {
                    foundStyle(parent.frames[i], styleName);
                }

                for (i = 0; i < window.frames.length; i++) {
                    foundStyle(window.frames[i], styleName);
                    var frame = window.frames[i];
                    for (ii = 0; ii < frame.frames.length; ii++) {
                        foundStyle(frame.frames[ii], styleName);
                        var _frame = frame.frames[ii];
                        for (iii = 0; iii < _frame.frames.length; iii++)
                        { foundStyle(_frame.frames[iii], styleName); }
                    }
                }
            } catch (ex) { }



        }

        function foundStyle(frameName, styleName) {

            if (frameName.document.getElementById("linkStyle") != null) {
                frameName.document.getElementById("linkStyle").href = "../Themes/" + styleName + "/css.css";
            }
        }

        function BtnStyle() {
            var cookie = GetCookie("CurrentStyle");
            if (cookie != null) {

                liSpring.className = "StyleBtn";
                liSummer.className = "StyleBtn";
                liAutumn.className = "StyleBtn";
                liWinter.className = "StyleBtn";

                switch (cookie) {
                    case "Green":
                        liSpring.className = "CurrentStyleBtn";
                        break;
                    case "Blue":
                        liSummer.className = "CurrentStyleBtn";
                        break;
                    case "Orange":
                        liAutumn.className = "CurrentStyleBtn";
                        break;
                    case "Red":
                        liWinter.className = "CurrentStyleBtn";
                        break;
                }
            }
        }

        function GetStyle(obj) {
            var cookie = GetCookie("CurrentStyle");
            var id = obj.id;
            var returnValue = false;

            if (cookie != null) {

                switch (cookie) {
                    case "Green":
                        if (id == 'liSpring')
                            returnValue = true;
                        break;
                    case "Blue":
                        if (id == 'liSummer')
                            returnValue = true;
                        break;
                    case "Orange":
                        if (id == 'liAutumn')
                            returnValue = true;
                        break;
                    case "Red":
                        if (id == 'liWinter')
                            returnValue = true;
                        break;
                }
            }

            return returnValue;
        }

        function StyleOver(obj) {
            if (GetStyle(obj))
                obj.className = 'CurrentStyleBtn bgc4';
            else
                obj.className = 'StyleBtn bgc4';
        }

        function StyleOut(obj) {
            if (GetStyle(obj))
                obj.className = 'CurrentStyleBtn';
            else
                obj.className = 'StyleBtn';
        }




    </script>

    <script type="text/javascript">


        //选择菜单代码:::::::::::::
        var lastSelected = null;

        function Selected(the, gotoUrl) {
            if (the == lastSelected) {
                //document.getElementById("ifWin").src = gotoUrl;
                Open("ifWin", gotoUrl);
                return;
            }
            var TdSelected = the;
            TdSelected.className = "bgc6 bgimg2 TdSelected";
            if (lastSelected != null) {
                lastSelected.className = "";
            }
            lastSelected = TdSelected;
            //document.getElementById("ifWin").src = gotoUrl;
            Open("ifWin", gotoUrl);
        }

        function mouseover(the) {
            currentClass = the.className;
            if (currentClass == '') the.className = 'bgc4 mouseover';
        }

        function mouseout(the) {
            if (the != lastSelected)
                the.className = currentClass;
        }

    </script>

    <script type="text/javascript">

        function Open(frameId, url) {
            var frame = document.getElementById(frameId);
            Loading(frame);
            document.getElementById(frameId).src = url;  //+ "?date=" + new Date().getSeconds();
            void (0);
        }

        function Loading(frame) {

            var offsetLeft = getLeft(frame);
            var offsetTop = getTop(frame);

            var loading = document.getElementById("divLoading");
            loading.style.left = (offsetLeft + frame.offsetWidth / 2 - loading.offsetWidth / 2) + "px";
            loading.style.top = (offsetTop + frame.offsetHeight / 2 - loading.offsetHeight / 2 - 60) + "px";
            loading.style.visibility = "visible";
        }

        function Loadend() {
            document.getElementById("divLoading").style.visibility = "hidden";
            //alert(document.getElementById("parentTd").offsetHeight);
            //ifWin.height = parentTd.clientHeight+"px";
        }

        function getLeft(obj) {
            var offset = obj.offsetLeft;
            if (obj.offsetParent != null) offset += getLeft(obj.offsetParent);
            return offset;
        };

        function getTop(obj) {
            var offset = obj.offsetTop;
            if (obj.offsetParent != null) offset += getTop(obj.offsetParent);
            return offset;
        };

        function setDing(num) {
            var expdate = new Date();
            expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * 365)); //1year
            SetCookie("__mt_ding", num, expdate, "/", null, false);
        }

        function getDing() {
            var cookie = GetCookie("__mt_ding");
            if (cookie == null || cookie == "")
                return -1;
            else {
                return parseInt(cookie);
            }
        }

        function setcbxDing() {
            try {
                var d = getDing();
                if (d == 0) {
                    document.getElementById("cbxDing").className = "dingNo";//.checked = false; //alert(d);
                    parent.setDing(0);
                    parent.OpenSub(0);
                }
                else {
                    document.getElementById("cbxDing").className = "dingYes";//.checked = true; //alert(d);
                    parent.setDing(1);
                    parent.OpenSub(1);
                }
            } catch (ex)
            { alert(ex); }
        }

        function cbxOnchange(the) {
            if (the.className == "dingNo") {
                the.className = "dingYes"; setDing(1);
                parent.setDing(1); //alert(getDing());


            } else {
                the.className = "dingNo"; setDing(0);
                parent.setDing(0); //alert(getDing());

            }
        }


        function LoadShow() {
            parent.LoadShow();
        }




        //显示小菜单。
        var __showState = false;
        function smallMenu(sender, code, evt) {

            if (__showState)
            {
                close_smallMenu();
                __showState = false;
                return;
            }

            var obj = sender;
            var x = __mt_getLeft(obj) + obj.offsetWidth - 5;
            var y = __mt_getTop(obj) + obj.offsetHeight - 3;
            var divPopup = document.getElementById("divMenu");
            divPopup.style.left = x + 'px';
            divPopup.style.top = y + 'px';
            divPopup.style.visibility = "visible";
            divPopup.innerHTML = code.innerHTML;
            stopEventBubble(evt);
            __showState = true;
        }

        //关闭小菜单。
        function close_smallMenu() {
            var divPopup = document.getElementById("divMenu");
            if (divPopup.style.visibility == "visible") {
                divPopup.style.visibility = "hidden";
                __showState = false;
            }
        }

        //阻止事件冒泡。
        function stopEventBubble(event) {
            var e = event || window.event;

            if (e && e.stopPropagation) {
                e.stopPropagation();
            }
            else {
                e.cancelBubble = true;
            }
        }

    </script>

    <script src="../Jscript/Md5.js" type="text/javascript"></script>

    <script type="text/javascript">
        //function onClickLink(sender, href) {
        //    parent.onClickLink(sender, href);
        //}

        function onClickLink(sender, href) {
            var str = href.toLowerCase();

            if (MorePage(str)) {
                parent.onClickLink(sender, href);
            }
            else {
                //hash = "__mt_" + hex_md5(str);
                //parent.onClickLink2(sender, hash, href);

                hash = "default";
                parent.onClickSingleLink(sender, hash, href);
            }
        }

        function MorePage(str) {
            var arr = new Array();
            arr[0] = "poststudent.aspx";
            arr[1] = "studentlist.aspx";
            arr[2] = "postpotential.aspx";
            arr[3] = "potentiallist.aspx";
            arr[4] = "postclass.aspx";
            arr[5] = "classlist.aspx";

            for (i = 0; i < arr.length; i++) {
                if (str.indexOf(arr[i]) > -1) {
                    return true;
                }
            }

            return false;
        }
    </script>
</head>
<body class="bgc2" style="margin: 0px; padding: 0px; position: relative" onload="setcbxDing();">
    <form id="form1" runat="server" style="margin: 0px; padding: 0px">

        <div id="divMenu" class="smallmenu">
        </div>

        <div id="divTabCol" style="display: none; visibility: hidden;">
            <div style="width: 100%; height: 100%; padding: 0px; margin: 0px;">
                <div onclick="javascript:onClickLink(this, '../user/password.aspx');" onmouseover="__mt_NavMouseover(this,'smallmenu_item')" onmouseout="__mt_NavMouseout(this,'smallmenu_item')" class="smallmenu_item">
                    修改密码
                </div>
                <div onclick="javascript:onClickLink(this, '../user/Purview.aspx');" onmouseover="__mt_NavMouseover(this,'smallmenu_item')" onmouseout="__mt_NavMouseout(this,'smallmenu_item')" class="smallmenu_item">
                    我的权限
                </div>
            </div>
        </div>

        <div style="height: 51px; background-color: cornflowerblue;">
            <table class="leftNavStyle bgc1" cellspacing="0" cellpadding="0" style="margin: 0px; padding: 0px; border-bottom-width: 0px">
                <tr>
                    <th colspan="2" class="left_panel_titlebg1" style="height: 51px; border-bottom-width: 0px">
                        <table style="vertical-align: baseline; border-bottom-width: 0px">
                            <tr>
                                <td>
                                    <div class="userinfo">
                                        <li class="userface">
                                            <iframe frameborder="0" name="iFace" id="iFace" scrolling="no" style="width: 20px; height: 20px" src="Face.aspx"></iframe>
                                        </li>
                                        <li style="display: inline-block">
                                            <asp:Label ID="labTrueName" runat="server"></asp:Label>
                                        </li>
                                        <li style="display: inline-block; font-size: 9px; width: 20px; text-align: center; border-radius: 2px; cursor: pointer" class="StyleBtn" onmouseover="StyleOver(this)"
                                            onmouseout="StyleOut(this)" onclick="smallMenu(this,divTabCol)"><a>▼</a>

                                        </li>
                                    </div>
                                </td>
                                <td>
                                    <%--                                    <div style="text-align: right; font-weight: normal; padding-right: 12px">权限 退出</div>--%>

                                    <%--                                    <div class="userbutton" style="width: 80px; height: 50px; position: absolute; top: 25px; right: 10px;">
                                        <li>设置</li>
                                        <li style="width: 30px">提醒</li>
                                    </div>--%>

                                    <div id="cbxDing" onclick="cbxOnchange(this)" style="width: 15px; height: 15px; position: absolute; top: 2px; right: 2px">
                                    </div>
                                    <div class="rightbutton" style="white-space: nowrap; position: absolute; z-index: 0; top: 20px; right: 5px; display: none">
                                        <ul style="margin: 0px; padding: 0px">
                                            <%--                                            <li style="border: 0px">
                                                <div style="float: left; margin-left: 5px" class="ico_theme">
                                                </div>
                                            </li>--%>
                                            <li id="liSpring" onclick="setStyle(0);" class="StyleBtn" onmouseover="StyleOver(this)"
                                                onmouseout="StyleOut(this)">春</li>
                                            <li id="liSummer" onclick="setStyle(1);" class="StyleBtn" onmouseover="StyleOver(this)"
                                                onmouseout="StyleOut(this)">夏</li>
                                            <li id="liAutumn" onclick="setStyle(2);" class="StyleBtn" onmouseover="StyleOver(this)"
                                                onmouseout="StyleOut(this)">秋</li>
                                            <li id="liWinter" onclick="setStyle(3);" class="StyleBtn" onmouseover="StyleOver(this)"
                                                onmouseout="StyleOut(this)">冬</li>
                                        </ul>
                                        <%--<input id="cbxDing" onchange="cbxOnchange(this)" type="checkbox" />--%>
                                    </div>


                                </td>
                            </tr>
                        </table>
                    </th>
                </tr>
            </table>
        </div>

        <div style="background-color: cornflowerblue; position: absolute; top: 50px; left: 0px; right: 0px; bottom: 25px; z-index: 1000">
            <table class="leftNavStyle bgc1" cellspacing="0" cellpadding="0" style="margin: 0px; padding: 0px; height: 100%; border-top-width: 0px">
                <tr>
                    <td class="leftTd left_panel_line">
                        <table class="leftNavBtnStyle" cellspacing="0" cellpadding="0">
                            <tr>
                                <td id="td_1" onclick="Selected(this,'ServiceLeft.aspx')" onmouseover="mouseover(this)"
                                    onmouseout="mouseout(this)">
                                    <ul style="padding: 0px; margin: 0px">
                                        <li class="ico_market"></li>
                                        <li>客服</li>
                                    </ul>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_2" onclick="Selected(this,'TeacherLeft.aspx')" onmouseover="mouseover(this)"
                                    onmouseout="mouseout(this)">
                                    <ul style="padding: 0px; margin: 0px">
                                        <li class="ico_teacher"></li>
                                        <li>教师</li>
                                    </ul>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_3" onclick="Selected(this,'AffairsLeft.aspx')" onmouseover="mouseover(this)"
                                    onmouseout="mouseout(this)">
                                    <ul style="padding: 0px; margin: 0px">
                                        <li class="ico_course"></li>
                                        <li>教务</li>
                                    </ul>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_4" onclick="Selected(this,'FinanceLeft.aspx')" onmouseover="mouseover(this)"
                                    onmouseout="mouseout(this)">
                                    <ul style="padding: 0px; margin: 0px">
                                        <li class="ico_finance"></li>
                                        <li>财务</li>
                                    </ul>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_5" onclick="Selected(this,'StoreroomLeft.aspx')" onmouseover="mouseover(this)"
                                    onmouseout="mouseout(this)">
                                    <ul style="padding: 0px; margin: 0px">
                                        <li class="ico_storeroom"></li>
                                        <li>仓库</li>
                                    </ul>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_6" onclick="Selected(this,'PersonnelLeft.aspx')" onmouseover="mouseover(this)"
                                    onmouseout="mouseout(this)">
                                    <ul style="padding: 0px; margin: 0px">
                                        <li class="ico_personnel"></li>
                                        <li>人事</li>
                                    </ul>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_7" onclick="Selected(this,'PolicyLeft.aspx')" onmouseover="mouseover(this)"
                                    onmouseout="mouseout(this)">
                                    <ul style="padding: 0px; margin: 0px">
                                        <li class="ico_peport"></li>
                                        <li>分析</li>
                                    </ul>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_8" onclick="Selected(this,'SMSLeft.aspx')" onmouseover="mouseover(this)"
                                    onmouseout="mouseout(this)">
                                    <ul style="padding: 0px; margin: 0px">
                                        <li class="ico_sms"></li>
                                        <li>短信</li>
                                    </ul>
                                </td>
                            </tr>
                            <tr style="display: none">
                                <td id="td_10" onclick="Selected(this,'ChatLeft.aspx')" onmouseover="mouseover(this)"
                                    onmouseout="mouseout(this)">
                                    <ul style="padding: 0px; margin: 0px">
                                        <li class="ico_chat"></li>
                                        <li>消息</li>
                                    </ul>
                                </td>
                            </tr>
                            <tr>
                                <td id="td_9" onclick="Selected(this,'SystemLeft.aspx')" onmouseover="mouseover(this)"
                                    onmouseout="mouseout(this)">
                                    <ul style="padding: 0px; margin: 0px">
                                        <li class="ico_sys"></li>
                                        <li>系统</li>
                                    </ul>
                                </td>
                            </tr>
                            <tr>
                                <td style="height: auto !important;">&nbsp;
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td class="bgc6 rightTd">
                        <iframe frameborder="0" scrolling="auto" id="ifWin" name="ifWin" onload="Loadend()"></iframe>
                        <div id="divLoading" style="visibility: hidden; position: absolute" class="loading">
                        </div>
                    </td>
                </tr>
            </table>
        </div>

        <div style="background-color: cornflowerblue; position: absolute; top: auto; left: 0px; right: 0px; bottom: 0px; height: 25px">
            <div style="line-height: 25px; vertical-align: middle; text-align: center">
                <a onclick="onClickLink(this, '../Admin/SystemInfo.aspx')" href="#"><%= "Version:" + swq.Version %></a>
            </div>
        </div>

        <div class="left_topbgp" style="width: 100%; height: 73px; display: none">
            <div id="divLogo" runat="server" style="text-align: center; margin-left: auto; margin-right: auto; width: 200px; height: 73px; background-repeat: no-repeat; cursor: hand; cursor: pointer; background-position: center 12px; border: 0px solid red">
            </div>
        </div>

        <script type="text/javascript">

            var firstTd = false;
            for (i = 0; i < purviewGroup.length; i++) {
                if (purviewGroup[i] == 0) {
                    var td = document.getElementById("td_" + (i + 1));
                    if (td != null)
                        td.style.display = "none";
                }
                else {
                    if (!firstTd) {
                        var td = document.getElementById("td_" + (i + 1));
                        if (td != null)
                            td.onclick();
                        firstTd = true;
                    }
                }
            }
        </script>
    </form>
</body>
</html>
