(function(){var a=window.CustomFormMsg={EmptyInput:"\u5bf9\u4e0d\u8d77\uff0c{0}\u4e0d\u80fd\u4e3a\u7a7a!",FormatError:"\u5bf9\u4e0d\u8d77,\u8f93\u5165\u7684{0}\u683c\u5f0f\u9519\u8bef!",EmptySelect:"\u5bf9\u4e0d\u8d77,\u60a8\u6ca1\u6709\u9009\u62e9{0}\u7684\u4efb\u4f55\u9879!",OtherError:"\u6570\u636e\u9519\u8bef",SubmitFail:"\u4fe1\u63d0\u4ea4\u5931\u8d25,\u8bf7\u5237\u65b0\u9875\u9762\u540e\u91cd\u8bd5!",SubmitSuccess:"\u4fe1\u606f\u63d0\u4ea4\u6210\u529f!"}})();function submitForm(){var c="";for(var f=0;f<controls.length;f++){switch(controls[f][2]){case 1:var e=document.getElementById(controls[f][0]).value;if(controls[f][3]&&e.length<=0){alert(CustomFormMsg.EmptyInput.replace("{0}",controls[f][1]));document.getElementById(controls[f][0]).focus();return false}if(controls[f][4]!=null&&controls[f][4]!=""){if(!validataControl(controls[f][4],e)){alert(CustomFormMsg.FormatError.replace("{0}",controls[f][4]));document.getElementById(controls[f][0]).focus();return false}}c+=controls[f][1]+"|$|"+e+"|$$|";break;case 2:var e="";var b=document.getElementsByName(controls[f][0]);var g=0;if(b!=null){for(var d=0;d<b.length;d++){if(b[d].checked){e+=b[d].value+";";g++}}if(controls[f][3]&&g<=0){alert(CustomFormMsg.EmptySelect.replace("{0}",controls[f][1]));return false}c+=controls[f][1]+"|$|"+e+"|$$|"}break;default:alert(CustomFormMsg.OtherError);return false;break}}if(c!=""){var a=sbsdomainserver.HostName+"/Commpages/ClientPageAjax.aspx?do=submitform";$.ajax({type:"POST",url:a,timeout:20000,error:function(){alert(CustomFormMsg.SubmitFail)},data:"siteid="+siteid+"&menuid="+menuid+"&content="+c,success:function(h){if(h=="1"){alert(CustomFormMsg.SubmitSuccess);location.reload()}else{alert(CustomFormMsg.SubmitFail)}}})}else{alert(CustomFormMsg.SubmitFail)}}function validataControl(validatatype,value){if(value==null||value==""){return true}var regexEnum={number:"^-?[1-9]\\d*$",email:"^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$",url:"^http[s]?:\\/\\/([\\w-]+\\.)+[\\w-]+([\\w-./?%&=]*)?$",tel:"^((\\d{3,4})?-?\\d{7,8})$",zipcode:"^\\d{6}$",mobile:"^(13|15)[0-9]{9}$",date:"^\\d{4}(\\-|\\/|.)\\d{1,2}\\1\\d{1,2}$",qq:"^[1-9]*[1-9][0-9]*$",idcard:"^[1-9]([0-9]{14}|[0-9]{17})$"};var regstring=eval("regexEnum."+validatatype);var reg=new RegExp(regstring,"i");return reg.test(value)};

