/*
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in non-GPL project. Please contact sales@dhtmlx.com for details
*/
(function(){function E(){for(var a=scheduler.get_visible_events(),c=[],b=0;b<this.y_unit.length;b++)c[b]=[];c[e]||(c[e]=[]);for(b=0;b<a.length;b++){for(var e=this.order[a[b][this.y_property]],f=0;this._trace_x[f+1]&&a[b].start_date>=this._trace_x[f+1];)f++;for(;this._trace_x[f]&&a[b].end_date>this._trace_x[f];)c[e][f]||(c[e][f]=[]),c[e][f].push(a[b]),f++}return c}function t(a,c,b){var e=0,f=c?a.end_date:a.start_date;if(f.valueOf()>scheduler._max_date.valueOf())f=scheduler._max_date;var g=f-scheduler._min_date_timeline;
if(g<0)k=0;else{var i=Math.round(g/(b*scheduler._cols[0]));if(i>scheduler._cols.length)i=scheduler._cols.length;for(var d=0;d<i;d++)e+=scheduler._cols[d];var j=scheduler.date.add(scheduler._min_date_timeline,scheduler.matrix[scheduler._mode].x_step*i,scheduler.matrix[scheduler._mode].x_unit),g=f-j,k=Math.floor(g/b)}e+=c?k-14:k+1;return e}function F(a){var c="";if(a&&this.render!="cell"){a.sort(function(a,b){return a.start_date.valueOf()==b.start_date.valueOf()?a.id>b.id?1:-1:a.start_date>b.start_date?
1:-1});for(var b=[],e=a.length,f=0;f<e;f++){var g=a[f];for(g._inner=!1;b.length;)if(b[b.length-1].end_date.valueOf()<=g.start_date.valueOf())b.splice(b.length-1,1);else break;for(var i=!1,d=0;d<b.length;d++){var j=b[d];if(j.end_date.valueOf()<=g.start_date.valueOf()){i=!0;g._sorder=j._sorder;b.splice(d,1);g._inner=!0;break}}if(b.length)b[b.length-1]._inner=!0;if(!i)if(b.length)if(b.length<=b[b.length-1]._sorder){if(b[b.length-1]._sorder)for(var k=0;k<b.length;k++){for(var h=!1,l=0;l<b.length;l++)if(b[l]._sorder==
k){h=!0;break}if(!h){g._sorder=k;break}}else g._sorder=0;g._inner=!0}else{for(var h=b[0]._sorder,m=1;m<b.length;m++)if(b[m]._sorder>h)h=b[m]._sorder;g._sorder=h+1;g._inner=!1}else g._sorder=0;b.push(g);b.length>(b.max_count||0)?(b.max_count=b.length,g._count=b.length):g._count=g._count?g._count:1}for(var n=0;n<a.length;n++)a[n]._count=b.max_count;for(var o=0;o<e;o++)c+=scheduler.render_timeline_event.call(this,a[o],!1)}return c}function G(a){var c="<table style='table-layout:fixed;' cellspacing='0' cellpadding='0'>",
b=[];scheduler._load_mode&&scheduler._load();if(this.render=="cell")b=E.call(this);else for(var e=scheduler.get_visible_events(),f=0;f<e.length;f++){var g=this.order[e[f][this.y_property]];b[g]||(b[g]=[]);b[g].push(e[f])}for(var i=0,d=0;d<scheduler._cols.length;d++)i+=scheduler._cols[d];var j=new Date;this._step=j=(scheduler.date.add(j,this.x_step*this.x_size,this.x_unit)-j)/i;this._summ=i;var k=scheduler._colsS.heights=[];this._events_height={};this._section_height={};for(d=0;d<this.y_unit.length;d++){var h=
this._logic(this.render,this.y_unit[d],this);scheduler._merge(h,{height:this.dy});if(this.section_autoheight){if(this.y_unit.length*h.height<a.offsetHeight)h.height=Math.max(h.height,Math.floor((a.offsetHeight-1)/this.y_unit.length));this._section_height[this.y_unit[d].key]=h.height}scheduler._merge(h,{tr_className:"",style_height:"height:"+h.height+"px;",style_width:"width:"+(this.dx-1)+"px;",td_className:"dhx_matrix_scell"+(scheduler.templates[this.name+"_scaley_class"](this.y_unit[d].key,this.y_unit[d].label,
this.y_unit[d])?" "+scheduler.templates[this.name+"_scaley_class"](this.y_unit[d].key,this.y_unit[d].label,this.y_unit[d]):""),td_content:scheduler.templates[this.name+"_scale_label"](this.y_unit[d].key,this.y_unit[d].label,this.y_unit[d]),summ_width:"width:"+i+"px;",table_className:""});var l=F.call(this,b[d]);if(this.fit_events){var m=this._events_height[this.y_unit[d].key]||0;h.height=m>h.height?m:h.height;h.style_height="height:"+h.height+"px;";this._section_height[this.y_unit[d].key]=h.height}c+=
"<tr class='"+h.tr_className+"' style='"+h.style_height+"'><td class='"+h.td_className+"' style='"+h.style_width+" height:"+(h.height-1)+"px;'>"+h.td_content+"</td>";if(this.render=="cell")for(f=0;f<scheduler._cols.length;f++)c+="<td class='dhx_matrix_cell "+scheduler.templates[this.name+"_cell_class"](b[d][f],this._trace_x[f],this.y_unit[d])+"' style='width:"+(scheduler._cols[f]-1)+"px'><div style='width:"+(scheduler._cols[f]-1)+"px'>"+scheduler.templates[this.name+"_cell_value"](b[d][f])+"</div></td>";
else{c+="<td><div style='"+h.summ_width+" "+h.style_height+" position:relative;' class='dhx_matrix_line'>";c+=l;c+="<table class='"+h.table_className+"' cellpadding='0' cellspacing='0' style='"+h.summ_width+" "+h.style_height+"' >";for(f=0;f<scheduler._cols.length;f++)c+="<td class='dhx_matrix_cell "+scheduler.templates[this.name+"_cell_class"](b[d],this._trace_x[f],this.y_unit[d])+"' style='width:"+(scheduler._cols[f]-1)+"px'><div style='width:"+(scheduler._cols[f]-1)+"px'></div></td>";c+="</table>";
c+="</div></td>"}c+="</tr>"}c+="</table>";this._matrix=b;a.innerHTML=c;scheduler._rendered=[];for(var n=scheduler._obj.getElementsByTagName("DIV"),d=0;d<n.length;d++)n[d].getAttribute("event_id")&&scheduler._rendered.push(n[d]);this._scales={};for(d=0;d<a.firstChild.rows.length;d++){k.push(a.firstChild.rows[d].offsetHeight);var o=this.y_unit[d].key,p=this._scales[o]=scheduler._isRender("cell")?a.firstChild.rows[d]:a.firstChild.rows[d].childNodes[1].getElementsByTagName("div")[0];scheduler.callEvent("onScaleAdd",
[p,o])}}function H(a){var c=scheduler.xy.scale_height,b=this._header_resized||scheduler.xy.scale_height;scheduler._cols=[];scheduler._colsS={height:0};this._trace_x=[];var e=scheduler._x-this.dx-18,f=[this.dx],g=scheduler._els.dhx_cal_header[0];g.style.width=f[0]+e+"px";for(var i=scheduler._min_date_timeline=scheduler._min_date,d=0;d<this.x_size;d++)this._trace_x[d]=new Date(i),i=scheduler.date.add(i,this.x_step,this.x_unit),scheduler._cols[d]=Math.floor(e/(this.x_size-d)),e-=scheduler._cols[d],f[d+
1]=f[d]+scheduler._cols[d];a.innerHTML="<div></div>";if(this.second_scale){for(var j=this.second_scale.x_unit,k=[this._trace_x[0]],h=[],l=[this.dx,this.dx],m=0,n=0;n<this._trace_x.length;n++){var o=this._trace_x[n],p=z(j,o,k[m]);p&&(++m,k[m]=o,l[m+1]=l[m]);var r=m+1;h[m]=scheduler._cols[n]+(h[m]||0);l[r]+=scheduler._cols[n]}a.innerHTML="<div></div><div></div>";var u=a.firstChild;u.style.height=b+"px";var s=a.lastChild;s.style.position="relative";for(var v=0;v<k.length;v++){var t=k[v],x=scheduler.templates[this.name+
"_second_scalex_class"](t),w=document.createElement("DIV");w.className="dhx_scale_bar dhx_second_scale_bar"+(x?" "+x:"");scheduler.set_xy(w,h[v]-1,b-3,l[v],0);w.innerHTML=scheduler.templates[this.name+"_second_scale_date"](t);u.appendChild(w)}}scheduler.xy.scale_height=b;for(var a=a.lastChild,q=0;q<this._trace_x.length;q++){i=this._trace_x[q];scheduler._render_x_header(q,f[q],i,a);var y=scheduler.templates[this.name+"_scalex_class"](i);y&&(a.lastChild.className+=" "+y)}scheduler.xy.scale_height=c;
var A=this._trace_x;a.onclick=function(a){var b=B(a);b&&scheduler.callEvent("onXScaleClick",[b.x,A[b.x],a||event])};a.ondblclick=function(a){var b=B(a);b&&scheduler.callEvent("onXScaleDblClick",[b.x,A[b.x],a||event])}}function z(a,c,b){switch(a){case "hour":return c.getHours()!=b.getHours()||z("day",c,b);case "day":return!(c.getDate()==b.getDate()&&c.getMonth()==b.getMonth()&&c.getFullYear()==b.getFullYear());case "week":return!(scheduler.date.getISOWeek(c)==scheduler.date.getISOWeek(b)&&c.getFullYear()==
b.getFullYear());case "month":return!(c.getMonth()==b.getMonth()&&c.getFullYear()==b.getFullYear());case "year":return c.getFullYear()!=b.getFullYear();default:return!1}}function I(a){if(a){scheduler.set_sizes();C();var c=scheduler._min_date;H.call(this,scheduler._els.dhx_cal_header[0]);G.call(this,scheduler._els.dhx_cal_data[0]);scheduler._min_date=c;scheduler._els.dhx_cal_date[0].innerHTML=scheduler.templates[this.name+"_date"](scheduler._min_date,scheduler._max_date)}}function D(){if(scheduler._tooltip)scheduler._tooltip.style.display=
"none",scheduler._tooltip.date=""}function J(a,c,b){if(a.render=="cell"){var e=c.x+"_"+c.y,f=a._matrix[c.y][c.x];if(!f)return D();f.sort(function(a,b){return a.start_date>b.start_date?1:-1});if(scheduler._tooltip){if(scheduler._tooltip.date==e)return;scheduler._tooltip.innerHTML=""}else{var g=scheduler._tooltip=document.createElement("DIV");g.className="dhx_tooltip";document.body.appendChild(g);g.onclick=scheduler._click.dhx_cal_data}for(var i="",d=0;d<f.length;d++){var j=f[d].color?"background-color:"+
f[d].color+";":"",k=f[d].textColor?"color:"+f[d].textColor+";":"";i+="<div class='dhx_tooltip_line' event_id='"+f[d].id+"' style='"+j+""+k+"'>";i+="<div class='dhx_tooltip_date'>"+(f[d]._timed?scheduler.templates.event_date(f[d].start_date):"")+"</div>";i+="<div class='dhx_event_icon icon_details'>&nbsp;</div>";i+=scheduler.templates[a.name+"_tooltip"](f[d].start_date,f[d].end_date,f[d])+"</div>"}scheduler._tooltip.style.display="";scheduler._tooltip.style.top="0px";scheduler._tooltip.style.left=
document.body.offsetWidth-b.left-scheduler._tooltip.offsetWidth<0?b.left-scheduler._tooltip.offsetWidth+"px":b.left+c.src.offsetWidth+"px";scheduler._tooltip.date=e;scheduler._tooltip.innerHTML=i;scheduler._tooltip.style.top=document.body.offsetHeight-b.top-scheduler._tooltip.offsetHeight<0?b.top-scheduler._tooltip.offsetHeight+c.src.offsetHeight+"px":b.top+"px"}}function C(){dhtmlxEvent(scheduler._els.dhx_cal_data[0],"mouseover",function(a){var c=scheduler.matrix[scheduler._mode];if(c&&c.render==
"cell"){if(c){var b=scheduler._locate_cell_timeline(a),a=a||event,e=a.target||a.srcElement;if(b)return J(c,b,getOffset(b.src))}D()}});C=function(){}}function K(a){for(var c=a.parentNode.childNodes,b=0;b<c.length;b++)if(c[b]==a)return b;return-1}function B(a){for(var a=a||event,c=a.target?a.target:a.srcElement;c&&c.tagName!="DIV";)c=c.parentNode;if(c&&c.tagName=="DIV"){var b=c.className.split(" ")[0];if(b=="dhx_scale_bar")return{x:K(c),y:-1,src:c,scale:!0}}}scheduler.matrix={};scheduler._merge=function(a,
c){for(var b in c)typeof a[b]=="undefined"&&(a[b]=c[b])};scheduler.createTimelineView=function(a){scheduler._merge(a,{section_autoheight:!0,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,event_dy:scheduler.xy.bar_height-5,event_min_dy:scheduler.xy.bar_height-5,resize_events:!0,fit_events:!0,second_scale:!1,_logic:function(a,b,c){var d={};scheduler.checkEvent("onBeforeViewRender")&&(d=scheduler.callEvent("onBeforeViewRender",
[a,b,c]));return d}});scheduler.checkEvent("onTimelineCreated")&&scheduler.callEvent("onTimelineCreated",[a]);var c=scheduler.render_data;scheduler.render_data=function(b,g){if(this._mode==a.name)if(g)for(var i=0;i<b.length;i++)this.clear_event(b[i]),this.render_timeline_event.call(this.matrix[this._mode],b[i],!0);else scheduler.renderMatrix.call(a,!0,!0);else return c.apply(this,arguments)};scheduler.matrix[a.name]=a;scheduler.templates[a.name+"_cell_value"]=function(a){return a?a.length:""};scheduler.templates[a.name+
"_cell_class"]=function(){return""};scheduler.templates[a.name+"_scalex_class"]=function(){return""};scheduler.templates[a.name+"_second_scalex_class"]=function(){return""};scheduler.templates[a.name+"_scaley_class"]=function(){return""};scheduler.templates[a.name+"_scale_label"]=function(a,b){return b};scheduler.templates[a.name+"_tooltip"]=function(a,b,c){return c.text};scheduler.templates[a.name+"_date"]=function(a,b){return a.getDay()==b.getDay()&&b-a<864E5?scheduler.templates.day_date(a):scheduler.templates.week_date(a,
b)};scheduler.templates[a.name+"_scale_date"]=scheduler.date.date_to_str(a.x_date||scheduler.config.hour_date);scheduler.templates[a.name+"_second_scale_date"]=scheduler.date.date_to_str(a.second_scale&&a.second_scale.x_date?a.second_scale.x_date:scheduler.config.hour_date);scheduler.date["add_"+a.name]=function(b,c){return scheduler.date.add(b,(a.x_length||a.x_size)*c*a.x_step,a.x_unit)};scheduler.date[a.name+"_start"]=function(b){var c=scheduler.date[a.x_unit+"_start"]||scheduler.date.day_start,
e=c.call(scheduler.date,b);return e=scheduler.date.add(e,a.x_step*a.x_start,a.x_unit)};scheduler.attachEvent("onSchedulerResize",function(){return this._mode==a.name?(scheduler.renderMatrix.call(a,!0,!0),!1):!0});scheduler.attachEvent("onOptionsLoad",function(){a.order={};scheduler.callEvent("onOptionsLoadStart",[]);for(var b=0;b<a.y_unit.length;b++)a.order[a.y_unit[b].key]=b;scheduler.callEvent("onOptionsLoadFinal",[]);scheduler._date&&a.name==scheduler._mode&&scheduler.setCurrentView(scheduler._date,
scheduler._mode)});scheduler.callEvent("onOptionsLoad",[a]);scheduler[a.name+"_view"]=function(){scheduler.renderMatrix.apply(a,arguments)};var b=new Date,e=scheduler.date.add(b,a.x_step,a.x_unit).valueOf()-b.valueOf();scheduler["mouse_"+a.name]=function(b){var c=this._drag_event;if(this._drag_id)c=this.getEvent(this._drag_id),this._drag_event._dhx_changed=!0;b.x-=a.dx;for(var e=0,d=0,j=0;d<=this._cols.length-1;d++){var k=this._cols[d];e+=k;if(e>b.x){var h=(b.x-(e-k))/k,h=h<0?0:h;break}}for(e=0;j<
this._colsS.heights.length;j++)if(e+=this._colsS.heights[j],e>b.y)break;b.fields={};a.y_unit[j]||(j=a.y_unit.length-1);if(j>=0&&a.y_unit[j]&&(b.section=b.fields[a.y_property]=a.y_unit[j].key,c))c[a.y_property]=b.section;b.x=0;var l;if(d>=a._trace_x.length)l=scheduler.date.add(a._trace_x[a._trace_x.length-1],a.x_step,a.x_unit);else{var m=a._trace_x[d+1]?a._trace_x[d+1]:scheduler.date.add(a._trace_x[a._trace_x.length-1],a.x_step,a.x_unit),n=Math.ceil(h*(m-a._trace_x[d]));l=new Date(+a._trace_x[d]+n)}if(this._drag_mode==
"move"&&this._drag_id&&this._drag_event){var c=this.getEvent(this._drag_id),o=this._drag_event;if(!o._move_delta)o._move_delta=(c.start_date-l)/6E4;l=scheduler.date.add(l,o._move_delta,"minute")}if(this._drag_mode=="resize"&&c)b.resize_from_start=!!(Math.abs(c.start_date-l)<Math.abs(c.end_date-l));b.y=Math.round((l-this._min_date)/(6E4*this.config.time_step));b.custom=!0;b.shift=this.config.time_step;return b}};scheduler.render_timeline_event=function(a,c){var b=a[this.y_property],e=a._sorder,f=t(a,
!1,this._step),g=t(a,!0,this._step),i=this.event_dy;this.event_dy=="full"&&(i=this.section_autoheight?this._section_height[b]-6:this.dy-3);this.resize_events&&(i=Math.max(Math.floor(i/a._count),this.event_min_dy));var d=i-2;!a._inner&&this.event_dy=="full"&&(d=(d+2)*(a._count-e)-2);var j=2+e*i+(e?e*2:0);scheduler.config.cascade_event_display&&(j=2+e*scheduler.config.cascade_event_margin+(e?e*2:0));var k=i+j+2;if(!this._events_height[b]||this._events_height[b]<k)this._events_height[b]=k;var h=scheduler.templates.event_class(a.start_date,
a.end_date,a),h="dhx_cal_event_line "+(h||""),l=a.color?"background:"+a.color+";":"",m=a.textColor?"color:"+a.textColor+";":"",n=scheduler.templates.event_bar_text(a.start_date,a.end_date,a),o='<div event_id="'+a.id+'" class="'+h+'" style="'+l+""+m+"position:absolute; top:"+j+"px; height: "+d+"px; left:"+f+"px; width:"+Math.max(0,g-f)+"px;"+(a._text_style||"")+'">';if(scheduler.config.drag_resize){var p="dhx_event_resize";o+="<div class='"+p+" "+p+"_start' style='height: "+d+"px;'></div><div class='"+
p+" "+p+"_end' style='height: "+d+"px;'></div>"}o+=n+"</div>";if(c){var r=document.createElement("DIV");r.innerHTML=o;var u=this.order[b],s=scheduler._els.dhx_cal_data[0].firstChild.rows[u].cells[1].firstChild;scheduler._rendered.push(r.firstChild);s.appendChild(r.firstChild)}else return o};scheduler.renderMatrix=function(a,c){if(!c)scheduler._els.dhx_cal_data[0].scrollTop=0;scheduler._min_date=scheduler.date[this.name+"_start"](scheduler._date);scheduler._max_date=scheduler.date.add(scheduler._min_date,
this.x_size*this.x_step,this.x_unit);scheduler._table_view=!0;if(this.second_scale){if(a&&!this._header_resized)this._header_resized=scheduler.xy.scale_height,scheduler.xy.scale_height*=2,scheduler._els.dhx_cal_header[0].className+=" dhx_second_cal_header";if(!a&&this._header_resized){scheduler.xy.scale_height/=2;this._header_resized=!1;var b=scheduler._els.dhx_cal_header[0];b.className=b.className.replace(/ dhx_second_cal_header/gi,"")}}I.call(this,a)};scheduler._locate_cell_timeline=function(a){for(var a=
a||event,c=a.target?a.target:a.srcElement,b={},e=scheduler.matrix[scheduler._mode],f=scheduler.getActionData(a),g=0;g<e._trace_x.length-1;g++)if(+f.date<=e._trace_x[g+1])break;b.x=g;b.y=e.order[f.section];var i=scheduler._isRender("cell")?1:0;b.src=e._scales[f.section].getElementsByTagName("td")[g+i];if(c.className.split(" ")[0]=="dhx_matrix_scell")b.x=-1,b.src=c,b.scale=!0;return b};var L=scheduler._click.dhx_cal_data;scheduler._click.dhx_marked_timespan=scheduler._click.dhx_cal_data=function(a){var c=
L.apply(this,arguments),b=scheduler.matrix[scheduler._mode];if(b){var e=scheduler._locate_cell_timeline(a);e&&(e.scale?scheduler.callEvent("onYScaleClick",[e.y,b.y_unit[e.y],a||event]):scheduler.callEvent("onCellClick",[e.x,e.y,b._trace_x[e.x],(b._matrix[e.y]||{})[e.x]||[],a||event]))}return c};scheduler.dblclick_dhx_marked_timespan=scheduler.dblclick_dhx_matrix_cell=function(a){var c=scheduler.matrix[scheduler._mode];if(c){var b=scheduler._locate_cell_timeline(a);b&&(b.scale?scheduler.callEvent("onYScaleDblClick",
[b.y,c.y_unit[b.y],a||event]):scheduler.callEvent("onCellDblClick",[b.x,b.y,c._trace_x[b.x],(c._matrix[b.y]||{})[b.x]||[],a||event]))}};scheduler.dblclick_dhx_matrix_scell=function(a){return scheduler.dblclick_dhx_matrix_cell(a)};scheduler._isRender=function(a){return scheduler.matrix[scheduler._mode]&&scheduler.matrix[scheduler._mode].render==a};scheduler.attachEvent("onCellDblClick",function(a,c,b,e,f){if(!(this.config.readonly||f.type=="dblclick"&&!this.config.dblclick_create)){var g=scheduler.matrix[scheduler._mode],
i={};i.start_date=g._trace_x[a];i.end_date=g._trace_x[a+1]?g._trace_x[a+1]:scheduler.date.add(g._trace_x[a],g.x_step,g.x_unit);i[scheduler.matrix[scheduler._mode].y_property]=g.y_unit[c].key;scheduler.addEventNow(i,null,f)}});scheduler.attachEvent("onBeforeDrag",function(){return!scheduler._isRender("cell")});scheduler.attachEvent("onEventChanged",function(a,c){c._timed=this.is_one_day_event(c)});var M=scheduler._render_marked_timespan;scheduler._render_marked_timespan=function(a,c,b){if(!scheduler.config.display_marked_timespans)return[];
if(scheduler.matrix&&scheduler.matrix[scheduler._mode]){if(!scheduler._isRender("cell")){var e=scheduler.matrix[scheduler._mode],f=[],g=[],i=[];if(b)i=[c],g=[b];else{var d=e.order,j;for(j in d)d.hasOwnProperty(j)&&(g.push(j),i.push(e._scales[j]))}var k=scheduler._min_date,h=scheduler._max_date,l=[];if(a.days>6){var m=new Date(a.days);scheduler.date.date_part(new Date(k))<=+m&&+h>=+m&&l.push(m)}else l.push.apply(l,scheduler._get_dates_by_index(a.days));for(var n=a.zones,o=scheduler._get_css_classes_by_config(a),
p=0;p<g.length;p++)for(var c=i[p],b=g[p],r=0;r<l.length;r++)for(var u=l[r],s=0;s<n.length;s+=2){var v=n[s],z=n[s+1],x=new Date(+u+v*6E4),w=new Date(+u+z*6E4);if(scheduler._min_date<w&&scheduler._max_date>x){var q=scheduler._get_block_by_config(a);q.className=o;var y=t({start_date:x},!1,e._step)-1,A=t({start_date:w},!1,e._step)-1,B=A-y-1,C=e._section_height[b]-1;q.style.cssText="height: "+C+"px; left: "+y+"px; width: "+B+"px; top: 0;";c.insertBefore(q,c.firstChild);f.push(q)}}return f}}else return M.apply(scheduler,
[a,c,b])};var N=scheduler._append_mark_now;scheduler._append_mark_now=function(a){if(scheduler.matrix&&scheduler.matrix[scheduler._mode]){var c=new Date,b=scheduler._get_zone_minutes(c),e={days:+scheduler.date.date_part(c),zones:[b,b+1],css:"dhx_matrix_now_time",type:"dhx_now_time"};return scheduler._render_marked_timespan(e)}else return N.apply(scheduler,[a])};scheduler.attachEvent("onViewChange",function(a,c){scheduler.matrix&&scheduler.matrix[c]&&scheduler.markNow&&scheduler.markNow()});scheduler.attachEvent("onScaleAdd",
function(a,c){var b=scheduler._marked_timespans;if(b&&scheduler.matrix&&scheduler.matrix[scheduler._mode])for(var e=scheduler._mode,f=scheduler._min_date,g=scheduler._max_date,i=b.global,d=scheduler.date.date_part(new Date(f));d<g;d=scheduler.date.add(d,1,"day")){var j=+d,k=d.getDay(),h=[],l=i[j]||i[k];h.push.apply(h,scheduler._get_configs_to_render(l));if(b[e]&&b[e][c]){var m=scheduler._get_types_to_render(b[e][c][k],b[e][c][j]);h.push.apply(h,scheduler._get_configs_to_render(m))}for(var n=0;n<h.length;n++){var o=
h[n],p=o.days;p<7?(p=j,scheduler._render_marked_timespan(o,a,c),p=k):scheduler._render_marked_timespan(o,a,c)}}})})();
