﻿var Page_ValidationVer="125";var Page_IsValid=true;var Page_BlockSubmit=false;var Page_InvalidControlToBeFocused=null;function ValidatorUpdateDisplay(A){if(typeof(A.display)=="string"){if(A.display=="None"){return}if(A.display=="Dynamic"){A.style.display=A.isvalid?"none":"inline";return}}if((navigator.userAgent.indexOf("Mac")>-1)&&(navigator.userAgent.indexOf("MSIE")>-1)){A.style.display="inline"}A.style.visibility=A.isvalid?"hidden":"visible"}function ValidatorUpdateIsValid(){Page_IsValid=AllValidatorsValid(Page_Validators)}function AllValidatorsValid(A){if((typeof(A)!="undefined")&&(A!=null)){var B;for(B=0;B<A.length;B++){if(!A[B].isvalid){return false}}}return true}function ValidatorHookupControlID(A,B){if(typeof(A)!="string"){return}var C=document.getElementById(A);if((typeof(C)!="undefined")&&(C!=null)){ValidatorHookupControl(C,B)}else{B.isvalid=true;B.enabled=false}}function ValidatorHookupControl(D,B){if(typeof(D.tagName)!="string"){return}if(D.tagName!="INPUT"&&D.tagName!="TEXTAREA"&&D.tagName!="SELECT"){var C;for(C=0;C<D.childNodes.length;C++){ValidatorHookupControl(D.childNodes[C],B)}return}else{if(typeof(D.Validators)=="undefined"){D.Validators=new Array;var A;if(D.type=="radio"){A="onclick"}else{A="onchange";if(typeof(B.focusOnError)=="string"&&B.focusOnError=="t"){ValidatorHookupEvent(D,"onblur","ValidatedControlOnBlur(event); ")}}ValidatorHookupEvent(D,A,"ValidatorOnChange(event); ");if(D.type=="text"||D.type=="password"||D.type=="file"){ValidatorHookupEvent(D,"onkeypress","if (!ValidatedTextBoxOnKeyPress(event)) { event.cancelBubble = true; if (event.stopPropagation) event.stopPropagation(); return false; } ")}}D.Validators[D.Validators.length]=B}}function ValidatorHookupEvent(control,eventType,functionPrefix){var ev;eval("ev = control."+eventType+";");if(typeof(ev)=="function"){ev=ev.toString();ev=ev.substring(ev.indexOf("{")+1,ev.lastIndexOf("}"))}else{ev=""}var func;if(navigator.appName.toLowerCase().indexOf("explorer")>-1){func=new Function(functionPrefix+" "+ev)}else{func=new Function("event",functionPrefix+" "+ev)}eval("control."+eventType+" = func;")}function ValidatorGetValue(A){var B;B=document.getElementById(A);if(typeof(B.value)=="string"){return B.value}return ValidatorGetValueRecursive(B)}function ValidatorGetValueRecursive(B){if(typeof(B.value)=="string"&&(B.type!="radio"||B.checked==true)){return B.value}var C,A;for(C=0;C<B.childNodes.length;C++){A=ValidatorGetValueRecursive(B.childNodes[C]);if(A!=""){return A}}return""}function Page_ClientValidate(B){Page_InvalidControlToBeFocused=null;if(typeof(Page_Validators)=="undefined"){return true}var A;for(A=0;A<Page_Validators.length;A++){ValidatorValidate(Page_Validators[A],B,null)}ValidatorUpdateIsValid();ValidationSummaryOnSubmit(B);Page_BlockSubmit=!Page_IsValid;return Page_IsValid}function ValidatorCommonOnSubmit(){Page_InvalidControlToBeFocused=null;var A=!Page_BlockSubmit;if((typeof(window.event)!="undefined")&&(window.event!=null)){window.event.returnValue=A}Page_BlockSubmit=false;return A}function ValidatorEnable(A,B){A.enabled=(B!=false);ValidatorValidate(A);ValidatorUpdateIsValid()}function ValidatorOnChange(D){if(!D){D=window.event}Page_InvalidControlToBeFocused=null;var B;if((typeof(D.srcElement)!="undefined")&&(D.srcElement!=null)){B=D.srcElement}else{B=D.target}var A;if(typeof(B.Validators)!="undefined"){A=B.Validators}else{if(B.tagName.toLowerCase()=="label"){B=document.getElementById(B.htmlFor);A=B.Validators}}var C;for(C=0;C<A.length;C++){ValidatorValidate(A[C],null,D)}ValidatorUpdateIsValid()}function ValidatedTextBoxOnKeyPress(B){if(B.keyCode==13){ValidatorOnChange(B);var A;if((typeof(B.srcElement)!="undefined")&&(B.srcElement!=null)){A=B.srcElement.Validators}else{A=B.target.Validators}return AllValidatorsValid(A)}return true}function ValidatedControlOnBlur(A){var B;if((typeof(A.srcElement)!="undefined")&&(A.srcElement!=null)){B=A.srcElement}else{B=A.target}if((typeof(B)!="undefined")&&(B!=null)&&(Page_InvalidControlToBeFocused==B)){B.focus();Page_InvalidControlToBeFocused=null}}function ValidatorValidate(A,B,C){A.isvalid=true;if((typeof(A.enabled)=="undefined"||A.enabled!=false)&&IsValidationGroupMatch(A,B)){if(typeof(A.evaluationfunction)=="function"){A.isvalid=A.evaluationfunction(A);if(!A.isvalid&&Page_InvalidControlToBeFocused==null&&typeof(A.focusOnError)=="string"&&A.focusOnError=="t"){ValidatorSetFocus(A,C)}}}ValidatorUpdateDisplay(A)}function ValidatorSetFocus(A,B){var C;if(typeof(A.controlhookup)=="string"){var D;if((typeof(B)!="undefined")&&(B!=null)){if((typeof(B.srcElement)!="undefined")&&(B.srcElement!=null)){D=B.srcElement}else{D=B.target}}if((typeof(D)!="undefined")&&(D!=null)&&(typeof(D.id)=="string")&&(D.id==A.controlhookup)){C=D}}if((typeof(C)=="undefined")||(C==null)){C=document.getElementById(A.controltovalidate)}if((typeof(C)!="undefined")&&(C!=null)&&(C.tagName.toLowerCase()!="table"||(typeof(B)=="undefined")||(B==null))&&((C.tagName.toLowerCase()!="input")||(C.type.toLowerCase()!="hidden"))&&(typeof(C.disabled)=="undefined"||C.disabled==null||C.disabled==false)&&(typeof(C.visible)=="undefined"||C.visible==null||C.visible!=false)&&(IsInVisibleContainer(C))){if(C.tagName.toLowerCase()=="table"&&(typeof(__nonMSDOMBrowser)=="undefined"||__nonMSDOMBrowser)){var E=C.getElementsByTagName("input");var F=E[E.length-1];if(F!=null){C=F}}if(typeof(C.focus)!="undefined"&&C.focus!=null){C.focus();Page_InvalidControlToBeFocused=C}}}function IsInVisibleContainer(A){if(typeof(A.style)!="undefined"&&((typeof(A.style.display)!="undefined"&&A.style.display=="none")||(typeof(A.style.visibility)!="undefined"&&A.style.visibility=="hidden"))){return false}else{if(typeof(A.parentNode)!="undefined"&&A.parentNode!=null&&A.parentNode!=A){return IsInVisibleContainer(A.parentNode)}}return true}function IsValidationGroupMatch(B,C){if((typeof(C)=="undefined")||(C==null)){return true}var A="";if(typeof(B.validationGroup)=="string"){A=B.validationGroup}return(A==C)}function ValidatorOnLoad(){if(typeof(Page_Validators)=="undefined"){return}var i,val;for(i=0;i<Page_Validators.length;i++){val=Page_Validators[i];if(typeof(val.evaluationfunction)=="string"){eval("val.evaluationfunction = "+val.evaluationfunction+";")}if(typeof(val.isvalid)=="string"){if(val.isvalid=="False"){val.isvalid=false;Page_IsValid=false}else{val.isvalid=true}}else{val.isvalid=true}if(typeof(val.enabled)=="string"){val.enabled=(val.enabled!="False")}if(typeof(val.controltovalidate)=="string"){ValidatorHookupControlID(val.controltovalidate,val)}if(typeof(val.controlhookup)=="string"){ValidatorHookupControlID(val.controlhookup,val)}}Page_ValidationActive=true}function ValidatorConvert(O,J,E){function C(T){var U=E.cutoffyear%100;var S=E.cutoffyear-U;return((T>U)?(S-100+T):(S+T))}var K,A,D,M;if(J=="Integer"){M=/^\s*[-\+]?\d+\s*$/;if(O.match(M)==null){return null}K=parseInt(O,10);return(isNaN(K)?null:K)}else{if(J=="Double"){M=new RegExp("^\\s*([-\\+])?(\\d*)\\"+E.decimalchar+"?(\\d*)\\s*$");D=O.match(M);if(D==null){return null}if(D[2].length==0&&D[3].length==0){return null}A=(D[1]!=null?D[1]:"")+(D[2].length>0?D[2]:"0")+(D[3].length>0?"."+D[3]:"");K=parseFloat(A);return(isNaN(K)?null:K)}else{if(J=="Currency"){var B=(E.digits>0);var I,L;var N=parseInt(E.groupsize,10);if(!isNaN(N)&&N>0){I="{1,"+N+"}";L="{"+N+"}"}else{I=L="+"}M=new RegExp("^\\s*([-\\+])?((\\d"+I+"(\\"+E.groupchar+"\\d"+L+")+)|\\d*)"+(B?"\\"+E.decimalchar+"?(\\d{0,"+E.digits+"})":"")+"\\s*$");D=O.match(M);if(D==null){return null}if(D[2].length==0&&B&&D[5].length==0){return null}A=(D[1]!=null?D[1]:"")+D[2].replace(new RegExp("(\\"+E.groupchar+")","g"),"")+((B&&D[5].length>0)?"."+D[5]:"");K=parseFloat(A);return(isNaN(K)?null:K)}else{if(J=="Date"){var F=new RegExp("^\\s*((\\d{4})|(\\d{2}))([-/]|\\. ?)(\\d{1,2})\\4(\\d{1,2})\\s*$");D=O.match(F);var R,G,H;if(D!=null&&(D[2].length==4||E.dateorder=="ymd")){R=D[6];G=D[5];H=(D[2].length==4)?D[2]:C(parseInt(D[3],10))}else{if(E.dateorder=="ymd"){return null}var Q=new RegExp("^\\s*(\\d{1,2})([-/]|\\. ?)(\\d{1,2})\\2((\\d{4})|(\\d{2}))\\s*$");D=O.match(Q);if(D==null){return null}if(E.dateorder=="mdy"){R=D[3];G=D[1]}else{R=D[1];G=D[3]}H=(D[5].length==4)?D[5]:C(parseInt(D[6],10))}G-=1;var P=new Date(H,G,R);if(H<100){P.setFullYear(H)}return(typeof(P)=="object"&&H==P.getFullYear()&&G==P.getMonth()&&R==P.getDate())?P.valueOf():null}else{return O.toString()}}}}}function ValidatorCompare(B,A,F,D){var G=D.type;var C,E;if((C=ValidatorConvert(B,G,D))==null){return false}if(F=="DataTypeCheck"){return true}if((E=ValidatorConvert(A,G,D))==null){return true}switch(F){case"NotEqual":return(C!=E);case"GreaterThan":return(C>E);case"GreaterThanEqual":return(C>=E);case"LessThan":return(C<E);case"LessThanEqual":return(C<=E);default:return(C==E)}}function CompareValidatorEvaluateIsValid(B){var A=ValidatorGetValue(B.controltovalidate);if(ValidatorTrim(A).length==0){return true}var D="";if((typeof(B.controltocompare)!="string")||(typeof(document.getElementById(B.controltocompare))=="undefined")||(null==document.getElementById(B.controltocompare))){if(typeof(B.valuetocompare)=="string"){D=B.valuetocompare}}else{D=ValidatorGetValue(B.controltocompare)}var C="Equal";if(typeof(B.operator)=="string"){C=B.operator}return ValidatorCompare(A,D,C,B)}function CustomValidatorEvaluateIsValid(val){var value="";if(typeof(val.controltovalidate)=="string"){value=ValidatorGetValue(val.controltovalidate);if((ValidatorTrim(value).length==0)&&((typeof(val.validateemptytext)!="string")||(val.validateemptytext!="true"))){return true}}var args={Value:value,IsValid:true};if(typeof(val.clientvalidationfunction)=="string"){eval(val.clientvalidationfunction+"(val, args) ;")}return args.IsValid}function RegularExpressionValidatorEvaluateIsValid(B){var D=ValidatorGetValue(B.controltovalidate);if(ValidatorTrim(D).length==0){return true}var A=new RegExp(B.validationexpression);var C=A.exec(D);return(C!=null&&D==C[0])}function ValidatorTrim(A){var B=A.match(/^\s*(\S+(\s+\S+)*)\s*$/);return(B==null)?"":B[1]}function RequiredFieldValidatorEvaluateIsValid(A){return(ValidatorTrim(ValidatorGetValue(A.controltovalidate))!=ValidatorTrim(A.initialvalue))}function RangeValidatorEvaluateIsValid(A){var B=ValidatorGetValue(A.controltovalidate);if(ValidatorTrim(B).length==0){return true}return(ValidatorCompare(B,A.minimumvalue,"GreaterThanEqual",A)&&ValidatorCompare(B,A.maximumvalue,"LessThanEqual",A))}function ValidationSummaryOnSubmit(F){if(typeof(Page_ValidationSummaries)=="undefined"){return}var A,B,E;for(B=0;B<Page_ValidationSummaries.length;B++){A=Page_ValidationSummaries[B];A.style.display="none";if(!Page_IsValid&&IsValidationGroupMatch(A,F)){var D;if(A.showsummary!="False"){A.style.display="";if(typeof(A.displaymode)!="string"){A.displaymode="BulletList"}switch(A.displaymode){case"List":headerSep="<br>";first="";pre="";post="<br>";end="";break;case"BulletList":default:headerSep="";first="<ul>";pre="<li>";post="</li>";end="</ul>";break;case"SingleParagraph":headerSep=" ";first="";pre="";post=" ";end="<br>";break}E="";if(typeof(A.headertext)=="string"){E+=A.headertext+headerSep}E+=first;for(D=0;D<Page_Validators.length;D++){if(!Page_Validators[D].isvalid&&typeof(Page_Validators[D].errormessage)=="string"){E+=pre+Page_Validators[D].errormessage+post}}E+=end;A.innerHTML=E;window.scrollTo(0,0)}if(A.showmessagebox=="True"){E="";if(typeof(A.headertext)=="string"){E+=A.headertext+"\r\n"}var C=Page_Validators.length-1;for(D=0;D<=C;D++){if(!Page_Validators[D].isvalid&&typeof(Page_Validators[D].errormessage)=="string"){switch(A.displaymode){case"List":E+=Page_Validators[D].errormessage;if(D<C){E+="\r\n"}break;case"BulletList":default:E+="- "+Page_Validators[D].errormessage;if(D<C){E+="\r\n"}break;case"SingleParagraph":E+=Page_Validators[D].errormessage+" ";break}}}alert(E)}}}};