if(typeof jQuery=="undefined")jQuery=function(){};if(typeof jQuery.classBehaviours=="undefined")jQuery.classBehaviours=function(){};if(typeof jQuery.classBehaviours.handlers=="undefined")jQuery.classBehaviours.handlers=function(){};jQuery.classBehaviours.handlers.validateForm={name:"validateForm",focused:null,start:function(c){formNode=jQuery.classBehaviours.utilities.rootNode(c,"FORM");formNode.onsubmit=this.submitted;allNodes=c.getElementsByTagName("*");for(var a=0;a<allNodes.length;a++){if(allNodes[a].nodeName=="TR")allNodes[a].className+=allNodes[a].className.indexOf("passive")<0?" passive":"";if(allNodes[a].type=="submit"||allNodes[a].type=="image")allNodes[a].onclick=this.submitted;if(allNodes[a].className.indexOf("test_")>-1){allNodes[a].className+=allNodes[a].className.indexOf("passive")<0?" passive":"";testName=jQuery.classBehaviours.utilities.getClassParameter(allNodes[a],"test",null);testApplied=null;for(b in this.tests)if(this.tests[b].name==testName)testApplied=this.tests[b].apply(allNodes[a]);if(testApplied==null)testApplied=this.custom.apply(allNodes[a])}}},summary:function(b){rootNode=jQuery.classBehaviours.utilities.rootNode(b,"FIELDSET");allRows=rootNode.getElementsByTagName("TR");errorMessage="";for(var a=0;a<allRows.length;a++)if(allRows[a].className.indexOf("error")>-1&&allRows[a].innerHTML.indexOf(" test_")>-1){errorLabels=allRows[a].getElementsByTagName("LABEL");if(errorLabels.length>0)errorMessage+="<li>"+errorLabels[0].innerHTML+"</li>"}validationSummaries=jQuery.classBehaviours.utilities.getElementsByClassName("summary",rootNode);if(validationSummaries.length>0){validationTextId=jQuery.classBehaviours.utilities.getClassParameter(validationSummaries[0],"failure","");validationText=document.getElementById(validationTextId).value;validationSummaries[0].innerHTML=validationText.replace("{labels}","<ul>"+errorMessage+"</ul>");validationSummaries[0].style.display=errorMessage!=""?"block":"none"}return errorMessage==""},update:function(a,b){mandatoryId=jQuery.classBehaviours.utilities.getClassParameter(a,"required","no");mandatory=mandatoryId!="yes"&&mandatoryId!="no"?document.getElementById(mandatoryId).checked:mandatoryId=="yes";empty=a.value==""||a.value==a.title;ignore=!mandatory&&empty;a.className=ignore?a.className.replace("success","passive").replace("error","passive"):b?a.className.replace("passive","success").replace("error","success"):a.className.replace("passive","error").replace("success","error");rootNode=jQuery.classBehaviours.utilities.rootNode(a,"TR");rootNode.className=ignore?rootNode.className.replace("success","passive").replace("error","passive"):b?rootNode.className.replace("passive","success").replace("error","success"):rootNode.className.replace("passive","error").replace("success","error");return b||ignore},ajaxWait:function(){var d=jQuery.classBehaviours.handlers.validateForm},ajaxReplace:function(d,a,b){var c=jQuery.classBehaviours.handlers.validateForm;a.innerHTML=b.split("<root>")[1].split("</root>")[0];focussedNode=document.getElementById(c.focused);focussedNode!=null&&focussedNode.focus();jQuery.classBehaviours.parser.parseNode(a.parentNode.parentNode)},submitted:function(e,d){var b=typeof this.nodeName=="undefined"?e:this,c=jQuery.classBehaviours.handlers.validateForm,f="";formNode=jQuery.classBehaviours.utilities.rootNode(b,"FORM");rootNode=jQuery.classBehaviours.utilities.rootNode(b,"FIELDSET");allNodes=rootNode.getElementsByTagName("*");if(d==true){allNodes=[];testValidated=true}for(var a=0;a<allNodes.length;a++){testValidated=false;if(allNodes[a].nodeName=="INPUT"||allNodes[a].nodeName=="SELECT"||allNodes[a].nodeName=="TEXTAREA")if(allNodes[a].className.indexOf("test_")>-1)if(typeof allNodes[a].onchange!="undefined")testValidated=allNodes[a].onchange()}summaryResult=c.summary(rootNode);replySubmit=jQuery.classBehaviours.utilities.getClassParameter(rootNode,"submit",null);if(replySubmit=="ajax"){referingId=jQuery.classBehaviours.utilities.getClassParameter(rootNode,"target",null);referingId=jQuery.classBehaviours.utilities.getClassParameter(b,"target",referingId);referingObject=referingId==null?b:document.getElementById(referingId);post="ajax="+b.getAttribute("id")+"&section="+jQuery.classBehaviours.utilities.getClassParameter(b,"section","");summaryResult&&jQuery.classBehaviours.ajax.addSubmit(b,c.ajaxReplace,c.ajaxWait,post,referingObject);return false}else return summaryResult}};jQuery.classBehaviours.handlers.validateForm.tests={resubmit:{name:"resubmit",apply:function(a){a.onchange=this.validate;a.onfocus=this.store;return true},store:function(b){var a=typeof this.nodeName=="undefined"?b:this,c=jQuery.classBehaviours.handlers.validateForm;c.focused=a.id},validate:function(b){var a=typeof this.nodeName=="undefined"?b:this,c=jQuery.classBehaviours.handlers.validateForm;return c.submitted(a,true)}},email:{name:"email",apply:function(a){a.onchange=this.validate;return true},validate:function(b){var a=typeof this.nodeName=="undefined"?b:this,c=jQuery.classBehaviours.handlers.validateForm;return c.update(a,a.value.match(/^[\w\.\-\,\+]+@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/)!=null)}},nlPhone:{name:"nlPhone",apply:function(a){a.onchange=this.validate;return true},validate:function(b){var a=typeof this.nodeName=="undefined"?b:this,c=jQuery.classBehaviours.handlers.validateForm;return c.update(a,a.value.match(/(^\+[0-9]{2}|^\+[0-9]{2}\(0\)|^\(\+[0-9]{2}\)\(0\)|^00[0-9]{2}|^0)([0-9]{9}$|[0-9\-\s]{10}$)/)!=null)}},nlPostal:{name:"nlPostal",apply:function(a){a.onchange=this.validate;return true},validate:function(b){var a=typeof this.nodeName=="undefined"?b:this,c=jQuery.classBehaviours.handlers.validateForm;return c.update(a,a.value.match(/^[0-9]{4}\s{0,1}[a-zA-Z]{2}$/)!=null)}},isoDate:{name:"isoDate",apply:function(a){a.onchange=this.validate;return true},validate:function(b){var a=typeof this.nodeName=="undefined"?b:this,c=jQuery.classBehaviours.handlers.validateForm;return c.update(a,a.value.match(/^\d{4}\-\d{1,2}\-\d{1,2}$/)!=null)}},numeric:{name:"numeric",apply:function(a){a.onchange=this.validate;return true},validate:function(b){var a=typeof this.nodeName=="undefined"?b:this,c=jQuery.classBehaviours.handlers.validateForm;return c.update(a,a.value.match(/^[0-9]+$/)!=null)}},currency:{name:"currency",apply:function(a){a.onchange=this.validate;return true},validate:function(b){var a=typeof this.nodeName=="undefined"?b:this,c=jQuery.classBehaviours.handlers.validateForm;return c.update(a,a.value.match(/^[0-9]+(\.[0-9]{1,2})?$/)!=null)}},alphaNumeric:{name:"alphaNumeric",apply:function(a){a.onchange=this.validate;return true},validate:function(b){var a=typeof this.nodeName=="undefined"?b:this,c=jQuery.classBehaviours.handlers.validateForm;return c.update(a,a.value.match(/^[a-zA-Z0-9]/)!=null)}},nlBank:{name:"nlBank",apply:function(a){a.onchange=this.validate;return true},validate:function(d){var b=typeof this.nodeName=="undefined"?d:this,c=jQuery.classBehaviours.handlers.validateForm;inputValue=b.value;if(inputValue.length!=9)return c.update(b,false);else{numericTotal=0;for(a=0;a<inputValue.length;a++)numericTotal+=inputValue.substr(a,1)*(9-a);return c.update(b,numericTotal%11==0)}}},anyRadio:{name:"anyRadio",apply:function(b){allInputs=b.getElementsByTagName("INPUT");if(allInputs.length==0)allInputs=new Array(b);for(var a=0;a<allInputs.length;a++)if(allInputs[a].type=="radio"){allInputs[a].className=b.className;allInputs[a].onclick=navigator.userAgent.indexOf("MSIE ")>-1?this.delay:this.validate;allInputs[a].onchange=navigator.userAgent.indexOf("MSIE ")>-1?this.delay:this.validate}return true},delay:function(){var a=typeof this.nodeName=="undefined"?that:this,b=jQuery.classBehaviours.handlers.validateForm;setTimeout('jQuery.classBehaviours.handlers.validateForm.tests.anyRadio.validate(document.getElementById("'+a.id+'"))',200)},validate:function(c){var b=typeof this.nodeName=="undefined"?c:this,d=jQuery.classBehaviours.handlers.validateForm;anyChecked=false;allInputs=document.getElementsByTagName("input");for(var a=0;a<allInputs.length;a++)if(allInputs[a].name==b.name&&allInputs[a].type=="radio")if(allInputs[a].checked)anyChecked=true;return d.update(b,anyChecked)}},anyCheckbox:{name:"anyCheckbox",apply:function(b){allInputs=b.getElementsByTagName("INPUT");if(allInputs.length==0)allInputs=new Array(b);for(var a=0;a<allInputs.length;a++)if(allInputs[a].type=="checkbox"){allInputs[a].className=b.className;allInputs[a].onclick=navigator.userAgent.indexOf("MSIE ")>-1?this.delay:this.validate;allInputs[a].onchange=navigator.userAgent.indexOf("MSIE ")>-1?this.delay:this.validate}return true},delay:function(){var a=typeof this.nodeName=="undefined"?that:this,b=jQuery.classBehaviours.handlers.validateForm;setTimeout('jQuery.classBehaviours.handlers.validateForm.tests.anyCheckbox.validate(document.getElementById("'+a.id+'"))',200)},validate:function(c){var b=typeof this.nodeName=="undefined"?c:this,d=jQuery.classBehaviours.handlers.validateForm;anyChecked=false;parentNode=jQuery.classBehaviours.utilities.rootNode(b,"TR");allInputs=parentNode.getElementsByTagName("input");for(var a=0;a<allInputs.length;a++)if(allInputs[a].checked)anyChecked=true;return d.update(b,anyChecked)}},notEmpty:{name:"notEmpty",apply:function(a){a.onchange=this.validate;return true},validate:function(b){var a=typeof this.nodeName=="undefined"?b:this,c=jQuery.classBehaviours.handlers.validateForm;return c.update(a,a.value!="")}},password:{name:"password",apply:function(a){a.onchange=this.validate;a.onblur=this.validate;return true},validate:function(b){var a=typeof this.nodeName=="undefined"?b:this,c=jQuery.classBehaviours.handlers.validateForm;wasRepeated=false;repeatedId=jQuery.classBehaviours.utilities.getClassParameter(a,"clone",null);if(repeatedId!=null){repeatedValue=document.getElementById(repeatedId).value;wasRepeated=repeatedValue==a.value&&repeatedValue!=""&&a.value!=""}return c.update(a,wasRepeated)}}};jQuery.classBehaviours.handlers.validateForm.custom={apply:function(a){a.onchange=this.validate;return true},validate:function(b){var a=typeof this.nodeName=="undefined"?b:this,c=jQuery.classBehaviours.handlers.validateForm;customRegId=jQuery.classBehaviours.utilities.getClassParameter(a,"test",null);customRegString=document.getElementById(customRegId).value;customRegExp=new RegExp(customRegString);return c.update(a,a.value.match(customRegExp)!=null)}};if(typeof jQuery.fn!="undefined"){jQuery.fn.validateForm=function(){return this.each(function(){jQuery.classBehaviours.handlers.validateForm.start(this)})};$(document).ready(function(){$(".validateForm").validateForm()})}