1function validateForm(f,d,g,b,c,e,a){this.idEl=d;this.type=g;this.params=b;this.messages=c;this.errorsMsg=new Array();this.errorId=new Array();this.current=0;this.end=this.idEl.length;this.errorMsg="";this.typeShowError=e;this.nameForm=f;if(a){this.css_class_error=a}else{this.css_class_error="fielderror"}this.addError=function(){if(this.getType()=="eqne"||this.getType()=="eq"){this.errorId[this.errorId.length]=this.getParam()}this.errorId[this.errorId.length]=this.getId();this.errorsMsg[this.errorsMsg.length]=this.getMessage()};this.parseNumber=function(){var h=/^(\d*),(\d*)$/;var j=(h.test(this.getParam()))?(new RegExp("^(\\d){"+RegExp.$1+","+RegExp.$2+"}$")):(new RegExp("^(\\d){"+this.getParam()+"}$"));if(!j.test(this.getValue(0))){this.addError()}};this.checkNumber=function(h){this.parseNumber()};this.checkFloat=function(){var h=parseFloat(this.getValue(0));if(isNaN(h)||h<=0){this.addError()}};this.checkRegular=function(){var h=new RegExp(this.getParam());if(!h.test(this.getValue(0))){this.addError()}};this.checkFloatOrEmpty=function(){var h=parseFloat(this.getValue(0));if(!this.checkNotEmptyFunc(this.getValue())){return true}else{this.checkFloat()}};this.checkFloatOrEmptyOrZero=function(){if(this.getValue(0)==0){return true}else{this.checkFloatOrEmpty()}};this.checkNotNull=function(){if(this.getValue(0)==0){this.addError()}};this.checkMoreLength=function(){if(this.getValue(0).length<this.getParam()){this.addError()}};this.checkLessLength=function(){if(this.getValue(0).length>this.getParam()){this.addError()}};this.checkEqualNotEmpty=function(j){var h=this.getValue(0);var k=this.getValue(this.getParam());if(k!=h){this.addError()}else{if(j){if(!this.checkNotEmptyFunc(k)){this.addError()}}}};this.checkNotEmptyFunc=function(j){var h=/\S/;return(j)?(h.test(j)):(h.test(this.getValue(0)))};this.checkNotEmpty=function(){if(!this.checkNotEmptyFunc()){this.addError()}};this.checkMail=function(){var h=/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if(!h.test(this.getValue(0))){this.addError()}};this.checkZipCode=function(){var h=/\S/;if(!h.test(this.getValue(0))){this.addError()}};this.checkDate=function(){var j=this.getValue(0);var l=new RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})$");if(l.test(j)){var k=RegExp.$1;var m=RegExp.$2;var h=RegExp.$3;if(m<1||m>12){this.addError()}else{if(k>2099||k<1900){this.addError()}else{if(h<1||h>31){this.addError()}}}}else{this.addError()}};this.checkDateOrEmpty=function(){if(!this.checkNotEmptyFunc(this.getValue())){return true}else{this.checkDate()}};this.naturalNumber=function(){var h=parseInt(this.getValue(0));if(isNaN(h)||h<=0){this.addError()}};this.checked=function(){if(!this.$().checked){this.addError()}};this.getType=function(){return this.type[this.current]};this.getForm=function(){return document.forms[f]};this.getId=function(){return this.idEl[this.current]};this.getParam=function(){return this.params[this.current]};this.getMessage=function(){return this.messages[this.current]};this.getCurrent=function(){return this.idEl[this.current]};this.next=function(){this.current++};this.notEnd=function(){return(this.current<this.end)};this.$=function(h){return(h)?(document.getElementById(h)):(document.getElementById(this.getCurrent()))};this.getValue=function(h){if(!h){var j=this.$(this.getCurrent())}else{var j=this.$(h)}switch(j.type){case"select-one":return j.options[j.selectedIndex].value;break;case"radio":case"checkbox":return j.checked;break;case"number":case"text":case"email":case"password":case"textarea":return j.value;break}};this.validate=function(){this.unhighlightFields();while(this.notEnd()){if(this.$(0)){switch(this.getType()){case"num":this.checkNumber();break;case"nem":this.checkNotEmpty();break;case"em":this.checkMail();break;case"nat":this.naturalNumber();break;case"chk":this.checked();break;case"fl":this.checkFloat();break;case"fl|em":this.checkFloatOrEmpty();break;case"fl|em|0":this.checkFloatOrEmptyOrZero();break;case"notn":this.checkNotNull();break;case"eq":this.checkEqualNotEmpty(0);break;case"eqne":this.checkEqualNotEmpty(1);break;case"more":this.checkMoreLength();break;case"less":this.checkLessLength();break;case"date":this.checkDate(this.getParam());break;case"reg":this.checkRegular();break;case"date|em":this.checkDateOrEmpty(this.getParam());break;case"zip":this.checkZipCode();break}}this.next()}if(this.errorsMsg.length){this.$(this.errorId[0]).focus();switch(this.typeShowError){case 1:this.showErrors();break;case 2:this.highlightFields();break;case 3:this.showErrors();this.highlightFields();break}return false}else{return true}};this.showErrors=function(){var j=this.errorsMsg.length;for(var h=0;h<j;h++){this.errorMsg+=this.errorsMsg[h]+"\n"}alert(this.errorMsg)};this.unhighlightFields=function(){var j=this.getForm();var h=j.length;for(i=0;i<h;i++){if(j.elements[i].type=="button"||j.elements[i].type=="submit"||j.elements[i].type=="hidden"){continue}else{if(j.elements[i].type=="checkbox"){jQuery(j.elements[i].parentNode).removeClass(this.css_class_error)}else{jQuery(j.elements[i]).removeClass(this.css_class_error)}}}};this.highlightFields=function(){var j=this.errorId.length;for(var h=0;h<j;h++){if(this.$(this.errorId[h]).type=="checkbox"){jQuery(this.$(this.errorId[h]).parentNode).addClass(this.css_class_error)}else{jQuery(this.$(this.errorId[h])).addClass(this.css_class_error)}}}};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.