Type.registerNamespace("Telerik.Web.UI.Scheduler.Views.Month.GroupedByDate");
Telerik.Web.UI.Scheduler.Views.Month.GroupedByDate.Model=function(_1,_2){
this._owner=_1;
this._modelData=Sys.Serialization.JavaScriptSerializer.deserialize(_2);
this._rawModelData=_2;
this._monthModels=[];
this._resources=null;
};
Telerik.Web.UI.Scheduler.Views.Month.GroupedByDate.Model.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._monthModels[i]=new Telerik.Web.UI.Scheduler.Views.Month.Model(this._owner,this._rawModelData);
}
},getTimeSlotFromDomElement:function(_5){
var _6=this._getRawIndexFromDomElement(_5);
var _7=this._getTimeFromDomElement(_5);
var _8=this._resources.getResource(_6.modelIndex);
return new Telerik.Web.UI.Scheduler.Views.Month.GroupedByDate.TimeSlot(_6,_7,_8,_5);
},_getTimeFromDomElement:function(_9){
var _a=this._getRawIndexFromDomElement(_9);
return this._monthModels[0]._getTimeFromIndex(_a);
},_getRawIndexFromDomElement:function(_b){
while(_b&&(_b.tagName.toUpperCase()!="TD")){
_b=_b.parentNode;
}
if(!_b){
return null;
}
var _c=_b.parentNode;
var _d=_b.cellIndex;
var _e=_d%this._resources.get_count();
var _f=_c.parentNode;
var _10=_f.parentNode;
var _11=_c.rowIndex;
var _12=_c.cells.length/this._resources.get_count();
var _13=Math.floor(_d/this._resources.get_count());
var _14;
var _15;
var _16;
if(this._modelData.isVertical){
_14=_13;
_15=_10.rows.length;
_16=_11;
}else{
_14=_11;
_15=_12;
_16=_13;
}
var _17=(_14*_15)+_16;
return {modelIndex:_e,dayIndex:_17};
}};
Telerik.Web.UI.Scheduler.Views.Month.GroupedByDate.Model.registerClass("Telerik.Web.UI.Scheduler.Views.Month.GroupedByDate.Model",null,Telerik.Web.UI.ISchedulerModel);
Telerik.Web.UI.Scheduler.Views.Month.GroupedByDate.TimeSlot=function(_18,_19,_1a,_1b){
this._resource=_1a;
Telerik.Web.UI.Scheduler.Views.Month.GroupedByDate.TimeSlot.initializeBase(this,[_18,_19,_1b]);
};
Telerik.Web.UI.Scheduler.Views.Month.GroupedByDate.TimeSlot.prototype={get_index:function(){
var _1c=this.get_rawIndex();
var _1d=Telerik.Web.UI.Scheduler.Views.Month.GroupedByDate.TimeSlot.callBaseMethod(this,"get_index");
return String.format("{0}:{1}",_1c.modelIndex,_1d);
},get_resource:function(){
return this._resource;
}};
Telerik.Web.UI.Scheduler.Views.Month.GroupedByDate.TimeSlot.registerClass("Telerik.Web.UI.Scheduler.Views.Month.GroupedByDate.TimeSlot",Telerik.Web.UI.Scheduler.Views.Month.TimeSlot);

