(function(){scheduler.matrix={};scheduler._merge=function(M,L){for(var N in L){if(typeof M[N]=="undefined"){M[N]=L[N]}}};scheduler.createTimelineView=function(O){scheduler._merge(O,{section_autoheight:true,name:"matrix",x:"time",y:"time",x_step:1,x_unit:"hour",y_unit:"day",y_step:1,x_start:0,x_size:24,y_start:0,y_size:7,render:"cell",dx:200,dy:50,_logic:function(S,R,Q){var P={};if(scheduler.checkEvent("onBeforeViewRender")){P=scheduler.callEvent("onBeforeViewRender",[S,R,Q])}return P}});if(scheduler.checkEvent("onTimelineCreated")){scheduler.callEvent("onTimelineCreated",[O])}scheduler[O.name+"_view"]=function(){scheduler.renderMatrix.apply(O,arguments)};var L=scheduler.render_data;scheduler.render_data=function(P,R){if(this._mode==O.name){if(R){for(var Q=0;Q
U.x){break}}T=0;for(Q;QU.y){break}}U.fields={};U.fields[O.y_property]=P[O.y_property]=O.y_unit[Q].key;U.x=Q/10000000;if(this._drag_mode=="new-size"&&P.start_date*1==this._drag_start*1){S++}if(S>=O._trace_x.length){var R=scheduler.date.add(O._trace_x[O._trace_x.length-1],O.x_step,O.x_unit)}else{var R=O._trace_x[S]}U.y=Math.round((R-this._min_date)/(1000*60*this.config.time_step));U.custom=true;U.shift=M;return U}}};scheduler.render_timeline_event=function(U,V,R){var N=E(U,false,this._step);var L=E(U,true,this._step);var P=scheduler.xy.bar_height;var T=2+V*P;var Q=scheduler.templates.event_class(U.start_date,U.end_date,U);Q="dhx_cal_event_line "+(Q||"");var O=''+scheduler.templates.event_bar_text(U.start_date,U.end_date,U)+"
";if(!R){return O}else{var S=document.createElement("DIV");S.innerHTML=O;var M=this.order[U[this.y_property]];var W=scheduler._els.dhx_cal_data[0].firstChild.rows[M].cells[1].firstChild;scheduler._rendered.push(S.firstChild);W.appendChild(S.firstChild)}};function K(){var N=scheduler.getEvents(scheduler._min_date,scheduler._max_date);var M=[];for(var O=0;O=this._trace_x[L+1]){L++}while(this._trace_x[L]&&N[O].end_date>this._trace_x[L]){if(!M[P][L]){M[P][L]=[]}M[P][L].push(N[O]);L++}}return M}function E(S,Q,L){var T=0;var O=(Q)?S.end_date:S.start_date;if(O.valueOf()>scheduler._max_date.valueOf()){O=scheduler._max_date}var U=O-scheduler._min_date_timeline;if(U<0){M=0}else{var R=Math.round(U/(L*scheduler._cols[0]));if(R>scheduler._cols.length){R=scheduler._cols.length}for(var P=0;P"+Q.td_content+" | ";if(this.render=="cell"){for(var O=0;O"+scheduler.templates[this.name+"_cell_value"](Z[P][O])+"
"}}else{R+="
";if(Z[P]){Z[P].sort(function(d,c){return d.start_date>c.start_date?1:-1});var X=[];for(var O=0;O W.start_date){L++}X[L]=W;R+=scheduler.render_timeline_event.call(this,W,L)}}R+="";R+=" | "}R+=""}R+="";this._matrix=Z;S.scrollTop=0;S.innerHTML=R;scheduler._rendered=[];var U=document.getElementsByTagName("DIV");for(var P=0;P
";N=N.firstChild;scheduler._cols=[];scheduler._colsS={height:0};this._trace_x=[];scheduler._min_date_timeline=scheduler._min_date;var R=scheduler._min_date;var Q=scheduler._x-this.dx-18;var P=this.dx;for(var L=0;L
T.start_date?1:-1});if(scheduler._tooltip){if(scheduler._tooltip.date==R){return }scheduler._tooltip.innerHTML=""}else{var O=scheduler._tooltip=document.createElement("DIV");O.className="dhx_tooltip";document.body.appendChild(O);O.onclick=scheduler._click.dhx_cal_data}var N="";for(var M=0;M";N+=""+(L[M]._timed?scheduler.templates.event_date(L[M].start_date):"")+"
";N+="
";N+=scheduler.templates[P.name+"_tooltip"](L[M].start_date,L[M].end_date,L[M])+" "}scheduler._tooltip.style.display="";scheduler._tooltip.style.top="0px";if(document.body.offsetWidth-Q.left-scheduler._tooltip.offsetWidth<0){scheduler._tooltip.style.left=Q.left-scheduler._tooltip.offsetWidth+"px"}else{scheduler._tooltip.style.left=Q.left+S.src.offsetWidth+"px"}scheduler._tooltip.date=R;scheduler._tooltip.innerHTML=N;if(document.body.offsetHeight-Q.top-scheduler._tooltip.offsetHeight<0){scheduler._tooltip.style.top=Q.top-scheduler._tooltip.offsetHeight+S.src.offsetHeight+"px"}else{scheduler._tooltip.style.top=Q.top+"px"}}function F(){dhtmlxEvent(scheduler._els.dhx_cal_data[0],"mouseover",function(M){var L=scheduler.matrix[scheduler._mode];if(L){var O=scheduler._locate_cell_timeline(M);var M=M||event;var N=M.target||M.srcElement;if(O){return J(L,O,getOffset(O.src))}}H()});F=function(){}}scheduler.renderMatrix=function(M){var L=scheduler.date[this.name+"_start"](scheduler._date);scheduler._min_date=scheduler.date.add(L,this.x_start*this.x_step,this.x_unit);scheduler._max_date=scheduler.date.add(scheduler._min_date,this.x_size*this.x_step,this.x_unit);scheduler._table_view=true;C.call(this,M)};function G(M){var N=M.parentNode.childNodes;for(var L=0;L