﻿
           /*第一种形式 第二种形式 更换显示样式*/
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 gryhmm = document.getElementById("tbPwd").value; //对用户
               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 {
                        Subresume();
                     
                    }
                }
            );
               } else {
                   if (gryhmc.length == 0) {
                       alert("用户名不能为空");
                       document.getElementById("tbuserName").focus();
                   }
                   if (gryhmm.length == 0) {
                       alert("密码不能为空");
                       document.getElementById("tbPwd").focus();
                   }
               }
              
           }
           function Subresume() {
               var flag = Com_Infor_view_job.SessionP();
               if (flag.value == false) {
                   showdiv(document.getElementById("msgBox"));
               }
               else {
                   hiddiv(document.getElementById("msgBox"));
                   var jobid = document.getElementById("getjid").value;
                   var url = "../yunnanzhaogongzuo/PersonSubResume.aspx?id=" + jobid;
                   var framewindow = new dw.app.FrameWindow('', { frmUrl: url, width: "550px", height: "240px" });
                   framewindow.setTitle('投递简历信息');
                   framewindow.show();
                   framewindow.setCenter();
               }



           }
           ///安全退出
           function anquantuichu() {

               remotePostCall(getDomain() + "Ajax.aspx", "CancelLogin", "",
                function(result) {
                    document.getElementById("TbLogin1").innerHTML = result;
                });
           }
           //个人管理中心
           function grglzx() {
               window.open(getDomain() + "yunnanzhaogongzuo/PersonMange.aspx", '_parent');
           }
           //企业管理中心
           function qyglzx() {
               window.open(getDomain() + "yunnanrencai/ComManage.aspx", '_parent');


           }
           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 {

                        alert("登陆成功");
                        window.location.reload();                
                        //document.getElementById("con_one_2").nodeValue = "";
                        // document.getElementById("con_one_2").innerHTML = result;
                    }
                }
            );


               }
           }
           function grzchelp()//个人用户帮助
           {
               window.open(GetWebRootUrl());

           }
           function qyzchelp()//企业用户帮助
           {
               window.open(GetWebRootUrl());

           }
           function grzc()//个人用户注册
           {
               window.open(getDomain() + "yunnanzhaogongzuo/PersonRegister.aspx");

           }
           function qyzc()//企业用户注册
           {
               window.open(getDomain() + "yunnanrencai/Com_Regist.aspx");

           }
