var space=registerNamespace("RS.form");space.stringValidator=function(g,e,b,d,a,c,f){this.mandatory=g;this.mandatoryError=e;this.minLen=b;this.maxLen=d;this.lenError=a;this.regex=c;this.regexError=f;this.data="";this.error=false;this.errorMessage="";if(this.mandatoryError==null){this.mandatoryError="Please fill out"}if(this.lenError==null){this.lenError="%min%-%max% Chars";this.lenError=this.lenError.replace(/%min%/,this.minLen);this.lenError=this.lenError.replace(/%max%/,this.maxLen)}this.validate=function(){this.resetError();if(this.mandatory&&this.data==""){this.setErrorMessage(this.mandatoryError);return false}if(this.data!=""&&this.minLen!=undefined&&this.data.length<this.minLen){this.setErrorMessage(this.lenError);return false}if(this.data!=""&&this.maxLen!=undefined&&this.data.length>this.maxLen){this.setErrorMessage(this.lenError);return false}if(this.regex!=undefined){var i=new RegExp(this.regex);var h=i.exec(this.data);if(h==null){this.setErrorMessage(this.regexError);return false}}if(typeof(this.postValidate)=="function"){this.postValidate()}return true};this.isValid=function(){return this.validate()};this.setErrorMessage=function(h){this.error=true;this.errorMessage=h};this.resetError=function(){this.error=false;this.errorMessage=""}};