Type.registerNamespace("Telerik.Web.UI.Scheduler");
Telerik.Web.UI.Scheduler.DateGroupedWeekModel=function(_1,_2){
Telerik.Web.UI.Scheduler.DateGroupedWeekModel.initializeBase(this,[_1,_2]);
this._rawModelData=_2;
this._weekModels=new Array();
this._resources=new Telerik.Web.UI.SchedulerResourceCollection();
};
Telerik.Web.UI.Scheduler.DateGroupedWeekModel.prototype={initialize:function(){
var _3=this._modelData.groupingResource;
this._resources=this._owner.get_resources().getResourcesByType(_3);
for(var i=0;i<this._resources.get_count();i++){
this._weekModels[i]=new Telerik.Web.UI.Scheduler.WeekModel(this._owner,this._rawModelData);
}
},getTimeSlotFromDomElement:function(_5){
var _6=this._getRawIndexFromDomElement(_5);
var _7=this._getTimeFromDomElement(_5);
var _8=this._resources.getResource(_6.modelIndex);
var _9=this._owner.get_minutesPerRow();
return new Telerik.Web.UI.Scheduler.DateGroupedWeekTimeSlot(_6,_7,_9,_8,_5);
},_getMaxAppointmentGrowth:function(_a){
if(this._modelData.isVertical){
var _b=this.getTimeSlotFromDomElement(_a);
return (this._modelData.slotsPerDay-_b.get_rawIndex().rowIndex-1);
}else{
return Telerik.Web.UI.Scheduler.DateGroupedWeekModel.callBaseMethod(this,"_getMaxAppointmentGrowth",[_a]);
}
},_getRawIndexFromDomElement:function(_c){
while(_c&&(_c.tagName.toUpperCase()!="TD")){
_c=_c.parentNode;
}
if(!_c){
return null;
}
var _d=_c.parentNode;
var _e=_d.parentNode;
var _f=_e.parentNode;
var _10=_f.parentNode;
var _11=_c.cellIndex;
var _12=_c.parentNode.rowIndex;
var _13=Sys.UI.DomElement.containsCssClass(_d,"rsAllDayRow");
var _14=_13?0:1;
var _15;
var _16;
var _17;
if(this._modelData.isVertical){
_15=_11;
var _18=_e.rows.length/this._modelData.numberOfDays;
_17=_12%_18;
if(this._modelData.showAllDayRow&&!_13){
_17--;
}
_16=Math.floor(_12/_18);
}else{
_15=_11%this._resources.get_count();
_16=Math.floor(_11/this._resources.get_count());
_17=_12;
}
return {modelIndex:_15,viewPartIndex:_14,rowIndex:_17,cellIndex:_16};
},_getTimeFromDomElement:function(_19){
var _1a=this._getRawIndexFromDomElement(_19);
var _1b=new Date(this._modelData.start);
var _1c=_1a.rowIndex*this._owner.get_minutesPerRow();
Telerik.Web.UI.RadScheduler._incrementTime(_1b,24*_1a.cellIndex,_1c);
return _1b;
}};
Telerik.Web.UI.Scheduler.DateGroupedWeekModel.registerClass("Telerik.Web.UI.Scheduler.DateGroupedWeekModel",Telerik.Web.UI.Scheduler.WeekModelBase);
Telerik.Web.UI.Scheduler.DateGroupedWeekTimeSlot=function(_1d,_1e,_1f,_20,_21){
this._resource=_20;
Telerik.Web.UI.Scheduler.DateGroupedWeekTimeSlot.initializeBase(this,[_1d,_1e,_1f,_21]);
};
Telerik.Web.UI.Scheduler.DateGroupedWeekTimeSlot.prototype={get_index:function(){
var _22=this.get_rawIndex();
var _23=Telerik.Web.UI.Scheduler.DateGroupedWeekTimeSlot.callBaseMethod(this,"get_index");
return String.format("{0}:{1}",_22.modelIndex,_23);
},get_resource:function(){
return this._resource;
}};
Telerik.Web.UI.Scheduler.DateGroupedWeekTimeSlot.registerClass("Telerik.Web.UI.Scheduler.DateGroupedWeekTimeSlot",Telerik.Web.UI.Scheduler.WeekTimeSlot);

