
function ibpValidationConstructor(){var Err=function(){var oSource=new Object;var sMessage=new String;this.clear=function(){oSource=new Object;sMessage=new String;}
this.add=function(oSrc,sMsg){oSource=oSrc;sMessage=sMsg;}
this.raise=function(){var sName=oSource.NAME;var sMsg=oSource.MSG;if(!(oSource.NOMSG||oSource.form&&oSource.form.NOMSG||ibpValidation.NOMSG))
{if(!(oSource.NOFOCUS||oSource.form&&oSource.form.NOFOCUS||ibpValidation.NOFOCUS))
{if(oSource.CONTAINER_TAB_ID&&window.ibpUtils)
{ibpUtils.setSelectedTab(oSource.CONTAINER_TAB_ID,false);}
try
{if(oSource.focus)oSource.focus();}
catch(e){}
try
{if(oSource.select)oSource.select();}
catch(e){}
try
{if(window.ibpUtils)
{if(ibpUtils.toBoolean(oSource.FCK_EDITOR))
ibpUtils.fckEditorSetFocus(sName);}}
catch(e){}}
sMsg=sMsg?sMsg:sMessage+(ibpMsg.get("ibpValidation.inTheField").replace("~1~",sName));alert(sMsg);}
this.clear();}}
var _isAccessible=function(oElement){var ret=false;if(oElement)
{try
{oElement.focus();ret=true;}
catch(exception)
{ret=false;}}
return ret;}
var getValueOf=function(oElement){var retVal=null;if(oElement.ISARRAY)
{oElement=oElement.form.elements[oElement.name];var len=oElement.length;for(var i=0;i<len;i++)
{retVal=_getValueOf(oElement[i]);if(retVal)return retVal;}
return retVal;}
else
{return _getValueOf(oElement);}}
var _getValueOf=function(oElement){var sReturnValue=null;if(!oElement)return sReturnValue;if(window.ibpUtils)
{if(ibpUtils.toBoolean(oElement.FCK_EDITOR))
sReturnValue=ibpUtils.fckEditorGetContent(oElement.name);}
if(sReturnValue!=null)
return sReturnValue;switch(oElement.type){case"text":case"textarea":case"file":case"password":case"hidden":sReturnValue=oElement.value;break;case"select-one":if(!oElement.options.length||oElement.selectedIndex==-1)return;sReturnValue=oElement.options[oElement.selectedIndex].value;break;case"select-multiple":var i,iOptions=oElement.options.length;if(!iOptions||oElement.selectedIndex==-1)return;for(i=0;i<iOptions;i++){if(oElement.options[i].selected&&oElement.options[i].value.toString().trim()){sReturnValue=true;break;}}
case"checkbox":if(oElement.checked)
sReturnValue=oElement.value?oElement.value:true;break;case"radio":if(oElement.value!=null&&oElement.checked)sReturnValue=oElement.value;break;}
return sReturnValue;}
var isSet=function(prm)
{var und;return(prm!=und&&prm!=null);}
var isDate=function(sDate,sFormat,bConvert){if(!sDate)return false;if(!sFormat)sFormat=ibpValidation.DATEFORMAT;sFormat=sFormat.toUpperCase();var aDaysInMonth=new Array(31,28,31,30,31,30,31,31,30,31,30,31);var sSepDate=sDate.charAt(sDate.search(/\D/));var sSepFormat=sFormat.charAt(sFormat.search(/[^MDY]/i));if(sSepDate!=sSepFormat)return false;var aValueMDY=sDate.split(sSepDate,3);var aFormatMDY=sFormat.split(sSepFormat,3);var dayPos,monthPos,yearPos,yearLen;for(var i=0;i<3;i++){if(aFormatMDY[i].indexOf("D")!=-1)dayPos=i;if(aFormatMDY[i].indexOf("M")!=-1)monthPos=i;if(aFormatMDY[i].indexOf("Y")!=-1)yearPos=i;}
yearLen=aFormatMDY[yearPos].length;var iMonth,iDay,iYear;iMonth=aValueMDY[monthPos];iDay=aValueMDY[dayPos];iYear=aValueMDY[yearPos];if(!isNum(iMonth)||!isNum(iDay)||!isNum(iYear))return false;if(yearLen!=2&&yearLen!=4)yearLen=4;if(iYear.length!=yearLen&&iYear.length!=4)return false;var iDaysInMonth=(iMonth!=2)?aDaysInMonth[iMonth-1]:((iYear%4==0&&iYear%100!=0||iYear%400==0)?29:28);if(iDay!=null&&iMonth!=null&&iYear!=null&&iMonth<13&&iMonth>0&&iDay>0&&iDay<=iDaysInMonth){if(bConvert){return new Date(iYear,iMonth-1,iDay);}else return true;}else return false;}
var hasDate=function(oElement,sFormat,bConvert){if(!oElement)return false;if(!sFormat){if(oElement.DATEFORMAT){sFormat=oElement.DATEFORMAT;}else if(oElement.form&&oElement.form.DATEFORMAT){sFormat=oElement.form.DATEFORMAT;}else{sFormat=ibpValidation.DATEFORMAT;}}
return isDate(getValueOf(oElement),sFormat,bConvert);}
var isNotEmpty=function(v){return(v?true:false);}
var hasNotEmpty=function(oElement){if(!oElement)return false;return isNotEmpty(getValueOf(oElement));}
var isNum=function(v){if(v!=0&&!v)return false;return(v.toString()&&!/\D/.test(v));}
var hasNum=function(oElement){if(!oElement)return false;return isNum(getValueOf(oElement));}
var isFloat=function(sValue,bSigned){if(!isSet(sValue))return false;var num=new Number(sValue);return(!isNaN(num)&&(bSigned?true:num<=0));}
var hasFloat=function(oElement,bSigned){if(!oElement)return false;if(bSigned==null)bSigned=oElement.SIGNED;return isFloat(getValueOf(oElement),bSigned);}
var isInteger=function(sValue,bSigned){if(!isSet(sValue))return false;var re=new RegExp("^"+((bSigned)?"\\-?":"")+"\\d+$");return re.test(sValue);}
var hasInteger=function(oElement,bSigned){if(!oElement)return false;if(bSigned==null)bSigned=oElement.SIGNED;return isInteger(getValueOf(oElement),bSigned);}
var isRegExp=function(sValue,oRegExp){if(!(oRegExp&&oRegExp.constructor==RegExp&&sValue))return false;return oRegExp.test(sValue);}
var hasRegExp=function(oElement,oRegExp){if(!oElement)return false;if(!(oRegExp&&oRegExp.constructor==RegExp))oRegExp=oElement.REGEXP;return isRegExp(getValueOf(oElement),oRegExp);}
var isGivenValues=function(sValue,sVals){if(!(isSet(sVals)&&isSet(sValue)))return false;sValue=sValue.toLowerCase();var values=(""+sVals).toLowerCase().split(",");if(!values||values.length==0)return false;for(var i=0;i<values.length;i++)
{if(sValue==values[i])return true;}
return false;}
var hasGivenValue=function(oElement,sVals){if(!oElement)return false;if(!(sVals))sVals=oElement.ALLOWEDVALUES;return isGivenValues(getValueOf(oElement),sVals);}
var isAllowedFileType=function(sValue,sTypes){if(!(sTypes&&sValue))return false;var fileTypes=sTypes.split(",");if(!fileTypes||fileTypes.length==0)return false;var reStr="";for(var i=0;i<fileTypes.length;i++)
{if(i>0)reStr+="|";if((fileTypes[i]=="\"\"")&&sValue.indexOf(".")==-1)
return true;else
reStr+="^.+\\."+fileTypes[i].trim()+"$";}
return isRegExp(sValue,new RegExp(reStr,"i"));}
var hasAllowedFileType=function(oElement,sTypes){if(!oElement)return false;if(!(sTypes))sTypes=oElement.ALLOWEDFILETYPES;return isAllowedFileType(getValueOf(oElement),sTypes);}
var isForbiddenFileType=function(sValue,sTypes){if(!(sTypes&&sValue))return false;return isAllowedFileType(sValue,sTypes);}
var hasForbiddenFileType=function(oElement,sTypes){if(!oElement)return false;if(!(sTypes))sTypes=oElement.FORBIDDENFILETYPES;return isForbiddenFileType(getValueOf(oElement),sTypes);}
var isEmail=function(sValue){if(!sValue)return false;return isRegExp(sValue,/^[\w_-]+(\.[\w_-]+)*@[\w_-]+(\.[\w_-]+)*\.\w{2,4}$/);}
var hasEmail=function(oElement){if(!oElement)return false;return isEmail(getValueOf(oElement));}
var isEmails=function(sValue){if(!sValue)return false;var tmpValue=sValue.split(",");for(var i=0;i<tmpValue.length;i++)
{if(!isEmail(tmpValue[i]))
{return false;}}
return true;}
var hasEmails=function(oElement){if(!oElement)return false;return isEmails(getValueOf(oElement));}
var isPhone=function(sValue){if(!sValue)return false;var sPhone=sValue.replace(/\D/g,"");var iDigits=sPhone.length;return(iDigits==10||iDigits==11&&/^1/.test(sPhone));}
var hasPhone=function(oElement){if(!oElement)return false;return isPhone(getValueOf(oElement));}
var isZip=function(sValue){if(!sValue)return false;return isRegExp(sValue,/^\d{5}(-?\d{4})?$/);}
var hasZip=function(oElement){if(!oElement)return false;return isZip(getValueOf(oElement));}
var isSysName=function(sValue){if(!sValue)return false;return isRegExp(sValue,/^[A-Za-z][A-Za-z0-9_]*$/);}
var hasSysName=function(oElement){if(!oElement)return false;return isSysName(getValueOf(oElement));}
var fixSysName=function(name)
{var o="";if(name.toLowerCase().indexOf("wf_")==0)name=name.substring(3);var len=name.length;if(len==0)return"";var idx=0;var curChar;var curCharCode;curChar=name.charAt(idx);curCharCode=name.charCodeAt(idx);while(!((curCharCode>=65&&curCharCode<=90)||(curCharCode>=97&&curCharCode<=122)))
{idx++;if(idx==len)return"";curChar=name.charAt(idx);curCharCode=name.charCodeAt(idx);}
if((curCharCode>=65&&curCharCode<=90)||(curCharCode>=97&&curCharCode<=122))o+=curChar;for(var i=idx+1;i<len;i++)
{curChar=name.charAt(i);curCharCode=name.charCodeAt(i);if((curCharCode>=65&&curCharCode<=90)||(curCharCode>=97&&curCharCode<=122)||(curCharCode>=48&&curCharCode<=57)||(curCharCode==95))o+=curChar;}
return o;}
var validateControlsArray=function(form,controlName,validate)
{if(form.constructor!=Object)form=document.forms[form];if(controlName.constructor==Array)
{for(var i=0;i<controlName.length;i++)
{if(!validateControlsArray(form.name,controlName[i],validate))return false;}}
if(validate.constructor!=Array)return false;if(validate.length>0&&validate[0].constructor!=Array)return false;var el;for(var i=0;i<form.elements.length;i++)
{el=form.elements[i];if(el.name==controlName)
{for(var j=0;j<validate.length;j++)
{el[validate[j][0]]=validate[j][1];}
if(!validateControl(el))return false;}}
return true;}
var validateControl=function(oElement){if(!_validateControl(oElement))
{ibpValidation.Err.raise();return false;}else return true;}
var _validateControl=function(oElement){var multiLangMsg=function(varA,varB)
{var result="";result=ibpMsg.get("ibpValidation.enterValBetween").replace("~1~",varA);result=result.replace("~2~",varB);return result;}
if(!oElement)return false;if(oElement.NOSPACE&&oElement.value)
oElement.value=oElement.value.replace(/\s/g,"");if(oElement.FIXSYSNAME&&oElement.value)
oElement.value=fixSysName(oElement.value);if(oElement.UPPERCASE&&oElement.value)
oElement.value=oElement.value.toUpperCase();if(oElement.LOWERCASE&&oElement.value)
oElement.value=oElement.value.toLowerCase();if(oElement.value)oElement.value=oElement.value.trim();var sValue=getValueOf(oElement);var bRequired=(oElement.REQUIRED);var bElHidden=(oElement.type=="hidden"||oElement.style.display=="none"||oElement.style.visibility=="hidden"||oElement.className=="hiddenEl");var bElReadonly=oElement.readOnly;var bElDIsabled=oElement.disabled;var bInaccessible=bElHidden||bElReadonly||bElDIsabled||bElHidden;var bIgnore=((oElement.form&&oElement.form.IGNORE_READONLY||oElement.IGNORE_READONLY)&&bElReadonly||(oElement.form&&oElement.form.IGNORE_DISABLED||oElement.IGNORE_DISABLED)&&bElDIsabled||(oElement.form&&oElement.form.IGNORE_HIDDEN||oElement.IGNORE_HIDDEN)&&bElHidden||(oElement.form&&oElement.form.IGNORE_INACCESSIBLE||oElement.IGNORE_INACCESSIBLE)&&(bInaccessible||!_isAccessible(oElement)));if(!bIgnore&&bRequired&&!sValue)
{ibpValidation.Err.add(oElement,ibpMsg.get("ibpValidation.enterValue"));return false;}
var bSigned=oElement.SIGNED;if(!bIgnore&&oElement.FLOAT&&sValue){if(!isFloat(sValue,bSigned)){ibpValidation.Err.add(oElement,ibpMsg.get("ibpValidation.enterNum"));return false;}
var iMin=oElement.MIN;var iMax=oElement.MAX;if(iMin&&!iMax){if(sValue<parseFloat(iMin)){ibpValidation.Err.add(oElement,ibpMsg.get("ibpValidation.enterValueGreater")+iMin);return false;}}else if(!iMin&&iMax){if(sValue>parseFloat(iMax)){ibpValidation.Err.add(oElement,ibpMsg.get("ibpValidation.enterValueLess")+iMax);return false;}}else if(iMin&&iMax){if(sValue<parseFloat(iMin)||sValue>parseFloat(iMax)){ibpValidation.Err.add(oElement,multiLangMsg(iMin,iMax));return false;}}}
if(!bIgnore&&oElement.AMOUNT&&sValue){var re=new RegExp("^"+((bSigned)?"\\-?":"")+"(\\d*\\.?\\d{2}|\\d+\\.?(\\d{2})?)$");if(!re.test(sValue))
{ibpValidation.Err.add(oElement,ibpMsg.get("ibpValidation.enterDollar"));return false;}}
if(!bIgnore&&oElement.INTEGER&&sValue){if(!isInteger(sValue,bSigned)){ibpValidation.Err.add(oElement,ibpMsg.get("ibpValidation.enterInteger"));return false;}
var iMin=oElement.MIN;var iMax=oElement.MAX;if(iMin&&!iMax){if(sValue<ibpUtils.enParseInt(iMin)){ibpValidation.Err.add(oElement,ibpMsg.get("ibpValidation.enterValueGreater")+iMin);return false;}}else if(!iMin&&iMax){if(sValue>ibpUtils.enParseInt(iMax)){ibpValidation.Err.add(oElement,ibpMsg.get("ibpValidation.enterValueLess")+iMax);return false;}}else if(iMin&&iMax){if(sValue<ibpUtils.enParseInt(iMin)||sValue>ibpUtils.enParseInt(iMax)){ibpValidation.Err.add(oElement,multiLangMsg(iMin,iMax));return false;}}}
if(!bIgnore&&oElement.DATE&&sValue)
{var sFormat=null;if(oElement.DATEFORMAT){sFormat=oElement.DATEFORMAT;}else if(oElement.form&&oElement.form.DATEFORMAT){sFormat=oElement.form.DATEFORMAT;}else{sFormat=ibpValidation.DATEFORMAT;}
if(!isDate(sValue,sFormat)){ibpValidation.Err.add(oElement,ibpMsg.get("ibpValidation.enterDate")
+sFormat.toUpperCase()+"'");return false;}}
var oRegexp=oElement.REGEXP;if(!bIgnore&&oRegexp&&oRegexp.constructor==RegExp&&sValue){if(!isRegExp(sValue,oRegexp)){ibpValidation.Err.add(oElement,ibpMsg.get("ibpValidation.enterPattern"));return false;}}
if(!bIgnore&&oElement.PHONE&&sValue){if(!isPhone(sValue)){ibpValidation.Err.add(oElement,ibpMsg.get("ibpValidation.enterPhone"));return false;}}
if(!bIgnore&&oElement.EMAIL&&sValue){if(!isEmail(sValue)){ibpValidation.Err.add(oElement,ibpMsg.get("ibpValidation.enterEmail"));return false;}}
if(!bIgnore&&oElement.EMAILS&&sValue){if(!isEmails(sValue)){ibpValidation.Err.add(oElement,ibpMsg.get("ibpValidation.enterEmails"));return false;}}
if(!bIgnore&&isSet(oElement.ALLOWEDVALUES)&&sValue){if(!isGivenValues(sValue,oElement.ALLOWEDVALUES)){ibpValidation.Err.add(oElement,ibpMsg.get("ibpValidation.allowedValues").replace("~1~",oElement.ALLOWEDVALUES));return false;}}
if(!bIgnore&&isSet(oElement.FORBIDDENVALUES)&&sValue){if(isGivenValues(sValue,oElement.FORBIDDENVALUES)){ibpValidation.Err.add(oElement,ibpMsg.get("ibpValidation.forbiddenValues").replace("~1~",oElement.FORBIDDENVALUES));return false;}}
if(!bIgnore&&oElement.ALLOWEDFILETYPES&&sValue){if(!isAllowedFileType(sValue,oElement.ALLOWEDFILETYPES)){ibpValidation.Err.add(oElement,ibpMsg.get("ibpValidation.allowedFileTypes").replace("~1~",oElement.ALLOWEDFILETYPES));return false;}}
if(!bIgnore&&oElement.FORBIDDENFILETYPES&&sValue){if(isForbiddenFileType(sValue,oElement.FORBIDDENFILETYPES)){ibpValidation.Err.add(oElement,ibpMsg.get("ibpValidation.forbiddenFileTypes").replace("~1~",oElement.FORBIDDENFILETYPES));return false;}}
if(!bIgnore&&oElement.ZIP&&sValue){if(!isZip(sValue)){ibpValidation.Err.add(oElement,ibpMsg.get("ibpValidation.enterZip"));return false;}}
if(!bIgnore&&oElement.SYSNAME&&sValue){if(!isSysName(sValue)){ibpValidation.Err.add(oElement,ibpMsg.get("ibpValidation.enterSystemName"));return false;}}
if(!bIgnore&&(bRequired||sValue))
{var iMin=oElement.MIN_LEN;var iMax=oElement.MAX_LEN;if(iMin&&!iMax){if(sValue.length<ibpUtils.enParseInt(iMin)){var msg=ibpMsg.get("ibpValidation.enterNoOfCharsGreater")+iMin+"\n"
+ibpMsg.get("ibpValidation.noOfChars").replace("~1~",sValue.length);ibpValidation.Err.add(oElement,msg);return false;}}else if(!iMin&&iMax){if(sValue.length>ibpUtils.enParseInt(iMax)){var msg=ibpMsg.get("ibpValidation.enterNoOfCharsLess")+iMax+"\n"
+ibpMsg.get("ibpValidation.noOfChars").replace("~1~",sValue.length);ibpValidation.Err.add(oElement,msg);return false;}}else if(iMin&&iMax){var msg=ibpMsg.get("ibpValidation.enterNoOfCharsBetween").replace("~1~",iMin).replace("~2~",iMax)+"\n"
+ibpMsg.get("ibpValidation.noOfChars").replace("~1~",sValue.length);if(sValue.length<ibpUtils.enParseInt(iMin)||sValue.length>ibpUtils.enParseInt(iMax)){ibpValidation.Err.add(oElement,msg);return false;}}}
var vAnd=oElement.AND;if(!bIgnore&&vAnd&&sValue){if(vAnd.constructor!=Array)vAnd=vAnd.toString().split(/,/);var i,iFields=vAnd.length;for(i=0;i<iFields;i++){var oNewElement=(vAnd[i].form)?vAnd[i]:oElement.form.elements[vAnd[i].trim()];if(oNewElement)
{var bElNewHidden=(oNewElement.type=="hidden"||oNewElement.style.display=="none"||oNewElement.style.visibility=="hidden");var bElNewReadonly=oNewElement.readOnly;var bElNewDIsabled=oNewElement.disabled;var bElNewInaccessible=bElNewHidden||bElNewReadonly||bElNewDIsabled;var bIgnoreNewEl=((oNewElement.form&&oNewElement.form.IGNORE_READONLY||oNewElement.IGNORE_READONLY)&&bElNewReadonly||(oNewElement.form&&oNewElement.form.IGNORE_DISABLED||oNewElement.IGNORE_DISABLED)&&bElNewDIsabled||(oNewElement.form&&oNewElement.form.IGNORE_HIDDEN||oNewElement.IGNORE_HIDDEN)&&bElNewHidden||(oNewElement.form&&oNewElement.form.IGNORE_INACCESSIBLE||oNewElement.IGNORE_INACCESSIBLE)&&(bElNewInaccessible||!_isAccessible(oNewElement)));if(!getValueOf(oNewElement)&&!bIgnoreNewEl){ibpValidation.Err.add(oNewElement,ibpMsg.get("ibpValidation.enterValue"));return false;}}}}
var vOr=typeof oElement.OR=="object";if(!bIgnore&&vOr&&!sValue){vOr=oElement.OR["fields"];if(vOr){if(vOr.constructor!=Array)
vOr=vOr.toString().split(/,/);var i,iFields=vOr.length;var bValue=false;for(i=0;i<iFields;i++){var oNewElement=(vOr[i].form)?vOr[i]:oElement.form.elements[vOr[i].trim()];if(oNewElement)
bValue|=!!getValueOf(oNewElement);}
if(!bValue){ibpValidation.Err.add(oElement,oElement.OR["msg"]?oElement.OR["msg"]:ibpMsg.get("ibpValidation.enterValue"));return false;}}}
var vEqual=typeof oElement.EQUAL=="object";if(!bIgnore&&vEqual&&sValue)
{vEqual=oElement.EQUAL["fields"];if(vEqual)
{if(vEqual.constructor!=Array)vEqual=vEqual.toString().split(/,/);var i,iFields=vEqual.length;for(i=0;i<iFields;i++)
{var oNewElement=(vEqual[i].form)?vEqual[i]:oElement.form.elements[vEqual[i].trim()];if(oNewElement)
{var bElNewHidden=(oNewElement.type=="hidden"||oNewElement.style.display=="none"||oNewElement.style.visibility=="hidden");var bElNewReadonly=oNewElement.readOnly;var bElNewDIsabled=oNewElement.disabled;var bElNewInaccessible=bElNewHidden||bElNewReadonly||bElNewDIsabled;var bIgnoreNewEl=((oNewElement.form&&oNewElement.form.IGNORE_READONLY||oNewElement.IGNORE_READONLY)&&bElNewReadonly||(oNewElement.form&&oNewElement.form.IGNORE_DISABLED||oNewElement.IGNORE_DISABLED)&&bElNewDIsabled||(oNewElement.form&&oNewElement.form.IGNORE_HIDDEN||oNewElement.IGNORE_HIDDEN)&&bElNewHidden||(oNewElement.form&&oNewElement.form.IGNORE_INACCESSIBLE||oNewElement.IGNORE_INACCESSIBLE)&&(bElNewInaccessible||!_isAccessible(oNewElement)));if(getValueOf(oNewElement)!=sValue&&!bIgnoreNewEl)
{ibpValidation.Err.add(oElement,oElement.EQUAL["msg"]?oElement.EQUAL["msg"]:ibpMsg.get("ibpValidation.equalVals").replace('~1~',oNewElement.NAME));return false;}}}}}
var vNotEqual=typeof oElement.NOT_EQUAL=="object";if(!bIgnore&&vNotEqual&&sValue)
{vNotEqual=oElement.NOT_EQUAL["fields"];if(vNotEqual)
{if(vNotEqual.constructor!=Array)
{vNotEqual=vNotEqual.toString().split(/,/);}
var i,iFields=vNotEqual.length;var aVals=new Array();aVals[0]=sValue;for(i=0;i<iFields;i++)
{var oNewElement=(vNotEqual[i].form)?vNotEqual[i]:oElement.form.elements[vNotEqual[i].trim()];if(oNewElement)
{var bElNewHidden=(oNewElement.type=="hidden"||oNewElement.style.display=="none"||oNewElement.style.visibility=="hidden");var bElNewReadonly=oNewElement.readOnly;var bElNewDIsabled=oNewElement.disabled;var bElNewInaccessible=bElNewHidden||bElNewReadonly||bElNewDIsabled;var bIgnoreNewEl=((oNewElement.form&&oNewElement.form.IGNORE_READONLY||oNewElement.IGNORE_READONLY)&&bElNewReadonly||(oNewElement.form&&oNewElement.form.IGNORE_DISABLED||oNewElement.IGNORE_DISABLED)&&bElNewDIsabled||(oNewElement.form&&oNewElement.form.IGNORE_HIDDEN||oNewElement.IGNORE_HIDDEN)&&bElNewHidden||(oNewElement.form&&oNewElement.form.IGNORE_INACCESSIBLE||oNewElement.IGNORE_INACCESSIBLE)&&(bElNewInaccessible||!_isAccessible(oNewElement)));if(ibpUtils.isInArray(getValueOf(oNewElement),aVals)&&!bIgnoreNewEl)
{ibpValidation.Err.add(oElement,oElement.NOT_EQUAL["msg"]?oElement.NOT_EQUAL["msg"]:ibpMsg.get("ibpValidation.notEqualVals").replace('~1~',oNewElement.NAME));aVals=null;return false;}
if(!bIgnoreNewEl)
aVals[aVals.length]=getValueOf(oNewElement);}}}}
if(typeof oElement.onvalidate=="function"&&oElement.onvalidate()==false)return false;return true;}
var validateForm=function(oForm,bIgnore)
{if(bIgnore)return true;var frm=oForm;if(!(oForm.constructor==Object||typeof oForm=="object"))
{frm=document.forms[oForm];}
if(!frm)
{oForm=document.getElementById(oForm);}
else oForm=frm;if(!oForm||!(oForm.constructor==Object||typeof oForm=="object"))return false;if(typeof oForm.onbeforevalidate=="function"&&oForm.onbeforevalidate()==false)
return false;var i,oElement,iElements=oForm.elements.length;for(i=0;i<iElements;i++){oElement=oForm.elements[i];if(!_validateControl(oElement)){ibpValidation.Err.raise();return false;}}
if(typeof oForm.onaftervalidate=="function"&&oForm.onaftervalidate()==false)
return false;if(typeof oForm.fnSubmit=="function"&&oForm.fnSubmit()==false)return false;return true;}
var setup=function(oForm){if(!oForm){var i,iForms=document.forms.length;for(i=0;i<iForms;i++){oForm=document.forms[i];_setupForm(oForm);}}else{_setupForm(oForm);}}
var _setupForm=function(oForm){if(!oForm.bProcessed){oForm.fnSubmit=oForm.onsubmit;oForm.onsubmit=function(){return validateForm(this);}
oForm.bProcessed=true;}}
if("".replace&&window.RegExp){String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"");}
this.isDate=isDate;this.hasDate=hasDate;this.isNotEmpty=isNotEmpty;this.hasNotEmpty=hasNotEmpty;this.isNum=isNum;this.hasNum=hasNum;this.isFloat=isFloat;this.hasFloat=hasFloat;this.isInteger=isInteger;this.hasInteger=hasInteger;this.isRegExp=isRegExp;this.hasRegExp=hasRegExp;this.isGivenValues=isGivenValues;this.hasGivenValue=hasGivenValue;this.isAllowedFileType=isAllowedFileType;this.hasAllowedFileType=hasAllowedFileType;this.isForbiddenFileType=isForbiddenFileType;this.hasForbiddenFileType=hasAllowedFileType;this.isEmail=isEmail;this.hasEmail=hasEmail;this.isEmails=isEmails;this.hasEmails=hasEmails;this.isPhone=isPhone;this.hasPhone=hasPhone;this.isZip=isZip;this.hasZip=hasZip;this.isSysName=isSysName;this.hasSysName=hasSysName;this.fixSysName=fixSysName;this.getValueOf=getValueOf;this.validateControl=validateControl;this.validateControlsArray=validateControlsArray;this.validateForm=validateForm;this.setupForms=setup;this.Err=new Err;this.DATEFORMAT="MM/DD/YYYY";}}
if(!window.ibpValidation)window.ibpValidation=new ibpValidationConstructor();
