ValidationUtil=new Object();ValidationUtil.REGEX_NON_ASCII=new RegExp("[^\\x00-\\x7F]");ValidationUtil.REGEX_EMAIL=new RegExp('^([^()<>@,;:\\\\".\\s\\x00-\\x1F\\x7F\\[\\]]+|"([^\\\\"\\x0D]|\\\\.)*")(\\.([^()<>@,;:\\\\".\\s\\x00-\\x1F\\x7F\\[\\]]+|"([^\\\\"\\x0D]|\\\\.)*"))*@[^()<>@,;:\\\\".\\s\\x00-\\x1F\\x7F\\[\\]]+(\\.[^()<>@,;:\\\\".\\s\\x00-\\x1F\\x7F\\[\\]]+)*\\.([^()<>@,;:\\\\".\\s\\x00-\\x1F\\x7F\\[\\]]{2,4}|museum)$');ValidationUtil.REGEX_LTRIM=new RegExp("^\\s*(.*)");ValidationUtil.REGEX_RTRIM=new RegExp("([^\\s]*)\\s*$");ValidationUtil.REGEX_INTEGER=new RegExp("^\\d+$");ValidationUtil.REGEX_NUMERIC=new RegExp("^\\d+(\\.\\d*)?$");ValidationUtil.isEmail=function(a){return !ValidationUtil.REGEX_NON_ASCII.test(a)&&ValidationUtil.REGEX_EMAIL.test(a)};ValidationUtil.isDate=function(a){return(Date.parse(a))?true:false};ValidationUtil.isDateYMD=function(b,c,a){return ValidationUtil.isDateMDY(c,a,b)};ValidationUtil.isDateMDY=function(c,a,b){if(ValidationUtil.REGEX_INTEGER.test(c)&&ValidationUtil.REGEX_INTEGER.test(a)&&ValidationUtil.REGEX_INTEGER.test(b)){var e=new Date(b,--c,a);return(e&&e.getFullYear()==b&&e.getMonth()==c&&e.getDate()==a)}return false};ValidationUtil.isInteger=function(a){return ValidationUtil.REGEX_INTEGER.test(a)};ValidationUtil.isNumeric=function(a){return ValidationUtil.REGEX_NUMERIC.test(a)};ValidationUtil.hasValue=function(a){if(!a||(typeof a!="string")){return false}a=a.replace(ValidationUtil.REGEX_LTRIM,"$1");a=a.replace(ValidationUtil.REGEX_RTRIM,"$1");return a!=""};function setSuperClass(c,b){for(var a in b){if(typeof b[a]=="function"){c[a]=b[a]}}}function BaseFormBean(fieldCollection){var myFieldCollection=fieldCollection;var errors=new Array();var baseErrorMessage=null;function buildBaseAccessorMethodName(propName){if(!propName||(typeof propName!="string")||!/^[a-zA-Z][a-zA-Z0-9_]+$/.test(propName)){return null}return propName.charAt(0).toUpperCase()+propName.substring(1,propName.length)}function Accessor(fieldName){var myFieldName=fieldName;this.getterMethod=function(){return myFieldCollection[myFieldName]};this.setterMethod=function(param){myFieldCollection[myFieldName]=param}}for(var fieldName in fieldCollection){var baseAccessorMethodName=buildBaseAccessorMethodName(fieldName);if(baseAccessorMethodName!=null){var accessor=new Accessor(fieldName);this["get"+baseAccessorMethodName]=accessor.getterMethod;this["set"+baseAccessorMethodName]=accessor.setterMethod}}this.get=function(param){var accessorName=buildBaseAccessorMethodName(param);if(!accessorName){return null}var accessorMethod=this["get"+accessorName];return(typeof accessorMethod=="function")?eval("this.get"+accessorName+"()"):null};this.getFieldCollection=function(){return myFieldCollection};this.validate=function(){return};this.isValid=function(){this.clearErrors();this.validate();return this.getNumErrors()==0};this.clearErrors=function(){errorFields=new Array()};this.addError=function(fieldName,fieldDescription){var o=new Object();o.name=fieldName;o.description=fieldDescription;errors[errors.length]=o};this.getNumErrors=function(){return errors.length};this.getErrors=function(){return errors};this.setBaseErrorMessage=function(newErrorMessage){baseErrorMessage=newErrorMessage};this.getBaseErrorMessage=function(){if(baseErrorMessage!=null){return baseErrorMessage}else{var result="The following fields are missing or invalid";if(this.get("profanityfiltered")=="true"){result+="\n(some fields may have been filtered for profanity)"}return result+":"}};this.getFullErrorMessage=function(beforeFirstError,betweenErrors,afterLastError){if(typeof beforeFirstError=="undefined"){beforeFirstError=" "}if(typeof betweenErrors=="undefined"){betweenErrors=", "}if(typeof afterLastError=="undefined"){afterLastError=""}var fullErrorMessage=this.getBaseErrorMessage();fullErrorMessage+=beforeFirstError;var errors=this.getErrors();for(var i=0;errors&&i<errors.length;i++){if(i!=0){fullErrorMessage+=betweenErrors}fullErrorMessage+=errors[i].description}fullErrorMessage+=afterLastError;return fullErrorMessage}}function simplifyClientSideFormData(f){if(!f||!f.elements){return null}var a=new Object();for(var d=0;d<f.elements.length;d++){var c=f[d];var b=c.name;if(b){var e=simplifyClientSideElementValue(c);if(!a[b]){a[b]=e}else{if(e){a[b]=a[b]+","+e}}}}return a}function simplifyClientSideElementValue(b){if(!b){return null}var a="";if((typeof b.type!="undefined")&&b.type!=null&&(b.type.toLowerCase()=="checkbox"||b.type.toLowerCase()=="radio")){if(b.checked){a=b.value}}else{if((typeof b.value!="undefined")&&b.value!=null){a=b.value}else{if(b.options&&(typeof b.options.length=="number")&&(typeof b.selectedIndex=="number")){a=b.options[b.selectedIndex].value}}}return a}function validateClientSideForm(formObject,formName){if(!formObject){return true}if(!formName){formName=formObject.name}if(!formName){return true}var formData=simplifyClientSideFormData(formObject);var formBean=eval("new "+formName+"(formData)");if(!formBean.isValid()){var errorMessage=formBean.getFullErrorMessage("\n    ","\n    ","");alert(errorMessage);return false}return true}function signupform(a){setSuperClass(this,new BaseFormBean(a));this.validate=function(){this.clearErrors();if(!ValidationUtil.isEmail(this.get("email"))){this.addError("email","E-mail Address")}};this.getFieldsToRunThroughProfanityFilter=function(){return""};this.getProfileFields=function(){var b="";return b};this.getAllNamedLists=function(){return""};this.getShortSurveyFields=function(){return""};this.getLongSurveyFields=function(){return""};this.getFieldsToReload=function(){return""}};
