var undef;var isFocusSet;var internalRules;function performCheck(J,H,D){isFocusSet=false;var I=makeRules(H);internalRules=makeRules(H);this.f=document.forms[J];if(!this.f){debug("DEBUG: could not find form object "+J);return null}var G=new Array();var C=0;if(I.length){for(var E=0;E0){if(strTrim(HEADER_MSG).length>0){C+=HEADER_MSG+"\n\n"}for(var A=0;A0){C+="\n"+FOOTER_MSG}alert(C);return false}else{return true}}function displayInnerHtml(B){if(B!=null&&B.length>0){var C="";if(strTrim(HEADER_MSG).length>0){C+=HEADER_MSG}C+="";if(strTrim(FOOTER_MSG).length>0){C+=FOOTER_MSG}document.getElementById(errorsdiv).innerHTML=C;document.getElementById(errorsdiv).className=innererror;document.getElementById(errorsdiv).style.display="block";return false}else{document.getElementById(errorsdiv).innerHTML="";document.getElementById(errorsdiv).className="";document.getElementById(errorsdiv).style.display="none";return true}}function displayInline(C){if(C!=null&&C.length>0){var A=new Array();var D=0;for(var B=0;B0){displayInnerHtml(A)}return false}else{return true}}function clearAllInlineDivs(){var C=document.getElementsByTagName("div");for(var B=0;B0){for(var A=0;AmyRule.comparisonValue){highlight(el,inputclasserror);err=myRule.alertMsg}}}else{if(myRule.ruleName=="minlength"){if(isNaN(myRule.comparisonValue)){debug("DEBUG: comparisonValue for rule "+myRule.ruleName+" not a number")}else{if(el.value.lengtheval(rangeVal[1])){highlight(el,inputclasserror);err=myRule.alertMsg}}}}else{if(myRule.ruleName=="regexp"){reg=new RegExp(myRule.comparisonValue);if(!reg.test(el.value)){highlight(el,inputclasserror);err=myRule.alertMsg}}else{if(myRule.ruleName=="integer"){err=checkInteger(el,myRule)}else{if(myRule.ruleName=="double"){err=checkDouble(el,myRule)}else{if(myRule.ruleName=="date"){err=checkDate(el,myRule)}else{if(myRule.ruleName=="date_lt"){err=checkDateLessThan(el,myRule,false)}else{if(myRule.ruleName=="date_le"){err=checkDateLessThan(el,myRule,true)}else{if(myRule.ruleName=="keypress"){}else{if(myRule.ruleName=="empty"){if(el.value!=null&&el.value!=""){highlight(el,inputclasserror);err=myRule.alertMsg}}else{debug("DEBUG: rule "+myRule.ruleName+" not supported for "+el.type)}}}}}}}}}}}}}}}}}}}}}return err}function checkInteger(A,B){reg=new RegExp("^[-+]{0,1}[0-9]*$");if(!reg.test(A.value)){highlight(A,inputclasserror);return B.alertMsg}}function checkDouble(B,C){var A=DECIMAL_SEP;reg=new RegExp("^[-+]{0,1}[0-9]*["+A+"]{0,1}[0-9]*$");if(!reg.test(B.value)){highlight(B,inputclasserror);return C.alertMsg}}function checkDate(B,C){error=null;if(B.value!=""){var A=DATE_FORMAT;ddReg=new RegExp("dd");MMReg=new RegExp("MM");yyyyReg=new RegExp("yyyy");if(!ddReg.test(A)||!MMReg.test(A)||!yyyyReg.test(A)){debug("DEBUG: locale format "+A+" not supported")}else{ddStart=A.indexOf("dd");MMStart=A.indexOf("MM");yyyyStart=A.indexOf("yyyy")}strReg=A.replace("dd","[0-9]{2}").replace("MM","[0-9]{2}").replace("yyyy","[0-9]{4}");reg=new RegExp("^"+strReg+"$");if(!reg.test(B.value)){highlight(B,inputclasserror);error=C.alertMsg}else{dd=B.value.substring(ddStart,ddStart+2);MM=B.value.substring(MMStart,MMStart+2);yyyy=B.value.substring(yyyyStart,yyyyStart+4);if(!checkddMMyyyy(dd,MM,yyyy)){highlight(B,inputclasserror);error=C.alertMsg}}}return error}function checkDateLessThan(E,F,C){error=null;var B=checkDate(E,F)==null?true:false;if(B&&E.value!=""){var A=DATE_FORMAT;ddStart=A.indexOf("dd");MMStart=A.indexOf("MM");yyyyStart=A.indexOf("yyyy");dd=E.value.substring(ddStart,ddStart+2);MM=E.value.substring(MMStart,MMStart+2);yyyy=E.value.substring(yyyyStart,yyyyStart+4);myDate=""+yyyy+MM+dd;strReg=A.replace("dd","[0-9]{2}").replace("MM","[0-9]{2}").replace("yyyy","[0-9]{4}");reg=new RegExp("^"+strReg+"$");var G=F.comparisonValue.indexOf("$")==0?true:false;var D="";if(G){toSplit=F.comparisonValue.substr(1);tmp=toSplit.split(":");if(tmp.length==2){D=this.getField(f,tmp[0]).value}else{D=this.getField(f,F.comparisonValue.substr(1)).value}}else{D=F.comparisonValue}if(!reg.test(D)){highlight(E,inputclasserror);error=F.alertMsg}else{cdd=D.substring(ddStart,ddStart+2);cMM=D.substring(MMStart,MMStart+2);cyyyy=D.substring(yyyyStart,yyyyStart+4);cDate=""+cyyyy+cMM+cdd;if(C){if(!checkddMMyyyy(cdd,cMM,cyyyy)||myDate>cDate){highlight(E,inputclasserror);error=F.alertMsg}}else{if(!checkddMMyyyy(cdd,cMM,cyyyy)||myDate>=cDate){highlight(E,inputclasserror);error=F.alertMsg}}}}else{if(E.value!=""){highlight(E,inputclasserror);error=F.alertMsg}}return error}function checkEqual(B,C){error=null;var D=C.comparisonValue.indexOf("$")==0?true:false;var A="";if(D){toSplit=C.comparisonValue.substr(1);tmp=toSplit.split(":");if(tmp.length==2){A=this.getField(f,tmp[0]).value}else{A=this.getField(f,C.comparisonValue.substr(1)).value}}else{A=C.comparisonValue}if(B.value!=A){highlight(B,inputclasserror);error=C.alertMsg}return error}function checkNotEqual(B,C){error=null;var D=C.comparisonValue.indexOf("$")==0?true:false;var A="";if(D){toSplit=C.comparisonValue.substr(1);tmp=toSplit.split(":");if(tmp.length==2){A=this.getField(f,tmp[0]).value}else{A=this.getField(f,C.comparisonValue.substr(1)).value}}else{A=C.comparisonValue}if(B.value==A){highlight(B,inputclasserror);error=C.alertMsg}return error}function checkddMMyyyy(A,C,B){retVal=true;if((A<1)||(A>31)||(C<1)||(C>12)||(A==31&&(C==2||C==4||C==6||C==9||C==11))||(A>29&&C==2)||(A==29&&(C==2)&&((B%4>0)||(B%4==0&&B%100==0&&B%400>0)))){retVal=false}return retVal}function checkCheckbox(A,B){if(B.ruleName=="required"){if(!A.checked){highlight(A,inputclasserror);return B.alertMsg}}else{if(B.ruleName=="equal"){if(!A.checked||A.value!=B.comparisonValue){highlight(A,inputclasserror);return B.alertMsg}}else{if(B.ruleName=="notequal"){if(!A.checked||A.value==B.comparisonValue){highlight(A,inputclasserror);return B.alertMsg}}else{debug("DEBUG: rule "+B.ruleName+" not supported for "+A.type)}}}}function checkSelOne(A,C){if(C.ruleName=="required"){var B=false;var D=A.selectedIndex;if(D>=0&&A.options[D].value){B=true}if(!B){highlight(A,inputclasserror);return C.alertMsg}}else{if(C.ruleName=="equal"){var B=false;var D=A.selectedIndex;if(D>=0&&A.options[D].value==C.comparisonValue){B=true}if(!B){highlight(A,inputclasserror);return C.alertMsg}}else{if(C.ruleName=="notequal"){var B=false;var D=A.selectedIndex;if(D>=0&&A.options[D].value!=C.comparisonValue){B=true}if(!B){highlight(A,inputclasserror);return C.alertMsg}}else{debug("DEBUG: rule "+C.ruleName+" not supported for "+A.type)}}}}function checkSelMul(B,D){if(D.ruleName=="required"){var C=false;opts=B.options;for(var A=0;A