Type.registerNamespace("AjaxControlToolkit");AjaxControlToolkit.MaskedEditBehavior=function(f){var c=null,d=false,e=true,b="",a=this;AjaxControlToolkit.MaskedEditBehavior.initializeBase(a,[f]);a._Mask=b;a._MaskType=AjaxControlToolkit.MaskedEditType.None;a._Filtered=b;a._PromptChar="_";a._InputDirection=AjaxControlToolkit.MaskedEditInputDirections.LeftToRight;a._MessageValidatorTip=e;a._ShowMessageErrorFloat=d;a._CssMessageErrorFloat=b;a._AutoComplete=e;a._AutoCompleteValue=b;a._ClearTextOnInvalid=d;a._ClearMaskOnLostfocus=e;a._AcceptAmPm=AjaxControlToolkit.MaskedEditShowSymbol.None;a._AcceptNegative=AjaxControlToolkit.MaskedEditShowSymbol.None;a._DisplayMoney=AjaxControlToolkit.MaskedEditShowSymbol.None;a._OnFocusCssClass="MaskedEditFocus";a._OnInvalidCssClass="MaskedEditError";a._OnFocusCssNegative="MaskedEditFocusNegative";a._OnBlurCssNegative="MaskedEditBlurNegative";a._CultureName=b;a._UserDateFormat=AjaxControlToolkit.MaskedEditUserDateFormat.None;a._UserTimeFormat=AjaxControlToolkit.MaskedEditUserTimeFormat.None;a._CultureDatePlaceholder=b;a._CultureTimePlaceholder=b;a._CultureDecimalPlaceholder=b;a._CultureThousandsPlaceholder=b;a._CultureDateFormat=b;a._CultureCurrencySymbolPlaceholder=b;a._CultureAMPMPlaceholder=b;a._AMPMPlaceholderSeparator=";";a._Century=1900;a._AllowCopyPaste=e;a._ClipboardText=AjaxControlToolkit.Resources.Shared_BrowserSecurityPreventsPaste;a._CharsEditMask="9L$CAN?";a._CharsSpecialMask="/:.,";a._MaskConv=b;a._EmptyMask=b;a._maskvalid=b;a._DirectSelText=b;a._initialvalue=b;a._LogicSymbol=b;a._LogicTextMask=b;a._LogicMask=b;a._LogicMaskConv=b;a._LogicPrompt=String.fromCharCode(1);a._LogicEscape=String.fromCharCode(2);a._LogicFirstPos=-1;a._LogicLastPos=-1;a._LogicLastInt=-1;a._QtdValidInput=0;a._InLostfocus=d;a._ExternalMessageError=b;a._CurrentMessageError=b;a._FiringOnChange=d;a._ErroOnEnter=d;a._charLetters="ABCDEFGHIJKLMNOPQRSTUVWXYZ";a._charNumbers="0123456789";a._charEscape="\\";a._DelimitStartDup="{";a._DelimitEndDup="}";a._focusHandler=c;a._keypressdown=c;a._keypressHandler=c;a._blurHandler=c;a._mouseOutHandler=c;a._mouseOutHandler=c;a._mouseMoveHandler=c;a._mouseEnterHandler=c;a._changeHandler=c;a._timer=c;a._timerHandler=c;a._SaveSymb=b;a._SaveText=b;a._SavePosi=-1;a._SaveMask=b;a._SaveKeyDown=0};AjaxControlToolkit.MaskedEditBehavior.prototype={initialize:function(){var c=true,a=this,b=a.get_element();a._InLostfocus=c;AjaxControlToolkit.MaskedEditBehavior.callBaseMethod(a,"initialize");a._createMask();var e=false,f=a.get_ClientState();if(f!=null&&f!=""){e=f=="Focused";a.set_ClientState(null)}if(typeof document.activeElement != "unknown")if(b.id==document.activeElement.id)e=c;if(a._ShowMessageErrorFloat){a._mouseOutHandler=Function.createDelegate(a,a._onMouseOut);$addHandler(b,"mouseout",a._mouseOutHandler);a._mouseMoveHandler=Function.createDelegate(a,a._onMouseMove);$addHandler(b,"mousemove",a._mouseMoveHandler);a._mouseEnterHandler=Function.createDelegate(a,a._onMouseover);$addHandler(b,"mouseover",a._mouseEnterHandler)}if(!b.readOnly){a._keypressdown=Function.createDelegate(a,a._onKeyPressdown);$addHandler(b,"keydown",a._keypressdown);a._keypressHandler=Function.createDelegate(a,a._onKeyPress);$addHandler(b,"keypress",a._keypressHandler)}a._focusHandler=Function.createDelegate(a,a._onFocus);$addHandler(b,"focus",a._focusHandler);a._blurHandler=Function.createDelegate(a,a._onBlur);$addHandler(b,"blur",a._blurHandler);a._changeHandler=Function.createDelegate(a,a._onChange);$addHandler(b,"change",a._changeHandler);if(Sys.Browser.agent==Sys.Browser.Opera){a._timerHandler=Function.createDelegate(a,a._OnTimerTicket);a._timer=new Sys.Timer;a._timer.set_enabled(false);a._timer.set_interval(100);a._timer.add_tick(a._timerHandler);a._SaveText="";a._SavePosi=-1;a._timer.set_enabled(c)}var d=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(b);if(a._ClearMaskOnLostfocus)a._InitValue(d.get_Value(),c);else a._InitValue(d.get_Value().substring(a._LogicFirstPos,a._LogicLastPos+1),c);if(e)a._onFocus();else{a._ClearMaskOnLostfocus&&d.set_Value(a._getClearMask(d.get_Value()));var g=a._CaptureServerValidators();if(!g)a._OnInvalidCssClass!=""&&a.AddCssClassMaskedEdit(a._OnInvalidCssClass)}},dispose:function(){var b=null,a=this,c=a.get_element();if(a._mouseOutHandler){$removeHandler(c,"mouseout",a._mouseOutHandler);a._mouseOutHandler=b}if(a._mouseMoveHandler){$removeHandler(c,"mousemove",a._mouseMoveHandler);a._mouseMoveHandler=b}if(a._mouseEnterHandler){$removeHandler(c,"mouseover",a._mouseEnterHandler);a._mouseEnterHandler=b}if(a._focusHandler){$removeHandler(c,"focus",a._focusHandler);a._focusHandler=b}if(a._focusHandler){$removeHandler(c,"focus",a._focusHandler);a._focusHandler=b}if(a._blurHandler){$removeHandler(c,"blur",a._blurHandler);a._blurHandler=b}if(a._changeHandler){$removeHandler(c,"change",a._changeHandler);a._changeHandler=b}if(a._keypressdown){$removeHandler(c,"keydown",a._keypressdown);a._keypressdown=b}if(a._keypressHandler){$removeHandler(c,"keypress",a._keypressHandler);a._keypressHandler=b}if(a._timerHandler){a._timer.set_enabled(false);a._timerHandler=b;a._timer.dispose();a._timer=b}AjaxControlToolkit.MaskedEditBehavior.callBaseMethod(a,"dispose")},_OnTimerTicket:function(){var a=this;a._SaveSymb="";if(a._InLostfocus)return;a._timer.set_enabled(false);var b=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(a.get_element());if(a._SaveText!=""){b.set_Value(a._SaveText);a.setSelectionRange(a._SavePosi,a._SavePosi);a._SaveText="";a._SavePosi=-1;a._SaveMask=b.get_Value()}else{b.get_Value().length!=a._EmptyMask.length&&b.set_Value(a._SaveMask);a._timer.get_interval()!=100&&a._timer.set_interval(100)}a._timer.set_enabled(true)},_onChange:function(){!this._FiringOnChange&&this._onFocus()},_onFocus:function(){var b=false,a=this;a._InLostfocus=b;a._RemoveDivToolTip();a._OnFocusCssClass!=""&&a.AddCssClassMaskedEdit(a._OnFocusCssClass);var g=a.get_element(),d=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(g);a._initialvalue=d.get_Value();if(a._ClearMaskOnLostfocus)a._InitValue(d.get_Value(),b);else a._InitValue(d.get_Value().substring(a._LogicFirstPos,a._LogicLastPos+1),b);var c=a._getClearMask(),e=b;if(a._MessageValidatorTip&&c=="")e=true;if((a._MaskType==AjaxControlToolkit.MaskedEditType.Time||a._MaskType==AjaxControlToolkit.MaskedEditType.DateTime)&&a.get_CultureAMPMPlaceholder()!=""&&c=="")a._AcceptAmPm&&a.InsertAMPM(a.get_CultureAMPMPlaceholder().substring(0,1));else if(a._MaskType==AjaxControlToolkit.MaskedEditType.Number&&c!="")a._LogicSymbol=="-"&&a._OnFocusCssNegative!=""&&a.AddCssClassMaskedEdit(a._OnFocusCssNegative);if(a._InputDirection==AjaxControlToolkit.MaskedEditInputDirections.RightToLeft)if(a._LogicLastInt!=-1)a.setSelectionRange(a._LogicLastInt,a._LogicLastInt);else a.setSelectionRange(a._LogicLastPos+1,a._LogicLastPos+1);else if(a._MaskType==AjaxControlToolkit.MaskedEditType.Number&&c!=""){var f=a._getLastEmptyPosition()+1;a.setSelectionRange(f,f)}else a.setSelectionRange(a._LogicFirstPos,a._LogicFirstPos);a.ShowTooltipMessage(b);e&&a.ShowTooltipMessage(true)},_PeforformValidLostFocus:function(e){var a=this,c=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(a.get_element()),b=a._getClearMask(c.get_Value());b==""&&a._MaskType==AjaxControlToolkit.MaskedEditType.Number&&a._LogicSymbol=="-"&&a.InsertSignal("+");if(b!=""&&a._AutoComplete&&a._MaskType==AjaxControlToolkit.MaskedEditType.Date)a.AutoFormatDate();else if(b!=""&&a._AutoComplete&&a._MaskType==AjaxControlToolkit.MaskedEditType.Time)a.AutoFormatTime();else if(b!=""&&a._AutoComplete&&a._MaskType==AjaxControlToolkit.MaskedEditType.DateTime)a.AutoFormatDateTime();else b!=""&&a._AutoComplete&&a._MaskType==AjaxControlToolkit.MaskedEditType.Number&&a.AutoFormatNumber();(a._ClearMaskOnLostfocus&&b!=""||e&&a._ClearMaskOnLostfocus)&&c.set_Value(a._getClearMask(c.get_Value()));a.AddCssClassMaskedEdit("");a._MaskType==AjaxControlToolkit.MaskedEditType.Number&&a._LogicSymbol=="-"&&a._OnBlurCssNegative!=""&&a.AddCssClassMaskedEdit(a._OnBlurCssNegative);a.ShowTooltipMessage(false);a._RemoveDivToolTip();var d=a._CaptureClientsValidators();if(!d){a._OnInvalidCssClass!=""&&a.AddCssClassMaskedEdit(a._OnInvalidCssClass);if(a._ClearTextOnInvalid){a._createMask();c.set_Value(a._EmptyMask)}}return d},_onBlur:function(d){var a=this;a._InLostfocus=true;var b=a._PeforformValidLostFocus(true);if(b){var c=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(a.get_element());!a.get_element().readOnly&&a._initialvalue!=c.get_Value()&&d&&a._fireChanged()}},_fireChanged:function(){this._FiringOnChange=true;var a=this.get_element();if(document.createEventObject)a.fireEvent("onchange");else if(document.createEvent){var b=document.createEvent("HTMLEvents");b.initEvent("change",true,true);a.dispatchEvent(b)}this._FiringOnChange=false},_onKeyPress:function(g){var d=false,e=true,a=this,h=a._KeyCode(g);if(h==9)return e;if(scanCode==13){var i=a._PeforformValidLostFocus(d);a._ErroOnEnter=d;if(!i)a._ErroOnEnter=e;if(Sys.Browser.agent==Sys.Browser.Opera){var j=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(a.get_element());a._SaveText=j.get_Value();a._SavePosi=a._getCurrentPosition();a._timer.set_enabled(d);a._timer.set_interval(1);a._timer.set_enabled(e)}return i}a._OnFocusCssClass!=""&&a._ErroOnEnter&&a.AddCssClassMaskedEdit(a._OnFocusCssClass);a._ErroOnEnter=d;if(!a._isNormalChar(g,h)){a._ExecuteNav(g,h);return d}curpos=a._deleteTextSelection();if(curpos==-1)curpos=a._getCurrentPosition();var b=String.fromCharCode(scanCode);if(a._MaskType==AjaxControlToolkit.MaskedEditType.Date&&b==a.get_CultureDatePlaceholder())a._AdjustElementDate();else if(a._MaskType==AjaxControlToolkit.MaskedEditType.Time&&b==a.get_CultureTimePlaceholder())a._AdjustElementTime();else if(a._MaskType==AjaxControlToolkit.MaskedEditType.DateTime&&(b==a.get_CultureTimePlaceholder()||b==a.get_CultureDatePlaceholder()))a._AdjustElementDateTime(b);else if(a._MaskType==AjaxControlToolkit.MaskedEditType.Number&&a._InputDirection==AjaxControlToolkit.MaskedEditInputDirections.LeftToRight&&b==a.get_CultureDecimalPlaceholder()&&curpos==a._LogicLastInt)a._AdjustElementDecimalLTR();else if(a._MaskType==AjaxControlToolkit.MaskedEditType.Number&&a._InputDirection==AjaxControlToolkit.MaskedEditInputDirections.RightToLeft&&b==a.get_CultureDecimalPlaceholder()&&curpos==a._LogicLastInt)a._AdjustElementDecimalRTL();else if(a._MaskType==AjaxControlToolkit.MaskedEditType.Number&&b==a.get_CultureDecimalPlaceholder()&&curpos!=a._LogicLastInt)a._MoveDecimalPos();else if(a._MaskType==AjaxControlToolkit.MaskedEditType.Number&&a._InputDirection==AjaxControlToolkit.MaskedEditInputDirections.LeftToRight&&b==a.get_CultureThousandsPlaceholder())a._MoveThousandLTR();else if(a._MaskType==AjaxControlToolkit.MaskedEditType.Number&&a._InputDirection==AjaxControlToolkit.MaskedEditInputDirections.RightToLeft&&b==a.get_CultureThousandsPlaceholder())a._MoveThousandRTL();else if((a._MaskType==AjaxControlToolkit.MaskedEditType.Time||a._MaskType==AjaxControlToolkit.MaskedEditType.DateTime)&&a.get_CultureFirstLettersAMPM().toUpperCase().indexOf(b.toUpperCase())!=-1){if(a._AcceptAmPm){a.InsertAMPM(b);a.setSelectionRange(curpos,curpos)}}else if(a._MaskType==AjaxControlToolkit.MaskedEditType.Number&&a._AcceptNegative!=AjaxControlToolkit.MaskedEditShowSymbol.None&&"+-".indexOf(b)!=-1)if(Sys.Browser.agent!=Sys.Browser.Opera){a.InsertSignal(b);a.setSelectionRange(curpos,curpos)}else if(a._SaveSymb==""){a.InsertSignal(b);a.setSelectionRange(curpos,curpos);a._SaveSymb=b;a._timer.set_enabled(d);a._timer.set_interval(1);a._timer.set_enabled(e)}else a._SaveSymb="";else{var l=curpos;curpos=a._getNextPosition(curpos);var c=curpos;if(a._LogicLastInt!=-1&&a._InputDirection==AjaxControlToolkit.MaskedEditInputDirections.RightToLeft){if(l==a._LogicLastInt)c=a._getLastEmptyPosition()}else if(curpos>=a._LogicLastPos+1&&a._InputDirection==AjaxControlToolkit.MaskedEditInputDirections.RightToLeft)c=a._getLastEmptyPosition();if(a._processKey(c,b)){a._MessageValidatorTip&&a.ShowTooltipMessage(d);if(a._InputDirection==AjaxControlToolkit.MaskedEditInputDirections.LeftToRight){a._insertContent(b,c);curpos=a._getNextPosition(c+1)}else if(a._InputDirection==AjaxControlToolkit.MaskedEditInputDirections.RightToLeft)if(a._LogicLastInt==-1)if(curpos a._LogicFirstPos)d.left--;a.setSelectionRange(d.left,d.right)}else{var f=a._getCurrentPosition();f>a._LogicFirstPos&&a.setSelectionRange(f-1,f)}}else{curpos=a._getCurrentPosition()-1;if(curposa._LogicLastPos+1)curpos=a._LogicLastPos+1;a.setSelectionRange(curpos,curpos)}if(Sys.Browser.agent==Sys.Browser.Opera){var e=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(a.get_element());a._SaveText=e.get_Value();a._SavePosi=curpos;a._timer.set_enabled(h);a._timer.set_interval(1);a._timer.set_enabled(g)}}else if(c==27){a._SetCancelEvent(b);var e=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(a.get_element());if(a._EmptyMask==a._initialvalue)e.set_Value("");else e.set_Value(a._initialvalue);a._onFocus()}a._SetCancelEvent(b)},_backspace:function(a){var b=this,c=false;if(a>b._LogicFirstPos){var d=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(b.get_element()),e=d.get_Value();a=b._getPreviousPosition(a-1);b._deleteAtPosition(a,true);c=true}return c},_deleteAtPosition:function(e,s){var a=this,n=false,m=a._LogicLastPos+1;if(a._LogicLastInt!=-1&&a._InputDirection==AjaxControlToolkit.MaskedEditInputDirections.RightToLeft)m=a._LogicLastInt;var h=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(a.get_element());if(s==false&&a._InputDirection==AjaxControlToolkit.MaskedEditInputDirections.RightToLeft&&e==m){ClearText=a._getClearMask(h.get_Value());if(ClearText!=""){n=true;ClearText=ClearText.replace(new RegExp("(\\"+a.get_CultureThousandsPlaceholder()+")","g"),"")+"";if(ClearText.substring(ClearText.length-1,ClearText.length)==a.get_CultureDecimalPlaceholder())ClearText=ClearText.substring(0,ClearText.length-1);var g=ClearText.split(a.get_CultureDecimalPlaceholder());if(a._LogicLastInt!=-1&&g[0]!=""){g[0]=g[0].substring(0,g[0].length-1);ClearText=g[0];if(g.length=2)ClearText+=a.get_CultureDecimalPlaceholder()+g[1]}else ClearText=ClearText.substring(0,ClearText.length-1);ClearText+=a._LogicSymbol;a.loadValue(ClearText,m)}}else{var b=h.get_Value().substring(a._LogicFirstPos,a._LogicLastPos+1),c=a._LogicTextMask.substring(a._LogicFirstPos,a._LogicLastPos+1),f=0,j=e-a._LogicFirstPos;if(a._isValidMaskedEditPosition(e)){n=true;if(a._MaskType==AjaxControlToolkit.MaskedEditType.DateTime){var d=b.split(" "),q=e-a._LogicFirstPos;if(q>d[0].length){b=d[1];f=d[0].length+1;c=c.substring(f);j-=f}else{b=d[0];c=c.substring(0,d[0].length)}}var k=b.substring(j+1),l=c.substring(j+1);b=b.substring(0,j)+a._PromptChar;c=c.substring(0,j)+a._LogicPrompt;for(i=0;id[0].length){b=d[0]+" "+b;c=p.substring(0,f)+c}else{b=b+" "+d[1];c=c+p.substring(d[0].length)}}var o=h.get_Value();b=o.substring(0,a._LogicFirstPos)+b+o.substring(a._LogicLastPos+1);a._LogicTextMask=a._LogicTextMask.substring(0,a._LogicFirstPos)+c+a._LogicTextMask.substring(a._LogicLastPos+1);h.set_Value(b)}}return n},_ShowModalClipBoardInput:function(){var a=prompt(this._ClipboardText,"");return a},_PasteFromClipBoard:function(){var f=false,a=this,e=null,b,q=-1,p=-1;if(Sys.Browser.agent==Sys.Browser.InternetExplorer)e=window.clipboardData.getData("Text");else{var j=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(a.get_element()),l=j.get_Value(),g=a._GetBoundSelection(),b=a._getCurrentPosition(),m=a._AutoComplete,o=a._ClearTextOnInvalid,n=a._ClearMaskOnLostfocus,r=a._DirectSelText;a._AutoComplete=f;a._ClearTextOnInvalid=f;a._ClearMaskOnLostfocus=f;e=a._ShowModalClipBoardInput();a._AutoComplete=m;a._ClearTextOnInvalid=o;a._ClearMaskOnLostfocus=n;j.set_Value(l);if(g)a.setSelectionRange(g.left,g.right);else a.setSelectionRange(b,b)}if(e==null||e=="")return;if(e.length>a._maskvalid.length)e=e.substring(0,a._maskvalid.length);b=a._deleteTextSelection();if(b==-1){b=a._getCurrentPosition();if(g)b=g.left}a.setSelectionRange(b,b);var i=f;if(a._InputDirection==AjaxControlToolkit.MaskedEditInputDirections.RightToLeft&&a._LogicLastInt!=-1)i=true;for(var h=0,h=0;h=a._LogicLastPos+1&&a._InputDirection==AjaxControlToolkit.MaskedEditInputDirections.RightToLeft)c=a._getLastEmptyPosition();if(a._processKey(c,d)){a._MessageValidatorTip&&a.ShowTooltipMessage(f);if(a._InputDirection==AjaxControlToolkit.MaskedEditInputDirections.LeftToRight){a._insertContent(d,c);b=a._getNextPosition(c+1)}else if(a._InputDirection==AjaxControlToolkit.MaskedEditInputDirections.RightToLeft)if(a._LogicLastInt==-1)if(bd){if(e.get_Value().substring(a,a+1)==b.get_CultureThousandsPlaceholder()){c=a;break}a--}if(c==-1){a=b._LogicLastPos;d=f;while(a>d){if(e.get_Value().substring(a,a+1)==b.get_CultureThousandsPlaceholder()){c=a;break}a--}if(c==-1)return}b.setSelectionRange(c,c)},_AdjustElementDecimalLTR:function(){var a=this,i=a.get_element(),d=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(i),f=a._getCurrentPosition();if(d.get_Value().substring(f).indexOf(a.get_CultureDecimalPlaceholder())==-1)return;var e=d.get_Value().substring(a._LogicFirstPos,a._LogicLastPos+1),c=e.indexOf(a.get_CultureDecimalPlaceholder());if(c==-1)return;var b;ClearText=a._getClearMask(d.get_Value());if(ClearText!=""){ClearText=ClearText.replace(new RegExp("(\\"+a.get_CultureThousandsPlaceholder()+")","g"),"")+"";b=ClearText.split(a.get_CultureDecimalPlaceholder())}else b=a.get_CultureDecimalPlaceholder().split(a.get_CultureDecimalPlaceholder());if(b[0]=="")b[0]="0";var h=e.length-c-1;while(b[1].length=f){a._AdjustElementDecimalLTR();return}var b;ClearText=a._getClearMask(d.get_Value());if(ClearText!=""){ClearText=ClearText.replace(new RegExp("(\\"+a.get_CultureThousandsPlaceholder()+")","g"),"")+"";b=ClearText.split(a.get_CultureDecimalPlaceholder())}else b=a.get_CultureDecimalPlaceholder().split(a.get_CultureDecimalPlaceholder());if(b[0]=="")b[0]="0";var h=e.length-c-1;while(b[1].length=2&&g<=4&&h.length==2){e="M";b=c+a._LogicFirstPos}else if(g>=2&&g<=4&&h.length==3){e="M";b=6+a._LogicFirstPos+c}else if(h.length==3){e="S";b=c+a._LogicFirstPos}if(e=="")return;var i=k.get_Value().substring(a._LogicFirstPos,a._LogicLastPos+1);if(a._MaskType==AjaxControlToolkit.MaskedEditType.DateTime)i=i.split(" ")[1];var f=i.split(a.get_CultureTimePlaceholder()),j=a._GetTimeElementText(e),d;if(e=="H"){d=j+a.get_CultureTimePlaceholder()+f[1];if(f.length==3)d+=a.get_CultureTimePlaceholder()+f[2]}else if(e=="M"){d=f[0]+a.get_CultureTimePlaceholder()+j;if(f.length==3)d+=a.get_CultureTimePlaceholder()+f[2]}else if(e=="S"){d=f[0]+a.get_CultureTimePlaceholder()+f[1];d+=a.get_CultureTimePlaceholder()+j}if(a._MaskType==AjaxControlToolkit.MaskedEditType.DateTime)d=k.get_Value().substring(a._LogicFirstPos,c)+d;a.loadMaskValue(d,a._LogicFirstPos,a._LogicSymbol);a.setSelectionRange(b,b)},_GetTimeElementText:function(i){var d="",g="g",f=")",e="(\\",c=this,a,h=c._LogicTextMask.substring(c._LogicFirstPos,c._LogicLastPos+1);if(c._MaskType==AjaxControlToolkit.MaskedEditType.DateTime)h=h.substring(c._maskvalid.split(" ")[0].length+1);var b=h.split(c.get_CultureTimePlaceholder());b[0]=b[0].replace(new RegExp(e+c._LogicPrompt+f,g),c._PromptChar)+d;a=b[0].replace(new RegExp(e+c._PromptChar+f,g),d)+d;if(a!=d&&a.length<2){a="0"+a;b[0]=a}b[1]=b[1].replace(new RegExp(e+c._LogicPrompt+f,g),c._PromptChar)+d;a=b[1].replace(new RegExp(e+c._PromptChar+f,g),d)+d;if(a!=d&&a.length<2){a="0"+a;b[1]=a}if(b.length==3){b[2]=b[2].replace(new RegExp(e+c._LogicPrompt+f,g),c._PromptChar)+d;a=b[2].replace(new RegExp(e+c._PromptChar+f,g),d)+d;if(a!=d&&a.length<2){a="0"+a;b[2]=a}}if(i=="H")return b[0];else if(i=="M")return b[1];return b[2]},_AdjustElementDateTime:function(b){var a=this;b==a.get_CultureDatePlaceholder()&&a._AdjustElementDate();b==a.get_CultureTimePlaceholder()&&a._AdjustElementTime()},_AdjustElementDate:function(){var i="Y",h="M",g="D",f=" ",a=this,p=a.get_element(),n=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(p),l=n.get_Value().substring(a._LogicFirstPos,a._LogicLastPos+1);if(a._MaskType==AjaxControlToolkit.MaskedEditType.DateTime)l=l.split(f)[0];var j=l.split(a.get_CultureDatePlaceholder()),d="",b=a._getCurrentPosition()-a._LogicFirstPos,c=b+a._LogicFirstPos,e=a._maskvalid.indexOf("9999")!=-1?2:0;if(a.get_CultureDateFormat()=="DMY")if(b<=1){d=g;c=3+a._LogicFirstPos}else if(b>=2&&b<=4){d=h;c=6+a._LogicFirstPos}else{if(b>8+e&&a._MaskType==AjaxControlToolkit.MaskedEditType.DateTime){a.setSelectionRange(a._LogicFirstPos,a._LogicFirstPos);return}d=i;c=a._LogicFirstPos}else if(a.get_CultureDateFormat()=="MDY")if(b<=1){d=h;c=3+a._LogicFirstPos}else if(b>=2&&b<=4){d=g;c=6+a._LogicFirstPos}else{if(b>8+e&&a._MaskType==AjaxControlToolkit.MaskedEditType.DateTime){a.setSelectionRange(a._LogicFirstPos,a._LogicFirstPos);return}d=i;c=a._LogicFirstPos}else if(a.get_CultureDateFormat()=="DYM")if(b<=1){d=g;c=3+a._LogicFirstPos}else if(b>=2&&b<=4+e){d=i;c=6+e+a._LogicFirstPos}else{d=h;c=a._LogicFirstPos}else if(a.get_CultureDateFormat()=="MYD")if(b<=1){d=h;c=3+a._LogicFirstPos}else if(b>=2&&b<=4+e){d=i;c=6+e+a._LogicFirstPos}else{d=g;c=a._LogicFirstPos}else if(a.get_CultureDateFormat()=="YMD")if(b<=1+e){d=i;c=3+e+a._LogicFirstPos}else if(b>=2+e&&b<=4+e){d=h;c=6+e+a._LogicFirstPos}else{d=g;c=a._LogicFirstPos}else if(a.get_CultureDateFormat()=="YDM")if(b<=1+e){d=i;c=3+e+a._LogicFirstPos}else if(b>=2+e&&b<=4+e){d=g;c=6+e+a._LogicFirstPos}else{d=h;c=a._LogicFirstPos}var o=a._GetDateElementText(d);j[a.get_CultureDateFormat().indexOf(d)]=o;var m=j[0]+a.get_CultureDatePlaceholder()+j[1]+a._CultureDatePlaceholder+j[2];if(a._MaskType==AjaxControlToolkit.MaskedEditType.DateTime){var k=n.get_Value().substring(a._LogicFirstPos,a._LogicLastPos+1);if(k.split(f).length==3)m+=f+k.split(f)[1]+f+k.split(f)[2];else m+=f+k.split(f)[1]}a.loadMaskValue(m,a._LogicFirstPos,a._LogicSymbol);a.setSelectionRange(c,c)},_GetDateElementText:function(i){var d="",g="g",f=")",e="(\\",a=this,b,c;if(a._MaskType==AjaxControlToolkit.MaskedEditType.DateTime){var h=a._LogicTextMask.substring(a._LogicFirstPos,a._LogicLastPos+1).split(" ")[0];c=h.split(a.get_CultureDatePlaceholder())}else c=a._LogicTextMask.substring(a._LogicFirstPos,a._LogicLastPos+1).split(a.get_CultureDatePlaceholder());c[a.get_CultureDateFormat().indexOf("D")]=c[a.get_CultureDateFormat().indexOf("D")].replace(new RegExp(e+a._LogicPrompt+f,g),a._PromptChar)+d;b=c[a.get_CultureDateFormat().indexOf("D")].replace(new RegExp(e+a._PromptChar+f,g),d)+d;if(b!=d&&b.length<2){b="0"+b;c[a.get_CultureDateFormat().indexOf("D")]=b}c[a.get_CultureDateFormat().indexOf("M")]=c[a.get_CultureDateFormat().indexOf("M")].replace(new RegExp(e+a._LogicPrompt+f,g),a._PromptChar)+d;b=c[a.get_CultureDateFormat().indexOf("M")].replace(new RegExp(e+a._PromptChar+f,g),d)+d;if(b!=d&&b.length<2){b="0"+b;c[a.get_CultureDateFormat().indexOf("M")]=b}var j=a._maskvalid.indexOf("9999")!=-1?true:false;c[a.get_CultureDateFormat().indexOf("Y")]=c[a.get_CultureDateFormat().indexOf("Y")].replace(new RegExp(e+a._LogicPrompt+f,g),a._PromptChar)+d;b=c[a.get_CultureDateFormat().indexOf("Y")].replace(new RegExp(e+a._PromptChar+f,g),d)+d;if(j){if(b!=d&&b.length<4){while(b.length<4)b="0"+b;c[a.get_CultureDateFormat().indexOf("Y")]=b}}else if(b!=d&&b.length<2){b="0"+b;c[a.get_CultureDateFormat().indexOf("Y")]=b}return c[a.get_CultureDateFormat().indexOf(i)]},_GetBoundSelection:function(){var b=null,a=this.get_element();if(a.setSelectionRange){if(a.selectionStart!=a.selectionEnd)b={left:parseInt(a.selectionStart,10),right:parseInt(a.selectionEnd,10)}}else if(document.selection){sel=document.selection.createRange();if(sel.text!=""){var f=parseInt(sel.text.length,10);sel.text=String.fromCharCode(3)+sel.text;var c=a.createTextRange();c.findText(String.fromCharCode(3));c.select();var e=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(a),d=parseInt(e.get_Value().indexOf(String.fromCharCode(3)),10);document.selection.clear();b={left:d,right:d+f}}}return b},_deleteTextSelection:function(){var b=this,a=b.get_element(),g=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(a),d=g.get_Value(),e=-1,c=-1,h=false;if(a.setSelectionRange){if(a.selectionStart!=a.selectionEnd){var l=parseInt(a.selectionStart,10),k=parseInt(a.selectionEnd,10);h=true;e=k-l;c=a.selectionStart;a.selectionEnd=a.selectionStart}}else if(document.selection){sel=document.selection.createRange();if(sel.text!=""){h=true;var f=sel.text+String.fromCharCode(3);sel.text=f;var j=a.createTextRange();j.findText(f);j.select();c=g.get_Value().indexOf(f);document.selection.clear();e=parseInt(f.length,10)-1}}if(h){for(i=0;i0;c--){var d=e[0].substring(c-1,c);a._MaskType==AjaxControlToolkit.MaskedEditType.Number&&a._AcceptNegative!=AjaxControlToolkit.MaskedEditShowSymbol.None&&g.indexOf(d)!=-1&&a.InsertSignal(d);if(a._processKey(b,d)){a._insertContent(d,b);b=a._getPreviousPosition(b-1)}}if(e.length>1){b=a._getNextPosition(a._LogicLastInt);for(c=0;c0;c--){var d=f.substring(c-1,c);a._MaskType==AjaxControlToolkit.MaskedEditType.Number&&a._AcceptNegative!=AjaxControlToolkit.MaskedEditShowSymbol.None&&g.indexOf(d)!=-1&&a.InsertSignal(d);if(a._processKey(b,d)){a._insertContent(d,b);b=a._getPreviousPosition(b-1)}}},AutoFormatNumber:function(){var b=this,a,e=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(b.get_element());ValueText=e.get_Value();var d=b._AutoCompleteValue,f=false;for(a=b._LogicFirstPos;a<=b._LogicLastPos;a++)if(b._LogicTextMask.substring(a,a+1)==b._LogicPrompt){var c="0";if(d!="")c=d.substring(a-b._LogicFirstPos,a+1-b._LogicFirstPos);if(f){b._LogicTextMask=b._LogicTextMask.substring(0,a)+c+b._LogicTextMask.substring(a+1);ValueText=ValueText.substring(0,a)+c+ValueText.substring(a+1)}}else if(b._LogicMask.substring(a,a+1)==b._LogicPrompt&&"123456789".indexOf(b._LogicTextMask.substring(a,a+1))!=-1)f=true;e.set_Value(ValueText);return ValueText},AutoFormatTime:function(){var m=true,j=false,c=" ",d="",a=this,v=AjaxControlToolkit.TextBoxWrapper.get_Wrapper(a.get_element());ValueText=v.get_Value();var b=a._AutoCompleteValue;if(b.indexOf(a.get_CultureTimePlaceholder())==-1)b=d;if(a._MaskType==AjaxControlToolkit.MaskedEditType.DateTime){if(ValueText.split(c).length==3)ValueText=ValueText.split(c)[1]+c+ValueText.split(c)[2];else ValueText=ValueText.split(c)[1];if(b!=d){if(b.indexOf(a.get_CultureDatePlaceholder())==-1)b=c+b;if(b.split(c).length==3)b=b.split(c)[1]+c+b.split(c)[2];else b=b.split(c)[1]}}var s=new Date,e=s.getHours().toString();if(e.length<2)e="0"+e;if(b!=d)e=b.substring(0,2);var o=j,n=j,p=d,f=d,l=d;if(a.get_CultureAMPMPlaceholder()!=d){var t=a.get_CultureAMPMPlaceholder().split(a._AMPMPlaceholderSeparator);p=t[0];f=t[1];if(b==d){var l=p;if(e>12){e=(parseInt(e,10)-12).toString();if(e.length<2)e="0"+e;l=f}}else{l=p;if(b.indexOf(f)!=-1)l=f}o=m;if(ValueText.indexOf(f)!=-1&&f!=d)n=m;if(!a._AcceptAmPm){l=d;n=j;o=j}else{var u=m;if(ValueText.substring(0,1)!=a._PromptChar||ValueText.substring(1,2)!=a._PromptChar)u=j;if(u&&l!=d){o=m;n=j;if(f==l)n=m}}}var k=s.getMinutes().toString();if(k.length<2)k="0"+k;if(b!=d)k=b.substring(3,5);var r="00",g,h;if(a._MaskType==AjaxControlToolkit.MaskedEditType.DateTime){g=ValueText.substring(0,2);g=a._AdjustTime(g,e);h=ValueText.substring(3,5);h=a._AdjustTime(h,k)}else{g=ValueText.substring(a._LogicFirstPos,a._LogicFirstPos+2);g=a._AdjustTime(g,e);h=ValueText.substring(a._LogicFirstPos+3,a._LogicFirstPos+5);h=a._AdjustTime(h,k)}var q=a._maskvalid;if(a._MaskType==AjaxControlToolkit.MaskedEditType.DateTime)q=q.split(c)[1];if(q=="99:99:99"){if(b!=d)r=b.substring(6);var i;if(a._MaskType==AjaxControlToolkit.MaskedEditType.DateTime){i=ValueText.substring(6,8);i=a._AdjustTime(i,r)}else{i=ValueText.substring(a._LogicFirstPos+6,a._LogicFirstPos+8);i=a._AdjustTime(i,r)}ValueText=g+a.get_CultureTimePlaceholder()+h+a.get_CultureTimePlaceholder()+i}else ValueText=g+a.get_CultureTimePlaceholder()+h;if(n)ValueText+=c+f;else if(o)ValueText+=c+p;a._MaskType!=AjaxControlToolkit.MaskedEditType.DateTime&&a.loadValue(ValueText,a._LogicFirstPos);return ValueText},AutoFormatDateTime:function(){var a=this,b=a.AutoFormatDate(),c=a.AutoFormatTime();a.loadValue(b+" "+c,a._LogicFirstPos);return b+" "+c},AutoFormatDate:function(){var l="0",f="",a=this,i=a._GetDateElementText("D").replace(new RegExp("(\\"+a._PromptChar+")","g"),f)+f,j=a._GetDateElementText("M").replace(new RegExp("(\\"+a._PromptChar+")","g"),f)+f,k=a._GetDateElementText("Y").replace(new RegExp("(\\"+a._PromptChar+")","g"),f)+f,n=a._maskvalid.indexOf("9999")!=-1?true:false,g=a._AutoCompleteValue;if(g.indexOf(a.get_CultureDatePlaceholder())==-1)g=f;var d,e,c;if(g==f){var m=new Date;d=m.getUTCDate().toString();if(d.length<2)d=l+d;e=(m.getUTCMonth()+1).toString();if(e.length<2)e=l+e;if(n)c=m.getUTCFullYear().toString();else c=c.substring(2)}else{var b;if(a._MaskType==AjaxControlToolkit.MaskedEditType.DateTime){if(g.indexOf(a.get_CultureTimePlaceholder())==-1)g=g+" ";var o=g.split(" ")[0];b=o.split(a.get_CultureDatePlaceholder())}else b=g.split(a.get_CultureDatePlaceholder());if(a.get_CultureDateFormat()=="DMY"){d=b[0];e=b[1];c=b[2]}else if(a.get_CultureDateFormat()=="MDY"){d=b[1];e=b[0];c=b[2]}else if(a.get_CultureDateFormat()=="DYM"){d=b[0];e=b[2];c=b[1]}else if(a.get_CultureDateFormat()=="MYD"){d=b[2];e=b[0];c=b[1]}else if(a.get_CultureDateFormat()=="YMD"){d=b[2];e=b[1];c=b[0]}else if(a.get_CultureDateFormat()=="YDM"){d=b[1];e=b[2];c=b[0]}if(d.length<2)d=l+d;if(e.length<2)e=l+e;if(n)while(c.length<4)c=l+c;else while(c.length<2)c=l+c}if(i==f)i=d;if(j==f)j=e;if(k==f)k=c;var h;if(a.get_CultureDateFormat()=="DMY")h=i+a.get_CultureDatePlaceholder()+j+a._CultureDatePlaceholder+k;else if(a.get_CultureDateFormat()=="MDY")h=j+a.get_CultureDatePlaceholder()+i+a._CultureDatePlaceholder+k;else if(a.get_CultureDateFormat()=="DYM")h=i+a.get_CultureDatePlaceholder()+k+a._CultureDatePlaceholder+j;else if(a.get_CultureDateFormat()=="MYD")h=j+a.get_CultureDatePlaceholder()+k+a._CultureDatePlaceholder+i;else if(a.get_CultureDateFormat()=="YMD")h=k+a.get_CultureDatePlaceholder()+j+a._CultureDatePlaceholder+i;else if(a.get_CultureDateFormat()=="YDM")h=k+a.get_CultureDatePlaceholder()+i+a._CultureDatePlaceholder+j;a._MaskType!=AjaxControlToolkit.MaskedEditType.DateTime&&a.loadValue(h,a._LogicFirstPos);return h},ConvFmtNumber:function(a){var b=this;if(b._maskvalid.split(b.get_CultureDecimalPlaceholder()).length==2){if(a.substring(a.length-1,a.length)==b.get_CultureDecimalPlaceholder())a=a.substring(0,a.length-1);if(a.indexOf(b.get_CultureDecimalPlaceholder())==-1){a+=b.get_CultureDecimalPlaceholder();for(var d=b._maskvalid,c=0;c3)return a;var f=parseInt(c[0],10)+q;f=f.toString();if(f.length=0&&a._LogicTextMask.substring(b,b+1)!=a._LogicPrompt)b--;return b},_isValidMaskedEditPosition:function(a){return this._LogicMask.substring(a,a+1)==this._LogicPrompt},_getNextPosition:function(a){var b=this;while(!b._isValidMaskedEditPosition(a)&&ab._LogicLastPos+1)a=b._LogicLastPos+1;return a},_getPreviousPosition:function(a){var b=this;while(!b._isValidMaskedEditPosition(a)&&a>b._LogicFirstPos)a--;if(aa._LogicLastPos+1)begin=a._LogicLastPos+1;if(begin0)for(q=0;q КартаКарта