﻿function doLogin() {
    if ($("#txtAccount").val() == "") {
        alert("会员帐号不能为空！");
        $("#txtAccount").focus();
        return false;
    }
    if ($("#txtPassword").val() == "") {
        alert("会员密码不能为空！");
        $("#txtPassword").focus();
        return false;
    }
    if (!md5_vm_test()) {
        alert("模块加载失败!");
        return false;
    }

    var account = $("#txtAccount").val();
    var password = hex_md5($("#txtPassword").val());

    $("#login_state").html("验证中...");

    $.ajax({
        type: "post",
        cache: "false",
        url: "http://" + window.location.host + "/zh-CN/AjaxHandler/Login.ashx",
        data: "do=check&account=" + account + "&password=" + password,
        success: function(responseText) {
            if (responseText != null && responseText != "") {
                $("#clr_login").html(responseText);
            }
            else {
                $("#login_state").html("登录失败！");
            }
        },
        error: function() {
            $("#login_state").html("程序出错！");
        }
    });
}
function doLoginOut() {
    if (confirm("确认登出吗？")) {
        window.location.href = "http://" + window.location.host + "/zh-CN/Login.aspx?do=logout";
    }
}
function doReset() {
    this.form.reset();
    return false;
}
