if(typeof window.RadControlsNamespace=="undefined"){ window.RadControlsNamespace={}; } if(typeof (window.RadControlsNamespace.DomEventMixin)=="undefined"||typeof (window.RadControlsNamespace.DomEventMixin.Version)==null||window.RadControlsNamespace.DomEventMixin.Version<2){ RadControlsNamespace.DomEventMixin={Version:2,Initialize:function(_1){ _1.CreateEventHandler=this.CreateEventHandler; _1.AttachDomEvent=this.AttachDomEvent; _1.DetachDomEvent=this.DetachDomEvent; _1.DisposeDomEventHandlers=this.DisposeDomEventHandlers; _1._domEventHandlingEnabled=true; _1.EnableDomEventHandling=this.EnableDomEventHandling; _1.DisableDomEventHandling=this.DisableDomEventHandling; _1.RemoveHandlerRegister=this.RemoveHandlerRegister; _1.GetHandlerRegister=this.GetHandlerRegister; _1.AddHandlerRegister=this.AddHandlerRegister; _1.handlerRegisters=[]; },EnableDomEventHandling:function(){ this._domEventHandlingEnabled=true; },DisableDomEventHandling:function(){ this._domEventHandlingEnabled=false; },CreateEventHandler:function(_2,_3){ var _4=this; return function(e){ if(!_4._domEventHandlingEnabled&&!_3){ return false; } return _4[_2](e||window.event); }; },AttachDomEvent:function(_6,_7,_8,_9){ var _a=this.CreateEventHandler(_8,_9); var _b=this.GetHandlerRegister(_6,_7,_8); if(_b!=null){ this.DetachDomEvent(_b.Element,_b.EventName,_8); } var _c={"Element":_6,"EventName":_7,"HandlerName":_8,"Handler":_a}; this.AddHandlerRegister(_c); if(_6.addEventListener){ _6.addEventListener(_7,_a,false); }else{ if(_6.attachEvent){ _6.attachEvent("on"+_7,_a); } } },DetachDomEvent:function(_d,_e,_f){ var _10=null; var _11=""; if(typeof _f=="string"){ _11=_f; _10=this.GetHandlerRegister(_d,_e,_11); if(_10==null){ return; } _f=_10.Handler; } if(!_d){ return; } if(_d.removeEventListener){ _d.removeEventListener(_e,_f,false); }else{ if(_d.detachEvent){ _d.detachEvent("on"+_e,_f); } } if(_10!=null&&_11!=""){ this.RemoveHandlerRegister(_10); _10=null; } },DisposeDomEventHandlers:function(){ for(var i=0;i0){ this.HandleWheel(false); }else{ this.HandleWheel(true); } return true; } return false; },HandleWheel:function(_23){ },TextBoxKeyDownHandler:function(e){ },Disable:function(){ this.Enabled=false; this.TextBoxElement.disabled="disabled"; this.UpdateCssClass(); this.RaiseEvent("OnDisable",null); },Enable:function(){ this.Enabled=true; this.TextBoxElement.disabled=""; this.UpdateCssClass(); this.RaiseEvent("OnEnable",null); },Focus:function(){ this.TextBoxElement.focus(); },Blur:function(){ this.TextBoxElement.blur(); },SetValue:function(_25){ var _26=this.SetHiddenValue(_25); if(_26==false){ _25=""; } this.TriggerDOMChangeEvent(this.GetValidationField()); this.RaiseValueChangedEvent(_25,this.InitialValue); if(typeof (_26)=="undefined"||_26==true){ this.SetTextBoxValue(this.GetEditValue()); this.UpdateDisplayValue(); this.UpdateCssClass(); } },TriggerDOMChangeEvent:function(_27){ if(_27.fireEvent){ var _28=document.createEventObject(); _27.fireEvent("onchange",_28); }else{ if(_27.dispatchEvent){ var _29=true; var _28=document.createEvent("HTMLEvents"); _28.initEvent("change",_29,true); _27.dispatchEvent(_28); } } },_SetValue:function(_2a){ var _2b=this.SetHiddenValue(_2a); if(typeof (_2b)=="undefined"||_2b==true){ this.SetTextBoxValue(this.GetEditValue()); } },RaiseValueChangedEvent:function(_2c,_2d){ if(_2c.toString()==_2d.toString()){ return false; } this.InitialValue=this.GetValue(); var _2e=this.RaiseEvent("OnValueChanged",this.ValueChangedEventArgs(_2c,_2d)); if(this.AutoPostBack&&_2e){ this.RaisePostBackEvent(); } return _2e; },Clear:function(){ this.SetValue(""); },SetTextBoxValue:function(_2f){ if(this.TextBoxElement.value!=_2f){ this.TextBoxElement.value=_2f; } },GetTextBoxValue:function(_30){ return this.TextBoxElement.value; },GetWrapperElement:function(){ return document.getElementById(this.WrapperElementID); },UpdateDisplayValue:function(){ if(this.Focused){ this.SetTextBoxValue(this.GetEditValue()); }else{ if(this.IsEmpty()&&this.EmptyMessage){ this.IsEmptyMessage=true; this.SetTextBoxValue(this.EmptyMessage); }else{ this.IsEmptyMessage=false; this.SetTextBoxValue(this.GetDisplayValue()); } } },UpdateSelectionOnFocus:function(){ switch(this.SelectionOnFocus){ case 0: break; case 1: this.SetCaretPosition(0); break; case 2: if(this.TextBoxElement.value.length>0){ this.SetCaretPosition(this.TextBoxElement.value.length); } break; case 3: this.SelectAllText(); break; default: this.SetCaretPosition(0); break; } },RaiseErrorEvent:function(_31){ if(this.InEventRaise){ return; } this.InEventRaise=true; var _32=this.RaiseEvent("OnError",_31); if(_32!=false){ this.Invalid=true; this.UpdateCssClass(); var _33=this; var _34=function(){ _33.Invalid=false; _33.UpdateCssClass(); }; setTimeout(_34,100); } this.InEventRaise=false; },RaisePostBackEvent:function(){ eval(this.PostBackEventReferenceScript); },UpdateCssClass:function(){ if(this.Enabled&&(!this.IsEmptyMessage)&&(!this.IsNegative())){ this.TextBoxElement.style.cssText=this.Styles["EnabledStyle"][0]; this.TextBoxElement.className=this.Styles["EnabledStyle"][1]; } if(this.Enabled&&(!this.IsEmptyMessage)&&this.IsNegative()){ this.TextBoxElement.style.cssText=this.Styles["NegativeStyle"][0]; this.TextBoxElement.className=this.Styles["NegativeStyle"][1]; } if(this.Enabled&&this.IsEmptyMessage){ this.TextBoxElement.style.cssText=this.Styles["EmptyMessageStyle"][0]; this.TextBoxElement.className=this.Styles["EmptyMessageStyle"][1]; } if(this.Hovered){ this.TextBoxElement.style.cssText=this.Styles["HoveredStyle"][0]; this.TextBoxElement.className=this.Styles["HoveredStyle"][1]; } if(this.Focused){ this.TextBoxElement.style.cssText=this.Styles["FocusedStyle"][0]; this.TextBoxElement.className=this.Styles["FocusedStyle"][1]; } if(this.Invalid){ this.TextBoxElement.style.cssText=this.Styles["InvalidStyle"][0]; this.TextBoxElement.className=this.Styles["InvalidStyle"][1]; } if(!this.Enabled){ this.TextBoxElement.style.cssText=this.Styles["DisabledStyle"][0]; this.TextBoxElement.className=this.Styles["DisabledStyle"][1]; } },CalculateSelection:function(){ if(window.opera||!document.selection){ this.SelectionEnd=this.TextBoxElement.selectionEnd; this.SelectionStart=this.TextBoxElement.selectionStart; return; } var s1=document.selection.createRange(); if(s1.parentElement()!=this.TextBoxElement){ return; } var s=s1.duplicate(); s.move("character",-this.TextBoxElement.value.length); s.setEndPoint("EndToStart",s1); var _37=s.text.length; var _38=s.text.length+s1.text.length; this.SelectionEnd=Math.max(_37,_38); this.SelectionStart=Math.min(_37,_38); },ApplySelection:function(){ if(window.opera||!document.selection){ this.TextBoxElement.selectionStart=this.SelectionStart; this.TextBoxElement.selectionEnd=this.SelectionEnd; return; } this.TextBoxElement.select(); sel=document.selection.createRange(); sel.collapse(); sel.moveStart("character",this.SelectionStart); sel.collapse(); sel.moveEnd("character",this.SelectionEnd-this.SelectionStart); sel.select(); },SelectText:function(_39,end){ this.SelectionStart=_39; this.SelectionEnd=end; this.ApplySelection(); },SelectAllText:function(){ if(this.TextBoxElement.value.length>0){ this.SelectText(0,this.TextBoxElement.value.length); return true; } return false; },SetCaretPosition:function(_3b){ this.SelectionStart=_3b; this.SelectionEnd=_3b; this.ApplySelection(); },UpdateHiddenValue:function(){ return this.SetHiddenValue(this.TextBoxElement.value); },InitializeButtons:function(){ this.Button=null; var _3c=document.getElementById(this.WrapperElementID); var _3d=_3c.getElementsByTagName("span"); for(i=0;i<_3d.length;i++){ if(_3d[i].className.indexOf("radInpButtonCss")!=(-1)){ this.Button=_3d[i]; this.AttachDomEvent(this.Button,"click","ButtonClickHandler"); } } },ButtonClickHandler:function(e){ var _3f={"ButtonName":"Button"}; this.RaiseEvent("OnButtonClick",_3f); },SetHiddenValue:function(_40){ if(this.HiddenElement.value!=_40.toString()){ this.HiddenElement.value=_40; } this.SetValidationField(_40); return true; },SetValidationField:function(_41){ },GetValidationField:function(){ return this.HiddenElement; },ClearHiddenValue:function(){ this.HiddenElement.value=""; },ValueChangedEventArgs:function(_42,_43){ if(_43==null){ _43=this.HiddenElement.value; } return {"NewValue":_42,"OldValue":_43}; },GetValue:function(){ return this.HiddenElement.value; },GetDisplayValue:function(){ return this.HiddenElement.value; },GetEditValue:function(){ return this.HiddenElement.value; },IsEmpty:function(){ return this.HiddenElement.value==""; },IsNegative:function(){ return false; },IsReadOnly:function(){ return this.TextBoxElement.readOnly||!this.Enabled; }}; if(typeof (window.RadControlsNamespace)=="undefined"){ window.RadControlsNamespace=new Object(); } RadControlsNamespace.AppendStyleSheet=function(_44,_45,_46){ if(!_46){ return; } var _47=window.netscape&&!window.opera; if(!_44&&_47){ document.write("<"+"link"+" rel='stylesheet' type='text/css' href='"+_46+"' />"); }else{ var _48=document.createElement("link"); _48.rel="stylesheet"; _48.type="text/css"; _48.href=_46; document.getElementsByTagName("head")[0].appendChild(_48); } }; if(typeof (console)=="undefined"){ console={log:function(msg){ if(!this.logElement){ this.logElement=document.createElement("div"); this.logElement.style.cssText="border:2px inset buttonface;font:10px tahoma;padding:20px;height:200px;overflow:scroll;position:absolute;bottom:0;"; document.body.insertBefore(this.logElement,document.body.firstChild); } var _4a=document.createTextNode((new Date().toString())+": "+msg); this.logElement.appendChild(_4a); this.logElement.appendChild(document.createElement("hr")); }}; };if(typeof (Telerik)=="undefined"){ Telerik={}; } if(Telerik.TextInputEvents==null){ Telerik.TextInputEvents={}; } Telerik.TextInputEvents.ValueListener=function(_1){ this.Owner=_1; this.EventRequest=null; }; Telerik.TextInputEvents.ValueListener.prototype={AddChangeEventRequest:function(_2,_3){ if(this.EventRequest==null){ this.EventRequest={New:_2,Old:_3}; }else{ this.EventRequest.New=_2; } },QueueChangeEventRequest:function(_4,_5){ this.CancelPreviousRequest(); this.AddChangeEventRequest(_4,_5); var _6=this; var _7=function(){ _6.ValueChangedAction=null; _6.ProcessEvents(); }; if(this.Owner.DelayValueChangedEvent()){ this.ValueChangedAction=window.setTimeout(_7,300); }else{ _7(); } },CancelPreviousRequest:function(){ if(this.ValueChangedAction!=null){ window.clearTimeout(this.ValueChangedAction); this.ValueChangedAction=null; } },Dispose:function(){ this.CancelPreviousRequest(); },ProcessEvents:function(){ if(this.EventRequest!=null){ this.Owner.RaiseValueChangedEvent(this.EventRequest.New,this.EventRequest.Old); this.EventRequest=null; } }};;