Type.registerNamespace("Telerik.Web.UI");
Type.registerNamespace("Telerik.Web.UI.Scheduler");
Telerik.Web.UI.Scheduler.ResourceGroupedWeekModel=function(_1,_2){
Telerik.Web.UI.Scheduler.ResourceGroupedWeekModel.initializeBase(this,[_1,_2]);
this._rawModelData=_2;
this._weekModels=new Array();
this._resources=new Telerik.Web.UI.SchedulerResourceCollection();
this._tablesPerModel=0;
};
Telerik.Web.UI.Scheduler.ResourceGroupedWeekModel.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);
}
var _5=this._modelData.showAllDayRow==true;
this._tablesPerModel=_5?2:1;
},getTimeSlotFromDomElement:function(_6){
var _7=this._getRawIndexFromDomElement(_6);
var _8=this._getTimeFromDomElement(_6);
var _9=this._resources.getResource(_7.modelIndex);
var _a=this._owner.get_minutesPerRow();
return new Telerik.Web.UI.Scheduler.ResourceGroupedWeekTimeSlot(_7,_8,_a,_9,_6);
},_getMaxAppointmentGrowth:function(_b){
if(this._modelData.isVertical){
var _c=this.getTimeSlotFromDomElement(_b);
return (this._modelData.slotsPerDay-_c.get_rawIndex().rowIndex-1);
}else{
return Telerik.Web.UI.Scheduler.ResourceGroupedWeekModel.callBaseMethod(this,"_getMaxAppointmentGrowth",[_b]);
}
},_getRawIndexFromDomElement:function(_d){
while(_d&&(_d.tagName.toUpperCase()!="TD")){
_d=_d.parentNode;
}
var _e=_d.parentNode;
var _f=_e.parentNode;
var _10=_f.parentNode;
var _11=_10.parentNode;
var _12=this._weekModels[0]._getRawIndexFromDomElement(_d);
if(this._modelData.isVertical){
var _13=_f.rows.length/this._resources.get_count();
var _14=Math.floor(_12.rowIndex/_13);
_12.rowIndex=_12.rowIndex-(_14*_13);
if(this._modelData.showAllDayRow){
_12.rowIndex--;
}
_12.modelIndex=_14;
}else{
var _15=_e.cells.length/this._resources.get_count();
var _14=Math.floor(_12.cellIndex/_15);
_12.cellIndex=_12.cellIndex-(_14*_15);
_12.modelIndex=_14;
}
return _12;
},_getTimeFromDomElement:function(_16){
var _17=this._getRawIndexFromDomElement(_16);
return this._weekModels[0]._getTimeFromIndex(_17);
}};
Telerik.Web.UI.Scheduler.ResourceGroupedWeekModel.registerClass("Telerik.Web.UI.Scheduler.ResourceGroupedWeekModel",Telerik.Web.UI.Scheduler.WeekModelBase);
Telerik.Web.UI.Scheduler.ResourceGroupedWeekTimeSlot=function(_18,_19,_1a,_1b,_1c){
this._resource=_1b;
Telerik.Web.UI.Scheduler.ResourceGroupedWeekTimeSlot.initializeBase(this,[_18,_19,_1a,_1c]);
};
Telerik.Web.UI.Scheduler.ResourceGroupedWeekTimeSlot.prototype={get_index:function(){
var _1d=this.get_rawIndex();
var _1e=Telerik.Web.UI.Scheduler.ResourceGroupedWeekTimeSlot.callBaseMethod(this,"get_index");
return String.format("{0}:{1}",_1d.modelIndex,_1e);
},get_resource:function(){
return this._resource;
}};
Telerik.Web.UI.Scheduler.ResourceGroupedWeekTimeSlot.registerClass("Telerik.Web.UI.Scheduler.ResourceGroupedWeekTimeSlot",Telerik.Web.UI.Scheduler.WeekTimeSlot);

