Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.MaskedEventWrap=function(e,_2){
this.event=e.rawEvent;
this._selectionStart=_2.selectionStart;
this._selectionEnd=_2.selectionEnd;
this.fieldValue=_2.value;
};
Telerik.Web.UI.MaskedEventWrap.prototype={IsUpArrow:function(){
return this.event.keyCode==38;
},IsDownArrow:function(){
return this.event.keyCode==40;
}};
Telerik.Web.UI.MaskedEventWrap.registerClass("Telerik.Web.UI.MaskedEventWrap");;Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadMaskPart=function(){
this.value="";
this.index=-1;
this.type=-1;
this.PromptChar="_";
};
Telerik.Web.UI.RadMaskPart.prototype={HandleKey:function(ev){
return false;
},HandleWheel:function(_2){
return true;
},SetController:function(_3){
this.controller=_3;
},GetValue:function(){
return this.value.toString();
},GetVisValue:function(){
return "";
},SetValue:function(_4,_5){
return true;
},CanHandle:function(_6,_7){
return true;
},IsCaseSensitive:function(){
return false;
},GetLength:function(){
return 1;
},IsAlpha:function(_8){
return _8.match(/[^\u005D\u005B\t\n\r\f\s\v\\!-@|^_`{-¿]{1}/)!=null;
}};
Telerik.Web.UI.RadMaskPart.registerClass("Telerik.Web.UI.RadMaskPart");;Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadDigitMaskPart=function(){
Telerik.Web.UI.RadDigitMaskPart.initializeBase(this);
};
Telerik.Web.UI.RadDigitMaskPart.prototype={GetValue:function(){
return this.value.toString();
},IsCaseSensitive:function(){
return true;
},GetVisValue:function(){
if(this.value.toString()==""){
return this.PromptChar;
}
return this.value.toString();
},CanHandle:function(_1,_2){
if(isNaN(parseInt(_1))){
this.controller._OnChunkError(this,this.GetValue(),_1);
return false;
}
return true;
},SetValue:function(_3,_4){
if(_3==""||_3==this.PromptChar||_3==" "){
this.value="";
return true;
}
if(this.CanHandle(_3,_4)){
this.value=parseInt(_3);
}
return true;
}};
Telerik.Web.UI.RadDigitMaskPart.registerClass("Telerik.Web.UI.RadDigitMaskPart",Telerik.Web.UI.RadMaskPart);;Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadEnumerationMaskPart=function(_1){
Telerik.Web.UI.RadEnumerationMaskPart.initializeBase(this);
this.SetOptions(_1);
this.lastOffsetPunched=-1;
this.selectedForCompletion=0;
this.FlipDirection=0;
this.RebuildKeyBuff();
};
Telerik.Web.UI.RadEnumerationMaskPart.prototype={SetOptions:function(_2){
this.length=0;
this.Options=_2;
this.optionsIndex=[];
for(var i=0;i<this.Options.length;i++){
this.length=Math.max(this.length,this.Options[i].length);
this.optionsIndex[this.Options[i]]=i;
}
},CanHandle:function(){
return true;
},SetController:function(_4){
this.controller=_4;
this.InitializeSelection(_4.get_allowEmptyEnumerations());
},InitializeSelection:function(_5){
if(_5){
this.value="";
this.selectedIndex=-1;
}else{
this.value=this.Options[0];
this.selectedIndex=0;
}
},RebuildKeyBuff:function(){
this.keyBuff=[];
for(i=0;i<this.length;i++){
this.keyBuff[i]="";
}
this.keyBuffRebuilt=true;
},IsCaseSensitive:function(){
return true;
},ResetCompletion:function(){
this.selectedForCompetion=0;
},SelectNextCompletion:function(){
this.selectedForCompletion++;
},Store:function(_6,_7){
if(this.lastOffsetPunched==_7){
if(this.keyBuff[_7]==_6){
this.SelectNextCompletion();
}else{
this.RebuildKeyBuff();
}
}else{
this.ResetCompletion();
}
this.lastOffsetPunched=_7;
this.keyBuff[_7]=_6;
},SetNoCompletionValue:function(){
if(this.controller.get_allowEmptyEnumerations()){
this.SetOption(-1);
}
},SetValue:function(_8,_9){
_9-=this.offset;
this.Store(_8,_9);
var _a=new Telerik.Web.UI.CompletionList(this.Options,this.PromptChar);
var _b=_a.GetCompletions(this.keyBuff,_9);
if(_b.length>0){
var _c=this.optionsIndex[_b[this.selectedForCompletion%_b.length]];
this.SetOption(_c);
}else{
this.SetNoCompletionValue();
return false;
}
return true;
},GetVisValue:function(){
var v=this.value;
while(v.length<this.length){
v+=this.PromptChar;
}
return v;
},GetLength:function(){
return this.length;
},GetSelectedIndex:function(){
return this.selectedIndex;
},SetOption:function(_e,up){
var _10=this.value;
if(this.controller.get_allowEmptyEnumerations()){
if(_e<-1){
_e=this.Options.length+_e+1;
this.FlipDirection=-1;
}else{
if(_e>=this.Options.length){
_e=_e-this.Options.length-1;
this.FlipDirection=1;
}
}
}else{
if(_e<0){
_e=this.Options.length+_e;
this.FlipDirection=-1;
}else{
if(_e>=this.Options.length){
_e=_e-this.Options.length;
this.FlipDirection=1;
}
}
}
this.selectedIndex=_e;
this.value=_e==-1?"":this.Options[_e];
if(typeof (up)!="undefined"){
if(up){
this.controller._OnMoveUp(this,_10,this.value);
}else{
this.controller._OnMoveDown(this,_10,this.value);
}
}
this.controller._OnEnumChanged(this,_10,this.value);
this.FlipDirection=0;
},HandleKey:function(e){
this.controller._calculateSelection();
var _12=new Telerik.Web.UI.MaskedEventWrap(e,this.controller.TextBoxElement);
if(_12.IsDownArrow()){
this.SetOption(this.selectedIndex+1,false);
this.controller._Visualise();
this.controller._FixSelection(_12);
return true;
}else{
if(_12.IsUpArrow()){
this.SetOption(this.selectedIndex-1,true);
this.controller._Visualise();
this.controller._FixSelection(_12);
return true;
}
}
},HandleWheel:function(e){
this.controller._calculateSelection();
var _14=new Telerik.Web.UI.MaskedEventWrap(e,this.controller.TextBoxElement);
this.SetOption(this.selectedIndex-e.rawEvent.wheelDelta/120);
this.controller._Visualise();
this.controller._FixSelection(_14);
return false;
}};
Telerik.Web.UI.RadEnumerationMaskPart.registerClass("Telerik.Web.UI.RadEnumerationMaskPart",Telerik.Web.UI.RadMaskPart);
Telerik.Web.UI.CompletionList=function(_15,_16){
this.options=_15;
this.blankChar=_16;
};
Telerik.Web.UI.CompletionList.prototype={GetCompletions:function(_17,_18){
var _19=this.options;
for(var _1a=0;_1a<=_18;_1a++){
var _1b=_17[_1a].toLowerCase();
_19=this.FilterCompletions(_19,_1a,_1b);
}
return _19;
},FilterCompletions:function(_1c,_1d,key){
var _1f=[];
for(var _20=0;_20<_1c.length;_20++){
var _21=_1c[_20];
var _22=_21.charAt(_1d).toLowerCase();
if(this.CharacterMatchesCompletion(key,_22)){
_1f[_1f.length]=_21;
}
}
return _1f;
},CharacterMatchesCompletion:function(_23,_24){
return _23==this.blankChar||_23==" "||_23==_24;
}};
Telerik.Web.UI.CompletionList.registerClass("Telerik.Web.UI.CompletionList");;Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadFreeMaskPart=function(){
Telerik.Web.UI.RadFreeMaskPart.initializeBase(this);
};
Telerik.Web.UI.RadFreeMaskPart.prototype={IsCaseSensitive:function(){
return true;
},GetVisValue:function(){
if(this.value.toString()==""){
return this.PromptChar;
}
return this.value;
},SetValue:function(_1,_2){
this.value=_1;
return true;
}};
Telerik.Web.UI.RadFreeMaskPart.registerClass("Telerik.Web.UI.RadFreeMaskPart",Telerik.Web.UI.RadMaskPart);;Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadLiteralMaskPart=function(ch){
Telerik.Web.UI.RadLiteralMaskPart.initializeBase(this);
this.ch=ch;
};
Telerik.Web.UI.RadLiteralMaskPart.prototype={GetVisValue:function(){
return this.ch;
},GetLength:function(){
if(Sys.Browser.agent==Sys.Browser.Firefox){
return this.ch.length-(this.ch.split("\r\n").length-1);
}
return this.ch.length;
},GetValue:function(){
return "";
},IsCaseSensitive:function(){
if(this.NextChunk!=null){
return this.NextChunk.IsCaseSensitive();
}
},SetValue:function(_2,_3){
_3-=this.offset;
return _2==this.ch.charAt(_3)||!_2;
},CanHandle:function(_4,_5){
_5-=this.offset;
if(_4==this.ch.charAt(_5)){
return true;
}
if(!_4){
return true;
}
if(this.NextChunk!=null){
return this.NextChunk.CanHandle(_4,_5+this.GetLength());
}
}};
Telerik.Web.UI.RadLiteralMaskPart.registerClass("Telerik.Web.UI.RadLiteralMaskPart",Telerik.Web.UI.RadMaskPart);;Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadLowerMaskPart=function(){
Telerik.Web.UI.RadLowerMaskPart.initializeBase(this);
};
Telerik.Web.UI.RadLowerMaskPart.prototype={CanHandle:function(_1,_2){
if(!this.IsAlpha(_1)){
this.controller._OnChunkError(this,this.GetValue(),_1);
return false;
}
return true;
},GetVisValue:function(){
if(this.value.toString()==""){
return this.PromptChar;
}
return this.value.toString();
},SetValue:function(_3,_4){
if(_3==""){
this.value="";
return true;
}
if(this.IsAlpha(_3)){
this.value=_3.toLowerCase();
}else{
this.controller._OnChunkError(this,this.GetValue(),_3);
}
return true;
}};
Telerik.Web.UI.RadLowerMaskPart.registerClass("Telerik.Web.UI.RadLowerMaskPart",Telerik.Web.UI.RadMaskPart);;Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadNumericRangeMaskPart=function(_1,_2,_3,_4){
Telerik.Web.UI.RadNumericRangeMaskPart.initializeBase(this);
this.upperLimit=_2;
this.lowerLimit=_1;
this.length=Math.max(this.lowerLimit.toString().length,this.upperLimit.toString().length);
this.leftAlign=_3;
this.zeroFill=_4;
this.minusIncluded=this.lowerLimit<0||this.upperLimit<0;
this.value=_1;
this.FlipDirection=0;
};
Telerik.Web.UI.RadNumericRangeMaskPart.prototype={SetController:function(_5){
this.controller=_5;
this.GetVisValue();
},IsCaseSensitive:function(){
return true;
},CanHandle:function(_6,_7){
if((_6=="-"||_6=="+")&&this.lowerLimit<0){
return true;
}
if(isNaN(parseInt(_6))){
this.controller._OnChunkError(this,this.GetValue(),_6);
return false;
}
return true;
},InsertAt:function(_8,_9){
return this.visValue.substr(0,_9)+_8.toString()+this.visValue.substr(_9+1,this.visValue.length);
},ReplacePromptChar:function(_a){
var _b=this.leftAlign?"":"0";
while(_a.indexOf(this.PromptChar)>-1){
_a=_a.replace(this.PromptChar,_b);
}
return _a;
},SetValue:function(_c,_d){
if(_c==""){
_c=0;
}
if(isNaN(parseInt(_c))&&_c!="+"&&_c!="-"){
return true;
}
_d-=this.offset;
var _e=this.InsertAt(_c,_d);
_e=this.ReplacePromptChar(_e);
if(_e.indexOf("-")!=-1&&_e.indexOf("-")>0){
_e=_e.replace("-","0");
}
if(isNaN(parseInt(_e))){
_e=0;
}
if(this.controller.get_roundNumericRanges()){
_e=Math.min(this.upperLimit,_e);
_e=Math.max(this.lowerLimit,_e);
this.setInternalValue(_e);
}else{
if(_e<=this.upperLimit&&_e>=this.lowerLimit){
this.setInternalValue(_e);
this.GetVisValue();
}else{
return false;
}
}
this.GetVisValue();
return true;
},setInternalValue:function(_f){
var _10=this.value;
this.value=_f;
this.controller._OnEnumChanged(this,_10,_f);
if(_10>_f){
this.controller._OnMoveDown(this,_10,_f);
}else{
if(_10<_f){
this.controller._OnMoveUp(this,_10,_f);
}
}
this.FlipDirection=0;
},GetVisValue:function(){
var out="";
var _12=Math.abs(this.value).toString();
if(this.leftAlign){
if(this.value<0){
out+=this.PromptChar;
}
out+=_12;
while(out.length<this.length){
out+=this.controller.get_promptChar();
}
}else{
var _13=this.zeroFill?"0":this.controller.get_promptChar();
if(this.value<0){
_12="-"+_12;
}
while(out.length<this.length-_12.length){
out+=_13;
}
out+=_12;
}
this.visValue=out;
return out;
},GetLength:function(){
return this.length;
},HandleKey:function(e){
this.controller._calculateSelection();
var _15=new Telerik.Web.UI.MaskedEventWrap(e,this.controller.TextBoxElement);
if(_15.IsDownArrow()){
this.MoveDown();
this.controller._FixSelection(_15);
return true;
}else{
if(_15.IsUpArrow()){
this.MoveUp();
this.controller._FixSelection(_15);
return true;
}
}
},MoveUp:function(){
var _16=this.value;
_16++;
if(_16>this.upperLimit){
_16=this.lowerLimit;
this.FlipDirection=1;
}
this.setInternalValue(_16);
this.controller._Visualise();
},MoveDown:function(){
var _17=this.value;
_17--;
if(_17<this.lowerLimit){
_17=this.upperLimit;
this.FlipDirection=-1;
}
this.setInternalValue(_17);
this.controller._Visualise();
},HandleWheel:function(e){
var _19=this.value;
_19=parseInt(_19)+parseInt(e.rawEvent.wheelDelta/120);
var _1a=new Telerik.Web.UI.MaskedEventWrap(e,this.controller.TextBoxElement);
if(_19<this.lowerLimit){
_19=this.upperLimit-(this.lowerLimit-_19-1);
this.FlipDirection=-1;
}
if(_19>this.upperLimit){
_19=this.lowerLimit+(_19-this.upperLimit-1);
this.FlipDirection=1;
}
this.setInternalValue(_19);
this.controller._Visualise();
this.controller._FixSelection(_1a);
return false;
}};
Telerik.Web.UI.RadNumericRangeMaskPart.registerClass("Telerik.Web.UI.RadNumericRangeMaskPart",Telerik.Web.UI.RadMaskPart);;Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadUpperMaskPart=function(){
Telerik.Web.UI.RadUpperMaskPart.initializeBase(this);
};
Telerik.Web.UI.RadUpperMaskPart.prototype={CanHandle:function(_1,_2){
if(!this.IsAlpha(_1)){
this.controller._OnChunkError(this,this.GetValue(),_1);
return false;
}
return true;
},GetVisValue:function(){
if(this.value.toString()==""){
return this.PromptChar;
}
return this.value.toString();
},SetValue:function(_3,_4){
if(_3==""){
this.value="";
return true;
}
if(this.IsAlpha(_3)){
this.value=_3.toUpperCase();
}else{
this.controller._OnChunkError(this,this.GetValue(),_3);
}
return true;
}};
Telerik.Web.UI.RadUpperMaskPart.registerClass("Telerik.Web.UI.RadUpperMaskPart",Telerik.Web.UI.RadMaskPart);;Type.registerNamespace("Telerik.Web.UI");
Telerik.Web.UI.RadMaskedTextBox=function(_1){
Telerik.Web.UI.RadMaskedTextBox.initializeBase(this,[_1]);
this._parts=[];
this._partIndex=[];
this._displayPartIndex=[];
this._value="";
this._lastState=null;
this._length=0;
this._displayLength=0;
this._internalValueUpdate=false;
this._projectedValue="";
this._isTextarea=false;
this._initialMasks=[];
this._initialDisplayMasks=[];
this._promptChar="_";
this._displayPromptChar="_";
this._displayFormatPosition=Telerik.Web.UI.DisplayFormatPosition.Left;
this._hideOnBlur=false;
this._resetCaretOnFocus=false;
this._roundNumericRanges=true;
this._allowEmptyEnumerations=false;
this._readOnly=false;
this._focusOnStartup=false;
this._onTextBoxMouseUpDelegate=null;
this._onTextBoxMouseDownDelegate=null;
this._onTextBoxPasteDelegate=null;
this._onTextBoxPropertyChangeDelegate=null;
this._onTextBoxInputDelegate=null;
this._onFormResetDelegate=null;
this._isInitialized=false;
this._originalValue="";
};
Telerik.Web.UI.RadMaskedTextBox.prototype={initialize:function(){
Telerik.Web.UI.RadMaskedTextBox.callBaseMethod(this,"initialize");
this._fixAbsolutePositioning();
this._setMask(this.get__initialMasks());
if(this.get__initialDisplayMasks().length){
this._setDisplayMask(this.get__initialDisplayMasks());
}
this._SetValue(this._textBoxElement.value);
this._Visualise();
this._textBoxElement._oldValue=this._textBoxElement.value;
this._isTextarea=this._textBoxElement.tagName.toLowerCase()=="textarea";
if(this.get_focusOnStartup()){
this.focus();
}
this._RecordInitialState();
this._isInitialized=true;
},dispose:function(){
if(this._onTextBoxMouseUpDelegate){
$removeHandler(this._textBoxElement,"mouseup",this._onTextBoxMouseUpDelegate);
this._onTextBoxMouseUpDelegate=null;
}
if(this._onTextBoxMouseDownDelegate){
$removeHandler(this._textBoxElement,"mousedown",this._onTextBoxMouseDownDelegate);
this._onTextBoxMouseDownDelegate=null;
}
if(this._onFormResetDelegate){
$removeHandler(this._textBoxElement.form,"reset",this._onFormResetDelegate);
this._onFormResetDelegate=null;
}
if(Sys.Browser.agent==Sys.Browser.InternetExplorer){
if(this._onTextBoxPasteDelegate){
$removeHandler(this._textBoxElement,"paste",this._onTextBoxPasteDelegate);
this._onTextBoxPasteDelegate=null;
}
if(this._onTextBoxPropertyChangeDelegate){
$removeHandler(this._textBoxElement,"propertychange",this._onTextBoxPropertyChangeDelegate);
this._onTextBoxPropertyChangeDelegate=null;
}
}else{
if(this._onTextBoxInputDelegate){
$removeHandler(this._textBoxElement,"input",this._onTextBoxInputDelegate);
this._onTextBoxInputDelegate=null;
}
}
Telerik.Web.UI.RadMaskedTextBox.callBaseMethod(this,"dispose");
},isEmpty:function(){
return this._value=="";
},resetCursor:function(){
this.set_cursorPosition(0);
},inSelection:function(e){
this._calculateSelection();
if(this._textBoxElement.selectionStart!=this._textBoxElement.selectionEnd){
this._OnActivity(e);
return true;
}
if(e.ctrlKey||e.altKey||Sys.Browser.agent==Sys.Browser.Safari){
this._OnActivity(e);
return true;
}
return false;
},updateDisplayValue:function(){
if(this._isInitialized){
if(this._focused){
if((this.get_hideOnBlur()&&this.isEmpty())||this._displayParts){
this._Visualise();
this._textBoxElement.select();
}
if(this.get_resetCaretOnFocus()){
this.resetCursor();
}
}else{
this._Visualise();
}
}
},updateHiddenValue:function(){
return this._setHiddenValue(this.get_valueWithPromptAndLiterals());
},GetValueWithLiterals:function(){
return this.get_valueWithLiterals();
},GetValueWithPromptAndLiterals:function(){
return this.get_valueWithPromptAndLiterals();
},GetPrompt:function(){
return this.get_prompt();
},SetCursorPosition:function(_3){
this.set_cursorPosition(_3);
},get_valueWithLiterals:function(){
var _4=[];
for(var i=0;i<this._parts.length;i++){
_4[i]=this._parts[i].ch||this._parts[i].GetValue();
}
return _4.join("");
},get_valueWithPromptAndLiterals:function(){
return this._GetVisibleValues(this._parts);
},get_prompt:function(){
var _6=new RegExp(".","g");
var _7=[];
for(var i=0;i<this._parts.length;i++){
_7[i]=this._parts[i].ch||this._parts[i].GetVisValue().replace(_6,this.get_promptChar());
}
return _7.join("");
},get_displayValue:function(){
var _9=this._value;
while(_9.length<this._displayLength){
if(this.get_displayFormatPosition()){
_9=this.get_promptChar()+_9;
}else{
_9+=this.get_promptChar();
}
}
this._UpdateDisplayPartsInRange(_9,0,this._displayLength);
return this._GetVisibleValues(this._displayParts);
},set_cursorPosition:function(_a){
if(!this._focused){
return;
}
this._calculateSelection();
if(Sys.Browser.agent==Sys.Browser.InternetExplorer){
this._textBoxElement.select();
sel=document.selection.createRange();
var _b=this._textBoxElement.value.substr(0,_a).split("\r\n").length-1;
sel.move("character",_a-_b);
sel.select();
}else{
this._textBoxElement.selectionStart=_a;
this._textBoxElement.selectionEnd=_a;
}
},get_value:function(){
var _c=[];
for(var i=0;i<this._parts.length;i++){
_c[i]=this._parts[i].GetValue();
}
return _c.join("");
},set_value:function(_e){
this._SetValue(_e);
this.raise_valueChanged();
this._textBoxElement._oldValue=this._textBoxElement.value;
},get_promptChar:function(){
return this._promptChar;
},set_promptChar:function(_f){
if(this._promptChar!=_f){
this._promptChar=_f;
this.raisePropertyChanged("PromptChar");
}
},get_displayPromptChar:function(){
return this._displayPromptChar;
},set_displayPromptChar:function(_10){
if(this._displayPromptChar!=_10){
this._displayPromptChar=_10;
this.raisePropertyChanged("DisplayPromptChar");
}
},get_displayPromptChar:function(){
return this._displayPromptChar;
},set_displayPromptChar:function(_11){
if(this._displayPromptChar!=_11){
this._displayPromptChar=_11;
this.raisePropertyChanged("DisplayPromptChar");
}
},get_displayPromptChar:function(){
return this._displayPromptChar;
},set_displayPromptChar:function(_12){
if(this._displayPromptChar!=_12){
this._displayPromptChar=_12;
this.raisePropertyChanged("DisplayPromptChar");
}
},get_displayFormatPosition:function(){
return this._displayFormatPosition;
},set_displayFormatPosition:function(_13){
if(this._displayFormatPosition!=_13){
this._displayFormatPosition=_13;
this.raisePropertyChanged("DisplayFormatPosition");
}
},get_hideOnBlur:function(){
return this._hideOnBlur;
},set_hideOnBlur:function(_14){
if(this._hideOnBlur!=_14){
this._hideOnBlur=_14;
this.raisePropertyChanged("HideOnBlur");
}
},get_resetCaretOnFocus:function(){
return this._resetCaretOnFocus;
},set_resetCaretOnFocus:function(_15){
if(this._resetCaretOnFocus!=_15){
this._resetCaretOnFocus=_15;
this.raisePropertyChanged("ResetCaretOnFocus");
}
},get_roundNumericRanges:function(){
return this._roundNumericRanges;
},set_roundNumericRanges:function(_16){
if(this._roundNumericRanges!=_16){
this._roundNumericRanges=_16;
this.raisePropertyChanged("RoundNumericRanges");
}
},get_allowEmptyEnumerations:function(){
return this._allowEmptyEnumerations;
},set_allowEmptyEnumerations:function(_17){
if(this._allowEmptyEnumerations!=_17){
this._allowEmptyEnumerations=_17;
this.raisePropertyChanged("AllowEmptyEnumerations");
}
},get_readOnly:function(){
return this._readOnly;
},set_readOnly:function(_18){
if(this._readOnly!=_18){
this._readOnly=_18;
this.raisePropertyChanged("ReadOnly");
}
},get_focusOnStartup:function(){
return this._focusOnStartup;
},set_focusOnStartup:function(_19){
if(this._focusOnStartup!=_19){
this._focusOnStartup=_19;
this.raisePropertyChanged("FocusOnStartup");
}
},_attachMouseEventHandlers:function(){
Telerik.Web.UI.RadMaskedTextBox.callBaseMethod(this,"_attachMouseEventHandlers");
this._onTextBoxMouseUpDelegate=Function.createDelegate(this,this._onTextBoxMouseUpHandler);
this._onTextBoxMouseDownDelegate=Function.createDelegate(this,this._onTextBoxMouseDownHandler);
$addHandler(this._textBoxElement,"mouseup",this._onTextBoxMouseUpDelegate);
$addHandler(this._textBoxElement,"mousedown",this._onTextBoxMouseDownDelegate);
},_attachEventHandlers:function(){
Telerik.Web.UI.RadMaskedTextBox.callBaseMethod(this,"_attachEventHandlers");
this._onFormResetDelegate=Function.createDelegate(this,this._onFormResetHandler);
$addHandler(this._textBoxElement.form,"reset",this._onFormResetDelegate);
if(Sys.Browser.agent==Sys.Browser.InternetExplorer){
this._onTextBoxPasteDelegate=Function.createDelegate(this,this._onTextBoxPasteHandler);
this._onTextBoxPropertyChangeDelegate=Function.createDelegate(this,this._onTextBoxPropertyChangeHandler);
$addHandler(this._textBoxElement,"paste",this._onTextBoxPasteDelegate);
$addHandler(this._textBoxElement,"propertychange",this._onTextBoxPropertyChangeDelegate);
}else{
this._onTextBoxInputDelegate=Function.createDelegate(this,this._onTextBoxInputHandler);
$addHandler(this._textBoxElement,"input",this._onTextBoxInputDelegate);
}
if(Sys.Browser.agent==Sys.Browser.Opera){
var _1a=this;
var _1b=function(){
return _1a._ValueHandler({});
};
setInterval(_1b,10);
}
},_SetValue:function(_1c){
this._internalValueUpdate=true;
this._UpdatePartsInRange(_1c,0,this._length);
this._internalValueUpdate=false;
this._Visualise();
},_initializeHiddenElement:function(id){
this._hiddenElement=$get(id+"_Value");
},_initializeValidationField:function(id){
this._validationField=$get(id);
},_setValidationField:function(_1f){
if(this.isEmpty()){
this._validationField.value="";
}else{
this._validationField.value=this.get_valueWithLiterals();
}
},_getValidationField:function(_20){
return this._validationField;
},_onFormResetHandler:function(e){
this._setHiddenValue(this._originalValue);
this._SetValue(this._originalValue);
},_onTextBoxInputHandler:function(e){
this._ValueHandler(e);
},_onMouseWheel:function(e){
return this._OnMouseWheel(event);
},_onTextBoxPropertyChangeHandler:function(e){
this._OnPropertyChange();
},_onTextBoxPasteHandler:function(e){
if(this.get_readOnly()){
return false;
}
if(this._selectionStart==this._value.length){
return false;
}
var _26=this;
setTimeout(function(){
_26._FakeOnPropertyChange();
},1);
},_onTextBoxBlurHandler:function(e){
this._focused=false;
this._hovered=false;
this.raise_valueChanged();
this.raise_blur(Sys.EventArgs.Empty);
this.updateDisplayValue();
this.updateCssClass();
if(this.get_autoPostBack()&&this._ValueHasChanged()){
this.raisePostBackEvent();
}
this._textBoxElement._oldValue=this._textBoxElement.value;
},_onTextBoxMouseUpHandler:function(e){
this._FakeOnPropertyChange();
this._ValueHandler(e);
this._ActivityHandler(e);
},_onTextBoxMouseOutHandler:function(e){
this._hovered=false;
this.updateCssClass();
this.raise_mouseOut(Sys.EventArgs.Empty);
},_onTextBoxMouseOverHandler:function(e){
this._FakeOnPropertyChange();
this._hovered=true;
this.updateCssClass();
this.raise_mouseOver(Sys.EventArgs.Empty);
},_onTextBoxMouseDownHandler:function(e){
this._FakeOnPropertyChange();
this._ActivityHandler(e);
},_onTextBoxFocusHandler:function(e){
this._focused=true;
this.updateDisplayValue();
this.updateCssClass();
this._updateSelectionOnFocus();
this._FakeOnPropertyChange();
this._ActivityHandler(e);
this.raise_focus(Sys.EventArgs.Empty);
},_onTextBoxKeyUpHandler:function(e){
this._FakeOnPropertyChange();
},_OnActivity:function(e){
this._calculateSelection();
this._lastState=new Telerik.Web.UI.MaskedEventWrap(e,this._textBoxElement);
},_OnPropertyChange:function(){
if(this._internalValueUpdate){
return;
}
if(event.propertyName=="value"){
var e=event;
var _30=this;
var _31=function(){
_30._ValueHandler(e);
};
this._calculateSelection();
if(this._textBoxElement.selectionStart>0||this._textBoxElement.selectionEnd>0){
_31();
}else{
setTimeout(_31,1);
}
}
},_onTextBoxMouseWheelHandler:function(e){
if(this.get_readOnly()){
return false;
}
this._calculateSelection();
var _33=this._partIndex[this._textBoxElement.selectionStart];
if(_33==null){
return true;
}
return _33.HandleWheel(e);
},_updateSelectionOnFocus:function(){
switch(this.get_selectionOnFocus()){
case 0:
break;
case 1:
var _34=0;
var i;
for(i=0;i<this._partIndex.length;i++){
if(!this._partIndex[i].ch){
_34=i;
break;
}
}
this.set_caretPosition(_34);
break;
case 2:
if(this._textBoxElement.value.length>0){
this.set_caretPosition(this._textBoxElement.value.length);
}
break;
case 3:
this.selectAllText();
break;
default:
this.set_caretPosition(0);
break;
}
},_onTextBoxKeyDownHandler:function(e){
this._FakeOnPropertyChange();
if(this.inSelection(e)){
return true;
}
var _37=this._partIndex[this._textBoxElement.selectionStart];
if(this.get_readOnly()&&(e.keyCode==46||e.keyCode==8||e.keyCode==38||e.keyCode==40)){
e.preventDefault();
return false;
}else{
if(e.keyCode==13){
return true;
}else{
if(_37==null&&e.keyCode!=8){
return true;
}else{
if(_37!=null){
if(_37.HandleKey(e)){
e.preventDefault();
return false;
}
}
}
}
}
var _38=this._textBoxElement.selectionEnd;
var _39=false;
if((e.keyCode==46)&&_38<this._textBoxElement.value.length&&Sys.Browser.agent!=Sys.Browser.Opera){
_37.SetValue("",this._textBoxElement.selectionStart);
_38++;
_39=true;
}else{
if(e.keyCode==8&&_38&&Sys.Browser.agent!=Sys.Browser.Opera){
this._partIndex[this._textBoxElement.selectionStart-1].SetValue("",this._textBoxElement.selectionStart-1);
_38--;
_39=true;
}
}
if(_39){
return this._UpdateAfterKeyHandled(e,_38);
}
this._OnActivity(e);
return true;
},_onTextBoxKeyPressHandler:function(e){
if(this.get_readOnly()){
e.preventDefault();
e.stopPropagation();
return false;
}
var _3b=new Telerik.Web.UI.InputKeyPressEventArgs(e,e.charCode,String.fromCharCode(e.charCode));
this.raise_keyPress(_3b);
if(_3b.get_cancel()){
e.stopPropagation();
e.preventDefault();
return false;
}
if(this.inSelection(e)){
return true;
}
var _3c=this._partIndex[this._textBoxElement.selectionStart];
if(_3c==null){
return true;
}
if(Sys.Browser.agent==Sys.Browser.Firefox||Sys.Browser.agent==Sys.Browser.Opera){
if(e.charCode==8){
e.preventDefault();
e.stopPropagation();
return false;
}
if(!e.which){
this._OnActivity(e);
e.stopPropagation();
return true;
}
}
var _3d=this._textBoxElement.selectionEnd;
if(e.charCode==13){
if(this.get_autoPostBack()){
this.raisePostBackEvent();
}
return true;
}
var ch=String.fromCharCode(e.charCode);
if(_3c.CanHandle(ch)){
while(_3d<this._textBoxElement.value.length){
if(this._partIndex[_3d].SetValue(ch,_3d)){
_3d++;
break;
}
_3d++;
}
}
var _3f=this._UpdateAfterKeyHandled(e,_3d);
if(!_3f){
e.preventDefault();
}
e.stopPropagation();
return _3f;
},_OnEnumChanged:function(_40,_41,_42){
var _43=new Telerik.Web.UI.MaskedTextBoxEventArgs(_42,_41,_40);
this.raise_enumerationChanged(_43);
},_OnMoveUp:function(_44,_45,_46){
var _47=new Telerik.Web.UI.MaskedTextBoxEventArgs(_46,_45,_44);
this.raise_moveUp(_47);
},_OnMoveDown:function(_48,_49,_4a){
var _4b=new Telerik.Web.UI.MaskedTextBoxEventArgs(_4a,_49,_48);
this.raise_moveDown(_4b);
},_OnValueChange:function(_4c,_4d,_4e){
var _4f=new Telerik.Web.UI.MaskedTextBoxEventArgs(_4e,_4d,_4c);
this.raiseEvent("valueChanged",_4f);
},_OnChunkError:function(_50,_51,_52){
var _53=new Telerik.Web.UI.MaskedTextBoxEventArgs(_52,_51,_50);
this.raise_error(_53);
},_fixAbsolutePositioning:function(){
var f=this._textBoxElement;
if(f.previousSibling&&f.previousSibling.tagName.toLowerCase()=="label"&&f.style.position=="absolute"){
f.style.position="static";
var _55=f.parentNode;
_55.style.position="absolute";
_55.style.top=f.style.top;
_55.style.left=f.style.left;
}
},_RecordInitialState:function(){
this.initialFieldValue=this._textBoxElement.value;
},_PartAt:function(_56){
return this._partIndex[_56];
},_CreatePartCollection:function(_57,_58){
var _59;
var _5a=[];
var _5b=0;
for(var j=0;j<_57.length;j++){
_59=_57[j];
_59.PromptChar=_58;
_59.SetController(this);
_59.index=this._parts.length;
_5a[_5a.length]=_59;
if(_5a.length>1){
_5a[_5a.length-2].NextChunk=_59;
}
_59.NextChunk=null;
var _5d=_59.GetLength();
_59.offset=_5b;
_5b+=_5d;
}
return _5a;
},_setMask:function(_5e){
this._parts=this._CreatePartCollection(_5e,this.get_promptChar());
for(var i=0;i<this._parts.length;i++){
var _60=this._parts[i].GetLength();
for(var j=this._length;j<this._length+_60;j++){
this._partIndex[j]=this._parts[i];
}
this._length+=_60;
}
},_setDisplayMask:function(_62){
this._displayParts=this._CreatePartCollection(_62,this.get_displayPromptChar());
for(var i=0;i<this._displayParts.length;i++){
var _64=this._displayParts[i];
var _65=_64.GetLength();
if(_64.ch){
continue;
}
for(var j=this._displayLength;j<this._displayLength+_65;j++){
this._displayPartIndex[j]=this._displayParts[i];
}
this._displayLength+=_65;
}
},_SafariSelectionFix:function(e){
var _68=this._StrCompare(this._lastState.fieldValue,e.fieldValue);
e._selectionStart=_68[0];
e._selectionEnd=_68[0];
this._lastState._selectionStart=_68[1];
this._lastState._selectionEnd=_68[2];
},_HandleValueChange:function(e){
if(this.get_readOnly()){
this._Visualise();
return false;
}
if(this._lastState==null){
return;
}
var i,j;
if(Sys.Browser.agent==Sys.Browser.Safari){
this._SafariSelectionFix(e);
}
if(this._lastState.fieldValue.length>e.fieldValue.length){
if(e._selectionStart==this._textBoxElement.value.length){
this._partIndex[this._partIndex.length-1].SetValue("",this._partIndex.length-1);
}
if(this._lastState._selectionEnd>e._selectionStart){
i=this._lastState._selectionEnd;
while(i-->e._selectionStart){
this._partIndex[i].SetValue("",i);
}
}else{
i=this._lastState._selectionEnd+1;
while(i-->e._selectionStart){
this._partIndex[i].SetValue("",i);
e._selectionEnd++;
}
}
}
var _6c=this._lastState._selectionStart;
var _6d=Math.min(e._selectionStart,this._length);
var _6e=e.fieldValue.substr(_6c,_6d-_6c);
var _6f=this._UpdatePartsInRange(_6e,_6c,_6d);
e._selectionEnd+=_6f;
this._FixSelection(e);
},_SetPartValues:function(_70,_71,_72,_73,to){
var _75;
var i=0;
var j=_73;
var _78=0;
_72=_72.toString();
while(i<to-_73&&j<_71){
_75=_72.charAt(i);
if(_75==this.get_promptChar()){
_75="";
}
if(_70[j].SetValue(_75,j)){
i++;
}else{
_78++;
}
j++;
}
return _78;
},_UpdateDisplayPartsInRange:function(_79,_7a,to){
this._SetPartValues(this._displayPartIndex,this._displayLength,_79,_7a,to);
},_UpdatePartsInRange:function(_7c,_7d,to){
var _7f=this._SetPartValues(this._partIndex,this._length,_7c,_7d,to);
this._Visualise();
return _7f;
},_FixSelection:function(_80){
this.set_cursorPosition(_80._selectionEnd);
},_GetVisibleValues:function(_81){
var _82=[];
for(var i=0;i<_81.length;i++){
_82[i]=_81[i].GetVisValue();
}
return _82.join("");
},_Visualise:function(){
var _84=this.get_valueWithPromptAndLiterals();
var _85=this.get_value();
this._internalValueUpdate=true;
this._Render(_84);
this.updateCssClass();
this._value=_85;
this.updateHiddenValue();
this._internalValueUpdate=false;
this._projectedValue=this._textBoxElement.value;
},_Render:function(_86){
this._isEmptyMessage=false;
if(!this._focused){
if(this.get_hideOnBlur()&&this.isEmpty()){
this._isEmptyMessage=true;
this.set_textBoxValue(this.get_emptyMessage());
}else{
if(this._displayParts&&this._displayParts.length){
this.set_textBoxValue(this.get_displayValue());
}else{
this.set_textBoxValue(_86);
}
}
}else{
this.set_textBoxValue(_86);
}
},_getResetValue:function(){
var _87="";
var _88=this._parts[0];
while(_88.NextChunk){
if(_88.GetVisValue()==_88.GetValue()){
_87+=_88.PromptChar;
}else{
_87+=_88.GetVisValue();
}
_88=_88.NextChunk;
}
return _87;
},_ValueHasChanged:function(){
return this._textBoxElement.value!=this._textBoxElement._oldValue;
},_FakeOnPropertyChange:function(){
if(document.createEventObject){
if(event){
var ev=document.createEventObject(event);
}else{
var ev=document.createEventObject();
}
ev.propertyName="value";
this._textBoxElement.fireEvent("onpropertychange",ev);
}
},_UpdateAfterKeyHandled:function(e,_8b){
this._Visualise();
var _8c=new Telerik.Web.UI.MaskedEventWrap(e,this._textBoxElement);
_8c._selectionEnd=_8b;
this._FixSelection(_8c);
return false;
},_ValueHandler:function(e){
if(this._internalValueUpdate){
return true;
}
if(!e){
e=window.event;
}
this._calculateSelection();
var _8e=new Telerik.Web.UI.MaskedEventWrap(e,this._textBoxElement);
if(_8e.fieldValue!=this._projectedValue){
this._HandleValueChange(_8e);
}
return true;
},_ActivityHandler:function(e){
if(this._internalValueUpdate){
return true;
}
if(!e){
e=window.event;
}
this._OnActivity(e);
return true;
},_calculateSelection:function(){
if(document.selection&&Sys.Browser.agent!=Sys.Browser.Opera){
var s1;
try{
s1=document.selection.createRange();
}
catch(error){
return;
}
if(s1.parentElement()!=this._textBoxElement){
return;
}
var s=s1.duplicate();
if(this._isTextarea){
s.moveToElementText(this._textBoxElement);
}else{
s.move("character",-this._textBoxElement.value.length);
}
s.setEndPoint("EndToStart",s1);
this._textBoxElement.selectionStart=s.text.length;
this._textBoxElement.selectionEnd=this._textBoxElement.selectionStart+s1.text.length;
if(this._isTextarea){
}
}
},_StrCompare:function(_92,_93){
var i;
var _95,_96,_97;
i=0;
while(_92.charAt(i)==_93.charAt(i)&&i<_92.length){
i++;
}
_96=i;
_92=_92.substr(_96).split("").reverse().join("");
_93=_93.substr(_96).split("").reverse().join("");
i=0;
while(_92.charAt(i)==_93.charAt(i)&&i<_92.length){
i++;
}
_95=_96+_93.length-i;
_97=_92.length-i+_96;
return [_95,_96,_97];
},get__initialMasks:function(){
return this._initialMasks;
},set__initialMasks:function(_98){
this._initialMasks=_98;
},get__initialDisplayMasks:function(){
return this._initialDisplayMasks;
},set__initialDisplayMasks:function(_99){
this._initialDisplayMasks=_99;
},raise_valueChanged:function(){
this._triggerDOMChangeEvent(this._getValidationField());
if(this._ValueHasChanged()){
this._OnValueChange(null,this._textBoxElement._oldValue,this._textBoxElement.value);
}
}};
$telerik.makeCompatible(Telerik.Web.UI.RadMaskedTextBox);
Telerik.Web.UI.RadMaskedTextBox.registerClass("Telerik.Web.UI.RadMaskedTextBox",Telerik.Web.UI.RadInputControl);;