﻿function checkLogin()
{
     if($("LoginAccount").value=="")
    {
        alert("您忘记填写你的通行证帐号了。");
        $("LoginAccount").focus();
        return false;
    }
    
    if($("LoginPwd").value=="")
    {
        alert("您忘记填写通行证帐号密码了。");
        $("LoginPwd").focus();
        return false;
    }
    
    if($("verifycode").length>500)
    {
        alert("验证码不能为空。");
        $("verifycode").focus();
        return false;
    }
    return true;   
}

function theLoginSubmit()
{
    if(checkLogin())
    {
        AjaxHelper.Call({url:"?login=Y",pars:{LoginAccount:$("LoginAccount").value,LoginPwd:$("LoginPwd").value,verifycode:$("verifycode").value}});
    }
}

function exitLogin()
{
    location.href="exit.aspx";
}

//验证码提交快捷键
function theLoginKeySubmit(evt)
{
    evt = (evt) ? evt : ((window.event) ? window.event : null) 
    var key = evt.keyCode?evt.keyCode:evt.which; 
    if((key == 13 || key == 10))
    { 
        //按下了回车键
        theLoginSubmit();
        return false;
    }
}

//
function goHome()
{
    if(confirm('您确定要退出登录吗？'))
    { 
        location.href="?isexit=Y";
    }
}
