<%@ page language="C#" autoeventwireup="true" inherits="Top, App_Web_yjdmcdrp" %>

<!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>
    <meta http-equiv="x-ua-compatible" content="ie=7" />
    <link rel="stylesheet" href="css/common.css" type="text/css" />
    <style type="text/css">
    img.png {background-image: expression(this.runtimeStyle.backgroundImage = "none",this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "', sizingMethod='image')",this.src = "Images/1.gif")} 
        body 
    {
        background-image:url(Images/login_top_bg.jpg);
        background-repeat:repeat-x;
        background-position:top;
        height:90px;
        width:100%;
        }
    </style>
    <script type="text/javascript" src="js/jquery.js"></script>
    <script src="js/common.js" type="text/javascript"></script>
    <script type="text/javascript">
    
    //本方法是防止同账号同时登录
        function CheckToken() {
            var userid =  document.getElementById("hideUserId").value;
            var pars = 'xx=1&userid=' + userid;
            //alert(pars);
            sendAJAX("CheckToken.aspx", pars, "get", onComplete, true, false);
        }
        function onComplete(result) {
            //alert(result);
            if (result != document.getElementById("hideKey").value) {
                alert('对不起！您的账号在别处登录！请勿重复登录，否则建议修改您的密码！');
                parent.window.opener = null;
                parent.window.open('', '_self');
                parent.window.close();

                //window.parent.close();
            window.parent.location.href='elogin.aspx';
            }
        }
        
        //该方法是防止本机多次登录
        function CheckCookieToken() {
            //alert('xxx');


            //alert(document.getElementById("hideKey").value);
       

         var cookie = getCookie2('Token');
         //alert('cookie:'+cookie);
         if (cookie != document.getElementById("hideKey").value) {/*document.getElementById("lblKey").innerText*/
                alert('对不起！同一计算机同时只允许登录一个账号！请勿重复登录！');
                parent.window.opener = null;
                parent.window.open('', '_self');
                parent.window.close();

                //window.parent.close();
            window.parent.location.href='elogin.aspx';
            }
         }
        
        function getCookie2(objName)
        {//获取指定名称的cookie的值   
            var arrStr = document.cookie.split("; ");  
             for(var i = 0;i < arrStr.length;i ++)
             {
                    var temp = arrStr[i].split("=");   
                    if(temp[0] == objName) 
                     {
                        return unescape(temp[1]); 
                     }
            }
        }

    
        function M_User() {
            window.top.leftFrame.location.href = 'left_user.aspx?T=mystudy';
            window.top.manFrame.location.href = 'course/learnmycourse.aspx';
        }
        function M_UserIndex() {
            window.top.leftFrame.location.href = 'left_new.aspx';
            window.top.manFrame.location.href = 'manframe_new.aspx';
        }
        function M_Plan() {
            window.top.leftFrame.location.href = 'left_user.aspx?T=myplan';
            window.top.manFrame.location.href = 'plan/PersonalPlans.aspx';
        }
        function M_Exam() {
            window.top.leftFrame.location.href = 'left_user.aspx?T=myexam';
            window.top.manFrame.location.href = 'Exam/AddExamLFRM.aspx';
        }
        function M_Knowledge() {
            window.top.leftFrame.location.href = 'left_user.aspx?T=myknowledge';
            window.top.manFrame.location.href = 'Knowledge/PersonalInfo.aspx';
        }
        
        function M_Info() {
            window.top.leftFrame.location.href = 'left_user.aspx?T=myinfo';
            window.top.manFrame.location.href = 'remind.aspx?id=1';
        }

        function M_managehome() {
            window.top.leftFrame.location.href = 'left_manage.aspx?T=managehome';
            window.top.manFrame.location.href = 'adminframe_new.aspx';
        }

        function M_studymanage() {
            window.top.leftFrame.location.href = 'left_manage.aspx?T=studymanage';
            window.top.manFrame.location.href = 'studyMIntro.aspx';
        }

        function M_exammanage() {
            window.top.leftFrame.location.href = 'left_manage.aspx?T=exammanage';
            window.top.manFrame.location.href = 'exammintro.aspx';
        }

        function M_resource() {
            window.top.leftFrame.location.href = 'left_manage.aspx?T=resource';
            window.top.manFrame.location.href = 'resourceMintro.aspx';
        }
        function M_usermanage() {
            window.top.leftFrame.location.href = 'left_manage.aspx?T=usermanage';
            window.top.manFrame.location.href = 'usermintro.aspx';
        }
        function M_report() {
            window.top.leftFrame.location.href = 'left_manage.aspx?T=report';
            window.top.manFrame.location.href = 'repoort/OrgStudyMonth.aspx';
        }
        function M_news() {
            window.top.leftFrame.location.href = 'left_manage.aspx?T=news';
            window.top.manFrame.location.href = 'SysManage/AfficheLFRM.aspx';
        }
        function M_sysusermanage() {
            window.top.leftFrame.location.href = 'left_manage.aspx?T=sysusermanage';
            window.top.manFrame.location.href = 'UserInfo/UserLFRM.aspx';
        }

        //改变用户角色
        function ChangeRole(v) {
         //alert(v);
            //var selValue = document.getElementById("ddlRole").options[document.getElementById("ddlRole").selectedIndex].value;
            if (v == "0") {
                document.getElementById("divUser").style.display = "block";
                document.getElementById("divManage").style.display = "none";
                document.getElementById("divSysManage").style.display = "none";
                
                //改变left和manFrame
                window.top.leftFrame.location.href = 'left_new.aspx?T=mystudy';
                window.top.manFrame.location.href = 'manframe_new.aspx';
            }
            else if (v == "1") {
            document.getElementById("divUser").style.display = "none";
            document.getElementById("divManage").style.display = "block";
            document.getElementById("divSysManage").style.display = "none";
            //改变left和manFrame
            window.top.leftFrame.location.href = 'left_manage.aspx?T=managehome';
            window.top.manFrame.location.href = 'adminframe_new.aspx';
            }
            else if (v == "SA") {
            document.getElementById("divUser").style.display = "none";
            document.getElementById("divManage").style.display = "none";
            document.getElementById("divSysManage").style.display = "block";

            //改变left和manFrame
            window.top.leftFrame.location.href = 'left_manage.aspx?T=sysusermanage';
            window.top.manFrame.location.href = 'UserInfo/UserLFRM.aspx';
            }
        }


    </script>
