var Class={create:function(){return function(){this.initialize.apply(this,arguments)
}
}};
function getValue(A){return document.getElementById(A).value
}function getElement(A){return document.getElementById(s)
}var Validate=Class.create();
Validate.prototype={initialize:function(){this.error_array=[];
this.rules_array=[];
this.e=true;
this.toggleEl=false
},isEqual:function(A,B){if(A==B){return true
}else{return false
}},hasValidChars:function(C,A,B){function D(E){return E.replace(new RegExp("([\\\\-])","g"),"\\$1")
}return new RegExp("^["+D(A)+"]+$",(!B?"i":"")).test(C)
},isSimpleIP:function(A){ipRegExp=/^(([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+)\.([0-2]*[0-9]+[0-9]+))$/;
return ipRegExp.test(A)
},isAlphaLatin:function(A){alphaRegExp=/^[0-9a-z]+$/i;
return alphaRegExp.test(A)
},isNotEmpty:function(A){return/\S/.test(A)
},isEmpty:function(A){return !/\S/.test(A)
},isIntegerInRange:function(D,A,C){var B=Number(D);
if(isNaN(B)){return false
}if(B!=Math.round(B)){return false
}return(B>=A&&B<=C)
},isNum:function(A){numRegExp=/^[0-9]+$/;
return numRegExp.test(A)
},isEMailAddr:function(A){emailRegExp=/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.([a-z]){2,4})$/;
return emailRegExp.test(A)
},isZipCode:function(A,B){if(!A){return false
}if(!B){format="US"
}switch(B){case"US":zpcRegExp=/^\d{5}$|^\d{5}-\d{4}$/;
break;
case"MA":zpcRegExp=/^\d{5}$/;
break;
case"CA":zpcRegExp=/^[A-Z]\d[A-Z] \d[A-Z]\d$/;
break;
case"DU":zpcRegExp=/^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/;
break;
case"FR":zpcRegExp=/^\d{5}$/;
break;
case"Monaco":zpcRegExp=/^(MC-)\d{5}$/;
break
}return zpcRegExp.test(A)
},isDate:function(A,B){if(!A){return false
}if(!B){B="FR"
}switch(B){case"FR":RegExpformat=/^(([0-2]\d|[3][0-1])\/([0]\d|[1][0-2])\/([2][0]|[1][9])\d{2})$/;
break;
case"US":RegExpformat=/^([2][0]|[1][9])\d{2}\-([0]\d|[1][0-2])\-([0-2]\d|[3][0-1])$/;
break;
case"SHORTFR":RegExpformat=/^([0-2]\d|[3][0-1])\/([0]\d|[1][0-2])\/\d{2}$/;
break;
case"SHORTUS":RegExpformat=/^\d{2}\-([0]\d|[1][0-2])\-([0-2]\d|[3][0-1])$/;
break;
case"dd MMM yyyy":RegExpformat=/^([0-2]\d|[3][0-1])\s(Jan(vier)?|F√©v(rier)?|Mars|Avr(il)?|Mai|Juin|Juil(let)?|Aout|Sep(tembre)?|Oct(obre)?|Nov(ember)?|Dec(embre)?)\s([2][0]|[1][19])\d{2}$/;
break;
case"MMM dd, yyyy":RegExpformat=/^(J(anuary|u(ne|ly))|February|Ma(rch|y)|A(pril|ugust)|(((Sept|Nov|Dec)em)|Octo)ber)\s([0-2]\d|[3][0-1])\,\s([2][0]|[1][9])\d{2}$/;
break
}return RegExpformat.test(A)
},isMD5:function(A){if(!A){return false
}md5RegExp=/^[a-f0-9]{32}$/;
return md5RegExp.test(A)
},isURL:function(A){if(!A){return false
}A=A.toLowerCase();
urlRegExp=/^(((ht|f)tp(s?))\:\/\/)([0-9a-zA-Z\-]+\.)+[a-zA-Z]{2,6}(\:[0-9]+)?(\/\S*)?$/;
return urlRegExp.test(A)
},isGuid:function(A){if(!A){return false
}GuidRegExp=/^[{|\(]?[0-9a-fA-F]{8}[-]?([0-9a-fA-F]{4}[-]?){3}[0-9a-fA-F]{12}[\)|}]?$/;
return GuidRegExp.test(A)
},isISBN:function(A){if(!A){return false
}ISBNRegExp=/ISBN\x20(?=.{13}$)\d{1,5}([- ])\d{1,7}\1\d{1,6}\1(\d|X)$/;
return ISBNRegExp.test(A)
},isSSN:function(A){if(!A){return false
}ssnRegExp=/^\d{3}-\d{2}-\d{4}$/;
return ssnRegExp.test(A)
},isDecimal:function(A){if(!A){return false
}decimalRegExp=/^-?(0|[1-9]{1}\d{0,})(\.(\d{1}\d{0,}))?$/;
return decimalRegExp.test(A)
},isplatform:function(A){if(!A){return false
}var B;
winRegExp=/\win/i;
if(winRegExp.test(window.navigator.platform)){B="win"
}macRegExp=/\mac/i;
if(macRegExp.test(window.navigator.platform)){B="mac"
}nixRegExp=/\unix|\linux|\sun/i;
if(nixRegExp.test(window.navigator.platform)){B="nix"
}if(A==B){return true
}else{return false
}},isNumOrEmpty:function(A){numRegExp=/^[0-9]+$/;
if(numRegExp.test(A)||!/\S/.test(A)||A==""){return true
}else{return false
}},getValue:function(A){document.getElementById(A).value
},addRules:function(A){this.rules_array.push(A)
},check:function(){this.error_array=[];
this.e=true;
for(var A=0;
A<this.rules_array.length;
A++){this.toggleEl=false;
switch(this.rules_array[A].option){case"NumberOrEmpty":if(!this.isNumOrEmpty(getValue(this.rules_array[A].id))){this.error_array.push(this.rules_array[A].error);
this.e=false;
this.toggleEl=true
}break;
case"ValidChars":if(!this.hasValidChars(getValue(this.rules_array[A].id),this.rules_array[A].chars,false)){this.error_array.push(this.rules_array[A].error);
this.e=false;
this.toggleEl=true
}break;
case"AlphaLatin":if(this.isAlphaLatin(getValue(this.rules_array[A].id))){this.error_array.push(this.rules_array[A].error);
this.e=false;
this.toggleEl=true
}break;
case"required":if(this.isEmpty(getValue(this.rules_array[A].id))){this.error_array.push(this.rules_array[A].error);
this.e=false;
this.toggleEl=true
}break;
case"integerRange":if(!this.isIntegerInRange(getValue(this.rules_array[A].id),this.rules_array[A].Min,this.rules_array[A].Max)){this.error_array.push(this.rules_array[A].error);
this.e=false;
this.toggleEl=true
}break;
case"Number":if(!this.isNum(getValue(this.rules_array[A].id))){this.error_array.push(this.rules_array[A].error);
this.e=false;
this.toggleEl=true
}break;
case"email":if(!this.isEMailAddr(getValue(this.rules_array[A].id))){this.error_array.push(this.rules_array[A].error);
this.e=false;
this.toggleEl=true
}break;
case"zipCode":if(!this.isZipCode(getValue(this.rules_array[A].id),this.rules_array[A].country)){this.error_array.push(this.rules_array[A].error);
this.e=false;
this.toggleEl=true
}break;
case"date":if(!this.isDate(getValue(this.rules_array[A].id),this.rules_array[A].format)){this.error_array.push(this.rules_array[A].error);
this.e=false;
this.toggleEl=true
}break;
case"url":if(!this.isURL(getValue(this.rules_array[A].id))){this.error_array.push(this.rules_array[A].error);
this.e=false;
this.toggleEl=true
}break;
case"Decimal":if(!this.isDecimal(getValue(this.rules_array[A].id))){this.error_array.push(this.rules_array[A].error);
this.e=false;
this.toggleEl=true
}break;
case"isEqual":if(!this.isEqual(getValue(this.rules_array[A].id),getValue(this.rules_array[A].to))){this.error_array.push(this.rules_array[A].error);
this.e=false;
this.toggleEl=true
}break
}if(this.toggleEl){$(this.rules_array[A].error).removeClass("no-display");
if(navigator.appName.toString()=="Microsoft Internet Explorer"){$(this.rules_array[A].id).attachEvent("onfocus",function(){if(event.srcElement.id=="KNearest"){idErr="KNearest"
}if(event.srcElement.id=="range"){idErr="range"
}if(event.srcElement.value.length==0){$(idErr+"Error").removeClass("no-display")
}else{$(idErr+"Error").addClass("no-display")
}})
}else{$(this.rules_array[A].id).addEventListener("focus",function(B){if(this.value.length==0){$(this.id+"Error").removeClass("no-display")
}else{$(this.id+"Error").addClass("no-display")
}},true)
}}}},Apply:function(A){this.check();
if(this.e){return true
}else{return false
}}};