/*
dhtmlxScheduler v.2.3
This software is allowed to use under GPL or you need to obtain Commercial or Enterise License
to use it in not GPL project. Please contact sales@dhtmlx.com for details
(c) DHTMLX Ltd.
*/
scheduler.config.year_x=4;scheduler.config.year_y=3;scheduler.config.year_mode_name="year";scheduler.xy.year_top=0;scheduler.templates.year_date=function(A){return scheduler.date.date_to_str(scheduler.locale.labels.year_tab+" %Y")(A)};scheduler.templates.year_month=scheduler.date.date_to_str("%F");scheduler.templates.year_scale_date=scheduler.date.date_to_str("%D");scheduler.templates.year_tooltip=function(A,C,B){return B.text};(function(){var F=function(){return scheduler._mode==scheduler.config.year_mode_name};scheduler.dblclick_dhx_month_head=function(J){if(F()){var I=(J.target||J.srcElement);if(I.parentNode.className.indexOf("dhx_before")!=-1||I.parentNode.className.indexOf("dhx_after")!=-1){return false}var K=this.templates.xml_date(I.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.getAttribute("date"));K.setDate(parseInt(I.innerHTML,10));var H=this.date.add(K,1,"day");if(!this.config.readonly&&this.config.dblclick_create){this.addEventNow(K.valueOf(),H.valueOf(),J)}}};var C=scheduler.changeEventId;scheduler.changeEventId=function(){C.apply(this,arguments);if(F()){this.year_view(true)}};var B=scheduler.render_data;var G=scheduler.date.date_to_str("%Y/%m/%d");var E=scheduler.date.str_to_date("%Y/%m/%d");scheduler.render_data=function(H){if(!F()){return B.apply(this,arguments)}for(var I=0;I";K+=""+(H[J]._timed?this.templates.event_date(H[J].start_date):"")+"
";K+="
";K+=this.templates.year_tooltip(H[J].start_date,H[J].end_date,H[J])+""}this._tooltip.style.display="";this._tooltip.style.top="0px";if(document.body.offsetWidth-O.left-this._tooltip.offsetWidth<0){this._tooltip.style.left=O.left-this._tooltip.offsetWidth+"px"}else{this._tooltip.style.left=O.left+N.offsetWidth+"px"}this._tooltip.date=I;this._tooltip.innerHTML=K;if(document.body.offsetHeight-O.top-this._tooltip.offsetHeight<0){this._tooltip.style.top=O.top-this._tooltip.offsetHeight+N.offsetHeight+"px"}else{this._tooltip.style.top=O.top+"px"}};scheduler._init_year_tooltip=function(){dhtmlxEvent(scheduler._els.dhx_cal_data[0],"mouseover",function(H){if(!F()){return }var H=H||event;var I=H.target||H.srcElement;if((I.className||"").indexOf("dhx_year_event")!=-1){scheduler.showToolTip(E(I.getAttribute("date")),getOffset(I),H,I)}else{scheduler.hideToolTip()}});this._init_year_tooltip=function(){}};scheduler.attachEvent("onSchedulerResize",function(){if(F()){this.year_view(true);return false}return true});scheduler._get_year_cell=function(J){var H=J.getMonth()+12*(J.getFullYear()-this._min_date.getFullYear())-this.week_starts._month;var I=this._els.dhx_cal_data[0].childNodes[H];var J=this.week_starts[H]+J.getDate()-1;return I.childNodes[2].firstChild.rows[Math.floor(J/7)].cells[J%7].firstChild};var D=[];scheduler._mark_year_date=function(I,H){var J=this._get_year_cell(I);J.className="dhx_month_head dhx_year_event "+this.templates.event_class(H.start_date,H.end_date,H);J.setAttribute("date",G(I));D.push(J)};scheduler._unmark_year_date=function(H){this._get_year_cell(H).className="dhx_month_head"};scheduler._year_render_event=function(H){var I=H.start_date;if(I.valueOf()=this._max_date.valueOf()){return }}};scheduler.year_view=function(I){if(I){var H=scheduler.xy.scale_height;scheduler.xy.scale_height=-1}scheduler._els.dhx_cal_header[0].style.display=I?"none":"";scheduler.set_sizes();if(I){scheduler.xy.scale_height=H}scheduler._table_view=I;if(this._load_mode&&this._load()){return }if(I){scheduler._init_year_tooltip();scheduler._reset_year_scale();scheduler.render_view_data()}else{scheduler.hideToolTip()}};scheduler._reset_year_scale=function(){this._cols=[];this._colsS={};var T=[];var Z=this._els.dhx_cal_data[0];var X=this.config;Z.scrollTop=0;Z.innerHTML="";var M=Math.floor(parseInt(Z.style.width)/X.year_x);var L=Math.floor((parseInt(Z.style.height)-scheduler.xy.year_top)/X.year_y);if(L<190){L=190;M=Math.floor((parseInt(Z.style.width)-scheduler.xy.scroll_width)/X.year_x)}var Q=M-11;var I=0;var K=document.createElement("div");var a=this.date.week_start(new Date());for(var V=0;V<7;V++){this._cols[V]=Math.floor(Q/(7-V));this._render_x_header(V,I,a,K);a=this.date.add(a,1,"day");Q-=this._cols[V];I+=this._cols[V]}K.lastChild.className+=" dhx_scale_bar_last";var H=this.date[this._mode+"_start"](this.date.copy(this._date));var R=H;for(var V=0;V"+K.innerHTML+"
";W.childNodes[0].innerHTML=this.templates.year_month(H);var Y=this.date.week_start(H);var J=this._reset_month_scale(W.childNodes[2],H,Y);var P=W.childNodes[2].firstChild.rows;for(var S=P.length;S<6;S++){P[0].parentNode.appendChild(P[0].cloneNode(true));for(var O=0;O