﻿var code ; //在全局 定义验证码
function createCode(){ 
code = "";
var codeLength = 4;//验证码的长度
var checkCode = document.getElementById("checkCode");
checkCode.innerText = "";

var selectChar = new Array(2,3,4,5,6,7,8,9,'A','B','C','D','E','F','G','H','J','K','L','M','N','P','Q','R','S','T','U','V','W','X','Y','Z');

for(var i=0;i<codeLength;i++) {
   var charIndex = Math.floor(Math.random()*32);
   code +=selectChar[charIndex];
}
if(code.length != codeLength){
   createCode();
}
checkCode.innerText = code;
}
function AdminLogin()
{
    var UserName=document.all.username.value.replace(/ /g,"");
    var UserPwd=document.all.password.value.replace(/ /g,"");
    var VerCode=document.all.txtcode.value.toUpperCase();
    
    if(UserName==""||UserName=='请输入用户名')
    {
        alert("请输入用户名！");
        document.all.username.focus();
        return false;
        
    }else
    if(UserPwd==""||UserPwd==null)
    {
        alert("请输入密码！");
        document.all.password.focus();
        return false;
        
    }else
    if(VerCode==""||VerCode=="输入右边的字符"||VerCode==null)
    {
        alert("请输入验证码！");
        document.all.txtcode.focus();
        return false;
        
    }else
    if(VerCode != code ){
       alert("验证码输入错误！");
       createCode();
       return false;
    }else{
        returnString="";
        var PostInfo="FunctionName=userlogin&UserName="+escape(UserName)+"&pwd="+escape(UserPwd)+"";
        AJpost(PostInfo);
       
        if(returnString=='登陆成功')
        {
            alert(returnString);
            //='vip.shtml';
            parent.location.href='vip.shtml';
            return true;
        }else{
            alert(returnString);
            return false;
        }
    
    }
}
function fflush(obj){
obj.value="";
}

function search_f(obj)
{
    obj.value='';
}

function search_b(obj)
{
    obj.value='请在此输入您要搜索的关键词！';
}

function search_rc(i)
{
    if(i==0)
    {
        document.getElementById("div_job").style.display='block';
        document.getElementById("div_people").style.display='none';
    }else
    {
        document.getElementById("div_job").style.display='none';
        document.getElementById("div_people").style.display='block';
    }
}

function tjj(acc,zid)
{
    returnString="";
    var PostInfo="FunctionName=tjjl&account="+acc+"&zid="+zid+"";
    AJpost(PostInfo);
    if(returnString=="ok")
    {
        alert("提交简历成功！");
    }
    else if(returnString=="sok")
    {
        alert("您已经提交过简历，请耐心等待答复！");
    }
    else
    {
        alert("提交简历前请先登陆！");
    }
}

function mstz(acc,zid)
{
     returnString="";
    var PostInfo="FunctionName=fsmstz&account="+acc+"&zid="+zid+"";
    AJpost(PostInfo);
    if(returnString=="111")
    {
        alert("提交简历成功！");
    }
    else if(returnString=="222")
    {
        alert("个人会员无法发送面试通知！");
    }    
    else{
        alert("提交简历前请先登陆！");
    }
}
