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