<%--    <script type="text/javascript">
        function qiehuan(num) {
            var id = this.event.srcElement.id;
            alert(id);
            
        }
    </script>--%>
    <script type="text/javascript">
        var selectIndex = 0;
        jQuery(document).ready(function() {
            jQuery("div.right_nav>ul>li a").click(function() {
                jQuery("a[id=right_nav_hover]").attr("id", "");
                jQuery(this).attr("id", "right_nav_hover");
            });
            jQuery("div.right_nav>ul>li a").eq(selectIndex).click();
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:HiddenField ID="hideKey" runat="server" />
     <asp:HiddenField ID="hideUserId" runat="server" />
 <div class="header_content">
	    <div class="logo" style="float:left;"><img src="Images/login_logo.png" class="png img_style" alt="成都益用科技有限公司" /></div>
			<div class="top_link">
			    <ul>
			        <li><a href="#">帮助</a></li>
			         <%-- <li>|</li>
			      <li><a href="#">社区</a></li>
			        <li>|</li>
			        <li><a href="#">我的服务机构</a></li>
			        <li>|</li>
			        <li><a href="#">选项</a></li>
			        <li>|</li>--%>
			  <%--      <li><a href="#">退出 </a></li>--%>
			        <li style="padding-left:10px;"><img src="Images/tubiao14.gif" class="img_style" style="background-position:center;" />欢迎您,<asp:Label ID="lblUser" ForeColor="#0066A1" runat="server" Text=""></asp:Label> 当前角色：</li>
			        <li><asp:DropDownList ID="ddlRole"   runat="server" Font-Size="12px">
                        <asp:ListItem Value="0">学员</asp:ListItem>
                        <asp:ListItem Value="1">培训管理员</asp:ListItem>
                        <asp:ListItem Value="SA">系统管理员</asp:ListItem>
                        </asp:DropDownList>
                     </li>
			    </ul>
			</div>
     
            <asp:Label ID="lblKey" runat="server" Text="" style="color: #ffffff"></asp:Label>
             <asp:Label ID="lblUserId" runat="server" Text="" style="color: #ffffff"></asp:Label>
      </div>
	 
	 <div id="divUser" class="right_nav"><!--用户菜单-->
                <ul>
                    <li><a href="#" onclick="M_UserIndex();" onfocus="this.blur()"><img src="Images/ico_menu_01.png" class="img_style png"/> 系统首页</a></li>
                    <li><a href="#" onclick="M_User();" onfocus="this.blur()"><img src="Images/ico_menu_02.png" class="img_style png"/> 我的学习</a></li>
                    <li><a href="#" onclick="M_Plan();" onfocus="this.blur()"><img src="Images/ico_menu_03.png" class="img_style png"/> 我的计划</a></li>
                    <li><a href="#" onclick="M_Knowledge();" onfocus="this.blur()"><img src="Images/ico_menu_04.png" class="img_style png"/> 我的知识库</a></li>
                    <li><a href="#" onclick="M_Exam();" onfocus="this.blur()"><img src="Images/ico_menu_05.png" class="img_style png"/> 我的考试</a></li>
                    <li><a href="#" onclick="M_Info();" onfocus="this.blur()"><img src="Images/ico_menu_06.png" class="img_style png"/> 个人信息</a></li>
                    <li><asp:LinkButton ID="lbtnLogOff" runat="server" onclick="lbtnLogOff_Click"><div style=" padding-top:2px;"><img src="Images/ico_menu_close.png" class="img_style png"/> 退出系统</div></asp:LinkButton></li>
                    
                </ul>
            </div>
            <div id="divManage" style="display:none;" class="right_nav"><!--管理员菜单-->
                <ul>
                    <li><a href="#" id="right_nav_hover"  onclick="M_managehome();" onfocus="this.blur()"><img src="Images/ico_menu_01.png" class="img_style png"/> 管理首页 </a></li>
                      <%if (intSM == 0)
                          {
                              this.tabA2.Style.Add("display", "none");
                          }
                          else
                          {
                              this.tabA2.Style.Add("display", "block");
                          }
                        %>
                    <li id="tabA2"  runat="server"><a href="#"  onclick="M_studymanage();" onfocus="this.blur()"><img src="Images/ico_menu_02.png" class="img_style png"/> 学习管理 </a></li>
                      <%if (intEM == 0)
                          {
                              this.tabA3.Style.Add("display", "none");
                          }
                          else
                          {
                              this.tabA3.Style.Add("display", "block");
                          }
                        %>
                    <li id="tabA3"  runat="server"><a href="#" onclick="M_exammanage();" onfocus="this.blur()"><img src="Images/ico_menu_05.png" class="img_style png"/> 考试管理 </a></li>
                    <%if (intBM == 0)
                          {
                              this.tabA4.Style.Add("display", "none");
                          }
                          else
                          {
                              this.tabA4.Style.Add("display", "block");
                          }
                        %>
                    <li id="tabA4"  runat="server"><a href="#" onclick="M_resource();" onfocus="this.blur()"><img src="Images/ico_menu_04.png" class="img_style png"/> 资源管理 </a></li>
                         <%if (intUM == 0)
                          {
                              this.tabA5.Style.Add("display", "none");
                          }
                          else
                          {
                              this.tabA5.Style.Add("display", "block");
                          }
                        %>
                    <li id="tabA5"  runat="server"><a href="#" onclick="M_usermanage();" onfocus="this.blur()"><img src="Images/ico_menu_06.png" class="img_style png"/> 用户管理 </a></li>
                    <%if (intRM == 0)
                          {
                              this.tabA6.Style.Add("display", "none");
                          }
                          else
                          {
                              this.tabA6.Style.Add("display", "block");
                          }
                        %>
                    <li  id="tabA6"  runat="server"><a href="#" onclick="M_report();" onfocus="this.blur()"><img src="Images/ico_menu_07.png" class="img_style png"/> 报表管理 </a></li>
                    <%if (intAM == 0)
                          {
                              this.tabA7.Style.Add("display", "none");
                          }
                          else
                          {
                              this.tabA7.Style.Add("display", "block");
                          }
                        %>
                    <li  id="tabA7"  runat="server"><a href="#" onclick="M_news();" onfocus="this.blur()"><img src="Images/ico_menu_08.png" class="img_style png"/> 公告管理 </a></li>
                    <li><asp:LinkButton ID="LinkButton1" runat="server" onclick="lbtnLogOff_Click"><div style=" padding-top:2px;"><img src="Images/ico_menu_close.png" class="img_style png"/> 退出系统</div></asp:LinkButton></li>
                </ul>
            </div>
              <div id="divSysManage" style="display:none;" class="right_nav"><!--系统管理员菜单-->
                <ul>
                   <%-- <li><a id="right_nav_hover"  onclick="M_sysusermanage();"><img src="Images/ico_menu_01.png" class="img_style png"/> 管理首页 </a></li>--%>
                     <%if (intSysM == 0)
                          {
                              this.tabA8.Style.Add("display", "none");
                          }
                          else
                          {
                              this.tabA8.Style.Add("display", "block");
                          }
                        %>
                    <li  id="tabA8"  runat="server"><a href="#" onclick="M_sysusermanage();" onfocus="this.blur()"><img src="Images/ico_menu_02.png" class="img_style png"/> 用户及权限管理</a></li>

                  <%--  <li><a onclick="#"><img src="Images/ico_menu_06.png" class="img_style png"/> 系统管理</a></li>--%>
                  
                    <li><asp:LinkButton ID="LinkButton2" runat="server" onclick="lbtnLogOff_Click"><div style=" padding-top:2px;"><img src="Images/ico_menu_close.png" class="img_style png"/> 退出系统</div></asp:LinkButton></li>
                </ul>
            </div>
            <input id="timeleave" value="120" type="hidden" />
    </form>
</body>
</html>
