$(function () {
    function ValidTemp() {
        var UserName = $("#UserName"),
                LogMoney = $("#LogMoney"),
                Info = $("#Info"),
                allFields = $([])
                .add(UserName).add(LogMoney).add(Info);
        var bValid = true;
        allFields.removeClass("ui-state-error");
        bValid = bValid && checkRegexp(UserName, Regex_UserName, "用户名格式错误");
        bValid = bValid && checkNumlength(LogMoney, "", 0.01, 2147483647);
        bValid = bValid && checkLength(Info, "备注内容", 1, 500);
        return bValid;
    };
    $("form").submit(function () {
        if (!ValidTemp()) {
            $(this).find("button[type=submit]").removeClass("loading").removeAttr("disabled");
            return false;
        }
    });
    $("#UserName").blur(function () {
        CommonGetAjax(5000,"/Common/ashx/global.ashx", { "Action": "CheckUserName", "UserName": $(this).val() }, $(".UserName"), "无法获取用户");
    });
});