﻿
           /*第一种形式 第二种形式 更换显示样式*/
function setTab(name, cursel, n) {

    remotePostCall(getDomain() + "/Ajax.aspx", "pcsession", "",
                function(result) {
                    switch (result) {
                        case "Yes":
                            xh(name, cursel, n);
                            break;
                        case "P":
                            alert("请退出个人用户才可以登陆")
                            break;
                        case "C":
                            alert("请退出企业用户才可以登陆")
                            break;
                    }
                }
            );


            }
            function xh(name, cursel, n) {
                for (i = 1; i <= n; i++) {

                    var menu = document.getElementById(name + i);
                    var con = document.getElementById("con_" + name + "_" + i);
                    menu.className = i == cursel ? "hover" : "";
                    con.style.display = i == cursel ? "block" : "none";
                }
            }
          
           function ReMoveChild() {
               var f = document.getElementById("Tab1");
               var childs = f.childNodes;
               alert(childs.length);
               //            for (var i = childs.length - 1; i >= 0; i--) {
               //                alert(childs[i].nodeName);
               //                f.removeChild(childs[i]);
               //            }
           }


           //个人用户登录
           function checklog() {
               var gryhmc = document.getElementById("tbuserName").value;
              // var gzdd=document.getElementById("tbgzdd").value;
               var gryhmm = document.getElementById("tbPwd").value; //对用户
               //var grjzyhm = document.getElementById("cbjzgryh"); //记住用用名
               if (gryhmc.length != 0 && gryhmm.length != 0) {
                   remotePostCall(getDomain()+"/Ajax.aspx", "CheckLogin", "mc=" +escape(gryhmc) + "&mm=" +escape(gryhmm),
                function(result) {
                    if (result == "yes") {
                        alert("密码或用户名错误！请重新输入。");
                        document.getElementById("tbuserName").value = "";
                        document.getElementById("tbPwd").value = "";
                        document.getElementById("tbuserName").focus();
                    }
                    else {
                        grglzx();
                        //document.getElementById("LoginDl").nodeValue = "";
                        // document.getElementById("con_one_1").innerHTML = result;
                        // clipboardData.setData('text', result);

                    }
                }
            );
               } else {
                   if (gryhmc.length == 0) {
                       alert("用户名不能为空");
                       document.getElementById("tbuserName").focus();
                   }
                   if (gryhmm.length == 0) {
                       alert("密码不能为空");
                       document.getElementById("tbPwd").focus();
                   }
               }
           }
           ///安全退出
           function anquantuichu() {

               remotePostCall(getDomain() + "Ajax.aspx", "CancelLogin", "",
                function(result) {
                    document.getElementById("TbLogin1").innerHTML = result;
                });
           }
           //个人管理中心
           function grglzx() {


               window.location.href = getDomain() + "/yunnanzhaogongzuo/PersonMange.aspx";
             
           //    window.open(getDomain() + "yunnanzhaogongzuo/PersonMange.aspx", '_parent',false);
        

           }  
           //企业管理中心
           function qyglzx() {       
               window.location.href = getDomain() + "/yunnanrencai/ComManage.aspx";
          }
           function GetWebRootUrl() {//得到页面所在文件夹

               var strFullPath = window.document.location.href;

               var strPath = window.document.location.pathname;

               var pos = strFullPath.indexOf(strPath);

               var prePath = strFullPath.substring(0, pos);

               var postPath = strPath.substring(0, strPath.substr(1).indexOf('/') + 1);

               return (prePath + postPath);

           }
           function getDomain()
           {
               var strFullPath = window.document.location.href;

               var strPath = window.document.location.pathname;

               var pos = strFullPath.indexOf(strPath);

               var prePath = strFullPath.substring(0, pos)+"/";
               return prePath;
               
           }
           //检查企业登陆验证
           function checkqylog() {
               var qyyhmc = document.getElementById("qyyhmc").value;
               var qyyhmm = document.getElementById("qyyhmm").value;
               var flag = false;
               if (qyyhmc.length == 0) {
                   alert("用户名不能为空");
                   document.getElementById("qyyhmc").focus();
                   flag = false;
               }
               if (qyyhmm.length == 0) {
                   alert("用户密码不能为空");
                   document.getElementById("qyyhmm").focus(); ;
                   flag = false;

               }
               if (qyyhmc.length != 0 && qyyhmm.length != 0) {
                   remotePostCall(getDomain()+"Ajax.aspx", "CheckComLogin", "mc=" +escape(qyyhmc) + "&mm=" +escape(qyyhmm),
                function(result) {
                    if (result == "yes") {
                        document.getElementById("qyyhmm").value = "";
                        document.getElementById("qyyhmm").value = "";
                        alert("密码或用户名错误！请重新输入。");
                    }
                    else {

                        qyglzx();
                        //document.getElementById("con_one_2").nodeValue = "";
                        // document.getElementById("con_one_2").innerHTML = result;
                    }
                }
            );


               }
           }
           function grzchelp()//个人用户帮助
           {

               window.location.href = getDomain() + "/yunnanzhaogongzuo/PersonHelp.aspx";
           }
           function qyzchelp()//企业用户帮助
           {

               window.location.href = getDomain() + "/yunnanrencai/ComHelp.aspx";

           }
           function grzc()//个人用户注册
           {
               window.location.href = getDomain() + "yunnanzhaogongzuo/PersonRegister.aspx";

           }
           function qyzc()//企业用户注册
           {
               window.location.href = getDomain() + "yunnanrencai/Com_Regist.aspx";

           }
        