﻿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._isInitialized=false;
};
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;
},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;
},_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 _25=this;
setTimeout(function(){
_25._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 _2f=this;
var _30=function(){
_2f._ValueHandler(e);
};
this._calculateSelection();
if(this.TextBoxElement.selectionStart>0||this.TextBoxElement.selectionEnd>0){
_30();
}else{
setTimeout(_30,1);
}
}
},_onTextBoxMouseWheelHandler:function(e){
if(this.get_readOnly()){
return false;
}
this._calculateSelection();
var _32=this._partIndex[this.TextBoxElement.selectionStart];
if(_32==null){
return true;
}
return _32.HandleWheel(e);
},_updateSelectionOnFocus:function(){
switch(this.get_selectionOnFocus()){
case 0:
break;
case 1:
var _33=0;
var i;
for(i=0;i<this._partIndex.length;i++){
if(!this._partIndex[i].ch){
_33=i;
break;
}
}
this.set_caretPosition(_33);
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 _36=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(_36==null&&e.keyCode!=8){
return true;
}else{
if(_36!=null){
if(_36.HandleKey(e)){
e.preventDefault();
return false;
}
}
}
}
}
var _37=this.TextBoxElement.selectionEnd;
var _38=false;
if((e.keyCode==46)&&_37<this.TextBoxElement.value.length&&Sys.Browser.agent!=Sys.Browser.Opera){
_36.SetValue("",this.TextBoxElement.selectionStart);
_37++;
_38=true;
}else{
if(e.keyCode==8&&_37&&Sys.Browser.agent!=Sys.Browser.Opera){
this._partIndex[this.TextBoxElement.selectionStart-1].SetValue("",this.TextBoxElement.selectionStart-1);
_37--;
_38=true;
}
}
if(_38){
return this._UpdateAfterKeyHandled(e,_37);
}
this._OnActivity(e);
return true;
},_onTextBoxKeyPressHandler:function(e){
if(this.get_readOnly()){
e.preventDefault();
e.stopPropagation();
return false;
}
var _3a=new Telerik.Web.UI.InputKeyPressEventArgs(e,e.charCode,String.fromCharCode(e.charCode));
this.raise_keyPress(_3a);
if(_3a.get_cancel()){
e.stopPropagation();
e.preventDefault();
return false;
}
if(this.inSelection(e)){
return true;
}
var _3b=this._partIndex[this.TextBoxElement.selectionStart];
if(_3b==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 _3c=this.TextBoxElement.selectionEnd;
if(e.charCode==13){
if(this.get_autoPostBack()){
this.raisePostBackEvent();
}
return true;
}
var ch=String.fromCharCode(e.charCode);
if(_3b.CanHandle(ch)){
while(_3c<this.TextBoxElement.value.length){
if(this._partIndex[_3c].SetValue(ch,_3c)){
_3c++;
break;
}
_3c++;
}
}
var _3e=this._UpdateAfterKeyHandled(e,_3c);
if(!_3e){
e.preventDefault();
}
e.stopPropagation();
return _3e;
},_OnEnumChanged:function(_3f,_40,_41){
var _42=new Telerik.Web.UI.MaskedTextBoxEventArgs(_41,_40,_3f);
this.raise_enumerationChanged(_42);
},_OnMoveUp:function(_43,_44,_45){
var _46=new Telerik.Web.UI.MaskedTextBoxEventArgs(_45,_44,_43);
this.raise_moveUp(_46);
},_OnMoveDown:function(_47,_48,_49){
var _4a=new Telerik.Web.UI.MaskedTextBoxEventArgs(_49,_48,_47);
this.raise_moveDown(_4a);
},_OnValueChange:function(_4b,_4c,_4d){
var _4e=new Telerik.Web.UI.MaskedTextBoxEventArgs(_4d,_4c,_4b);
this.raiseEvent("valueChanged",_4e);
},_OnChunkError:function(_4f,_50,_51){
var _52=new Telerik.Web.UI.MaskedTextBoxEventArgs(_51,_50,_4f);
this.raise_error(_52);
},_fixAbsolutePositioning:function(){
var f=this.TextBoxElement;
if(f.previousSibling&&f.previousSibling.tagName.toLowerCase()=="label"&&f.style.position=="absolute"){
f.style.position="static";
var _54=f.parentNode;
_54.style.position="absolute";
_54.style.top=f.style.top;
_54.style.left=f.style.left;
}
},_RecordInitialState:function(){
this.initialFieldValue=this.TextBoxElement.value;
},_PartAt:function(_55){
return this._partIndex[_55];
},_CreatePartCollection:function(_56,_57){
var _58;
var _59=[];
var _5a=0;
for(var j=0;j<_56.length;j++){
_58=_56[j];
_58.PromptChar=_57;
_58.SetController(this);
_58.index=this._parts.length;
_59[_59.length]=_58;
if(_59.length>1){
_59[_59.length-2].NextChunk=_58;
}
_58.NextChunk=null;
var _5c=_58.GetLength();
_58.offset=_5a;
_5a+=_5c;
}
return _59;
},_setMask:function(_5d){
this._parts=this._CreatePartCollection(_5d,this.get_promptChar());
for(var i=0;i<this._parts.length;i++){
var _5f=this._parts[i].GetLength();
for(var j=this._length;j<this._length+_5f;j++){
this._partIndex[j]=this._parts[i];
}
this._length+=_5f;
}
},_setDisplayMask:function(_61){
this._displayParts=this._CreatePartCollection(_61,this.get_displayPromptChar());
for(var i=0;i<this._displayParts.length;i++){
var _63=this._displayParts[i];
var _64=_63.GetLength();
if(_63.ch){
continue;
}
for(var j=this._displayLength;j<this._displayLength+_64;j++){
this._displayPartIndex[j]=this._displayParts[i];
}
this._displayLength+=_64;
}
},_SafariSelectionFix:function(e){
var _67=this._StrCompare(this._lastState.fieldValue,e.fieldValue);
e._selectionStart=_67[0];
e._selectionEnd=_67[0];
this._lastState._selectionStart=_67[1];
this._lastState._selectionEnd=_67[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 _6b=this._lastState._selectionStart;
var _6c=Math.min(e._selectionStart,this._length);
var _6d=e.fieldValue.substr(_6b,_6c-_6b);
var _6e=this._UpdatePartsInRange(_6d,_6b,_6c);
e._selectionEnd+=_6e;
this._FixSelection(e);
},_SetPartValues:function(_6f,_70,_71,_72,to){
var _74;
var i=0;
var j=_72;
var _77=0;
_71=_71.toString();
while(i<to-_72&&j<_70){
_74=_71.charAt(i);
if(_74==this.get_promptChar()){
_74="";
}
if(_6f[j].SetValue(_74,j)){
i++;
}else{
_77++;
}
j++;
}
return _77;
},_UpdateDisplayPartsInRange:function(_78,_79,to){
this._SetPartValues(this._displayPartIndex,this._displayLength,_78,_79,to);
},_UpdatePartsInRange:function(_7b,_7c,to){
var _7e=this._SetPartValues(this._partIndex,this._length,_7b,_7c,to);
this._Visualise();
return _7e;
},_FixSelection:function(_7f){
this.set_cursorPosition(_7f._selectionEnd);
},_GetVisibleValues:function(_80){
var _81=[];
for(var i=0;i<_80.length;i++){
_81[i]=_80[i].GetVisValue();
}
return _81.join("");
},_Visualise:function(){
var _83=this.get_valueWithPromptAndLiterals();
var _84=this.get_value();
this._internalValueUpdate=true;
this._Render(_83);
this.updateCssClass();
this._value=_84;
this.updateHiddenValue();
this._internalValueUpdate=false;
this._projectedValue=this.TextBoxElement.value;
},_Render:function(_85){
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(_85);
}
}
}else{
this.set_textBoxValue(_85);
}
},_onFormResetHandler:function(){
var _86=this._getResetValue();
this.set_value(_86);
this.TextBoxElement.defaultValue=_86;
this._Visualise();
},_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);
}
}};
$telerikCommon.makeCompatible(Telerik.Web.UI.RadMaskedTextBox);
Telerik.Web.UI.RadMaskedTextBox.registerClass("Telerik.Web.UI.RadMaskedTextBox",Telerik.Web.UI.RadInputControl);;
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();