function event_observe(e,t,n){element=document.getElementById(e);var r=function(e){n.call(element,e)};element.addEventListener?element.addEventListener(t,r,!1):element.attachEvent("on"+t,r)}function checkAttributeValueByParam(e,t,n,r,i,u,m,g,l){try{if($("#"+e).is(":hidden"))return!0}catch(e){}if(t||(t="false"),r||(r=""),i||(i=""),document.getElementById(e+"_msg").style.display="none","true"==t&&(!n||0==n.length))return r.length>0?document.getElementById(e+"_msg").innerHTML=r:document.getElementById(e+"_msg").innerHTML=i+"不能为空",document.getElementById(e+"_msg").style.display="",!1;if(u>0&&n.length<u)return r.length>0?document.getElementById(e+"_msg").innerHTML=r:document.getElementById(e+"_msg").innerHTML=i+"长度不能小于"+u+"个字符",document.getElementById(e+"_msg").style.display="",!1;if(m>0&&n.length>m)return r.length>0?document.getElementById(e+"_msg").innerHTML=r:document.getElementById(e+"_msg").innerHTML=i+"长度不能大于"+m+"个字符",document.getElementById(e+"_msg").style.display="",!1;var a;if(n&&n.length>0&&g&&"None"!=g)if("Custom"==g){if(l.length>0&&0==new RegExp(l,"gi").test(n))return r.length>0?document.getElementById(e+"_msg").innerHTML=r:document.getElementById(e+"_msg").innerHTML=i+"格式不正确",document.getElementById(e+"_msg").style.display="",!1}else if("Chinese"==g?a=/^[\u0391-\uFFE5]+$/:"English"==g?a=/^[A-Za-z]+$/:"Email"==g?a=/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/:"Url"==g?a=/^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\':+!]*([^<>\"\"])*$/:"Phone"==g?a=/^((\(\d{3}\))|(\d{3}\-))?(\(0\d{2,3}\)|0\d{2,3}-)?[1-9]\d{6,7}$/:"Mobile"==g?a=/^((\(\d{3}\))|(\d{3}\-))?1\d{10}$/:"Integer"==g?a=/^[-\+]?\d+$/:"Currency"==g?a=/^\d+(\.\d+)?$/:"Zip"==g?a=/^[1-9]\d{5}$/:"IdCard"==g?a=/^\d{15}(\d{2}[A-Za-z0-9])?$/:"QQ"==g&&(a=/^[1-9]\d{4,11}$/),a&&0==a.test(n))return r.length>0?document.getElementById(e+"_msg").innerHTML=r:document.getElementById(e+"_msg").innerHTML=i+"格式不正确",document.getElementById(e+"_msg").style.display="",!1;return!0}function checkAttributeValue(e){var t=e.srcElement||e.target;return checkAttributeValueByParam(t.id,t.getAttribute("isRequire"),t.value,t.getAttribute("errorMessage"),t.getAttribute("displayName"),parseInt(t.getAttribute("minNum")),parseInt(t.getAttribute("maxNum")),t.getAttribute("validateType"),t.getAttribute("regExp"))}function checkAttributeValueById(e){var t=document.getElementById(e);return!t||checkAttributeValueByParam(e,t.getAttribute("isRequire"),t.value,t.getAttribute("errorMessage"),t.getAttribute("displayName"),parseInt(t.getAttribute("minNum")),parseInt(t.getAttribute("maxNum")),t.getAttribute("validateType"),t.getAttribute("regExp"))}function checkAttributeValueByName(e){var t=document.getElementById(e);return!t||checkAttributeValueByParam(e,t.getAttribute("isRequire"),$("input[name='"+e+"']:checked").val()||$("select[name='"+e+"']").val(),t.getAttribute("errorMessage"),t.getAttribute("displayName"),parseInt(t.getAttribute("minNum")),parseInt(t.getAttribute("maxNum")),t.getAttribute("validateType"),t.getAttribute("regExp"))}function checkFormValueById(e){var t=!0,n=document.getElementById(e).getElementsByTagName("*"),r=document.getElementById("Submit");if(r){if(r.hasAttribute("clicking"))return!1;r.setAttribute("clicking","true"),r.setAttribute("class","btn")}if(n&&n.length>0)for(i=0;i<n.length;i++){var u=n.item(i);"true"==u.getAttribute("isValidate")&&("true"==u.getAttribute("islistitem")?0==checkAttributeValueByName(u.getAttribute("id"))&&(t=!1):0==checkAttributeValueById(u.getAttribute("id"))&&(t=!1))}return t||(r.removeAttribute("clicking"),r.setAttribute("class","btn btn-primary")),t}