function MaskedEditSetMessage(a,b,c){a.errormessage=b;if(c=="")a.text=b;else a.text=c;a.innerHTML=a.text}function MaskedEditMessageShow(a,b){if(typeof a.display=="string"){if(a.display=="None")return;if(a.display=="Dynamic"){a.style.display=b?"none":"inline";return}}a.style.visibility=b?"hidden":"visible"}function MaskedEditSetCssClass(b,c){var a=$get(b.TargetValidator);Sys.UI.DomElement.removeCssClass(a,b.InvalidValueCssClass);Sys.UI.DomElement.removeCssClass(a,b.CssBlurNegative);Sys.UI.DomElement.removeCssClass(a,b.CssFocus);Sys.UI.DomElement.removeCssClass(a,b.CssFocusNegative);c!=""&&Sys.UI.DomElement.addCssClass(a,c)}function MaskedEditValidatorDateTime(value){var d=" ",c=false,b=true,a="";MaskedEditSetMessage(value,a,a);MaskedEditSetCssClass(value,a);MaskedEditMessageShow(value,b);if(value.IsMaskedEdit=="false")return b;var target=$get(value.TargetValidator);if(value.ValidEmpty=="false")if(AjaxControlToolkit.TextBoxWrapper.get_Wrapper(target).get_Value()==value.InitialValue){MaskedEditSetMessage(value,value.EmptyValueMessage,value.EmptyValueText);MaskedEditSetCssClass(value,value.InvalidValueCssClass);MaskedEditMessageShow(value,c);return c}if(AjaxControlToolkit.TextBoxWrapper.get_Wrapper(target).get_Value()==a)return b;var ret=b,mask=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(target).get_Value();if(value.ValidationExpression!=a){var rx=new RegExp(value.ValidationExpression),matches=rx.exec(mask);ret=matches!=null&&mask==matches[0];if(!ret){MaskedEditSetMessage(value,value.InvalidValueMessage,value.InvalidValueText);MaskedEditSetCssClass(value,value.InvalidValueCssClass);MaskedEditMessageShow(value,c);return c}}var PartDate=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(target).get_Value().split(d)[0],PartTime=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(target).get_Value().split(d)[1];if(AjaxControlToolkit.TextBoxWrapper.get_Wrapper(target).get_Value().split(d).length==3)PartTime+=d+AjaxControlToolkit.TextBoxWrapper.get_Wrapper(target).get_Value().split(d)[2];var MinVlDt=a,MinVlTm=a;if(value.MinimumValue!=a){MinVlDt=value.MinimumValue.split(d)[0];MinVlTm=value.MinimumValue.split(d)[1]}var MaxVlDt=a,MaxVlTm=a;if(value.MaximumValue!=a){MaxVlDt=value.MaximumValue.split(d)[0];MaxVlTm=value.MaximumValue.split(d)[1]}ret=MaskedEditValidatorPartDate(value,PartDate,MinVlDt,MaxVlDt);if(ret)ret=MaskedEditValidatorPartTime(value,PartTime,MinVlTm,MaxVlTm);if(ret&&value.ClientValidationFunction!=a){var args={Value:mask,IsValid:b};eval(value.ClientValidationFunction+"(value, args);");ret=args.IsValid;if(!ret){MaskedEditSetMessage(value,value.InvalidValueMessage,value.InvalidValueText);MaskedEditSetCssClass(value,value.InvalidValueCssClass)}}!ret&&MaskedEditMessageShow(value,ret);return ret}function MaskedEditValidatorPartTime(b,n,h,g){var a=10,e=-1,x="([0-5][0-9])\\s(",w="([0-5][0-9])",k=true,j=b.TimeSeparator,y=b.AmPmSymbol,v=y.split(";"),z=y.replace(";","|"),A="^(^([0][0-9]|[1][0-2])"+j+w+j+x+z+")$)|(^([0][0-9]|[1][0-2])"+j+x+z+")$)$",B="^(^([0-1][0-9]|[2][0-3])"+j+w+j+"([0-5][0-9])$)|(^([0-1][0-9]|[2][0-3])"+j+"([0-5][0-9])$)$",f=e,p=e,s=e,r="",q=n.split(j),t=new RegExp(A),l=t.exec(n),u=new RegExp(B),m=u.exec(n);if(l&&l[0]==n){r=n.substring(n.length-2).substring(0,1);f=parseInt(q[0],a);if(r.toUpperCase()==v[1].substring(0,1).toUpperCase()){f+=12;if(f==24)f=12}p=parseInt(q[1],a);s=b.length>9?parseInt(q[2].substring(0,2),a):0}else if(m&&m[0]==n){f=parseInt(q[0],a);p=parseInt(q[1],a);s=n.length>5?parseInt(q[2],a):0}if(f==e||p==e||s==e)k=false;if(!k){MaskedEditSetMessage(b,b.InvalidValueMessage,b.InvalidValueText);MaskedEditSetCssClass(b,b.InvalidValueCssClass)}if(k&&(g!=""||h!="")){var c,i,o,d;if(h!=""){c=e;i=e;o=e;d=h.split(j);l=t.exec(h);m=u.exec(h);if(l&&l[0]==h){r=h.substring(h.length-2).substring(0,1);c=parseInt(d[0],a);if(r.toUpperCase()==v[1].substring(0,1).toUpperCase()){c+=12;if(c==24)c=0}i=parseInt(d[1],a);o=h.length>9?parseInt(d[2].substring(0,2),a):0}else if(m&&m[0]==h){c=parseInt(d[0],a);i=parseInt(d[1],a);o=h.length>5?parseInt(d[2],a):0}k=f>c||f==c&&p>i||f==c&&p==i&&s>=o;if(!k){MaskedEditSetMessage(b,b.MinimumValueMessage,b.MinimumValueText);MaskedEditSetCssClass(b,b.InvalidValueCssClass)}}if(g!=""&&k){c=e;i=e;o=e;d=g.split(j);l=t.exec(g);m=u.exec(g);if(l&&l[0]==g){r=g.substring(g.length-2).substring(0,1);c=parseInt(d[0],a);if(r.toUpperCase()==v[1].substring(0,1).toUpperCase()){c+=12;if(c==24)c=0}i=parseInt(d[1],a);o=g.length>9?parseInt(d[2].substring(0,2),a):0}else if(m&&m[0]==g){c=parseInt(d[0],a);i=parseInt(d[1],a);o=g.length>5?parseInt(d[2],a):0}k=f <999)c+=parseInt(a.Century.substring(0,1)+c,d);f=k>0&&i>0&&c>0&&(k<=([,31,28,31,30,31,30,31,31,30,31,30,31])[i]||k==29&&i==2&&c%4==0&&(c%100>0||c%400==0))}if(!f){MaskedEditSetMessage(a,a.InvalidValueMessage,a.InvalidValueText);MaskedEditSetCssClass(a,a.InvalidValueCssClass)}if(f&&(n!=""||o!="")){var g,j=-1,h=-1,b=-1;if(o!=""){g=o.split(m);j=parseInt(g[e.indexOf("D")],d);h=parseInt(g[e.indexOf("M")],d);b=parseInt(g[e.indexOf("Y")],d);if(b<100)b=parseInt(b+a.Century,d);else if(b<999)b+=parseInt(a.Century.substring(0,1)+b,d);f=j>0&&h>0&&b>0&&c>b||c==b&&i>h||c==b&&i==h&&k>=j;if(!f){MaskedEditSetMessage(a,a.MinimumValueMessage,a.MinimumValueText);MaskedEditSetCssClass(a,a.InvalidValueCssClass)}}if(f&&n!=""){g=n.split(m);j=parseInt(g[e.indexOf("D")],d);h=parseInt(g[e.indexOf("M")],d);b=parseInt(g[e.indexOf("Y")],d);if(b<100)b=parseInt(b+a.Century,d);else if(b<999)b+=parseInt(a.Century.substring(0,1)+b,d);f=j>0&&h>0&&b>0&&cCompnum){ret=c;MaskedEditSetMessage(value,value.MaximumValueMessage,value.MaximumValueText);MaskedEditSetCssClass(value,value.InvalidValueCssClass)}}if(ret&&value.MinimumValue!=a){Compnum=parseInt(value.MinimumValue,10);if(Compnum==(isNaN(Compnum)?d:Compnum))if(num0?m[2]:"0")+"."+m[4];else cleanInput=(m[2].length>0?m[2]:"0")+"."+m[4];num=parseFloat(cleanInput);ret=num==(isNaN(num)?d:num)}if(!ret){MaskedEditSetMessage(value,value.InvalidValueMessage,value.InvalidValueText);MaskedEditSetCssClass(value,value.InvalidValueCssClass)}if(ret){if(value.MaximumValue!=a){Compnum=parseFloat(value.MaximumValue);if(Compnum==(isNaN(Compnum)?d:Compnum))if(num>Compnum){ret=c;MaskedEditSetMessage(value,value.MaximumValueMessage,value.MaximumValueText);MaskedEditSetCssClass(value,value.InvalidValueCssClass)}}if(ret&&value.MinimumValue!=a){Compnum=parseFloat(value.MinimumValue);if(Compnum==(isNaN(Compnum)?d:Compnum))if(numnum){ret=b;MaskedEditSetMessage(value,value.MaximumValueMessage,value.MaximumValueText);MaskedEditSetCssClass(value,value.InvalidValueCssClass)}}if(ret&&value.MinimumValue!="")if(value.MinimumValue.match(exp)!=c){num=parseInt(value.MinimumValue,10);if(num==(isNaN(num)?c:num))if(mask.length КартаКарта