function RadDigitMaskPart(){
}
RadDigitMaskPart.prototype=new RadMaskPart();
RadDigitMaskPart.prototype.GetValue=function(){
return this.value.toString();
};
RadDigitMaskPart.prototype.IsCaseSensitive=function(){
return true;
};
RadDigitMaskPart.prototype.GetVisValue=function(){
if(this.value.toString()==""){
if(this.PromptChar==""){
return " ";
}else{
return this.PromptChar;
}
}
return this.value.toString();
};
RadDigitMaskPart.prototype.CanHandle=function(_1,_2){
if(isNaN(parseInt(_1))){
this.controller.OnChunkError(this,this.GetValue(),_1);
return false;
}
return true;
};
RadDigitMaskPart.prototype.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;
};;function RadEnumerationMaskPart(_1){
this.SetOptions(_1);
this.lastOffsetPunched=-1;
this.selectedForCompletion=0;
this.FlipDirection=0;
this.RebuildKeyBuff();
}
RadEnumerationMaskPart.prototype=new RadMaskPart();
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;
}
};
RadEnumerationMaskPart.prototype.CanHandle=function(){
return true;
};
RadEnumerationMaskPart.prototype.SetController=function(_4){
this.controller=_4;
this.InitializeSelection(_4.AllowEmptyEnumerations);
};
RadEnumerationMaskPart.prototype.InitializeSelection=function(_5){
if(_5){
this.value="";
this.selectedIndex=-1;
}else{
this.value=this.Options[0];
this.selectedIndex=0;
}
};
RadEnumerationMaskPart.prototype.RebuildKeyBuff=function(){
this.keyBuff=[];
for(i=0;i<this.length;i++){
this.keyBuff[i]="";
}
this.keyBuffRebuilt=true;
};
RadEnumerationMaskPart.prototype.IsCaseSensitive=function(){
return true;
};
RadEnumerationMaskPart.prototype.ShowHint=function(_6){
var _7=this;
for(var i=0;i<this.Options.length;i++){
var _9=document.createElement("a");
_9.index=i;
_9.onclick=function(){
_7.SetOption(this.index);
_7.controller.Visualise();
return false;
};
_9.innerHTML=this.Options[i];
_9.href="javascript:void(0)";
_6.appendChild(_9);
}
return true;
};
RadEnumerationMaskPart.prototype.ResetCompletion=function(){
this.selectedForCompetion=0;
};
RadEnumerationMaskPart.prototype.SelectNextCompletion=function(){
this.selectedForCompletion++;
};
RadEnumerationMaskPart.prototype.Store=function(_a,_b){
if(this.lastOffsetPunched==_b){
if(this.keyBuff[_b]==_a){
this.SelectNextCompletion();
}else{
this.RebuildKeyBuff();
}
}else{
this.ResetCompletion();
}
this.lastOffsetPunched=_b;
this.keyBuff[_b]=_a;
};
RadEnumerationMaskPart.prototype.SetNoCompletionValue=function(){
if(this.controller.AllowEmptyEnumerations){
this.SetOption(-1);
}
};
RadEnumerationMaskPart.prototype.SetValue=function(_c,_d){
_d-=this.offset;
this.Store(_c,_d);
var _e=new CompletionList(this.Options,this.PromptChar);
var _f=_e.GetCompletions(this.keyBuff,_d);
if(_f.length>0){
var _10=this.optionsIndex[_f[this.selectedForCompletion%_f.length]];
this.SetOption(_10);
}else{
this.SetNoCompletionValue();
return false;
}
return true;
};
RadEnumerationMaskPart.prototype.GetVisValue=function(){
var v=this.value;
while(v.length<this.length){
v+=this.PromptChar;
}
return v;
};
RadEnumerationMaskPart.prototype.GetLength=function(){
return this.length;
};
RadEnumerationMaskPart.prototype.GetSelectedIndex=function(){
return this.selectedIndex;
};
RadEnumerationMaskPart.prototype.SetOption=function(_12,up){
var _14=this.value;
if(this.controller.AllowEmptyEnumerations){
if(_12<-1){
_12=this.Options.length+_12+1;
this.FlipDirection=-1;
}else{
if(_12>=this.Options.length){
_12=_12-this.Options.length-1;
this.FlipDirection=1;
}
}
}else{
if(_12<0){
_12=this.Options.length+_12;
this.FlipDirection=-1;
}else{
if(_12>=this.Options.length){
_12=_12-this.Options.length;
this.FlipDirection=1;
}
}
}
this.selectedIndex=_12;
this.value=_12==-1?"":this.Options[_12];
if(typeof (up)!="undefined"){
if(up){
this.controller.OnMoveUp(this,_14,this.value);
}else{
this.controller.OnMoveDown(this,_14,this.value);
}
}
this.controller.OnEnumChanged(this,_14,this.value);
this.FlipDirection=0;
};
RadEnumerationMaskPart.prototype.HandleKey=function(e){
this.controller.CalculateSelection();
var _16=new MaskedEventWrap(e,this.controller.field);
if(_16.IsDownArrow()){
this.SetOption(this.selectedIndex+1,false);
this.controller.Visualise();
this.controller.FixSelection(_16);
return true;
}else{
if(_16.IsUpArrow()){
this.SetOption(this.selectedIndex-1,true);
this.controller.Visualise();
this.controller.FixSelection(_16);
return true;
}
}
};
RadEnumerationMaskPart.prototype.HandleWheel=function(e){
this.controller.CalculateSelection();
var _18=new MaskedEventWrap(e,this.controller.field);
this.SetOption(this.selectedIndex-e.wheelDelta/120);
this.controller.Visualise();
this.controller.FixSelection(_18);
return false;
};
function CompletionList(_19,_1a){
this.options=_19;
this.blankChar=_1a;
}
CompletionList.prototype.GetCompletions=function(_1b,_1c){
var _1d=this.options;
for(var _1e=0;_1e<=_1c;_1e++){
var _1f=_1b[_1e].toLowerCase();
_1d=this.FilterCompletions(_1d,_1e,_1f);
}
return _1d;
};
CompletionList.prototype.FilterCompletions=function(_20,_21,key){
var _23=[];
for(var _24=0;_24<_20.length;_24++){
var _25=_20[_24];
var _26=_25.charAt(_21).toLowerCase();
if(this.CharacterMatchesCompletion(key,_26)){
_23[_23.length]=_25;
}
}
return _23;
};
CompletionList.prototype.CharacterMatchesCompletion=function(_27,_28){
return _27==this.blankChar||_27==" "||_27==_28;
};;function RadFreeMaskPart(){
}
RadFreeMaskPart.prototype=new RadMaskPart();
RadFreeMaskPart.prototype.IsCaseSensitive=function(){
return true;
};
RadFreeMaskPart.prototype.GetVisValue=function(){
if(this.value.toString()==""){
return this.PromptChar;
}
return this.value;
};
RadFreeMaskPart.prototype.SetValue=function(_1,_2){
this.value=_1;
return true;
};;function RadInputHint(_1,_2){
this.textBox=_1;
this.skin=_2;
}
RadInputHint.prototype.Show=function(_3,_4){
if(_3){
var _5=this.GetRect(this.textBox.field);
this.Container=document.createElement("div");
if(_3.ShowHint(this.Container)){
this.Container.className="radHint_"+this.skin;
document.body.appendChild(this.Container);
this.Container.style.position="absolute";
if(_4){
this.Container.style.left=_4.left+this.BodyScrollWidth()+"px";
this.Container.style.top=_5.Y+_5.Height+"px";
}else{
this.Container.style.left=_5.X+"px";
this.Container.style.top=_5.Y+_5.Height+"px";
}
this.CreateOverlay();
this.textBox.OnShowHint(this);
}else{
this.Container=null;
}
}
};
RadInputHint.prototype.HideOverlay=function(){
if(this.shim){
this.shim.style.visibility="hidden";
}
};
RadInputHint.prototype.CreateOverlay=function(){
if(window.opera){
return;
}
if(!this.shim){
this.shim=document.createElement("IFRAME");
this.shim.src="javascript:false;";
this.shim.frameBorder=0;
this.shim.id=this.Container.parentNode.id+"Overlay";
this.shim.style.position="absolute";
this.shim.style.visibility="hidden";
this.shim.style.border="1px solid red";
this.shim.style.filter="progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)";
this.shim.allowTransparency=false;
this.Container.parentNode.insertBefore(this.shim,this.Container);
}
var _6=this.GetRect(this.Container);
this.shim.style.cssText=this.Container.style.cssText;
this.shim.style.left=_6.X+"px";
this.shim.style.top=_6.Y+"px";
this.shim.style.width=_6.Width+"px";
this.shim.style.height=_6.Height+"px";
this.shim.style.visibility="visible";
};
RadInputHint.prototype.FindScrollPosX=function(_7){
var x=0;
var _9=_7;
while(_9.parentNode&&_9.parentNode.tagName!="BODY"){
if(typeof (_9.parentNode.scrollLeft)=="number"){
x+=_9.parentNode.scrollLeft;
}
_9=_9.parentNode;
}
return x;
};
RadInputHint.prototype.FindScrollPosY=function(_a){
var y=0;
var _c=_a;
while(_c.parentNode&&_c.parentNode.tagName!="BODY"){
if(typeof (_c.parentNode.scrollTop)=="number"){
y+=_c.parentNode.scrollTop;
}
_c=_c.parentNode;
}
return y;
};
RadInputHint.prototype.BodyScrollWidth=function(){
var _d=0;
if(typeof (document.body.scrollLeft)=="number"){
_d+=document.body.scrollLeft;
}
if(typeof (document.documentElement.scrollLeft)=="number"){
_d+=document.documentElement.scrollLeft;
}
return _d;
};
RadInputHint.prototype.BodyScrollHeight=function(){
var _e=0;
if(typeof (document.body.scrollTop)=="number"){
_e+=document.body.scrollTop;
}
if(typeof (document.documentElement.scrollTop)=="number"){
_e+=document.documentElement.scrollTop;
}
return _e;
};
RadInputHint.prototype.FindScrollPosXOpera=function(_f){
var x=0;
var _11=_f;
while(_11.offsetParent&&_11.offsetParent.tagName!="BODY"){
if(typeof (_11.offsetParent.scrollLeft)=="number"){
x+=_11.offsetParent.scrollLeft;
}
_11=_11.offsetParent;
}
return x;
};
RadInputHint.prototype.FindScrollPosYOpera=function(_12){
var y=0;
var _14=_12;
while(_14.offsetParent&&_14.offsetParent.tagName!="BODY"){
if(typeof (_14.offsetParent.scrollTop)=="number"){
y+=_14.offsetParent.scrollTop;
}
_14=_14.offsetParent;
}
return y;
};
RadInputHint.prototype.Hide=function(){
if(this.Container){
this.HideOverlay();
this.Container.parentNode.removeChild(this.Container);
this.Container=null;
}
};
RadInputHint.prototype.GetRect=function(_15){
var _16=_15.offsetWidth;
var _17=_15.offsetHeight;
var x=0;
var y=0;
var _1a=_15;
while(_1a.offsetParent){
x+=_1a.offsetLeft;
y+=_1a.offsetTop;
_1a=_1a.offsetParent;
}
var _1b=0;
var _1c=0;
if(window.opera){
x-=this.FindScrollPosXOpera(_15);
y-=this.FindScrollPosYOpera(_15);
}else{
x-=this.FindScrollPosX(_15);
y-=this.FindScrollPosY(_15);
}
return {X:x,Y:y,Width:_16,Height:_17};
};;function RadLiteralMaskPart(ch){
this.ch=ch;
}
RadLiteralMaskPart.prototype=new RadMaskPart();
RadLiteralMaskPart.prototype.GetVisValue=function(){
return this.ch;
};
RadLiteralMaskPart.prototype.GetLength=function(){
if(this.controller.mozilla){
return this.ch.length-(this.ch.split("\r\n").length-1);
}
return this.ch.length;
};
RadLiteralMaskPart.prototype.GetValue=function(){
return "";
};
RadLiteralMaskPart.prototype.IsCaseSensitive=function(){
if(this.NextChunk!=null){
return this.NextChunk.IsCaseSensitive();
}
};
RadLiteralMaskPart.prototype.SetValue=function(_2,_3){
_3-=this.offset;
return _2==this.ch.charAt(_3)||!_2;
};
RadLiteralMaskPart.prototype.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());
}
};;function RadLowerMaskPart(){
}
RadLowerMaskPart.prototype=new RadMaskPart();
RadLowerMaskPart.prototype.CanHandle=function(_1,_2){
if(!RadMaskPart.IsAlpha(_1)){
this.controller.OnChunkError(this,this.GetValue(),_1);
return false;
}
return true;
};
RadLowerMaskPart.prototype.GetVisValue=function(){
if(this.value.toString()==""){
return this.PromptChar;
}
return this.value.toString();
};
RadLowerMaskPart.prototype.SetValue=function(_3,_4){
if(_3==""){
this.value="";
return true;
}
if(RadMaskPart.IsAlpha(_3)){
this.value=_3.toLowerCase();
}else{
this.controller.OnChunkError(this,this.GetValue(),_3);
}
return true;
};;if(typeof (window.RadInputNamespace)=="undefined"){
window.RadInputNamespace=new Object();
}
function RadMaskedTextBox(){
if(typeof (arguments.length)=="undefined"||arguments.length==0){
return;
}
var _1=arguments[0];
RadTextBox.Extend(this);
RadControlsNamespace.EventMixin.Initialize(this);
RadControlsNamespace.DomEventMixin.Initialize(this);
this.CallBase("DisposeOldInstance",arguments);
if(arguments.length){
this.StartUp(arguments[0],arguments[1]);
}
this.form=this.field.form;
}
RadMaskedTextBox.prototype.ShouldUseAttachEvent=function(_2){
return (_2.attachEvent&&!window.opera&&!window.netscape);
};
RadMaskedTextBox.prototype.StartUp=function(_3,_4){
this.PromptChar="_";
this.DisplayPromptChar="_";
this.ReadOnly=false;
this.DisplayFormatPosition=0;
this.HideOnBlur=false;
this.ResetCaretOnFocus=false;
this.EmptyMessage="";
this.AutoPostBack=false;
this.AllowEmptyEnumerations=false;
this.ShowHint=false;
this.RoundNumericRanges=true;
this.FocusOnStartup=false;
this.parts=[];
this.partIndex=[];
this.displayPartIndex=[];
this.value="";
this.blurred=true;
this.hiddenField=document.getElementById(_3+"_Value");
this.validationField=document.getElementById(_3);
this.field=document.getElementById(_3+"_TextBox");
this.Enabled=!this.field.disabled;
this.field.oldValue=this.field.value;
this.ID=_3;
this.lastState=null;
this.length=0;
this.displayLength=0;
this.internalValueUpdate=false;
this.projectedValue="";
this.Hint=new RadInputHint(this,_4);
this.isTextarea=this.field.tagName.toLowerCase()=="textarea";
this.safari=navigator.userAgent.indexOf("Safari")>-1;
this.mozilla=navigator.userAgent.indexOf("Gecko")>-1;
this.AttachEventHandlers();
this.AttachDomEvent(window,"unload","Dispose");
if(_4){
this.field.overClass="radHoverCss_"+_4;
this.field.focusClass="radFocusedCss_"+_4;
this.field.defaultClass=this.field.className?this.field.className:"radEnabledCss_"+_4;
this.field.errorClass="radInvalidCss_"+_4;
this.field.className=this.field.defaultClass;
}else{
var _5=this.field.className;
this.field.overClass=_5;
this.field.focusClass=_5;
this.field.defaultClass=_5;
this.field.errorClass=_5;
}
this.field.focused=false;
this.FixAbsolutePositioning();
};
RadMaskedTextBox.prototype.Dispose=function(){
this.CallBase("Dispose",arguments);
if(this.ShouldUseAttachEvent(window)){
for(var _6 in this.handlers){
if(!this.handlers.hasOwnProperty(_6)){
continue;
}
this.field.detachEvent(_6,this.handlers[_6]);
this.handlers[_6]=null;
}
this.disposeEventHandler=null;
this.handlers=null;
}
for(var _6 in this.field){
if(typeof (this.field[_6])=="function"){
try{
this.field[_6]=null;
}
catch(e){
}
}
}
this.hiddenField=null;
this.validationField=null;
this.field.oldValue=null;
this.parts=null;
this.Hint=null;
this.form=null;
this.field.parentNode.removeChild(this.field);
this.field=null;
};
RadMaskedTextBox.prototype.FixAbsolutePositioning=function(){
var f=this.field;
if(f.previousSibling&&f.previousSibling.tagName.toLowerCase()=="label"&&f.style.position=="absolute"){
f.style.position="static";
var _8=f.parentNode;
_8.style.position="absolute";
_8.style.top=f.style.top;
_8.style.left=f.style.left;
}
};
RadMaskedTextBox.prototype.Initialize=function(){
this.Visualise();
if(this.FocusOnStartup){
this.Focus();
}
this.RecordInitialState();
};
RadMaskedTextBox.prototype.Enable=function(){
this.field.disabled="";
this.Enabled=true;
};
RadMaskedTextBox.prototype.Disable=function(){
this.field.disabled="disabled";
this.Enabled=false;
};
RadMaskedTextBox.prototype.RecordInitialState=function(){
this.initialFieldValue=this.field.value;
};
RadMaskedTextBox.prototype.Focus=function(){
this.field.focus();
this.field.selectionStart=this.field.selectionEnd=0;
};
RadMaskedTextBox.prototype.PartAt=function(_9){
return this.partIndex[_9];
};
RadMaskedTextBox.prototype.SetDisabledClass=function(_a){
this.field.disabledClass=_a;
if(this.field.disabled){
this.field.className=this.field.disabledClass;
}
};
RadMaskedTextBox.prototype.SetFocusClass=function(_b){
this.field.focusClass=_b;
};
RadMaskedTextBox.prototype.SetErrorClass=function(_c){
this.field.errorClass=_c;
};
RadMaskedTextBox.prototype.SetOverClass=function(_d){
this.field.overClass=_d;
};
RadMaskedTextBox.prototype.CreatePartCollection=function(_e,_f){
var _10;
var _11=[];
var _12=0;
for(var j=0;j<_e.length;j++){
_10=_e[j];
_10.PromptChar=_f;
_10.SetController(this);
_10.index=this.parts.length;
_11[_11.length]=_10;
if(_11.length>1){
_11[_11.length-2].NextChunk=_10;
}
_10.NextChunk=null;
var _14=_10.GetLength();
_10.offset=_12;
_12+=_14;
}
return _11;
};
RadMaskedTextBox.prototype.SetMask=function(){
this.parts=this.CreatePartCollection(arguments,this.PromptChar);
for(var i=0;i<this.parts.length;i++){
var _16=this.parts[i].GetLength();
for(var j=this.length;j<this.length+_16;j++){
this.partIndex[j]=this.parts[i];
}
this.length+=_16;
}
};
RadMaskedTextBox.prototype.SetDisplayMask=function(){
this.displayParts=this.CreatePartCollection(arguments,this.DisplayPromptChar);
for(var i=0;i<this.displayParts.length;i++){
var _19=this.displayParts[i];
var _1a=_19.GetLength();
if(_19.ch){
continue;
}
for(var j=this.displayLength;j<this.displayLength+_1a;j++){
this.displayPartIndex[j]=this.displayParts[i];
}
this.displayLength+=_1a;
}
};
RadMaskedTextBox.prototype.SetValue=function(_1c){
this.internalValueUpdate=true;
this.UpdatePartsInRange(_1c,0,this.length);
this.internalValueUpdate=false;
this.Visualise();
};
RadMaskedTextBox.prototype.SafariSelectionFix=function(e){
var _1e=this.StrCompare(this.lastState.fieldValue,e.fieldValue);
e.selectionStart=_1e[0];
e.selectionEnd=_1e[0];
this.lastState.selectionStart=_1e[1];
this.lastState.selectionEnd=_1e[2];
};
RadMaskedTextBox.prototype.HandleValueChange=function(e){
if(this.ReadOnly){
this.Visualise();
return false;
}
if(this.lastState==null){
return;
}
var i,j;
if(this.safari){
this.SafariSelectionFix(e);
}
if(this.lastState.fieldValue.length>e.fieldValue.length){
if(e.selectionStart==this.field.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 _22=this.lastState.selectionStart;
var _23=Math.min(e.selectionStart,this.length);
var _24=e.fieldValue.substr(_22,_23-_22);
var _25=this.UpdatePartsInRange(_24,_22,_23);
e.selectionEnd+=_25;
this.FixSelection(e);
};
RadMaskedTextBox.prototype.SetPartValues=function(_26,_27,_28,_29,to){
var _2b;
var i=0;
var j=_29;
var _2e=0;
_28=_28.toString();
while(i<to-_29&&j<_27){
_2b=_28.charAt(i);
if(_2b==this.PromptChar){
_2b="";
}
if(_26[j].SetValue(_2b,j)){
i++;
}else{
_2e++;
}
j++;
}
return _2e;
};
RadMaskedTextBox.prototype.UpdateDisplayPartsInRange=function(_2f,_30,to){
this.SetPartValues(this.displayPartIndex,this.displayLength,_2f,_30,to);
};
RadMaskedTextBox.prototype.UpdatePartsInRange=function(_32,_33,to){
var _35=this.SetPartValues(this.partIndex,this.length,_32,_33,to);
this.Visualise();
return _35;
};
RadMaskedTextBox.prototype.SetCursorPosition=function(_36){
if(!this.field.focused){
return;
}
this.CalculateSelection();
if(document.all&&!window.opera){
this.field.select();
sel=document.selection.createRange();
var _37=this.field.value.substr(0,_36).split("\r\n").length-1;
sel.move("character",_36-_37);
sel.select();
}else{
this.field.selectionStart=_36;
this.field.selectionEnd=_36;
}
};
RadMaskedTextBox.prototype.FixSelection=function(_38){
this.SetCursorPosition(_38.selectionEnd);
};
RadMaskedTextBox.prototype.GetValue=function(){
var _39=[];
for(var i=0;i<this.parts.length;i++){
_39[i]=this.parts[i].GetValue();
}
return _39.join("");
};
RadMaskedTextBox.prototype.GetValueWithLiterals=function(){
var _3b=[];
for(var i=0;i<this.parts.length;i++){
_3b[i]=this.parts[i].ch||this.parts[i].GetValue();
}
return _3b.join("");
};
RadMaskedTextBox.prototype.GetVisibleValues=function(_3d){
var _3e=[];
for(var i=0;i<_3d.length;i++){
_3e[i]=_3d[i].GetVisValue();
}
return _3e.join("");
};
RadMaskedTextBox.prototype.GetValueForField=function(){
return this.GetVisibleValues(this.parts);
};
RadMaskedTextBox.prototype.GetPrompt=function(){
var _40=new RegExp(".","g");
var _41=[];
for(var i=0;i<this.parts.length;i++){
_41[i]=this.parts[i].ch||this.parts[i].GetVisValue().replace(_40,this.PromptChar);
}
return _41.join("");
};
RadMaskedTextBox.prototype.Visualise=function(){
var _43=this.GetValueForField();
var _44=this.GetValue();
this.internalValueUpdate=true;
var _45=this.projectedValue;
this.Render(_43);
this.value=_44;
this.UpdateHiddenFieldValue();
this.UpdateValidationFieldValue();
this.internalValueUpdate=false;
this.projectedValue=this.field.value;
if(_45!=this.field.value){
this.OnValueChange(null,_45,this.field.value);
}
};
RadMaskedTextBox.prototype.Render=function(_46){
if(this.blurred){
if(this.HideOnBlur&&this.isEmpty()){
this.field.value=this.GetBlurredValue();
}else{
if(this.displayParts&&this.displayParts.length){
this.field.value=this.GetDisplayValue();
}else{
this.field.value=_46;
}
}
}else{
this.field.value=_46;
}
};
RadMaskedTextBox.prototype.UpdateHiddenFieldValue=function(){
this.hiddenField.value=this.GetValueForField();
};
RadMaskedTextBox.prototype.UpdateValidationFieldValue=function(){
if(this.isEmpty()){
this.validationField.value="";
}else{
this.validationField.value=this.GetValueWithLiterals();
}
};
RadMaskedTextBox.prototype.OnReset=function(){
this.SetValue(this.initialFieldValue);
this.Visualise();
};
RadMaskedTextBox.prototype.ValueHasChanged=function(){
return this.field.value!=this.field.oldValue;
};
RadMaskedTextBox.prototype.attach=function(_47,_48){
if(this.handlers==null){
this.handlers={};
}
if(this.ShouldUseAttachEvent(this.field)){
this.handlers["on"+_47]=_48;
this.field.attachEvent("on"+_47,_48);
}else{
if(this.field.addEventListener){
this.field.addEventListener(_47,_48,false);
}
}
};
RadMaskedTextBox.prototype.FakeOnPropertyChange=function(){
if(document.createEventObject){
if(event){
var ev=document.createEventObject(event);
}else{
var ev=document.createEventObject();
}
ev.propertyName="value";
this.field.fireEvent("onpropertychange",ev);
}
};
RadMaskedTextBox.prototype.AttachEventHandlers=function(){
var _4a=this;
var _4b=this.field;
this.AttachDomEvent(_4b.form,"reset","OnReset");
this.AttachDomEvent(_4b,"keydown","OnKeyDown");
this.AttachDomEvent(_4b,"keypress","OnKeyPress");
var _4c=function(e){
_4a.FakeOnPropertyChange();
_4a.ActivityHandler(e);
};
var _4e=function(){
if(!_4b.focused){
_4b.className=_4b.defaultClass;
}
};
var _4f=function(){
_4a.FakeOnPropertyChange();
if(!_4b.focused){
_4b.className=_4b.overClass;
}
};
var _50=function(e){
_4b.focused=true;
_4b.className=_4b.focusClass;
_4a.focusValue();
_4a.FakeOnPropertyChange();
_4a.ActivityHandler(e);
};
var _52=function(e){
_4a.FakeOnPropertyChange();
_4a.ValueHandler(e);
_4a.ActivityHandler(e);
_4a.DisplayHint();
};
var _54=function(){
if(_4a.ReadOnly){
return false;
}
if(_4b.selectionStart==_4b.value.length){
return false;
}
setTimeout(function(){
_4a.FakeOnPropertyChange();
},1);
};
var _55=function(){
_4a.FakeOnPropertyChange();
_4a.DisplayHint();
};
var _56=function(){
_4b.focused=false;
_4b.className=_4b.defaultClass;
_4a.blurValue();
var _57=_4a;
window.setTimeout(function(){
if(_57.Hint){
_57.Hint.Hide();
}
},200);
if(_4a.AutoPostBack&&_4a.ValueHasChanged()){
eval(_4a.AutoPostBackCode);
}
_4b.oldValue=_4b.value;
};
this.attach("keyup",_55);
this.attach("focus",_50);
this.attach("mousedown",_4c);
this.attach("mouseover",_4f);
this.attach("mouseout",_4e);
this.attach("mouseup",_52);
this.attach("blur",_56);
if(this.ShouldUseAttachEvent(_4b)){
this.attach("paste",_54);
this.attach("propertychange",function(){
_4a.OnPropertyChange();
});
this.attach("mousewheel",function(){
return _4a.OnMouseWheel(event);
});
}else{
var _58=function(e){
_4a.ValueHandler(e);
};
this.attach("blur",_56,false);
this.attach("input",_58,false);
}
if(window.opera){
var _5a=function(){
return _4a.ValueHandler({});
};
setInterval(_5a,10);
}
};
RadMaskedTextBox.prototype.GetBlurredValue=function(){
return this.EmptyMessage;
};
RadMaskedTextBox.prototype.GetDisplayValue=function(){
var _5b=this.value;
while(_5b.length<this.displayLength){
if(this.DisplayFormatPosition){
_5b=this.PromptChar+_5b;
}else{
_5b+=this.PromptChar;
}
}
this.UpdateDisplayPartsInRange(_5b,0,this.displayLength);
return this.GetVisibleValues(this.displayParts);
};
RadMaskedTextBox.prototype.isEmpty=function(){
return this.value=="";
};
RadMaskedTextBox.prototype.blurValue=function(){
this.blurred=true;
this.Visualise();
};
RadMaskedTextBox.prototype.focusValue=function(){
this.blurred=false;
if((this.HideOnBlur&&this.isEmpty())||this.displayParts){
this.Visualise();
this.field.select();
}
if(this.ResetCaretOnFocus){
this.ResetCursor();
}
};
RadMaskedTextBox.prototype.ResetCursor=function(){
this.SetCursorPosition(0);
};
RadMaskedTextBox.prototype.OnPropertyChange=function(){
if(this.internalValueUpdate){
return;
}
if(event.propertyName=="value"){
var e=event;
var _5d=this;
var _5e=function(){
_5d.ValueHandler(e);
};
this.CalculateSelection();
if(this.field.selectionStart>0||this.field.selectionEnd>0){
_5e();
}else{
setTimeout(_5e,1);
}
}
};
RadMaskedTextBox.prototype.OnMouseWheel=function(e){
if(this.ReadOnly){
return false;
}
this.CalculateSelection();
var _60=this.partIndex[this.field.selectionStart];
if(_60==null){
return true;
}
return _60.HandleWheel(e);
};
RadMaskedTextBox.prototype.OnKeyDown=function(e){
this.FakeOnPropertyChange();
if(this.InSelection(e)){
return true;
}
var _62=this.partIndex[this.field.selectionStart];
var _63=e.which?e.which:e.keyCode;
if(this.ReadOnly&&(_63==46||_63==8||_63==38||_63==40)){
RadControlsNamespace.DomEvent.PreventDefault(e);
return false;
}
if(_63==13){
return true;
}
if(_62==null&&_63!=8){
return true;
}
if(_62!=null){
if(_62.HandleKey(e)){
RadControlsNamespace.DomEvent.PreventDefault(e);
return false;
}
}
var _64=this.field.selectionEnd;
var _65=false;
if((_63==46)&&_64<this.field.value.length&&!window.opera){
_62.SetValue("",this.field.selectionStart);
_64++;
_65=true;
}else{
if(_63==8&&_64&&!window.opera){
this.partIndex[this.field.selectionStart-1].SetValue("",this.field.selectionStart-1);
_64--;
_65=true;
}
}
if(_65){
return this.UpdateAfterKeyHandled(e,_64);
}
this.OnActivity(e);
return true;
};
RadMaskedTextBox.prototype.OnKeyPress=function(e){
if(this.ReadOnly){
RadControlsNamespace.DomEvent.PreventDefault(e);
RadControlsNamespace.DomEvent.StopPropagation(e);
return false;
}
if(this.InSelection(e)){
return true;
}
var _67=this.partIndex[this.field.selectionStart];
if(_67==null){
return true;
}
if(this.mozilla||window.opera){
if(e.which==8){
RadControlsNamespace.DomEvent.PreventDefault(e);
RadControlsNamespace.DomEvent.StopPropagation(e);
return false;
}
if(!e.which){
this.OnActivity(e);
RadControlsNamespace.DomEvent.StopPropagation(e);
return true;
}
}
var _68=this.field.selectionEnd;
var _69=e.which?e.which:e.keyCode;
if(_69==13){
return true;
}
var ch=String.fromCharCode(_69);
if(_67.CanHandle(ch)){
while(_68<this.field.value.length){
if(this.partIndex[_68].SetValue(ch,_68)){
_68++;
break;
}
_68++;
}
}
var _6b=this.UpdateAfterKeyHandled(e,_68);
if(!_6b){
RadControlsNamespace.DomEvent.PreventDefault(e);
}
RadControlsNamespace.DomEvent.StopPropagation(e);
return _6b;
};
RadMaskedTextBox.prototype.UpdateAfterKeyHandled=function(e,_6d){
this.Visualise();
var _6e=new MaskedEventWrap(this.field,e);
_6e.selectionEnd=_6d;
this.FixSelection(_6e);
return false;
};
RadMaskedTextBox.prototype.InSelection=function(e){
this.CalculateSelection();
if(this.field.selectionStart!=this.field.selectionEnd){
this.OnActivity(e);
return true;
}
if(e.ctrlKey||e.altKey||this.safari){
this.OnActivity(e);
return true;
}
return false;
};
RadMaskedTextBox.prototype.ValueHandler=function(e){
if(this.internalValueUpdate){
return true;
}
if(!e){
e=window.event;
}
this.CalculateSelection();
var _71=new MaskedEventWrap(e,this.field);
if(_71.fieldValue!=this.projectedValue){
this.HandleValueChange(_71);
}
return true;
};
RadMaskedTextBox.prototype.ActivityHandler=function(e){
if(this.internalValueUpdate){
return true;
}
if(!e){
e=window.event;
}
this.OnActivity(e);
return true;
};
RadMaskedTextBox.prototype.DisplayHint=function(){
if(!this.ShowHint){
return;
}
this.CalculateSelection();
var _73=this.partIndex[this.field.selectionStart];
this.Hint.Hide();
var _74=null;
if(document.selection){
var _75=document.selection.createRange();
if(_75.getBoundingClientRect){
_74=_75.getBoundingClientRect();
}
}
this.Hint.Show(_73,_74);
};
RadMaskedTextBox.prototype.OnActivity=function(e){
this.CalculateSelection();
this.lastState=new MaskedEventWrap(e,this.field);
};
RadMaskedTextBox.prototype.CalculateSelection=function(){
if(document.selection&&!window.opera){
var s1;
try{
s1=document.selection.createRange();
}
catch(error){
return;
}
if(s1.parentElement()!=this.field){
return;
}
var s=s1.duplicate();
if(this.isTextarea){
s.moveToElementText(this.field);
}else{
s.move("character",-this.field.value.length);
}
s.setEndPoint("EndToStart",s1);
this.field.selectionStart=s.text.length;
this.field.selectionEnd=this.field.selectionStart+s1.text.length;
if(this.isTextarea){
}
}
};
RadMaskedTextBox.prototype.StrCompare=function(_79,_7a){
var i;
var _7c,_7d,_7e;
i=0;
while(_79.charAt(i)==_7a.charAt(i)&&i<_79.length){
i++;
}
_7d=i;
_79=_79.substr(_7d).split("").reverse().join("");
_7a=_7a.substr(_7d).split("").reverse().join("");
i=0;
while(_79.charAt(i)==_7a.charAt(i)&&i<_79.length){
i++;
}
_7c=_7d+_7a.length-i;
_7e=_79.length-i+_7d;
return [_7c,_7d,_7e];
};
function RadInputEventArgs(){
}
RadMaskedTextBox.prototype.FireEvent=function(_7f,_80,_81,_82){
if(typeof (_7f)=="function"){
_7f(this,{CurrentPart:_80,OldValue:_81,NewValue:_82});
}else{
if(typeof (window[_7f])=="function"){
window[_7f](this,{CurrentPart:_80,OldValue:_81,NewValue:_82});
}else{
if(_7f){
throw new Error("No such function: "+_7f);
}
}
}
};
RadMaskedTextBox.prototype.OnEnumChanged=function(_83,_84,_85){
this.FireEvent(this.OnClientEnumerationChanged,_83,_84,_85);
};
RadMaskedTextBox.prototype.OnMoveUp=function(_86,_87,_88){
this.FireEvent(this.OnClientMoveUp,_86,_87,_88);
};
RadMaskedTextBox.prototype.OnMoveDown=function(_89,_8a,_8b){
this.FireEvent(this.OnClientMoveDown,_89,_8a,_8b);
};
RadMaskedTextBox.prototype.OnValueChange=function(_8c,_8d,_8e){
this.FireEvent(this.OnClientValueChanged,_8c,_8d,_8e);
};
RadMaskedTextBox.prototype.OnShowHint=function(_8f){
this.FireEvent(this.OnClientShowHint,_8f,this.field.value,this.field.value);
};
RadMaskedTextBox.prototype.OnChunkError=function(_90,_91,_92){
this.FireEvent(this.OnClientError,_90,_91,_92);
var _93=this.field.focusClass;
this.field.className=this.field.errorClass;
var _94=this;
var _95=function(){
if(_94.field.className==_94.field.errorClass){
_94.field.className=_93;
}
};
setTimeout(_95,100);
};
function MaskedEventWrap(e,_97){
this.event=e;
this.selectionStart=_97.selectionStart;
this.selectionEnd=_97.selectionEnd;
this.fieldValue=_97.value;
}
MaskedEventWrap.prototype.IsUpArrow=function(){
return this.event.keyCode==38;
};
MaskedEventWrap.prototype.IsDownArrow=function(){
return this.event.keyCode==40;
};
function rdmskd(){
return new RadDigitMaskPart();
}
function rdmskl(_98){
return new RadLiteralMaskPart(_98);
}
function rdmske(_99){
return new RadEnumerationMaskPart(_99);
}
function rdmskr(_9a,_9b,_9c,_9d){
return new RadNumericRangeMaskPart(_9a,_9b,_9c,_9d);
}
function rdmsku(){
return new RadUpperMaskPart();
}
function rdmsklw(){
return new RadLowerMaskPart();
}
function rdmskp(){
return new RadPasswordMaskPart();
}
function rdmskf(){
return new RadFreeMaskPart();
};function RadMaskPart(){
this.value="";
this.index=-1;
this.type=-1;
this.PromptChar="_";
}
RadMaskPart.prototype.HandleKey=function(ev){
return false;
};
RadMaskPart.prototype.HandleWheel=function(_2){
return true;
};
RadMaskPart.prototype.SetController=function(_3){
this.controller=_3;
};
RadMaskPart.prototype.GetValue=function(){
return this.value.toString();
};
RadMaskPart.prototype.GetVisValue=function(){
return "";
};
RadMaskPart.prototype.SetValue=function(_4,_5){
return true;
};
RadMaskPart.prototype.CanHandle=function(_6,_7){
return true;
};
RadMaskPart.prototype.IsCaseSensitive=function(){
return false;
};
RadMaskPart.prototype.ShowHint=function(_8){
return false;
};
RadMaskPart.prototype.GetLength=function(){
return 1;
};
RadMaskPart.IsAlpha=function(_9){
return _9.match(/[^\u005D\u005B\t\n\r\f\s\v\\!-@|^_`{-┬┐]{1}/)!=null;
};;function RadNumericRangeMaskPart(_1,_2,_3,_4){
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;
}
RadNumericRangeMaskPart.prototype=new RadMaskPart();
RadNumericRangeMaskPart.prototype.SetController=function(_5){
this.controller=_5;
this.GetVisValue();
};
RadNumericRangeMaskPart.prototype.IsCaseSensitive=function(){
return true;
};
RadNumericRangeMaskPart.prototype.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;
};
RadNumericRangeMaskPart.prototype.InsertAt=function(_8,_9){
return this.visValue.substr(0,_9)+_8.toString()+this.visValue.substr(_9+1,this.visValue.length);
};
RadNumericRangeMaskPart.prototype.ReplacePromptChar=function(_a){
var _b=this.leftAlign?"":"0";
while(_a.indexOf(this.PromptChar)>-1){
_a=_a.replace(this.PromptChar,_b);
}
return _a;
};
RadNumericRangeMaskPart.prototype.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.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;
};
RadNumericRangeMaskPart.prototype.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{
this.controller.OnMoveUp(this,_10,_f);
}
this.FlipDirection=0;
};
RadNumericRangeMaskPart.prototype.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.PromptChar;
}
}else{
var _13=this.zeroFill?"0":this.controller.PromptChar;
if(this.value<0){
_12="-"+_12;
}
while(out.length<this.length-_12.length){
out+=_13;
}
out+=_12;
}
this.visValue=out;
return out;
};
RadNumericRangeMaskPart.prototype.GetLength=function(){
return this.length;
};
RadNumericRangeMaskPart.prototype.HandleKey=function(e){
this.controller.CalculateSelection();
var _15=new MaskedEventWrap(e,this.controller.field);
if(_15.IsDownArrow()){
this.MoveDown();
this.controller.FixSelection(_15);
return true;
}else{
if(_15.IsUpArrow()){
this.MoveUp();
this.controller.FixSelection(_15);
return true;
}
}
};
RadNumericRangeMaskPart.prototype.MoveUp=function(){
var _16=this.value;
_16++;
if(_16>this.upperLimit){
_16=this.lowerLimit;
this.FlipDirection=1;
}
this.setInternalValue(_16);
this.controller.Visualise();
};
RadNumericRangeMaskPart.prototype.MoveDown=function(){
var _17=this.value;
_17--;
if(_17<this.lowerLimit){
_17=this.upperLimit;
this.FlipDirection=-1;
}
this.setInternalValue(_17);
this.controller.Visualise();
};
RadNumericRangeMaskPart.prototype.HandleWheel=function(e){
var _19=this.value;
_19=parseInt(_19)+parseInt(e.wheelDelta/120);
var _1a=new MaskedEventWrap(e,this.controller.field);
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;
};;function RadPasswordMaskPart(){
}
RadPasswordMaskPart.prototype=new RadMaskPart();
RadPasswordMaskPart.prototype.IsCaseSensitive=function(){
return true;
};
RadPasswordMaskPart.prototype.GetVisValue=function(){
if(this.value.toString()==""){
return this.PromptChar;
}
return "*";
};
RadPasswordMaskPart.prototype.SetValue=function(_1,_2){
this.value=_1;
return true;
};;function RadUpperMaskPart(){
}
RadUpperMaskPart.prototype=new RadMaskPart();
RadUpperMaskPart.prototype.CanHandle=function(_1,_2){
if(!RadMaskPart.IsAlpha(_1)){
this.controller.OnChunkError(this,this.GetValue(),_1);
return false;
}
return true;
};
RadUpperMaskPart.prototype.GetVisValue=function(){
if(this.value.toString()==""){
return this.PromptChar;
}
return this.value.toString();
};
RadUpperMaskPart.prototype.SetValue=function(_3,_4){
if(_3==""){
this.value="";
return true;
}
if(RadMaskPart.IsAlpha(_3)){
this.value=_3.toUpperCase();
}else{
this.controller.OnChunkError(this,this.GetValue(),_3);
}
return true;
};;