<script>
    $(document).ready(function () {
        $("#username").focus();
        $("form[name='FormSelectLogin']").submit(function () {
            if ($("#username").val() == "") {
                alert("请填写用户名");
            }
            else if ($("#password").val() == "") {
                alert("请填写密码");
            }
            else {

                var tsTimeStamp = new Date().getTime();
                if ($("#expire").attr("checked") == true) {
                    var expire = $("#expire").val();
                }
                else {
                    var expire = "60";
                }

                var posturl = "/ajax/personLogin.ashx?from=loginpanel"; ;
                if ($('#utype').val() == "1")
                    posturl = "/ajax/personLogin.ashx?from=loginpanel";
                if ($('#utype').val() == "2")
                    posturl = "/ajax/hrLogin.ashx?from=loginpanel";

                $("#msg").show();
                $.post(posturl, { "username": $("#username").val(), "password": $("#password").val(), "expire": expire, "url": "", "time": tsTimeStamp },
function (data, textStatus) {

    if (data == "false") {

        $("#password").attr("value", "");
        alert("用户名或者密码错误");
    }
    else if (data == "userstatefalse") {
        $("#btnlogin").removeAttr("disabled", true);
        $("#password").attr("value", "");
        alert("会员未审核，请先登录注册邮箱激活你的邮件");
    }
    else {
        $("#logintable").html(data);
    }
})
            }
            return false;
        });
    }); 
</script>
<div id="logintable">
    <ul class="hd" id="selecttype">
        <li class="on">个人登陆</li>
        <li>企业登陆</li>
    </ul>
    <div class="clear">
    </div>
    <div class="tab" id="Div1">
        <form name="FormSelectLogin" method="post" id="FormSelectLogin">
        <div class="msg" style="display: none;">
            正在登录，请稍后……</div>
        <div id="login_form">
            <div class="td1">
                <input type="submit" class="btnlogin" id="btnlogin" name="btnlogin" value="" />
            </div>
            <div class="td2">
                帐号：
                <input type="text" class="input140" id="username" name="username" />
                <div class="clear">
                </div>
                密码：
                <input type="password" class="input140" id="password" name="password" />
            </div>
            <div class="clear">
            </div>
            <p>
                <input type="checkbox" checked="checked" value="" name="du" />
                记住密码 <a rel="nofollow" class="a_blue" target="_blank" href="/getpassword.aspx">忘记密码？</a>
                <%set (string){loginstr} = getqqloginstr()%>
                {loginstr}
            </p>
            <div class="bd">
                <ul>
                    <li><a href="/person/resumeList.aspx">填写我的简历</a> <a href="/person/mycollectjob.aspx">
                        查看面试邀请</a></li>
                </ul>
                <ul>
                    <li><a href="/hrregister.aspx">如何成为正式会员？</a> <a href="/about/help.html">如何发布职位？</a></li>
                </ul>
            </div>
            <div class="td3">
                <a href="/personregister.aspx" onfocus="blur()" class="btn_p"></a><a href="/hrregister.aspx"
                    onfocus="blur()" target="_blank" class="btn_h"></a>
            </div>
            <div class="clear">
            </div>
            <input type="hidden" id="utype" name="utype" value="1" />
        </div>
        </form>
    </div>
</div>
<script type="text/javascript">

    $(function () {

        $("#selecttype li").click(function () {

            if ($(this).index() == 0) {
                $("#utype").val("1");
            }
            if ($(this).index() == $("#selecttype li").length - 1) {
                $("#utype").val("2");
            }
        });
    });    
</script>
