function fValConfig(){this.code="alt";this.emsg="emsg";this.pattern="pattern";this.errorClass="errHilite";this.useSingleClassNames=false;this.clearEvent="change";this.eventOverride=false;this.confirmMsg=fvalidate.i18n.config.confirmMsg;this.confirmAbortMsg=fvalidate.i18n.config.confirmAbortMsg;this.submitButton=["Submit","Submit2"];this.resetButton="Reset";this.ccType="Credit_Card_Type";this.ccTypeObj="form1.Credit_Card_Type";this.boxError="errors";this.boxErrorPrefix="fv_error_";}if(typeof fvalidate=="undefined"){var fvalidate=new Object();}fvalidate.addEvent=function(_1,_2,fn,_4){if(typeof _1.attachEvent!="undefined"){_1.attachEvent("on"+_2,fn);}else{if(typeof _1.attachEventListener!="undefined"){_1.addEventListener(_2,fn,Boolean(_4));}}};fvalidate.addEvents=function(_5,_6,fn,_8){var i=0,evt;while(evt=_6[i++]){this.addEvent(_5,evt,fn,Boolean(_8));}};function validateForm(f,_b,_c,_d,_e,_f){_b=Boolean(_b);_c=Boolean(_c);_d=Boolean(_d);_e=Boolean(_e);_f=(typeof _f!="undefined")?parseInt(_f,10):0;var _10,fvCode,type;if(typeof f.fv=="undefined"){f.fv=new fValidate(f,_f,_e);}else{f.fv._reset();f.fv.errorMode=_f;}var _11,i=0,attr=f.fv.config.code;while(_11=f.elements[i++]){if(_11.nodeName=="FIELDSET"){continue;}fvCode=(_11[attr])?_11[attr]:_11.getAttribute(attr);if(!(typeof fvCode=="undefined"||fvCode==null||fvCode=="")){_10=fvCode.split("|");type=_10[0];_11.validated=true;if(typeof f.fv[type]=="undefined"){f.fv.devError([type,_11.name],"notFound");return false;}switch(_10.last()){case "bok":_10=_10.fv_reduce(1,1);_11.bok=true;break;case "if":_10=_10.fv_reduce(1,1);_11._if_=true;break;case "then":_10=_10.fv_reduce(1,1);_11._then_=true;break;default:_10=_10.fv_reduce(1,0);}if(/radio|checkbox/.test(_11.type)){_11.group=f.elements[_11.name];}if(typeof _11.fName=="undefined"){if(typeof _11.group!="undefined"){for(var j=0;j<_11.group.length;j++){if(f.fv.config.clearEvent!=null){addEvent(_11.group.item(j),f.fv.config.clearEvent,f.fv,"revertError",false);}}}else{addEvent(_11,f.fv.config.clearEvent,f.fv,"revertError",false);}}_11.fName=_11.name.format();f.fv.elem=_11;f.fv.type=type;var _13=new Function("obj","method","obj[method]( "+_10.toArgString()+" );");_13(f.fv,type);if(_11.validated==false&&_e==false){return false;}if(_11.validated==true){f.fv.revertError();}}}if(_e){f.fv.showGroupError();}if(f.fv.errors.length>0){return false;}if(_b&&!confirm(f.fv.config.confirmMsg)){if(f.fv.config.confirmAbortMsg!=""){alert(f.fv.config.confirmAbortMsg);}return false;}if(_c){if(typeof f.fv.config.submitButton=="object"){var sb,j=0;while(sb=f.fv.config.submitButton[j++]){if(f.fv.elementExists(sb)){f.elements[sb].disabled=true;}}}else{if(f.fv.elementExists(f.fv.config.submitButton)){f.elements[f.fv.config.submitButton].disabled=true;}}}if(_d&&f.fv.elementExists(f.fv.config.resetButton)){f.elements[f.fv.config.resetButton].disabled=true;}return true;function addEvent(_15,evt,obj,_18,_19){var _1a=_15;if(typeof _15.attachEvent!="undefined"){_15.attachEvent("on"+evt,function(){obj[_18](_1a);});}else{if(typeof _15.addEventListener!="undefined"){_15.addEventListener(evt,function(){obj[_18](_1a);},_19);}else{if(f.fv.config.eventOverride){eleme["on"+evt]=function(){obj[_18](_1a);};}}}}}function fValidate(f,_1c,_1d){var _1e=this;this.form=f;this.errorMode=_1c;this.groupError=_1d;this.errors=new Array();this.validated=true;this.config=new fValConfig();this.i18n=fvalidate.i18n;f.onreset=function(){var _1f,i=0;while(_1f=this.elements[i++]){_1e.revertError(_1f);}};addLabelProperties();function addLabelProperties(){if(typeof f.getElementsByTagName=="undefined"){return;}var _20=f.getElementsByTagName("label");var _21,i=j=0;var _22;while(_21=_20[i++]){if(typeof _21.htmlFor=="undefined"){return;}_22=f.elements[_21.htmlFor];if(typeof _22=="undefined"){_1e.devError([_21.htmlFor],"noLabel");}else{if(typeof _22.label!="undefined"){continue;}else{if(typeof _22.length!="undefined"&&_22.length>1&&_22.nodeName!="SELECT"){for(j=0;j<_22.length;j++){_22.item(j).label=_21;}}}}_22.label=_21;}}}fValidate.prototype._reset=function(){this.errors=new Array();this.showErrors=new Array();};fValidate.prototype.elementExists=function(_23){return Boolean(typeof this.form.elements[_23]!="undefined");};fValidate.prototype.throwError=function(_24,_25){var _26=this.elem;if(typeof _26.name=="undefined"){_26=_26[0];}if(_26.bok&&this.isBlank()){_26.validated=true;return;}if(_26.cv){return;}_26.validated=false;_25=this.setArg(_25,0);_24=this.setArg(_24,[]);emsgElem=(typeof this.elem.getAttribute=="undefined")?this.elem[0]:this.elem;if(emsgElem.getAttribute(this.config.emsg)){var _27=emsgElem.getAttribute(this.config.emsg);}var _28=this.translateMessage(_24,this.i18n.errors[this.type][_25]);if(this.groupError){this.errors.push({"elem":_26,"msg":_28});}else{this.showError(_28,false,emsgElem);var _29=(typeof _26.fields!="undefined")?_26.fields[0]:_26;this.selectFocus(_29);}};fValidate.prototype.showError=function(_2a,_2b,_2c){var _2d=this,_2c=this.setArg(_2c,this.elem),isHidden=Boolean(_2c.type=="hidden"),label=(isHidden)?null:_2c.label||null,_2a=(_2c.getAttribute(this.config.emsg))?_2c.getAttribute(this.config.emsg).replace(/\\n/g,"\n"):_2a,errorClass=this.config.errorClass,singleCSS=this.config.useSingleClassNames;if(typeof this.showErrors=="undefined"){this.showErrors=new Array();}switch(this.errorMode){case 0:alertError();break;case 1:inputError();break;case 2:labelError();break;case 3:appendError();break;case 4:boxError();break;case 5:inputError();labelError();break;case 6:inputError();appendError();break;case 7:inputError();boxError();break;case 8:inputError();alertError();break;case 9:labelError();appendError();break;case 10:labelError();boxError();break;case 11:labelError();alertError();break;case 12:appendError();boxError();break;case 13:appendError();alertError();break;case 14:boxError();alertError();break;case 15:inputError();labelError();appendError();break;case 16:inputError();labelError();boxError();break;case 17:inputError();labelError();alertError();break;case 18:inputError();appendError();boxError();break;case 19:inputError();appendError();alertError();break;case 20:inputError();boxError();alertError();break;case 21:labelError();appendError();boxError();break;case 22:labelError();appendError();alertError();break;case 23:appendError();boxError();alertError();break;case 24:inputError();labelError();appendError();boxError();break;case 25:inputError();labelError();appendError();alertError();break;case 26:inputError();appendError();boxError();alertError();break;case 27:labelError();appendError();boxError();alertError();break;case 28:inputError();labelError();appendError();boxError();alertError();break;}function alertError(){if(_2d.groupError){_2d.showErrors.push(_2a);}else{alert(_2a);}if(_2b){alert(_2d.i18n.groupAlert+_2d.showErrors.join("\n\n- "));}}function inputError(){if((typeof _2c.length!="undefined"&&_2c.length>1&&_2c.nodeName!="SELECT")||isHidden){var _2e,i=0;while(_2e=(isHidden)?_2c.fields[i++]:_2c.item(i++)){if(_2e.className!=""&&singleCSS){_2e.revertClass=_2e.className;_2e.className=errorClass;}else{_2d.addCSSClass(_2e,errorClass);}}}else{if(singleCSS){_2c.revertClass=_2c.className;_2c.className=errorClass;}else{_2d.addCSSClass(_2c,errorClass);}}}function labelError(){if(label==null){return;}if(_2d.config.useSingleClassNames){label.className=errorClass;}else{_2d.addCSSClass(label,errorClass);}}function appendError(){if(label==null||typeof label.innerHTML=="undefined"){return;}if(typeof label.original=="undefined"){label.original=label.innerHTML;}label.innerHTML=label.original+" - "+_2a.toHTML();}function boxError(){if(typeof _2d.boxError=="undefined"){_2d.boxError=document.getElementById(_2d.config.boxError);}if(_2d.boxError==null){_2d.devError([_2d.config.boxError],"noBox");return;}if(typeof _2d.elem.name=="undefined"||_2d.elem.name==""){_2d.devError([_2d.elem[_2d.config.code]],"missingName");return;}var _2f=_2d.config.boxErrorPrefix+_2d.elem.name,errorElem;if(errorElem=document.getElementById(_2f)){errorElem.firstChild.nodeValue=_2a.toHTML();}else{errorElem=document.createHTMLElement("li",{id:_2f,"innerHTML":_2a.toHTML(),title:_2d.i18n.boxToolTip});_2d.boxError.appendChild(errorElem);errorElem.onclick=function(){var _30=_2d.form.elements[this.id.replace(_2d.config.boxErrorPrefix,"")];if(typeof _30.fields!="undefined"){_30=_30.fields[0];}if(typeof _30.select!="undefined"){_30.select();}if(typeof _30.focus!="undefined"){_30.focus();}};}_2d.boxError.style.display="block";}};fValidate.prototype.removeCSSClass=function(_31,_32){_31.className=_31.className.replace(_32,"").trim();};fValidate.prototype.addCSSClass=function(_33,_34){this.removeCSSClass(_33,_34);_33.className=(_33.className+" "+_34).trim();};fValidate.prototype.showGroupError=function(){for(var _35,firstElem,i=0;(_35=this.errors[i]);i++){if(i==0){firstElem=_35.elem;}this.elem=_35.elem;this.showError(_35.msg,Boolean(i==(this.errors.length-1)));}var _36=(typeof firstElem.fields!="undefined")?firstElem.fields[0]:firstElem;this.selectFocus(_36);};fValidate.prototype.revertError=function(_37){_37=this.setArg(_37,this.elem);var _38=Boolean(_37.type=="hidden"),errorClass=this.config.errorClass,i=0,errorElem,subelem;if((typeof _37.length!="undefined"&&_37.length>1&&_37.nodeName!="SELECT")||_38){if(_38&&typeof _37.fields!="undefined"){while(subelem=(_38)?_37.fields[i++]:_37.item(i++)){if(typeof subelem.revertClass!="undefined"){subelem.className=subelem.revertClass;}}}}else{if(this.config.useSingleClassNames){if(typeof subElement.revertClass!="undefined"){_37.className=_37.revertClass;}}else{this.removeCSSClass(_37,errorClass);}}if(typeof _37.label!="undefined"){if(this.config.useSingleClassNames){_37.label.className="";}else{this.removeCSSClass(_37.label,errorClass);}_37.label.innerHTML=(_37.label.original||_37.label.innerHTML);}if(typeof this.boxError!="undefined"){if(typeof this.boxError.normalize!="undefined"){this.boxError.normalize();}if(errorElem=document.getElementById(this.config.boxErrorPrefix+_37.name)){this.boxError.removeChild(errorElem);}if(this.boxError.childNodes.length==0){this.boxError.style.display="none";}}};fValidate.prototype.selectFocus=function(_39){if(typeof _39.select!="undefined"){_39.select();}if(typeof _39.focus!="undefined"){_39.focus();}};fValidate.prototype.typeMismatch=function(){var _3a={"text":"text|password|textarea","ta":"textarea","hidden":"hidden","s1":"select-one","sm":"select-multiple","select":"select-one|select-multiple","rg":"radio","radio":"radio","cb":"checkbox","file":"file"};var _3b=false,expected=new Array(),result=key=type=regex="";for(var i=0;i<arguments.length;i++){type=_3a[arguments[i]];regex=new RegExp(type);result+=(regex.test(this.elem.type))?"1":"0";key+="0";expected.push(type);}if(key^result==0){this.devError([this.elem.fName,this.elem.type,expected.join("|").replace(/\|/g,this.i18n.or)],"mismatch");this.elem.validated=false;return true;}return false;};fValidate.prototype.getValue=function(_3d){switch(_3d.type){case "text":case "password":case "textarea":case "hidden":case "file":return _3d.value;case "radio":case "select-single":if(typeof _3d.length=="undefined"){return _3d.value;}else{for(var i=0;i<_3d.length;i++){choice=(_3d.type=="radio")?"checked":"selected";if(_3d[i][choice]){return _3d[i].value;}}}case "select-multiple":case "checkbox":if(typeof _3d.length=="undefined"){return _3d.value;}else{var _3f=new Array();for(var i=0;i<_3d.length;i++){choice=(_3d.type=="checkbox")?"checked":"selected";if(_3d[i][choice]){_3f.push(_3d[i].value);}}return _3f;}default:return null;}};fValidate.prototype.setArg=function(arg,def){return (typeof arg=="undefined"||arg==""||arg==null)?def:arg;};fValidate.prototype.isBlank=function(el){var _44=this.form.elements[el]||this.elem;return Boolean(/^\s*$/.test(_44.value));};fValidate.prototype.translateMessage=function(_45,_46){var msg="";for(var i=0;i<_46.length;i++){msg+=(typeof _46[i]=="number")?_45[_46[i]]:_46[i];}return msg;};fValidate.prototype.devError=function(_49,_4a){if(typeof _49=="string"){_4a=_49;_49=[];}_4a=this.setArg(_4a,this.type);var _4b=this.i18n.devErrors[_4a];var a=[this.i18n.devErrors.lines[0],"----------------------------------------------------------------------------------------------",this.translateMessage(_49,_4b),"----------------------------------------------------------------------------------------------",this.i18n.devErrors.lines[1]];alert(a.join("\n"));};fValidate.prototype.paramError=function(_4d,_4e){_4e=this.setArg(_4e,this.elem.name);this.devError([_4d,this.type,_4e],"paramError");};document.createHTMLElement=function(_4f,_50){if(typeof document.createElement=="undefined"){return;}var _51=document.createElement(_4f);if(typeof _50!="undefined"){for(var i in _50){switch(true){case (i=="text"):_51.appendChild(document.createTextNode(_50[i]));break;case (i=="class"):_51.className=_50[i];break;default:_51.setAttribute(i,"");_51[i]=_50[i];}}}return _51;};Array.prototype.fv_reduce=function(b,e){var a=new Array();var _56=0;for(var i=b;i<this.length-e;i++){a[_56++]=this[i];}return a;};Array.prototype.toArgString=function(){var a=new Array();for(var i=0;i<this.length;i++){a.push("'"+this[i]+"'");}return a.toString();};String.prototype.format=function(){return this.replace(/\_/g," ").replace(/\[|\]/g,"");};String.prototype.toHTML=function(){return this.replace(/\n/g,"<br />").replace(/\t/g,"&nbsp;&nbsp;&nbsp;&nbsp;");};String.prototype.trim=function(){return this.replace(/^\s+|\s+$/,"");};String.prototype.toPattern=function(){return this.replace(/([\.\*\+\{\}\(\)\<\>\^\$\\])/g,"\\$1");};if(typeof fvalidate=="undefined"){var fvalidate=new Object();}fvalidate.i18n={errors:{blank:[["Please enter ",0]],length:[[0," must be at least ",1," characters long"],[0," must be no more than ",1," characters long.\nThe current text is ",2," characters long."]],equalto:[[0," must be equal to ",1]],number:[["The number you entered for ",0," is not valid"]],numeric:[["Only numeric values are valid for the ",0],["A minimum of ",0," numeric values are required for the ",1]],alnum:[["The data you entered, \"",0,"\", does not match the requested format for ",1,"\nMinimum Length: ",2,"\nCase: ",3,"\nNumbers allowed: ",4,"\nSpaces allowed: ",5,"\nPunctuation characters allowed: ",6,"\n"]],decimal:[["The data you entered,",0," is not valid.  Please re-enter the ",1]],decimalr:[[0," is not a valid. Please re-enter."]],ip:[["Please enter a valid IP"],["The port number you specified, ",0,",  is out of range.\nIt must be between ",1," and ",2]],ssn:[["You need to enter a valid Social Security Number.\nYour SSN must be entered in 'XXX-XX-XXXX' format."]],money:[[0," does not match the required format of ",1]],cc:[["The ",0," you entered is not valid. Please check again and re-enter."]],ccDate:[["You credit card has expired! Please use a different card."]],zip:[["Please enter a valid 5 or 9 digit Zip code."]],phone:[["Please enter a valid phone number plus Area Code."],["Please enter a valid phone number - seven or ten digits."]],email:[["Please enter a valid email address"]],url:[[0," is not a valid domain"]],date:[["The data entered for ",0," is not a valid date\nPlease enter a date using the following format: ",1],["Date must be before ",0],["Date must be on or before ",0],["Date must be after ",0],["Date must be on or after ",0]],select:[["Please select a valid option for ",0]],selectm:[["Please select between ",0," and ",1," options for ",2,".\nYou currently have ",3," selected"]],selecti:[["Please select a valid option for ",0]],checkbox:[["Please check ",0," before continuing"],["Please select between ",0," and ",1," options for ",2,".\nYou currently have ",3," selected"]],radio:[["Please check ",0," before continuing"],["Please select an option for ",0]],comparison:[[0," must be ",1," ",2]],eitheror:[["One and only one of the following fields must be entered:\n\t-",0,"\n"]],atleast:[["At least ",0," of the following fields must be entered:\n\t-",1,"\n\nYou have only ",2," filled in.\n"]],allornone:[["All or none of the following fields must be entered and accurate:\n\t-",0,"\nYou have only ",1," accurate field entered.\n"]],file:[["The file must be one of the following types:\n",0,"\nNote: File extension may be case-sensitive."]],custom:[[0," is invalid."]],cazip:[["Please enter a valid postal code."]],ukpost:[["Please enter a valid postcode."]],germanpost:[["Please enter a valid postcode."]],swisspost:[["Please enter a valid postcode."]]},comparison:{gt:"greater than",lt:"less than",gte:"greater than or equal to",lte:"less than or equal to",eq:"equal to",neq:"not equal to"},devErrors:{number:["The lower-bound (",0,") is greater than the upper-bound (",1,") on this element: ",2],length:["The minimum length (",0,") is greater than the maxiumum legnth (",1,") on this element: ",2],cc:["Credit Card type (",0,") not found."],lines:["! WARNING ! -- fValidate developer-assist error\n","\nIf you are not the developer, please contact the website administrator regarding this error."],paramError:["You must include the '",0,"' parameter for the '",1,"' validator type on this field: ",2],notFound:["The validator '",0,"' was not found.\nRequested by: ",1],noLabel:["No element found for label: ",0],noBox:["An element with the requested id '",0,"' was not found for the 'boxError' config value."],missingName:["The hidden input calling the following logical validator must have a valid name\nattribute when used in conjunction with the 'box' error-type.\n\t",0],mismatch:["Validator/Element type mismatch.\n\nElement: ",0,"\nElement type: ",1,"\nType required by validator: ",2],noCCType:["You must include a SELECT item with Credit Card type choices!"]},config:{confirmMsg:"Your data is about to be sent.\nPlease click 'Ok' to proceed or 'Cancel' to abort.",confirmAbortMsg:"Submission cancelled.  Data has not been sent."},boxToolTip:"Click to target field",groupAlert:"The following errors occured:\n\n- ",or:" or "};fValidate.prototype.blank=function(){if(this.typeMismatch("text")){return;}if(this.isBlank()){this.throwError([this.elem.fName]);}};fValidate.prototype.number=function(_1,lb,ub){if(this.typeMismatch("text")){return;}var _4=(_1==0)?parseInt(this.elem.value,10):parseFloat(this.elem.value);lb=this.setArg(lb,0);ub=this.setArg(ub,Number.infinity);if(lb>ub){this.devError([lb,ub,this.elem.name]);return;}var _5=Boolean(isNaN(_4)||_4!=this.elem.value);if(!_5){switch(true){case (lb!=false&&ub!=false):_5=!Boolean(lb<=_4&&_4<=ub);break;case (lb!=false):_5=Boolean(_4<lb);break;case (ub!=false):_5=Boolean(_4>ub);break;}}if(_5){this.throwError([this.elem.fName]);return;}this.elemPass=true;};fValidate.prototype.numeric=function(_6){if(this.typeMismatch("text")){return;}_6=this.setArg(_6,"*");var _7=new RegExp((_6=="*")?"^\\d+$":"^\\d{"+parseInt(_6,10)+"}\\d*$");if(!_7.test(this.elem.value)){if(_6=="*"){this.throwError([this.elem.fName]);}else{this.throwError([_6,this.elem.fName],1);}}};fValidate.prototype.length=function(_8,_9){if(this.typeMismatch("text")){return;}var _a=this.elem.value.length;_8=Math.abs(_8);_9=Math.abs(this.setArg(_9,Number.infinity));if(_8>_9){this.devError([_8,_9,this.elem.name]);return;}if(_8>parseInt(_a,10)){this.throwError([this.elem.fName,_8]);}if(_a>_9){this.throwError([this.elem.fName,_9,_a],1);}};fValidate.prototype.alnum=function(_b,_c,_d,_e,_f){if(this.typeMismatch("text")){return;}_c=this.setArg(_c,"a");_d=(_d=="true"||_d=="1");_e=(_e=="true"||_e=="1");var _10="",arrE=["None","Any","No","No","Any"];if(_b!="*"){_b=parseInt(_b,10);arrE[0]=_b;}else{_b=0;}switch(_c.toUpperCase()){case "U":_10+="A-Z";arrE[1]="UPPER";break;case "L":_10+="a-z";arrE[1]="lower";break;case "C":_10+="A-Z][a-z";arrE[1]="Intial capital";_b--;break;default:_10+="a-zA-Z";break;}if(_d==true){_10+="0-9";arrE[2]="Yes";}if(_e==true){_10+=" ";arrE[3]="Yes";}if(_f=="any"){arrE[4]="Any";}else{if(_f=="none"){arrE[4]="None";}else{_f=_f.replace(/pipe/g,"|");_10+=_f;arrE[4]=_f;}}var _11=(_b!="*")?"{"+_b+",}":"+";var _12=(_f=="any")?new RegExp("^(["+_10+"]|[^a-zA-Z0-9\\s])"+_11+"$"):new RegExp("^["+_10+"]"+_11+"$");if(!_12.test(this.elem.value)){this.throwError([this.elem.value,this.elem.fName,arrE[0],arrE[1],arrE[2],arrE[3],arrE[4]]);}};fValidate.prototype.equalto=function(_13){if(this.typeMismatch("text")){return;}if(typeof _13=="undefined"){this.paramError("oName");}var _14=this.form.elements[_13];if(this.elem.value!=_14.value){this.throwError([this.elem.fName,_14.fName]);}};fValidate.prototype.ssn=function(){if(this.typeMismatch("text")){return;}if(!(/^\d{3}\-\d{2}\-\d{4}$/.test(this.elem.value))){this.throwError();}};fValidate.prototype.select=function(){if(this.typeMismatch("s1")){return;}if(this.elem.selectedIndex==0){this.throwError([this.elem.fName]);}};fValidate.prototype.selectm=function(_15,_16){if(this.typeMismatch("sm")){return;}if(typeof _15=="undefined"){this.paramError("minS");}if(_16==999||_16=="*"||typeof _16=="undefined"||_16>this.elem.length){_16=this.elem.length;}var _17=0;for(var opt,i=0;(opt=this.elem.options[i]);i++){if(opt.selected){_17++;}}if(_17<_15||_17>_16){this.throwError([_15,_16,this.elem.fName,_17]);}};fValidate.prototype.selecti=function(_19){if(this.typeMismatch("s1")){return;}if(typeof _19=="undefined"){this.paramError("indexes");return;}_19=_19.split(",");var _1a=true;for(var i=0;i<_19.length;i++){if(this.elem.options[_19[i]].selected){_1a=false;break;}}if(!_1a){this.throwError([this.elem.fName]);}};fValidate.prototype.cazip=function(){var _1c=this.elem;if(this.typeMismatch("text")){return;}_1c.value=_1c.value.toUpperCase();if(!(/^[A-Z][0-9][A-Z] [0-9][A-Z][0-9]$/.test(_1c.value))){this.throwError();}};fValidate.prototype.capost=fValidate.prototype.cazip;fValidate.prototype.ukpost=function(){var _1d=this.elem;if(this.typeMismatch("text")){return;}_1d.value=_1d.value.toUpperCase();if(!(/^[A-Z]{1,2}\d[\dA-Z] ?\d[A-Z]{2}$/.test(_1d.value))){this.throwError();}};fValidate.prototype.germanpost=function(){var _1e=this.elem;if(this.typeMismatch("text")){return;}_1e.value=_1e.value.toUpperCase();if(!(/^(?:CH\-)\d{4}$/.test(_1e.value))){this.throwError();}};fValidate.prototype.swisspost=function(){var _1f=this.elem;if(this.typeMismatch("text")){return;}_1f.value=_1f.value.toUpperCase();if(!(/^(?:D\-)\d{5}$/.test(this.elem.value))){this.throwError();}};fValidate.prototype.email=function(_20){if(this.typeMismatch("text")){return;}if(typeof _20=="undefined"){_20=0;}var _21=[/.+@.+\..+$/i,/^\w.+@\w.+\.[a-z]+$/i,/^\w[-_a-z~.]+@\w[-_a-z~.]+\.[a-z]{2}[a-z]*$/i,/^\w[\w\d]+(\.[\w\d]+)*@\w[\w\d]+(\.[\w\d]+)*\.[a-z]{2,7}$/i];if(!_21[_20].test(this.elem.value)){this.throwError();}};fValidate.prototype.url=function(_22,_23,_24){if(this.typeMismatch("text")){return;}this.setArg(_22,"http");var _25="^(?:("+_22.replace(/\,/g,"|")+")\\:\\/\\/)";var end=(Boolean(_24)==true)?"(\\?.*)?$":"$";if(Boolean(_23)==true){_25+="?";}var _27=new RegExp(_25+"([\\w\\d-]+\\.?)+"+end);if(!_27.test(this.elem.value)){this.throwError([this.elem.fName]);}};fValidate.prototype.ip=function(_28,_29){if(this.typeMismatch("text")){return;}_28=this.setArg(_28,0);_29=this.setArg(_29,99999);if(!(/^\d{1,3}(\.\d{1,3}){3}(:\d+)?$/.test(this.elem.value))){this.throwError();}else{var _2a,i=0,parts=this.elem.value.split(/[.:]/);while(_2a=parts[i++]){if(i==5){if(_2a<_28||_2a>_29){this.throwError([_2a,_28,_29],1);}}else{if(_2a<0||_2a>255){this.throwError();}}}}};fValidate.prototype.decimal=function(_2b,_2c){if(this.typeMismatch("text")){return;}var _2d="",elem=this.elem;if(_2b!="*"){_2b=parseInt(_2b,10);}if(_2c!="*"){_2c=parseInt(_2c,10);}if(_2b==0){_2d="^\\.[0-9]{"+_2c+"}$";}else{if(_2b=="*"){_2d="^[0-9]*\\.[0-9]{"+_2c+"}$";}else{if(_2c=="*"){_2d="^[0-9]{"+_2b+"}\\.[0-9]+$";}else{_2d="^[0-9]{"+_2b+"}\\.[0-9]{"+_2c+"}$";}}}_2d=new RegExp(_2d);if(!_2d.test(elem.value)){this.throwError([elem.value,elem.fName]);}};fValidate.prototype.decimalr=function(_2e,_2f,_30,_31){if(this.typeMismatch("text")){return;}_2e=(_2e=="*")?0:parseInt(_2e,10);_2f=(_2f=="*")?"":parseInt(_2f,10);_30=(_30=="*")?0:parseInt(_30,10);_31=(_31=="*")?"":parseInt(_31,10);var _32="^[0-9]{"+_2e+","+_2f+"}\\.[0-9]{"+_30+","+_31+"}$";var _33=new RegExp(_32);if(!_33.test(this.elem.value)){this.throwError([this.elem.fName]);}return true;};fValidate.prototype.zip=function(sep){if(this.typeMismatch("text")){return;}sep=this.setArg(sep,"- ");var _35=new RegExp("^[0-9]{5}(|["+sep.toPattern()+"][0-9]{4})?$");if(!_35.test(this.elem.value)){this.throwError();}};fValidate.prototype.phone=function(_36){if(this.typeMismatch("text")){return;}_36=this.setArg(_36,0);var _37=[/^(\(?\d\d\d\)?)?[ -]?\d\d\d[ -]?\d\d\d\d$/,/^(\(\d\d\d\) )?\d\d\d[ -]\d\d\d\d$/];if(!_37[_36].test(this.elem.value)){if(_36==1){this.throwError();}else{this.throwError([],1);}}};fValidate.prototype.date=function(_38,_39,_3a,_3b){if(this.typeMismatch("text")){return;}if(typeof _38=="undefined"){this.paramError("formatStr");return;}_39=this.setArg(_39,"/");var _3c=[this.elem.fName,_38.replace(/\//g,_39)];var _3d=_38.split("/");var _3e=this.elem.value.split(_39);var _3f=new Object();for(var i=0;i<_3d.length;i++){switch(_3d[i].charAt(0).toLowerCase()){case "m":_3f.months=i;break;case "d":_3f.days=i;break;case "y":_3f.years=i;break;}}var _41=new Date(_3e[_3f.years],_3e[_3f.months]-1,_3e[_3f.days]);if(isNaN(_41)||_41.getDate()!=_3e[_3f.days]||_41.getMonth()!=_3e[_3f.months]-1||_41.getFullYear().toString().length!=_38.match(/y/g).length){this.throwError(_3c);return;}var _42=this.form.elements[_3b];if(typeof _42!="undefined"){_3b=_42.validDate||_42.value;}var _43=(_3b=="today")?new Date():new Date(_3b);_43.setHours(0);_43.setMinutes(0);_43.setSeconds(0);_43.setMilliseconds(0);var _44=_43.getTime()-_41.getTime();var _45=false;switch(parseInt(_3a)){case 1:_45=Boolean(_44>0);_3c=1;break;case 2:_45=Boolean((_44+86400000)>0);_3c=2;break;case 3:_45=Boolean(_44<0);_3c=3;break;case 4:_45=Boolean((_44-86400000)<0);_3c=4;break;default:_45=true;}if(!_45){this.throwError([_3b],_3c);}this.elem.validDate=_41.toString();};fValidate.prototype.money=function(ds,grp,dml){if(this.typeMismatch("text")){return;}ds=(ds==" ")?false:ds.toPattern();grp=(grp==" ")?false:grp.toPattern();dml=(dml==" ")?false:dml.toPattern();var _49,pattern;switch(true){case Boolean(ds&&grp&&dml):pattern="^"+ds+"(?:(?:[0-9]{1,3}"+grp+")(?:[0-9]{3}"+grp+")*[0-9]{3}|[0-9]{1,3})("+dml+"[0-9]{2})$";_49=ds+"XX"+grp+"XXX"+dml+"XX";break;case Boolean(ds&&grp&&!dml):pattern="^"+ds+"(?:(?:[0-9]{1,3}"+grp+")(?:[0-9]{3}"+grp+")*[0-9]{3}|[0-9]{1,3})$";_49=""+ds+"XX"+grp+"XXX";break;case Boolean(ds&&!grp&&dml):pattern="^"+ds+"[0-9]*(\\.[0-9]{2})$";_49=""+ds+"XXXXX"+dml+"XX";break;case Boolean(!ds&&grp&&dml):pattern="^(?:(?:[0-9]{1,3}"+grp+")(?:[0-9]{3}"+grp+")*[0-9]{3}|[0-9]{1,3})("+dml+"[0-9]{2})?$";_49="XX"+grp+"XXX"+dml+"XX";break;case Boolean(ds&&!grp&&!dml):pattern="^"+ds+"[0-9]*$";_49=""+ds+"XXXXX";break;case Boolean(!ds&&grp&&!dml):pattern="^(?:(?:[0-9]{1,3}"+grp+")(?:[0-9]{3}"+grp+")*[0-9]{3}|[0-9]{1,3})$";_49="XX"+grp+"XXX";break;case Boolean(!ds&&!grp&&dml):pattern="^[0-9]*("+dml+"[0-9]{2})$";_49="XXXXX"+dml+"XX";break;case Boolean(!ds&&!grp&&!dml):pattern="^.?(?:(?:[0-9]{1,3}.?)(?:[0-9]{3}.?)*[0-9]{3}|[0-9]{1,3})(.[0-9]{2})?$";_49="[?]XX[?]XXX[?XX]";}var _4a=new RegExp(pattern);if(!_4a.test(this.elem.value)){this.throwError([this.elem.fName,_49.replace(/\\/g,"")]);}};fValidate.prototype.checkbox=function(_4b,_4c){if(this.typeMismatch("cb")){return;}if(typeof _4b=="undefined"){this.paramError("minC");return;}if(this.elem==this.form.elements[this.elem.name]&&!this.elem.checked){this.throwError([this.elem.fName]);}else{this.elem=this.form.elements[this.elem.name];var len=this.elem.length;var _4e=0;if(_4c==999||_4c=="*"||typeof _4c=="undefined"||_4c>this.elem.length){_4c==len;}var i=len;while(i-->0){if(this.elem[i].checked){_4e++;}}if(_4e<_4b||_4e>_4c){this.throwError([_4b,_4c,this.elem[0].fName,_4e]);}}};fValidate.prototype.radio=function(){if(this.typeMismatch("rg")){return;}if(this.elem==this.form.elements[this.elem.name]&&!this.elem.checked){this.throwError([this.elem.fName]);}else{this.elem=this.form.elements[this.elem.name];for(var i=0;i<this.elem.length;i++){if(this.elem.item(i).checked){return;}}this.throwError([this.elem[0].fName]);}};fValidate.prototype.eitheror=function(){if(this.typeMismatch("hidden")){return;}if(typeof arguments[0]=="undefined"){this.paramError("delim");return;}if(typeof arguments[1]=="undefined"){this.paramError("fields");return;}var arg,i=0,fields=new Array(),field,nbCount=0,args=arguments[1].split(arguments[0]);this.elem.fields=new Array();while(arg=args[i++]){field=this.form.elements[arg];fields.push(field.fName);this.elem.fields.push(field);if(!this.isBlank(arg)){nbCount++;}}if(nbCount!=1){this.throwError([fields.join("\n\t-")]);}};fValidate.prototype.atleast=function(){if(this.typeMismatch("hidden")){return;}if(typeof arguments[0]==undefined){this.paramError("qty");return;}if(typeof arguments[1]==undefined){this.paramError("delim");return;}if(typeof arguments[2]==undefined){this.paramError("fields");return;}var arg,i=0,fields=new Array(),field,nbCount=0,args=arguments[2].split(arguments[1]);this.elem.fields=new Array();while(arg=args[i++]){field=this.form.elements[arg];fields.push(field.fName);this.elem.fields.push(field);if(!this.isBlank(arg)){nbCount++;}}if(nbCount<arguments[0]){this.throwError([arguments[0],fields.join("\n\t-"),nbCount]);}};fValidate.prototype.allornone=function(){if(this.typeMismatch("hidden")){return;}if(typeof arguments[0]=="undefined"){this.paramError("delim");return;}if(typeof arguments[1]=="undefined"){this.paramError("fields");return;}var arg,i=0,fields=new Array(),field,nbCount=0,args=arguments[1].split(arguments[0]);this.elem.fields=new Array();while(arg=args[i++]){field=this.form.elements[arg];fields.push(field.fName);this.elem.fields.push(field);if(!this.isBlank(arg)){nbCount++;}}if(nbCount>0&&nbCount<args.length){this.throwError([fields.join("\n\t-"),nbCount]);}};fValidate.prototype.comparison=function(_54,_55,_56){if(this.typeMismatch("hidden")){return;}var _57=this.form.elements[_54],elem2=this.form.elements[_56],value1=this.getValue(_57),value2=this.getValue(elem2);i18n=this.i18n.comparison;i=-1;var _58=[[">",i18n.gt],["<",i18n.lt],[">=",i18n.gte],["<=",i18n.lte],["==",i18n.eq],["!=",i18n.neq]];while(_58[++i][0]!=_55){}this.elem.fields=[_57,elem2];if(!eval(value1+_55+value2)){this.throwError([_57.fName,_58[i][1],elem2.fName]);}};fValidate.prototype.file=function(_59,_5a){if(this.typeMismatch("file")){return;}if(typeof _59=="undefined"){this.paramError("extensions");return;}_5a=Boolean(_5a)?"":"i";var _5b=new RegExp("^.+\\.("+_59.replace(/,/g,"|")+")$",_5a);if(!_5b.test(this.elem.value)){this.throwError([_59.replace(/,/g,"\n")]);}};fValidate.prototype.custom=function(_5c,_5d){if(this.typeMismatch("text")){return;}_5c=(_5c)?_5c.replace(/[^gim]/ig):"";var _5e=new RegExp(this.elem.getAttribute(this.config.pattern),_5c);if(!_5e.test(this.elem.value)){this.throwError([this.elem.fName]);}};fValidate.prototype.cc=function(){if(this.typeMismatch("text")){return;}var _5f=this.form.elements[this.config.ccType];if(!_5f){this.devError("noCCType");return;}var _60=_5f.options[_5f.selectedIndex].value.toUpperCase();var _61={"VISA":/^4\d{12}(\d{3})?$/,"MC":/^5[1-5]\d{14}$/,"DISC":/^6011\d{12}$/,"AMEX":/^3[4|7]\d{13}$/,"DINERS":/^3[0|6|8]\d{12}$/,"ENROUTE":/^2[014|149]\d{11}$/,"JCB":/^3[088|096|112|158|337|528]\d{12}$/,"SWITCH":/^(49030[2-9]|49033[5-9]|49110[1-2]|4911(7[4-9]|8[1-2])|4936[0-9]{2}|564182|6333[0-4][0-9]|6759[0-9]{2})\d{10}(\d{2,3})?$/,"DELTA":/^4(1373[3-7]|462[0-9]{2}|5397[8|9]|54313|5443[2-5]|54742|567(2[5-9]|3[0-9]|4[0-5])|658[3-7][0-9]|659(0[1-9]|[1-4][0-9]|50)|844[09|10]|909[6-7][0-9]|9218[1|2]|98824)\d{10}$/,"SOLO":/^(6334[5-9][0-9]|6767[0-9]{2})\d{10}(\d{2,3})?$/};if(_5f.validated==false&&this.groupError==true){return;}if(typeof _61[_60]=="undefined"&&_5f.validated==false&&this.groupError==false){this.devError([_60]);return;}this.elem.value=this.elem.value.replace(/[^\d]/g,"");if(!_61[_60].test(this.elem.value)||!this.elem.value.luhn()){this.throwError([this.elem.fName]);}};String.prototype.luhn=function(){var i=this.length;var _63="",digit;while(digit=this.charAt(--i)){_63+=(i%2==0)?digit*2:digit;}_63=eval(_63.split("").join("+"));return (_63%10==0);};fValidate.prototype.ccDate=function(_64,_65){if(this.typeMismatch("s1")){return;}_65=parseInt(this.getValue(this.form.elements[_65]),10)+2000;_64=parseInt(this.getValue(this.form.elements[_64]),10);var _66=new Date();var _67=new Date(_65,_64);if(_67<_66){alert(["Card Expired",_66,_67].join("\n"));}};