function GetCode(){var n=!1;return $.ajax({url:"/ashx/GetVerifyCode.ashx",async:!1,data:"data="+Math.random(),success:function(t){n=$("input[name='VerifyCode_UserControl']").val().toLowerCase()!=t.toLowerCase()?!1:!0}}),n}function CheckFormParmsApply(){var n;if($("#txtUserName").val().IsEmpty())return alert("姓名不能为空"),$("#txtUserName").focus(),!1;if($("#txtUserName").val().Verify()){if($("#txtUserTel").val().IsEmpty())return alert("联系电话不能为空"),$("#txtUserTel").focus(),!1;if($("#txtUserTel").val().IsMobile()||$("#txtUserTel").val().IsPhone())if($("#txtUserEmail").val().IsEmpty()){if($("#UserProvinceVila").val()=="0"||$("#UserCityVila").val()=="0")return alert("请选择所在地区"),$("#ddlUserProvince").focus(),!1;if($("#txtBuyMinPrice").val().IsEmpty())StringLength($("#SupplementVila").val())>600&&alert("补充说明长度不能超过300个汉字");else{n=/^\d+(\.\d{1,2})?$/;if(!n.test($("#txtBuyMinPrice").val()))return alert("优惠底价格式不正确"),$("#txtBuyMinPrice").focus(),!1}}else{n=/^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/;if(!n.test($("#txtUserEmail").val()))return alert("电子邮箱格式不正确"),$("#txtUserEmail").focus(),!1}else return alert("联系电话格式不正确"),$("#txtUserTel").focus(),!1}else return alert("姓名不能包含无效字符"),$("#txtUserName").focus(),!1;if(!GetCode())return alert("验证码输入不正确!"),!1;$.trim($("#txtBuyColor").val())=="请填写欲购车型颜色"&&$("#txtBuyColor").val("")}var txtsupplement;$(document).ready(function(){try{SeriesIdTemp>0&&$.getJSON("/ashx/GetCarSelect.ashx",{seriesId:SeriesIdTemp,isNewCar:"1",isInMarket:"1"},function(n){if(n){var t;$("#ddlBuyCar").empty().html('').attr("disabled","disabled"),$.each(n,function(n,i){t!=i.TrimYear&&($("").appendTo("#ddlBuyCar"),t=i.TrimYear),$("").val(i.TrimId).text(i.TrimName).appendTo("#ddlBuyCar")}),$("#ddlBuyCar").removeAttr("disabled")}})}catch(n){}txtsupplement=$.trim($("#txtSupplenment").val()),$("#txtSupplenment").focus(function(){var n=$.trim($(this).val());txtsupplement==n&&$(this).val("")}),$("#txtSupplenment").blur(function(){$.trim($(this).val())==""?($(this).val(txtsupplement),$("#SupplementVila").val("")):$("#SupplementVila").val($.trim($(this).val()))}),$("#txtBuyColor").focus(function(){$(this).val("")}),$("#ddlUserProvince").change(function(){$("#UserProvinceVila").val($(this).val())}),$("#ddlUserCity").change(function(){$("#UserCityVila").val($(this).val())})});