﻿var Page_ValidationVer="125",Page_IsValid=true,Page_BlockSubmit=false,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(c,b){if(typeof c!="string")return;var a=document.getElementById(c);if(typeof a!="undefined"&&a!=null)ValidatorHookupControl(a,b);else{b.isvalid=true;b.enabled=false}}function ValidatorHookupControl(a,b){if(typeof a.tagName!="string")return;if(a.tagName!="INPUT"&&a.tagName!="TEXTAREA"&&a.tagName!="SELECT"){var c;for(c=0;c<a.childNodes.length;c++)ValidatorHookupControl(a.childNodes[c],b);return}else{if(typeof a.Validators=="undefined"){a.Validators=[];var d;if(a.type=="radio")d="onclick";else{d="onchange";if(typeof b.focusOnError=="string"&&b.focusOnError=="t")ValidatorHookupEvent(a,"onblur","ValidatedControlOnBlur(event); ")}ValidatorHookupEvent(a,d,"ValidatorOnChange(event); ");if(a.type=="text"||a.type=="password"||a.type=="file")ValidatorHookupEvent(a,"onkeypress","if (!ValidatedTextBoxOnKeyPress(event)) { event.cancelBubble = true; if (event.stopPropagation) event.stopPropagation(); return false; } ")}a.Validators[a.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(b){var a;a=document.getElementById(b);if(typeof a.value=="string")return a.value;return ValidatorGetValueRecursive(a)}function ValidatorGetValueRecursive(a){if(typeof a.value=="string"&&(a.type!="radio"||a.checked==true))return a.value;var b,c;for(b=0;b<a.childNodes.length;b++){c=ValidatorGetValueRecursive(a.childNodes[b]);if(c!="")return c}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(b){if(!b)b=window.event;Page_InvalidControlToBeFocused=null;var a;if(typeof b.srcElement!="undefined"&&b.srcElement!=null)a=b.srcElement;else a=b.target;var c;if(typeof a.Validators!="undefined")c=a.Validators;else if(a.tagName.toLowerCase()=="label"){a=document.getElementById(a.htmlFor);c=a.Validators}var d;for(d=0;d<c.length;d++)ValidatorValidate(c[d],null,b);ValidatorUpdateIsValid()}function ValidatedTextBoxOnKeyPress(a){if(a.keyCode==13){ValidatorOnChange(a);var b;if(typeof a.srcElement!="undefined"&&a.srcElement!=null)b=a.srcElement.Validators;else b=a.target.Validators;return AllValidatorsValid(b)}return true}function ValidatedControlOnBlur(b){var a;if(typeof b.srcElement!="undefined"&&b.srcElement!=null)a=b.srcElement;else a=b.target;if(typeof a!="undefined"&&a!=null&&Page_InvalidControlToBeFocused==a){a.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(d,b){var a;if(typeof d.controlhookup=="string"){var c;if(typeof b!="undefined"&&b!=null)if(typeof b.srcElement!="undefined"&&b.srcElement!=null)c=b.srcElement;else c=b.target;if(typeof c!="undefined"&&c!=null&&typeof c.id=="string"&&c.id==d.controlhookup)a=c}if(typeof a=="undefined"||a==null)a=document.getElementById(d.controltovalidate);if(typeof a!="undefined"&&a!=null&&(a.tagName.toLowerCase()!="table"||typeof b=="undefined"||b==null)&&(a.tagName.toLowerCase()!="input"||a.type.toLowerCase()!="hidden")&&(typeof a.disabled=="undefined"||a.disabled==null||a.disabled==false)&&(typeof a.visible=="undefined"||a.visible==null||a.visible!=false)&&IsInVisibleContainer(a)){if(a.tagName.toLowerCase()=="table"&&(typeof __nonMSDOMBrowser=="undefined"||__nonMSDOMBrowser)){var f=a.getElementsByTagName("input"),e=f[f.length-1];if(e!=null)a=e}if(typeof a.focus!="undefined"&&a.focus!=null){a.focus();Page_InvalidControlToBeFocused=a}}}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(c,a){if(typeof a=="undefined"||a==null)return true;var b="";if(typeof c.validationGroup=="string")b=c.validationGroup;return b==a}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(d,l,b){function p(a){var c=b.cutoffyear%100,d=b.cutoffyear-c;return a>c?d-100+a:d+a}var c,k,a,h;if(l=="Integer"){h=/^\s*[-\+]?\d+\s*$/;if(d.match(h)==null)return null;c=parseInt(d,10);return isNaN(c)?null:c}else if(l=="Double"){h=new RegExp("^\\s*([-\\+])?(\\d*)\\"+b.decimalchar+"?(\\d*)\\s*$");a=d.match(h);if(a==null)return null;if(a[2].length==0&&a[3].length==0)return null;k=(a[1]!=null?a[1]:"")+(a[2].length>0?a[2]:"0")+(a[3].length>0?"."+a[3]:"");c=parseFloat(k);return isNaN(c)?null:c}else if(l=="Currency"){var o=b.digits>0,n,m,j=parseInt(b.groupsize,10);if(!isNaN(j)&&j>0){n="{1,"+j+"}";m="{"+j+"}"}else n=m="+";h=new RegExp("^\\s*([-\\+])?((\\d"+n+"(\\"+b.groupchar+"\\d"+m+")+)|\\d*)"+(o?"\\"+b.decimalchar+"?(\\d{0,"+b.digits+"})":"")+"\\s*$");a=d.match(h);if(a==null)return null;if(a[2].length==0&&o&&a[5].length==0)return null;k=(a[1]!=null?a[1]:"")+a[2].replace(new RegExp("(\\"+b.groupchar+")","g"),"")+(o&&a[5].length>0?"."+a[5]:"");c=parseFloat(k);return isNaN(c)?null:c}else if(l=="Date"){var q=new RegExp("^\\s*((\\d{4})|(\\d{2}))([-/]|\\. ?)(\\d{1,2})\\4(\\d{1,2})\\s*$");a=d.match(q);var i,e,g;if(a!=null&&(a[2].length==4||b.dateorder=="ymd")){i=a[6];e=a[5];g=a[2].length==4?a[2]:p(parseInt(a[3],10))}else{if(b.dateorder=="ymd")return null;var r=new RegExp("^\\s*(\\d{1,2})([-/]|\\. ?)(\\d{1,2})\\2((\\d{4})|(\\d{2}))\\s*$");a=d.match(r);if(a==null)return null;if(b.dateorder=="mdy"){i=a[3];e=a[1]}else{i=a[1];e=a[3]}g=a[5].length==4?a[5]:p(parseInt(a[6],10))}e-=1;var f=new Date(g,e,i);if(g<100)f.setFullYear(g);return typeof f=="object"&&g==f.getFullYear()&&e==f.getMonth()&&i==f.getDate()?f.valueOf():null}else return d.toString()}function ValidatorCompare(f,g,e,c){var d=c.type,a,b;if((a=ValidatorConvert(f,d,c))==null)return false;if(e=="DataTypeCheck")return true;if((b=ValidatorConvert(g,d,c))==null)return true;switch(e){case "NotEqual":return a!=b;case "GreaterThan":return a>b;case "GreaterThanEqual":return a>=b;case "LessThan":return a<b;case "LessThanEqual":return a<=b;default:return a==b}}function CompareValidatorEvaluateIsValid(a){var d=ValidatorGetValue(a.controltovalidate);if(ValidatorTrim(d).length==0)return true;var b="";if(typeof a.controltocompare!="string"||typeof document.getElementById(a.controltocompare)=="undefined"||null==document.getElementById(a.controltocompare)){if(typeof a.valuetocompare=="string")b=a.valuetocompare}else b=ValidatorGetValue(a.controltocompare);var c="Equal";if(typeof a.operator=="string")c=a.operator;return ValidatorCompare(d,b,c,a)}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(c){var a=ValidatorGetValue(c.controltovalidate);if(ValidatorTrim(a).length==0)return true;var d=new RegExp(c.validationexpression),b=d.exec(a);return b!=null&&a==b[0]}function ValidatorTrim(b){var a=b.match(/^\s*(\S+(\s+\S+)*)\s*$/);return a==null?"":a[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 b,d,c;for(d=0;d<Page_ValidationSummaries.length;d++){b=Page_ValidationSummaries[d];b.style.display="none";if(!Page_IsValid&&IsValidationGroupMatch(b,f)){var a;if(b.showsummary!="False"){b.style.display="";if(typeof b.displaymode!="string")b.displaymode="BulletList";switch(b.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>"}c="";if(typeof b.headertext=="string")c+=b.headertext+headerSep;c+=first;for(a=0;a<Page_Validators.length;a++)if(!Page_Validators[a].isvalid&&typeof Page_Validators[a].errormessage=="string")c+=pre+Page_Validators[a].errormessage+post;c+=end;b.innerHTML=c;window.scrollTo(0,0)}if(b.showmessagebox=="True"){c="";if(typeof b.headertext=="string")c+=b.headertext+"\r\n";var e=Page_Validators.length-1;for(a=0;a<=e;a++)if(!Page_Validators[a].isvalid&&typeof Page_Validators[a].errormessage=="string")switch(b.displaymode){case "List":c+=Page_Validators[a].errormessage;if(a<e)c+="\r\n";break;case "BulletList":default:c+="- "+Page_Validators[a].errormessage;if(a<e)c+="\r\n";break;case "SingleParagraph":c+=Page_Validators[a].errormessage+" "}alert(c)}}}}