Type.registerNamespace("Telerik.Web.UI.Scheduling");
Telerik.Web.UI.Scheduling.AdvancedTemplate=function(_1){
this._element=_1;
this._recurrencePatternPanel=null;
this._recurrencePatternHourlyPanel=null;
this._recurrencePatternDailyPanel=null;
this._recurrencePatternWeeklyPanel=null;
this._recurrencePatternMonthlyPanel=null;
this._recurrencePatternYearlyPanel=null;
this._recurrenceRangePanel=null;
this._repeatFrequencyInputs=new Array();
this._recurrentAppointmentCheckbox=null;
this._allDayEventCheckbox=null;
this._repeatGivenOccurrencesRadio=null;
this._repeatGivenOccurrencesInput=null;
this._repeatUntilGivenDateRadio=null;
this._repeatUntilGivenDateInput=null;
this._repeatUntilGivenDateClientID=null;
this._repeatEveryNthDayRadio=null;
this._repeatEveryNthDayInput=null;
this._repeatEveryNthMonthOnDateRadio=null;
this._repeatEveryNthMonthOnDateInput1=null;
this._repeatEveryNthMonthOnDateInput2=null;
this._repeatEveryNthMonthOnGivenDayRadio=null;
this._repeatEveryNthMonthOnGivenDayInput1=null;
this._repeatEveryNthMonthOnGivenDayInput2=null;
this._repeatEveryNthMonthOnGivenDayInput3=null;
this._repeatEveryYearOnDateRadio=null;
this._repeatEveryYearOnDateInput1=null;
this._repeatEveryYearOnDateInput2=null;
this._repeatEveryYearOnGivenDayRadio=null;
this._repeatEveryYearOnGivenDayInput1=null;
this._repeatEveryYearOnGivenDayInput2=null;
this._repeatEveryYearOnGivenDayInput3=null;
this._startTimeInputClientID=null;
this._endTimeInputClientID=null;
this._onRangeEndDateCalendarPopupButtonClickDelegate=null;
this._onRepeatUntilGivenDateInputClickDelegate=null;
this._onRepeatUntilGivenDateRadioClickDelegate=null;
};
Telerik.Web.UI.Scheduling.AdvancedTemplate._adjustHeight=function(_2){
var _3=$get(_2);
var _4=null;
var _5=null;
var _6=_3.getElementsByTagName("div");
var _7=_6.length;
for(var i=0;i<_7;i++){
var _9=_6[i];
if(Sys.UI.DomElement.containsCssClass(_9,"rsAdvancedSubmitArea")){
_5=_9;
}else{
if(Sys.UI.DomElement.containsCssClass(_9,"rsAdvOptions")){
_4=_9;
}
}
}
if(_4!=null&&_5!=null){
var _a=_3.offsetHeight;
var _b=(_a-_5.offsetHeight);
_4.style.height=_b+"px";
_b-=_4.offsetHeight-_b;
_4.style.height=_b+"px";
_5.style.cssText=_5.style.cssText;
}
};
Telerik.Web.UI.Scheduling.AdvancedTemplate.prototype={initialize:function(){
var _c=this.get_element();
this._initializeDivs(_c);
this._initializeSpans(_c);
this._initializeInputs(_c);
this._initializeDropdowns(_c);
this._glueControlWithRadio(this._repeatGivenOccurrencesInput,this._repeatGivenOccurrencesRadio,true);
this._glueRepeatUntilGivenDateWithRadio();
this._glueRangeEndDateWithRadio();
this._glueControlWithRadio(this._repeatEveryNthDayInput,this._repeatEveryNthDayRadio,true);
this._glueControlWithRadio(this._repeatEveryNthMonthOnDateInput1,this._repeatEveryNthMonthOnDateRadio,true);
this._glueControlWithRadio(this._repeatEveryNthMonthOnDateInput2,this._repeatEveryNthMonthOnDateRadio,false);
this._glueControlWithRadio(this._repeatEveryNthMonthOnGivenDayInput1,this._repeatEveryNthMonthOnGivenDayRadio,true);
this._glueControlWithRadio(this._repeatEveryNthMonthOnGivenDayInput2,this._repeatEveryNthMonthOnGivenDayRadio,false);
this._glueControlWithRadio(this._repeatEveryNthMonthOnGivenDayInput3,this._repeatEveryNthMonthOnGivenDayRadio,false);
this._glueControlWithRadio(this._repeatEveryYearOnDateInput1,this._repeatEveryYearOnDateRadio,true);
this._glueControlWithRadio(this._repeatEveryYearOnDateInput2,this._repeatEveryYearOnDateRadio,false);
this._glueControlWithRadio(this._repeatEveryYearOnGivenDayInput1,this._repeatEveryYearOnGivenDayRadio,true);
this._glueControlWithRadio(this._repeatEveryYearOnGivenDayInput2,this._repeatEveryYearOnGivenDayRadio,false);
this._glueControlWithRadio(this._repeatEveryYearOnGivenDayInput3,this._repeatEveryYearOnGivenDayRadio,false);
},dispose:function(){
if(this._repeatFrequencyInputs){
Array.forEach(this._repeatFrequencyInputs,function(_d){
$clearHandlers(_d);
},this);
this._repeatFrequencyInputs=null;
}
if(this._onRangeEndDateCalendarPopupButtonClickDelegate){
var _e=$get(this._repeatUntilGivenDateClientID+"_CalendarPopupButton");
$removeHandler(_e,"click",this._onRangeEndDateCalendarPopupButtonClickDelegate);
this._onRangeEndDateCalendarPopupButtonClickDelegate=null;
}
this._clearHandlersSafe(this._repeatGivenOccurrencesRadio);
this._clearHandlersSafe(this._repeatGivenOccurrencesInput);
this._repeatGivenOccurrencesRadio=null;
this._repeatGivenOccurrencesInput=null;
if(this._onRepeatUntilGivenDateInputClickDelegate){
$removeHandler(this._repeatUntilGivenDateInput,"click",this._onRepeatUntilGivenDateInputClickDelegate);
this._onRepeatUntilGivenDateInputClickDelegate=null;
}
if(this._onRepeatUntilGivenDateRadioClickDelegate){
$removeHandler(this._repeatUntilGivenDateRadio,"click",this._onRepeatUntilGivenDateRadioClickDelegate);
this._onRepeatUntilGivenDateRadioClickDelegate=null;
}
this._repeatUntilGivenDateRadio=null;
this._repeatUntilGivenDateInput=null;
this._clearHandlersSafe(this._repeatEveryNthDayRadio);
this._clearHandlersSafe(this._repeatEveryNthDayInput);
this._repeatEveryNthDayRadio=null;
this._repeatEveryNthDayInput=null;
this._clearHandlersSafe(this._repeatEveryNthMonthOnDateRadio);
this._clearHandlersSafe(this._repeatEveryNthMonthOnDateInput1);
this._clearHandlersSafe(this._repeatEveryNthMonthOnDateInput2);
this._repeatEveryNthMonthOnDateRadio=null;
this._repeatEveryNthMonthOnDateInput1=null;
this._repeatEveryNthMonthOnDateInput2=null;
this._clearHandlersSafe(this._repeatEveryNthMonthOnGivenDayRadio);
this._clearHandlersSafe(this._repeatEveryNthMonthOnGivenDayInput1);
this._clearHandlersSafe(this._repeatEveryNthMonthOnGivenDayInput2);
this._clearHandlersSafe(this._repeatEveryNthMonthOnGivenDayInput3);
this._repeatEveryNthMonthOnGivenDayRadio=null;
this._repeatEveryNthMonthOnGivenDayInput1=null;
this._repeatEveryNthMonthOnGivenDayInput2=null;
this._repeatEveryNthMonthOnGivenDayInput3=null;
this._clearHandlersSafe(this._repeatEveryYearOnDateRadio);
this._clearHandlersSafe(this._repeatEveryYearOnDateInput1);
this._clearHandlersSafe(this._repeatEveryYearOnDateInput2);
this._repeatEveryYearOnDateRadio=null;
this._repeatEveryYearOnDateInput1=null;
this._repeatEveryYearOnDateInput2=null;
this._clearHandlersSafe(this._repeatEveryYearOnGivenDayRadio);
this._clearHandlersSafe(this._repeatEveryYearOnGivenDayInput1);
this._clearHandlersSafe(this._repeatEveryYearOnGivenDayInput2);
this._clearHandlersSafe(this._repeatEveryYearOnGivenDayInput3);
this._repeatEveryYearOnGivenDayRadio=null;
this._repeatEveryYearOnGivenDayInput1=null;
this._repeatEveryYearOnGivenDayInput2=null;
this._repeatEveryYearOnGivenDayInput3=null;
this._clearHandlersSafe(this._recurrentAppointmentCheckbox);
this._clearHandlersSafe(this._allDayEventCheckbox);
this._recurrentAppointmentCheckbox=null;
this._allDayEventCheckbox=null;
this._recurrencePatternPanel=null;
this._recurrencePatternHourlyPanel=null;
this._recurrencePatternDailyPanel=null;
this._recurrencePatternWeeklyPanel=null;
this._recurrencePatternMonthlyPanel=null;
this._recurrencePatternYearlyPanel=null;
this._recurrenceRangePanel=null;
this._repeatFrequencyInput=null;
},get_element:function(){
return this._element;
},_initializeDivs:function(_f){
var _10=_f.getElementsByTagName("div");
var _11=_10.length;
for(var i=0;i<_11;i++){
var div=_10[i];
if((this._recurrencePatternPanel==null)&&div.id.endsWith("RecurrencePatternPanel")){
this._recurrencePatternPanel=div;
}else{
if((this._recurrencePatternHourlyPanel==null)&&div.id.endsWith("RecurrencePatternHourlyPanel")){
this._recurrencePatternHourlyPanel=div;
}else{
if((this._recurrencePatternDailyPanel==null)&&div.id.endsWith("RecurrencePatternDailyPanel")){
this._recurrencePatternDailyPanel=div;
}else{
if((this._recurrencePatternWeeklyPanel==null)&&div.id.endsWith("RecurrencePatternWeeklyPanel")){
this._recurrencePatternWeeklyPanel=div;
}else{
if((this._recurrencePatternMonthlyPanel==null)&&div.id.endsWith("RecurrencePatternMonthlyPanel")){
this._recurrencePatternMonthlyPanel=div;
}else{
if((this._recurrencePatternYearlyPanel==null)&&div.id.endsWith("RecurrencePatternYearlyPanel")){
this._recurrencePatternYearlyPanel=div;
}else{
if((this._recurrenceRangePanel==null)&&div.id.endsWith("RecurrenceRangePanel")){
this._recurrenceRangePanel=div;
}else{
if((this._repeatUntilGivenDateClientID==null)&&div.id.endsWith("RangeEndDate_wrapper")){
this._repeatUntilGivenDateClientID=div.id.substring(0,div.id.indexOf("_wrapper"));
}
}
}
}
}
}
}
}
}
},_initializeSpans:function(_14){
var _15=_14.getElementsByTagName("span");
var _16=_15.length;
for(var i=0;i<_16;i++){
var _18=_15[i];
if((this._startTimeInputClientID==null)&&_18.id.endsWith("StartTime_wrapper")){
this._startTimeInputClientID=_18.id.substring(0,_18.id.indexOf("_wrapper"));
}else{
if((this._endTimeInputClientID==null)&&_18.id.endsWith("EndTime_wrapper")){
this._endTimeInputClientID=_18.id.substring(0,_18.id.indexOf("_wrapper"));
}
}
}
},_initializeInputs:function(_19){
var _1a=_19.getElementsByTagName("input");
for(var i=0;i<_1a.length;i++){
var _1c=_1a[i];
if(_1c.name.endsWith("RepeatFrequency")){
Array.add(this._repeatFrequencyInputs,_1c);
$addHandlers(_1c,{"click":this._onRecurrencePatternChanged},this);
}else{
if(_1c.name.endsWith("RecurrentAppointment")){
this._recurrentAppointmentCheckbox=_1c;
$addHandlers(_1c,{"click":this._onRecurrenceStateChanged},this);
}else{
if(_1c.name.endsWith("AllDayEvent")){
this._allDayEventCheckbox=_1c;
$addHandlers(_1c,{"click":this._onAllDayStateChanged},this);
}else{
if(_1c.id.endsWith("RepeatGivenOccurrences")){
this._repeatGivenOccurrencesRadio=_1c;
}else{
if(_1c.name.endsWith("RangeOccurrences")){
this._repeatGivenOccurrencesInput=_1c;
}else{
if(_1c.id.endsWith("RepeatUntilGivenDate")){
this._repeatUntilGivenDateRadio=_1c;
}else{
if(_1c.id.endsWith("RangeEndDate_dateInput_text")){
this._repeatUntilGivenDateInput=_1c;
}else{
if(_1c.id.endsWith("RepeatEveryNthDay")){
this._repeatEveryNthDayRadio=_1c;
}else{
if(_1c.name.endsWith("DaylyRepeatInterval")){
this._repeatEveryNthDayInput=_1c;
}else{
if(_1c.id.endsWith("RepeatEveryNthMonthOnDate")){
this._repeatEveryNthMonthOnDateRadio=_1c;
}else{
if(_1c.name.endsWith("MonthlyRepeatDate")){
this._repeatEveryNthMonthOnDateInput1=_1c;
}else{
if(_1c.name.endsWith("MonthlyRepeatIntervalForDate")){
this._repeatEveryNthMonthOnDateInput2=_1c;
}else{
if(_1c.id.endsWith("RepeatEveryYearOnDate")){
this._repeatEveryYearOnDateRadio=_1c;
}else{
if(_1c.name.endsWith("YearlyRepeatDate")){
this._repeatEveryYearOnDateInput2=_1c;
}else{
if(_1c.id.endsWith("RepeatEveryNthMonthOnGivenDay")){
this._repeatEveryNthMonthOnGivenDayRadio=_1c;
}else{
if(_1c.name.endsWith("MonthlyRepeatIntervalForGivenDay")){
this._repeatEveryNthMonthOnGivenDayInput3=_1c;
}else{
if(_1c.id.endsWith("RepeatEveryYearOnGivenDay")){
this._repeatEveryYearOnGivenDayRadio=_1c;
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
},_initializeDropdowns:function(_1d){
var _1e=_1d.getElementsByTagName("select");
for(var i=0;i<_1e.length;i++){
if(_1e[i].id.endsWith("MonthlyDayOrdinalDropDown")){
this._repeatEveryNthMonthOnGivenDayInput1=_1e[i];
}else{
if(_1e[i].id.endsWith("MonthlyDayMaskDropDown")){
this._repeatEveryNthMonthOnGivenDayInput2=_1e[i];
}else{
if(_1e[i].id.endsWith("YearlyRepeatMonthForDate")){
this._repeatEveryYearOnDateInput1=_1e[i];
}else{
if(_1e[i].id.endsWith("YearlyDayOrdinalDropDown")){
this._repeatEveryYearOnGivenDayInput1=_1e[i];
}else{
if(_1e[i].id.endsWith("YearlyDayMaskDropDown")){
this._repeatEveryYearOnGivenDayInput2=_1e[i];
}else{
if(_1e[i].id.endsWith("YearlyRepeatMonthForGivenDay")){
this._repeatEveryYearOnGivenDayInput3=_1e[i];
}
}
}
}
}
}
}
},_glueControlWithRadio:function(_20,_21,_22){
if(_20&&_21){
$addHandlers(_20,{"click":function(e){
_21.checked=true;
_20.focus();
}},this);
if(_22==true){
$addHandlers(_21,{"click":function(e){
_20.focus();
}},this);
}
}
},_glueRangeEndDateWithRadio:function(){
if(!this._repeatUntilGivenDateClientID){
return;
}
var _25=$get(this._repeatUntilGivenDateClientID+"_CalendarPopupButton");
if(_25){
this._onRangeEndDateCalendarPopupButtonClickDelegate=Function.createDelegate(this,this._onRangeEndDateCalendarPopupButtonClick);
$addHandler(_25,"click",this._onRangeEndDateCalendarPopupButtonClickDelegate);
}
},_onRangeEndDateCalendarPopupButtonClick:function(e){
this._repeatUntilGivenDateRadio.checked=true;
this._repeatUntilGivenDateInput.focus();
},_glueRepeatUntilGivenDateWithRadio:function(){
if(this._repeatUntilGivenDateInput&&this._repeatUntilGivenDateRadio){
this._onRepeatUntilGivenDateInputClickDelegate=Function.createDelegate(this,this._onRepeatUntilGivenDateInputClick);
this._onRepeatUntilGivenDateRadioClickDelegate=Function.createDelegate(this,this._onRepeatUntilGivenDateRadioClick);
$addHandler(this._repeatUntilGivenDateInput,"click",this._onRepeatUntilGivenDateInputClickDelegate);
$addHandler(this._repeatUntilGivenDateRadio,"click",this._onRepeatUntilGivenDateRadioClickDelegate);
}
},_onRepeatUntilGivenDateInputClick:function(e){
this._repeatUntilGivenDateRadio.checked=true;
this._repeatUntilGivenDateInput.focus();
},_onRepeatUntilGivenDateRadioClick:function(e){
this._repeatUntilGivenDateInput.focus();
},_onRecurrencePatternChanged:function(e){
this._recurrencePatternHourlyPanel.style.display="none";
this._recurrencePatternDailyPanel.style.display="none";
this._recurrencePatternWeeklyPanel.style.display="none";
this._recurrencePatternMonthlyPanel.style.display="none";
this._recurrencePatternYearlyPanel.style.display="none";
switch(e.target.value){
case "RepeatFrequencyHourly":
this._recurrencePatternHourlyPanel.style.display="block";
break;
case "RepeatFrequencyDaily":
this._recurrencePatternDailyPanel.style.display="block";
break;
case "RepeatFrequencyWeekly":
this._recurrencePatternWeeklyPanel.style.display="block";
break;
case "RepeatFrequencyMonthly":
this._recurrencePatternMonthlyPanel.style.display="block";
break;
case "RepeatFrequencyYearly":
this._recurrencePatternYearlyPanel.style.display="block";
break;
}
},_onRecurrenceStateChanged:function(e){
if(e.target.checked){
this._recurrencePatternPanel.style.display="block";
this._recurrenceRangePanel.style.display="block";
}else{
this._recurrencePatternPanel.style.display="none";
this._recurrenceRangePanel.style.display="none";
}
},_onAllDayStateChanged:function(e){
if(e.target.checked){
var _2c=$find(this._startTimeInputClientID);
if(_2c){
_2c.Disable();
}
var _2d=$find(this._endTimeInputClientID);
if(_2d){
_2d.Disable();
}
}else{
var _2c=$find(this._startTimeInputClientID);
if(_2c){
_2c.Enable();
}
var _2d=$find(this._endTimeInputClientID);
if(_2d){
_2d.Enable();
}
}
},_clearHandlersSafe:function(_2e){
if(_2e){
$clearHandlers(_2e);
}
}};
Telerik.Web.UI.Scheduling.AdvancedTemplate.registerClass("Telerik.Web.UI.Scheduling.AdvancedTemplate");

