Form.Validator.addAllThese([["validate-enforce-oncheck",{test:function(a,b){var c=a.getParent("form").retrieve("validator");if(!c){return true}(b.toEnforce||document.id(b.enforceChildrenOf).getElements("input, select, textarea")).map(function(d){if(a.checked){c.enforceField(d)}else{c.ignoreField(d);c.resetField(d)}});return true}}],["validate-ignore-oncheck",{test:function(a,b){var c=a.getParent("form").retrieve("validator");if(!c){return true}(b.toIgnore||document.id(b.ignoreChildrenOf).getElements("input, select, textarea")).each(function(d){if(a.checked){c.ignoreField(d);c.resetField(d)}else{c.enforceField(d)}});return true}}],["validate-nospace",{errorMsg:function(){return Form.Validator.getMsg("noSpace")},test:function(a,b){return !a.get("value").test(/\s/)}}],["validate-toggle-oncheck",{test:function(b,c){var d=b.getParent("form").retrieve("validator");if(!d){return true}var a=c.toToggle||document.id(c.toToggleChildrenOf).getElements("input, select, textarea");if(!b.checked){a.each(function(e){d.ignoreField(e);d.resetField(e)})}else{a.each(function(e){d.enforceField(e)})}return true}}],["validate-reqchk-bynode",{errorMsg:function(){return Form.Validator.getMsg("reqChkByNode")},test:function(a,b){return(document.id(b.nodeId).getElements(b.selector||"input[type=checkbox], input[type=radio]")).some(function(c){return c.checked})}}],["validate-required-check",{errorMsg:function(a,b){return b.useTitle?a.get("title"):Form.Validator.getMsg("requiredChk")},test:function(a,b){return !!a.checked}}],["validate-reqchk-byname",{errorMsg:function(a,b){return Form.Validator.getMsg("reqChkByName").substitute({label:b.label||a.get("type")})},test:function(b,d){var c=d.groupName||b.get("name");var a=$$(document.getElementsByName(c)).some(function(g,f){return g.checked});var e=b.getParent("form").retrieve("validator");if(a&&e){e.resetField(b)}return a}}],["validate-match",{errorMsg:function(a,b){return Form.Validator.getMsg("match").substitute({matchName:b.matchName||document.id(b.matchInput).get("name")})},test:function(b,c){var d=b.get("value");var a=document.id(c.matchInput)&&document.id(c.matchInput).get("value");return d&&a?d==a:true}}],["validate-after-date",{errorMsg:function(a,b){return Form.Validator.getMsg("afterDate").substitute({label:b.afterLabel||(b.afterElement?Form.Validator.getMsg("startDate"):Form.Validator.getMsg("currentDate"))})},test:function(b,c){var d=document.id(c.afterElement)?Date.parse(document.id(c.afterElement).get("value")):new Date();var a=Date.parse(b.get("value"));return a&&d?a>=d:true}}],["validate-before-date",{errorMsg:function(a,b){return Form.Validator.getMsg("beforeDate").substitute({label:b.beforeLabel||(b.beforeElement?Form.Validator.getMsg("endDate"):Form.Validator.getMsg("currentDate"))})},test:function(b,c){var d=Date.parse(b.get("value"));var a=document.id(c.beforeElement)?Date.parse(document.id(c.beforeElement).get("value")):new Date();return a&&d?a>=d:true}}],["validate-custom-required",{errorMsg:function(){return Form.Validator.getMsg("required")},test:function(a,b){return a.get("value")!=b.emptyValue}}],["validate-same-month",{errorMsg:function(a,b){var c=document.id(b.sameMonthAs)&&document.id(b.sameMonthAs).get("value");var d=a.get("value");if(d!=""){return Form.Validator.getMsg(c?"sameMonth":"startMonth")}},test:function(a,b){var d=Date.parse(a.get("value"));var c=Date.parse(document.id(b.sameMonthAs)&&document.id(b.sameMonthAs).get("value"));return d&&c?d.format("%B")==c.format("%B"):true}}],["validate-cc-num",{errorMsg:function(a){var b=a.get("value").replace(/[^0-9]/g,"");return Form.Validator.getMsg("creditcard").substitute({length:b.length})},test:function(c){if(Form.Validator.getValidator("IsEmpty").test(c)){return true}var g=c.get("value");g=g.replace(/[^0-9]/g,"");var a=false;if(g.test(/^4[0-9]{12}([0-9]{3})?$/)){a="Visa"}else{if(g.test(/^5[1-5]([0-9]{14})$/)){a="Master Card"}else{if(g.test(/^3[47][0-9]{13}$/)){a="American Express"}else{if(g.test(/^6011[0-9]{12}$/)){a="Discover"}}}}if(a){var d=0;var e=0;for(var b=g.length-1;b>=0;--b){e=g.charAt(b).toInt();if(e==0){continue}if((g.length-b)%2==0){e+=e}if(e>9){e=e.toString().charAt(0).toInt()+e.toString().charAt(1).toInt()}d+=e}if((d%10)==0){return true}}var f="";while(g!=""){f+=" "+g.substr(0,4);g=g.substr(4)}c.getParent("form").retrieve("validator").ignoreField(c);c.set("value",f.clean());c.getParent("form").retrieve("validator").enforceField(c);return false}}]]);