




var question = "";
var pwd = "";
// 忘记密码
function checkLossPwd() {
    var name = $("#uname_loss").val();
    if (name == "" || (name.length < 1 || name.length > 12)) {
        $("#uname_loss").siblings("div").text("用户账号不能为空且长度在1～12位之间！");
       // $("#checkUname").html("用户账号不能为空且长度在1～12位之间！");
       $("input[id=uname_loss]").focus();
    } else {
        $("#checku").html("");
        $.ajax({
            url : "checkLossPwd.do",
            type : "post",
            data : "uname=" + name,
            dataType : "json",
            success : function(result) {
                if (result.info == "ng") {
                    $("#uname_loss").siblings("div").text("用户名不存在，请重新输入！");
                    //$("#checkUname").html("用户名不存在，请重新输入！");
                    $("input[id=uname_loss]").focus();
                    return false;
                } else {
                    $("#uname_loss").siblings("div").text("用户名正确！");
                   // $("#checkUname").html("用户名正确！");
                    $("input[id=mbanswer_loss]").val(result.answer);
                    question = result.question;
                    pwd = result.pwd;
                    $("#showMbanswer").show();
                    $("#showQuestion").show();
                    return true;
                }
            },
            error : function() {
                alert("请求处理中！");
                return false;
            }

        });
    }

}
// 验证密保答案
function checkMiBao() {

    var mbquestion = $("#miBaoQuestion").val();
    if (mbquestion!=question) {
        $("#checkMbquestion").html("问题不正确！请重新输入");
    } else {
        $("#checkMbquestion").html("您的密码是"+pwd);
    }

}
