var clickcheck=0;var errors="";var errorsf="";var english=true;var allOptional=false;function isblank(b){for(var a=0;a<b.length;a++){var d=b.charAt(a);if((d!=" ")&&(d!="\n")&&(d!="\t")){return false}}return true}function oCROption(a,b){this.checked=a;this.value=b}function oCR(a){this.name=a.name;this.type=a.type;if(a.alt!=null){this.alt=a.alt}if(a.optional!=null){this.optional=a.optional}this.myOptions=new Array()}function getDisplay(a){if((a.alt!=null)&&(a.alt!="")){display=a.alt}else{display=a.name}return display}function allowedChar(b,a){var c;if(a.length==0){return false}for(c=0;c<a.length;c++){if(b.indexOf(a.charAt(c))==-1){return false}}return true}function verify(n,u,d){var a="";var b="";lastElement="_NoElement";var p=new Array();for(g=0;g<n.length;g++){o=n.elements[g];if((o.type!="checkbox")&&(o.type!="radio")){p[p.length]=o}else{chkObjExist=0;for(j=0;j<p.length;j++){if(p[j].name==o.name){chkObjExist=j}}if(!chkObjExist){idx=p.length;p[idx]=new oCR(o);p[idx].myOptions[p[idx].myOptions.length]=new oCROption(o.checked,o.value)}else{p[chkObjExist].myOptions[p[chkObjExist].myOptions.length]=new oCROption(o.checked,o.value)}}}for(var g=0;g<p.length;g++){var o=p[g];if(o.validated!=null&&o.validated!=undefined){o.validated=false}if(!o.validated&&o.name!=lastElement){lastElement=o.name;o.validated=true;if(d==true){if(o.optional==null){o.optional=true}}if(((o.type=="text")||(o.type=="textarea")||(o.type=="file")||(o.type=="password")||(o.type=="hidden"))&&!o.optional){if((o.value==null)||(o.value=="")||isblank(o.value)){b+="\n "+getDisplay(o);continue}}if(((o.type=="radio")||(o.type=="checkbox"))&&!o.optional){crcheck=false;if(o.myOptions.length){for(k=0;k<o.myOptions.length;k++){if(o.myOptions[k].checked){crcheck=true}}}else{if(o.checked){crcheck=true}}if(!crcheck){b+="\n "+getDisplay(o)}}if(((o.type=="text")||(o.type=="textarea")||(o.type=="file")||(o.type=="password"))&&!isblank(o.value)){if(o.value.length<o.minLen){errors+="The field '"+getDisplay(o);errors+=" must be at least "+o.minLen+" characters in length.\n";errorsf+="Le champ '"+getDisplay(o);errorsf+=" doit être au moins "+o.minLen+" caractères en longueur.\n"}if(o.value.length>o.maxLen){errors+="The field '"+getDisplay(o);errors+=" must be less than "+o.maxLen+" characters in length.\n";errorsf+="Le champ '"+getDisplay(o);errorsf+=" doit être moins que "+o.maxLen+" caractères en longueur.\n"}if(o.compare!=null&&(o.compare.value!=o.value)){errors+="The field '"+getDisplay(o);errors+="' must match '"+getDisplay(o.compare)+"'.\n";errorsf+="Le champ '"+getDisplay(o)+"'";errorsf+=" doit correspondre "+getDisplay(o.compare)+".\n"}if((o.allowChar!=null)&&(allowedChar(o.allowChar,o.value)==false)){errors+="The field '"+getDisplay(o);errors+="' contains invalid characters.\n";errorsf+="Le champ '"+getDisplay(o);errorsf+="' contient des charactères invalides.\n"}}if((o.type=="text"||o.type=="textarea")&&(o.numeric||(o.min!=null)||(o.max!=null))&&!isblank(o.value)){var w=parseFloat(o.value);var t=o.value.replace(/,/,"");if((isNaN(w))||(isNaN(t))||((o.min!=null)&&(w<o.min))||((o.max!=null)&&(w>o.max))){errors+="The field '"+getDisplay(o)+"' must be a number";errorsf+="Le champ '"+getDisplay(o)+"' doit être un nombre";if(o.min!=null){errors+=" that is greater than "+o.min;errorsf+=" c'est plus grand que "+o.min}if(o.max!=null&&o.min!=null){errors+=" and less than "+o.max;errorsf+=" et moins que "+o.max}else{if(o.max!=null){errors+=" that is less than "+o.max;errorsf+=" c'est moins que "+o.max}}errors+=".\n";errorsf+=".\n"}}if(o.canPostFormat&&((o.type=="text")||(o.type=="textarea"))){if(isblank(o.value)==false){o.value=o.value.toUpperCase();var m=0;if(o.value.length==6){for(x=0;x<o.value.length;x++){if((x==0||x==2||x==4)&&!(allowedChar("ABCDEFGHIJKLMNOPQRSTUVWXYZ",o.value.charAt(x)))){m=1;break}else{if((x==1||x==3||x==5)&&!(allowedChar("0123456789",o.value.charAt(x)))){m=1;break}}}}else{if(o.value.length==7){for(x=0;x<o.value.length;x++){if((x==0||x==2||x==5)&&!(allowedChar("ABCDEFGHIJKLMNOPQRSTUVWXYZ",o.value.charAt(x)))){m=1;break}else{if((x==1||x==4||x==6)&&!(allowedChar("0123456789",o.value.charAt(x)))){m=1;break}else{if((x==3)&&!(allowedChar(" -",o.value.charAt(x)))){m=1;break}}}}}else{m=1}}if(m){errors+="The postal code '"+o.value+"' appears to be in an invalid format.  Please confirm the postal code.\n";errorsf+="Le code postal '"+o.value+"' semble être d'un format invalide. S.V.P. confirmez le code postal.\n"}}}if(o.usPostFormat&&((o.type=="text")||(o.type=="textarea"))){if(isblank(o.value)==false){var s=0;if(o.value.length==5){for(x=0;x<o.value.length;x++){if(allowedChar("0123456789",o.value.charAt(x))==false){s=1;break}}}else{if(o.value.length==10){for(x=0;x<o.value.length;x++){if(x!=5){if(allowedChar("0123456789",o.value.charAt(x))==false){s=1;break}}else{if(allowedChar("-",o.value.charAt(x))==false){s=1;break}}}}}if(s){errors+="The zip code '"+o.value+"' appears to be in an invalid format.  Please confirm the zip code.\n";errorsf+="Le code postal '"+o.value+"' semble être d'un format invalide. S.V.P. confirmez le code postal.\n"}}}if(o.emailFormat&&((o.type=="text")||(o.type=="textarea"))){if(isblank(o.value)==false){var r=0;indAt=o.value.indexOf("@");indDot=o.value.lastIndexOf(".");if((indAt==-1)||(indDot==-1)||(indDot<indAt)||(indDot<(o.value.length-5))||((indDot-indAt)<=1)||(indAt==0)){errors+="The email address '"+o.value+"' appears to be in an invalid format.  Please confirm the email address.\n";errorsf+="Le couriel '"+o.value+"' semble être dans un format invalide. Veuillez confirmer l'adresse électronique.\n"}}}if(o.dateFormat&&((o.type=="text")||(o.type=="textarea"))){if(isblank(o.value)==false){var q=31;var h=true;var c=false;var l=false;theMonth=o.value.substring(0,2);if(isNaN(theMonth)){theMonth=o.value.substring(0,1);c=true}if(c){theDay=o.value.substring(2,4);if(isNaN(theDay)){theDay=o.value.substring(2,3);l=true}}else{theDay=o.value.substring(3,5);if(isNaN(theDay)){theDay=o.value.substring(3,4);l=true}}if(c&&l){theYear=o.value.substring(4,8)}else{if(c||l){theYear=o.value.substring(5,9)}else{theYear=o.value.substring(6,10)}}if(isNaN(theMonth)||isNaN(theDay)||isNaN(theYear)){h=false}else{if(theMonth==2){if((theYear%4)==0){q=29}else{q=28}}else{if((theMonth==4)||(theMonth==6)||(theMonth==9)||(theMonth==11)){q=30}}}if((h==false)||(o.value.length>10)||(o.value.length<8)||((theMonth<1)||(theMonth>12))||((theDay<1)||(theDay>q))||((theYear<1900)||(theYear>9999))){errors+="The date '"+o.value+"' appears to be in an invalid format.  Please re-enter the date as mm/dd/yyyy.\n";errorsf+="La date '"+o.value+"' semble être dans un format invalide. Entrez s'il vous plaît dans la date comme mm/jj/aaaa.\n"}}}if(((o.type=="select")||(o.type=="select-one"))&&!o.multiple&&!o.optional){dropcheck=true;if(o.selectedIndex==null){o.selectedIndex=0}if(o.inList==null){o.inList=false}if(o.indexList){indexArray=o.indexList.split(",");for(idx=0;idx<indexArray.length;idx++){check=indexArray[idx];if((!o.inList&&check==o.selectedIndex)||(o.inList&&check!=o.selectedIndex)){dropcheck=false}}}if((o.min!=null)&&(o[o.selectedIndex].value<o.min)){dropcheck=false}if((o.max!=null)&&(o[o.selectedIndex].value>o.max)){dropcheck=false}if(!dropcheck&&((o[o.selectedIndex].value=="")&&!o.optional)){b+="\n "+getDisplay(o)}else{if(!dropcheck&&o[o.selectedIndex].value!=""){errors+="An inappropriate selection has been made in "+getDisplay(o)+"\n";errorsf+="Un choix inopportun a été fait dans "+getDisplay(o)+"\n"}}}else{if(((o.type=="select")||(o.type=="select-multiple"))&&o.multiple&&!o.optional){cntSelected=0;cntOkay=0;for(curIdx=0;curIdx<o.options.length;curIdx++){optionCheck=false;if(o.options[curIdx].selected){cntSelected++;optionCheck=true;if(o.inList==null){o.inList=false}if(o.indexList){indexArray=o.indexList.split(",");for(idx=0;idx<indexArray.length;idx++){check=indexArray[idx];if((!o.inList&&check==curIdx)||(o.inList&&check!=curIdx)){optionCheck=false}}}if((o.min!=null)&&(o.options[curIdx].value<o.min)){optionCheck=false}if((o.max!=null)&&(o.options[curIdx].value>o.max)){optionCheck=false}}if(optionCheck){cntOkay++}}if(cntSelected==0&&!o.optional){b+="\n "+getDisplay(o)}else{if(cntSelected!=cntOkay){errors+="An inappropriate selection has been made in "+getDisplay(o)+"\n";errorsf+="Un choix inopportun a été fait dans "+getDisplay(o)+"\n"}}}}}}if(!b&&!errors){return true}a="______________________________________________________\n\n";a+="The form was not submitted because of the following error(s).\n";a+="Please correct these error(s) and re-submit.\n";a+="______________________________________________________\n\n";msgf="______________________________________________________\n\n";msgf+="Le formulaire n'a pas été soumis à cause d'une ou des erreurs suivantes.\n";msgf+="Corrigez s'il vous plaît cette ou ces erreurs et resoumettre.\n";msgf+="______________________________________________________\n\n";if(b){a+="The following required field(s) are empty:\n"+b+"\n";msgf+="Le ou les champs exigés suivant sont vide:\n"+b+"\n"}a+="\n"+errors;msgf+="\n"+errorsf;if(!u){alert(msgf)}if(u){alert(a)}errors="";errorsf="";return false};
