Type.registerNamespace("Telerik.Web.UI"); $telerik.findDatePicker=$find; $telerik.toDatePicker=function(a){return a; }; Telerik.Web.UI.RadDatePicker=function(a){Telerik.Web.UI.RadDatePicker.initializeBase(this,[a]); this._calendar=null; this._dateInput=null; this._popupButton=null; this._validationInput=null; this._popupDirection=Telerik.Web.RadDatePickerPopupDirection.BottomRight; this._enableScreenBoundaryDetection=true; this._zIndex=null; this._enableShadows=true; this._animationSettings={}; this._popupControlID=null; this._popupButtonSettings=null; this._focusedDate=new Date(1980,0,1); this._minDate=new Date(1980,0,1); this._maxDate=new Date(2099,11,31); this._enabled=true; this._originalDisplay=null; this._showPopupOnFocus=false; this._enableAriaSupport=false; this._onPopupImageMouseOverDelegate=null; this._onPopupImageMouseOutDelegate=null; this._onPopupButtonClickDelegate=null; this._onPopupButtonKeyPressDelegate=null; this._onDateInputFocusDelegate=null; this._overlay=false; this._showPopupOnInit=false; this._enableKeyboardNavigation=false; }; Telerik.Web.UI.RadDatePicker.PopupInstances={}; if(Telerik.Web.UI.RadDateInputComponent){Telerik.Web.UI.RadDatePicker.PopupInstances=Telerik.Web.UI.RadDatePickerComponent.PopupInstances; }Telerik.Web.UI.RadDatePicker.prototype={initialize:function(){Telerik.Web.UI.RadDatePicker.callBaseMethod(this,"initialize"); this._initializeDateInput(); this._initializeCalendar(); var b=$get(this.get_id()+"_wrapper"); if($telerik.isIE&&document.documentMode&&document.documentMode>7&&b.style.display=="inline"){b.style.display="inline-block"; this.get_dateInput().repaint(); }if($telerik.getCurrentStyle(b,"direction")=="rtl"){var a=this.get_dateInput()._skin!=""?String.format(" RadPickerRTL_{0}",this.get_dateInput()._skin):""; b.className+=String.format(" RadPickerRTL{0}",a); }this._refreshPopupShadowSetting(); this.CalendarSelectionInProgress=false; this.InputSelectionInProgress=false; if(this.get_enableAriaSupport()){this._initializeAriaSupport(); }if(this._calendar){this._calendar._allowAutoPostBackOnNavigateOnly=true; if(this._showPopupOnInit){this._calendar._autoPostBack=false; this.showPopup(); this._calendar._autoPostBack=true; }}},dispose:function(){if(this._calendar!=null){this.hidePopup(); this._calendar.dispose(); }if(this._popupButton!=null){var b=this.get__popupImage(); if(b!=null){if(this._onPopupImageMouseOverDelegate){try{window.$removeHandler(b,"mouseover",this._onPopupImageMouseOverDelegate); }catch(a){}this._onPopupImageMouseOverDelegate=null; }if(this._onPopupImageMouseOutDelegate){try{window.$removeHandler(b,"mouseout",this._onPopupImageMouseOutDelegate); }catch(a){}this._onPopupImageMouseOutDelegate=null; }}if(this._onPopupButtonClickDelegate){try{window.$removeHandler(this._popupButton,"click",this._onPopupButtonClickDelegate); }catch(a){}this._onPopupButtonClickDelegate=null; }if(this._onPopupButtonKeyPressDelegate){try{window.$removeHandler(this._popupButton,"keypress",this._onPopupButtonKeyPressDelegate); }catch(a){}this._onPopupButtonKeyPressDelegate=null; }}if(this._popupButton){this._popupButton._events=null; }Telerik.Web.UI.RadDatePicker.callBaseMethod(this,"dispose"); },clear:function(){if(this._dateInput){this._dateInput.clear(); }if(this._calendar){this._calendar.unselectDates(this._calendar.get_selectedDates()); }},_clearHovers:function(){var b=this.get_popupContainer().getElementsByTagName("td"); for(var a=0; ab){this.set_focusedDate(b); }var a=[b.getFullYear(),(b.getMonth()+1),b.getDate()]; if(this._calendar){this._calendar.set_rangeMaxDate(a); }}this.updateClientState(); this.raisePropertyChanged("maxDate"); }},get_maxDateStr:function(){var a=this._maxDate.getFullYear().toString(); while(a.length<4){a="0"+a; }return parseInt(this._maxDate.getMonth()+1,10)+"/"+this._maxDate.getDate()+"/"+a+" "+this._maxDate.getHours()+":"+this._maxDate.getMinutes()+":"+this._maxDate.getSeconds(); },get_focusedDate:function(){return this._focusedDate; },set_focusedDate:function(b){var a=this._cloneDate(b); if(this._focusedDate.toString()!=a.toString()){this._focusedDate=a; this.raisePropertyChanged("focusedDate"); }},get_showPopupOnFocus:function(){return this._showPopupOnFocus; },set_showPopupOnFocus:function(a){this._showPopupOnFocus=a; },get_enableAriaSupport:function(){return this._enableAriaSupport; },set_enableAriaSupport:function(a){if(this._enableAriaSupport!=a){this._enableAriaSupport=a; }},repaint:function(){this._updatePercentageHeight(); },get_popupDirection:function(){return this._popupDirection; },set_popupDirection:function(a){this._popupDirection=a; },get_enableScreenBoundaryDetection:function(){return this._enableScreenBoundaryDetection; },set_enableScreenBoundaryDetection:function(a){this._enableScreenBoundaryDetection=a; },saveClientState:function(a){var e=["minDateStr","maxDateStr"]; var c; var d; if(a){for(c=0,d=a.length; c0){var a=0; if(this.get_dateInput()._textBoxElement.currentStyle){a=parseInt(this.get_dateInput()._textBoxElement.currentStyle.borderTopWidth,10)+parseInt(this.get_dateInput()._textBoxElement.currentStyle.borderBottomWidth,10)+parseInt(this.get_dateInput()._textBoxElement.currentStyle.paddingTop,10)+parseInt(this.get_dateInput()._textBoxElement.currentStyle.paddingBottom,10); }else{if(window.getComputedStyle){a=parseInt(window.getComputedStyle(this.get_dateInput()._textBoxElement,null).getPropertyValue("border-top-width"),10)+parseInt(window.getComputedStyle(this.get_dateInput()._textBoxElement,null).getPropertyValue("border-bottom-width"),10)+parseInt(window.getComputedStyle(this.get_dateInput()._textBoxElement,null).getPropertyValue("padding-top"),10)+parseInt(window.getComputedStyle(this.get_dateInput()._textBoxElement,null).getPropertyValue("padding-bottom"),10); }}this.get_dateInput()._textBoxElement.style.height="1px"; this.get_dateInput()._textBoxElement.style.cssText=this.get_dateInput()._textBoxElement.style.cssText; this.get_dateInput()._textBoxElement.style.height=b.offsetHeight-a+"px"; if(this.get_dateInput()._originalTextBoxCssText.search(/(^|[^-])height/)!=-1){this.get_dateInput()._originalTextBoxCssText=this.get_dateInput()._originalTextBoxCssText.replace(/(^|[^-])height(\s*):(\s*)([^;]+);/i,"$1height:"+(b.offsetHeight-a)+"px;"); }else{this.get_dateInput()._originalTextBoxCssText+="height:"+(b.offsetHeight-a)+"px;"; }}},_initializeCalendar:function(){if(this._calendar!=null){this._setUpCalendar(); this._calendar.set_enableMultiSelect(false); this._calendar.set_useColumnHeadersAsSelectors(false); this._calendar.set_useRowHeadersAsSelectors(false); if(this._zIndex){this._calendar._zIndex=parseInt(this._zIndex,10)+2; }this._calendar._enableShadows=this._enableShadows; if(this._calendar.get_renderMode()==Telerik.Web.UI.RenderMode.Classic){this._popupContainerID=this._calendar.get_id()+"_wrapper"; }else{this._popupContainerID=this._calendar.get_id(); }}},_propagateRangeValues:function(){if(this.get_minDate().toString()!=new Date(1980,0,1)){this._dateInput._minDate=this.get_minDate(); }if(this.get_maxDate().toString()!=new Date(2099,11,31)){this._dateInput._maxDate=this.get_maxDate(); }},_triggerDomChangeEvent:function(){this._dateInput._triggerDomEvent("change",this._validationInput); },_initializeAriaSupport:function(){var b=document.getElementById(this.get_id()+"_wrapper"); b.setAttribute("aria-atomic","true"); var a=document.getElementById(this.get_id()+"_popupButton"); if(a){a.setAttribute("role","button"); a.setAttribute("aria-controls",this.get_calendar().get_id()); }},_initializePopupButton:function(){this._popupButton=$get(this._popupControlID); if(this._popupButton!=null){this._attachPopupButtonEvents(); }},_attachPopupButtonEvents:function(){var a=this.get__popupImage(); if(a!=null){if(!this._hasAttribute("onmouseover")){this._onPopupImageMouseOverDelegate=Function.createDelegate(this,this._onPopupImageMouseOverHandler); window.$addHandler(a,"mouseover",this._onPopupImageMouseOverDelegate); }if(!this._hasAttribute("onmouseout")){this._onPopupImageMouseOutDelegate=Function.createDelegate(this,this._onPopupImageMouseOutHandler); window.$addHandler(a,"mouseout",this._onPopupImageMouseOutDelegate); }}if(this._hasAttribute("href")!=null&&this._hasAttribute("href")!=""&&this._hasAttribute("onclick")==null){this._onPopupButtonClickDelegate=Function.createDelegate(this,this._onPopupButtonClickHandler); window.$addHandler(this._popupButton,"click",this._onPopupButtonClickDelegate); }if(this._popupButton){this._onPopupButtonKeyPressDelegate=Function.createDelegate(this,this._onPopupButtonKeyPressHandler); window.$addHandler(this._popupButton,"keypress",this._onPopupButtonKeyPressDelegate); }},_onPopupImageMouseOverHandler:function(a){this.get__popupImage().src=this._popupButtonSettings.ResolvedHoverImageUrl; },_onPopupImageMouseOutHandler:function(a){this.get__popupImage().src=this._popupButtonSettings.ResolvedImageUrl; },_onPopupButtonClickHandler:function(a){this.togglePopup(); a.stopPropagation(); a.preventDefault(); return false; },_onPopupButtonKeyPressHandler:function(a){if(a.charCode==32){this.togglePopup(); a.stopPropagation(); a.preventDefault(); return false; }},_hasAttribute:function(a){return this._popupButton.getAttribute(a); },_calendarDateSelected:function(b){if(this.InputSelectionInProgress==true){return; }if(b.IsSelected){if(this.hidePopup()==false){return; }var a=this._getJavaScriptDate(b.get_date()); this.CalendarSelectionInProgress=true; this._setInputDate(a); }if(this._enableKeyboardNavigation){this._popupButton.focus(); }else{if(this.get_enableAriaSupport()){this._dateInput.get_element().focus(); }}},_actionBeforeShowPopup:function(){for(var b in Telerik.Web.UI.RadDatePicker.PopupInstances){if(Telerik.Web.UI.RadDatePicker.PopupInstances.hasOwnProperty(b)){var a=Telerik.Web.UI.RadDatePicker.PopupInstances[b].Opener; this._hideFastNavigationPopup(a); Telerik.Web.UI.RadDatePicker.PopupInstances[b].Hide(); }}},_hideFastNavigationPopup:function(b){if(b){var a=b.get_calendar()._getFastNavigation().Popup; if(a&&a.IsVisible()){a.Hide(true); }}},_setInputDate:function(a){this._dateInput.set_selectedDate(a); },_getJavaScriptDate:function(b){var a=new Date(); a.setFullYear(b[0],b[1]-1,b[2]); return a; },_onDateInputDateChanged:function(b,a){this._setValidatorDate(a.get_newDate()); this._triggerDomChangeEvent(); if(!this.isPopupVisible()){return; }if(this.isEmpty()){this._focusCalendar(); }else{if(!this.CalendarSelectionInProgress){this._setCalendarDate(a.get_newDate()); }}},_focusCalendar:function(){if(this._showPopupOnInit){this._showPopupOnInit=false; return; }this._calendar.unselectDates(this._calendar.get_selectedDates()); var a=[this.get_focusedDate().getFullYear(),this.get_focusedDate().getMonth()+1,this.get_focusedDate().getDate()]; this._calendar.navigateToDate(a); },_setValidatorDate:function(c){var d=""; if(c!=null){var b=(c.getMonth()+1).toString(); if(b.length==1){b="0"+b; }var a=c.getDate().toString(); if(a.length==1){a="0"+a; }d=c.getFullYear()+"-"+b+"-"+a; }this._validationInput.value=d; },_setCalendarDate:function(c){var b=[c.getFullYear(),c.getMonth()+1,c.getDate()]; if(this._calendar._autoPostBack){var a=this._calendar.get_selectedDates(); if(a&&b.join()==a.join()){return; }}var d=(this._calendar.FocusedDate[1]!=b[1])||(this._calendar.FocusedDate[0]!=b[0]); this.InputSelectionInProgress=true; this._calendar.unselectDates(this._calendar.get_selectedDates()); this._calendar.selectDate(b,d); this.InputSelectionInProgress=false; },_cloneDate:function(b){var c=null; if(!b){return null; }if(typeof(b.setFullYear)=="function"){c=[]; c[c.length]=b.getFullYear(); c[c.length]=b.getMonth()+1; c[c.length]=b.getDate(); c[c.length]=b.getHours(); c[c.length]=b.getMinutes(); c[c.length]=b.getSeconds(); c[c.length]=b.getMilliseconds(); }else{if(typeof(b)=="string"){c=b.split(/-/); }}if(c!=null){var a=new Date(); a.setDate(1); a.setFullYear(c[0]); a.setMonth(c[1]-1); a.setDate(c[2]); a.setHours(c[3]); a.setMinutes(c[4]); a.setSeconds(c[5]); a.setMilliseconds(0); return a; }return null; },_setUpValidationInput:function(){this._validationInput=$get(this.get_id()); },_setUpDateInput:function(){this._onDateInputValueChangedDelegate=Function.createDelegate(this,this._onDateInputValueChangedHandler); this._dateInput.add_valueChanged(this._onDateInputValueChangedDelegate); this._onDateInputBlurDelegate=Function.createDelegate(this,this._onDateInputBlurHandler); this._dateInput.add_blur(this._onDateInputBlurDelegate); this._onDateInputKeyPressDelegate=Function.createDelegate(this,this._onDateInputKeyPressHandler); this._dateInput.add_keyPress(this._onDateInputKeyPressDelegate); this._onDateInputFocusDelegate=Function.createDelegate(this,this._onDateInputFocusHandler); this._dateInput.add_focus(this._onDateInputFocusDelegate); },_onDateInputValueChangedHandler:function(b,a){this._onDateInputDateChanged(b,a); this.raise_dateSelected(a); this.CalendarSelectionInProgress=false; },_onDateInputBlurHandler:function(b,a){if(!b.get_selectedDate()){this._validationInput.value=""; }},_onDateInputFocusHandler:function(b,a){if(this._calendar&&this.get_showPopupOnFocus()){this.showPopup(); }},_triggerDomEvent:function(b,d){if(!b||b==""||!d){return; }var c; if(d.fireEvent&&document.createEventObject){c=document.createEventObject(); d.fireEvent(String.format("on{0}",b),c); }else{if(d.dispatchEvent){var a=true; c=document.createEvent("HTMLEvents"); c.initEvent(b,a,true); d.dispatchEvent(c); }}},_onDateInputKeyPressHandler:function(b,a){if(a.get_keyCode()==13){this._setValidatorDate(b.get_selectedDate()); }},_setUpCalendar:function(){this._onCalendarDateSelectedDelegate=Function.createDelegate(this,this._onCalendarDateSelectedHandler); this._calendar.add_dateSelected(this._onCalendarDateSelectedDelegate); },_onCalendarDateSelectedHandler:function(b,a){if(this.isPopupVisible()){this._calendarDateSelected(a.get_renderDay()); }},get__popupImage:function(){var b=null; if(this._popupButton!=null){var a=this._popupButton.getElementsByTagName("img"); if(a.length>0){b=a[0]; }else{b=this._popupButton; }}return b; },_refreshPopupShadowSetting:function(){if(!this.get_calendar()){return; }var a=Telerik.Web.UI.RadDatePicker.PopupInstances[this.get_calendar().get_id()]; if(a&&!$telerik.quirksMode){this.get__popup().EnableShadows=this._enableShadows; }},get__popup:function(){var a=Telerik.Web.UI.RadDatePicker.PopupInstances[this.get_calendar().get_id()]; if(!a){a=new Telerik.Web.UI.Calendar.Popup(); a._overlay=this._overlay; if(this._zIndex){a.zIndex=this._zIndex; }if(!this._enableShadows){a.EnableShadows=false; }if(this._animationSettings){a.ShowAnimationDuration=this._animationSettings.ShowAnimationDuration; a.ShowAnimationType=this._animationSettings.ShowAnimationType; a.HideAnimationDuration=this._animationSettings.HideAnimationDuration; a.HideAnimationType=this._animationSettings.HideAnimationType; }a._renderMode=this._renderMode; Telerik.Web.UI.RadDatePicker.PopupInstances[this._calendar.get_id()]=a; }return a; },get__PopupVisibleControls:function(){var a=[this.get_textBox(),this.get_popupContainer()]; if(this._popupButton!=null){a[a.length]=this._popupButton; }return a; },get__PopupButtonSettings:function(){return this._popupButtonSettings; },set__PopupButtonSettings:function(a){this._popupButtonSettings=a; },add_dateSelected:function(a){this.get_events().addHandler("dateSelected",a); },remove_dateSelected:function(a){this.get_events().removeHandler("dateSelected",a); },raise_dateSelected:function(a){this.raiseEvent("dateSelected",a); },add_popupOpening:function(a){this.get_events().addHandler("popupOpening",a); },remove_popupOpening:function(a){this.get_events().removeHandler("popupOpening",a); },raise_popupOpening:function(a){this.raiseEvent("popupOpening",a); },add_popupClosing:function(a){this.get_events().addHandler("popupClosing",a); },remove_popupClosing:function(a){this.get_events().removeHandler("popupClosing",a); },raise_popupClosing:function(a){this.raiseEvent("popupClosing",a); }}; Telerik.Web.UI.RadDatePicker.registerClass("Telerik.Web.UI.RadDatePicker",Telerik.Web.UI.RadWebControl);