typeof links=="undefined"&&(links={});typeof google=="undefined"&&(google=undefined);Array.prototype.indexOf||(Array.prototype.indexOf=function(n){for(var t=0;t<this.length;t++)if(this[t]==n)return t;return-1});Array.prototype.forEach||(Array.prototype.forEach=function(n,t){for(var i=0,r=this.length;i<r;++i)n.call(t||this,this[i],i,this)});links.Timeline=function(n,t){var i,r;if(n){for(this.dom={},this.conversion={},this.eventParams={},this.groups=[],this.groupIndexes={},this.items=[],this.renderQueue={show:[],hide:[],update:[]},this.renderedItems=[],this.clusterGenerator=new links.Timeline.ClusterGenerator(this),this.currentClusters=[],this.selection=undefined,this.listeners={},this.size={actualHeight:0,axis:{characterMajorHeight:0,characterMajorWidth:0,characterMinorHeight:0,characterMinorWidth:0,height:0,labelMajorTop:0,labelMinorTop:0,line:0,lineMajorWidth:0,lineMinorHeight:0,lineMinorTop:0,lineMinorWidth:0,top:0},contentHeight:0,contentLeft:0,contentWidth:0,frameHeight:0,frameWidth:0,groupsLeft:0,groupsWidth:0,items:{top:0}},this.dom.container=n,this.options={width:"100%",height:"auto",minHeight:0,groupMinHeight:0,autoHeight:!0,eventMargin:10,eventMarginAxis:20,dragAreaWidth:10,min:undefined,max:undefined,zoomMin:10,zoomMax:31536e10,moveable:!0,zoomable:!0,selectable:!0,unselectable:!0,editable:!1,snapEvents:!0,groupChangeable:!0,timeChangeable:!0,showCurrentTime:!0,showCustomTime:!1,showMajorLabels:!0,showMinorLabels:!0,showNavigation:!1,showButtonNew:!1,groupsOnRight:!1,groupsOrder:!0,axisOnTop:!1,stackEvents:!0,animate:!0,animateZoom:!0,cluster:!1,clusterMaxItems:5,style:"box",customStackOrder:!1,locale:"en",MONTHS:["January","February","March","April","May","June","July","August","September","October","November","December"],MONTHS_SHORT:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],DAYS:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],DAYS_SHORT:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ZOOM_IN:"Zoom in",ZOOM_OUT:"Zoom out",MOVE_LEFT:"Move left",MOVE_RIGHT:"Move right",NEW:"New",CREATE_NEW_EVENT:"Create new event"},this.setOptions(t),this.clientTimeOffset=0,i=this.dom;i.container.hasChildNodes();)i.container.removeChild(i.container.firstChild);this.step=new links.Timeline.StepDate;this.itemTypes={box:links.Timeline.ItemBox,range:links.Timeline.ItemRange,floatingRange:links.Timeline.ItemFloatingRange,dot:links.Timeline.ItemDot};this.data=[];this.firstDraw=!0;this.setVisibleChartRange(undefined,undefined,!1);this.render();r=this;setTimeout(function(){r.trigger("ready")},0)}};links.Timeline.prototype.draw=function(n,t){t&&console.log("WARNING: Passing options in draw() is deprecated. Pass options to the constructur or use setOptions() instead!");this.setOptions(t);this.options.selectable&&links.Timeline.addClassName(this.dom.frame,"timeline-selectable");this.setData(n);t&&(t.start||t.end)?this.setVisibleChartRange(t.start,t.end):this.firstDraw&&this.setVisibleChartRangeAuto();this.firstDraw=!1};links.Timeline.prototype.setOptions=function(n){var i,t,r;if(n){for(i in n)n.hasOwnProperty(i)&&(this.options[i]=n[i]);if(typeof links.locales!="undefined"&&this.options.locale!=="en"&&(t=links.locales[this.options.locale],t))for(r in t)t.hasOwnProperty(r)&&(this.options[r]=t[r]);n.showButtonAdd!=undefined&&(this.options.showButtonNew=n.showButtonAdd,console.log("WARNING: Option showButtonAdd is deprecated. Use showButtonNew instead"));n.intervalMin!=undefined&&(this.options.zoomMin=n.intervalMin,console.log("WARNING: Option intervalMin is deprecated. Use zoomMin instead"));n.intervalMax!=undefined&&(this.options.zoomMax=n.intervalMax,console.log("WARNING: Option intervalMax is deprecated. Use zoomMax instead"));n.scale&&n.step&&this.step.setScale(n.scale,n.step)}this.options.autoHeight=this.options.height==="auto"};links.Timeline.prototype.getOptions=function(){return this.options};links.Timeline.prototype.addItemType=function(n,t){this.itemTypes[n]=t};links.Timeline.mapColumnIds=function(n){for(var t={},u=n.getNumberOfColumns(),f=!0,i,r=0;r<u;r++)i=n.getColumnId(r)||n.getColumnLabel(r),t[i]=r,(i=="start"||i=="end"||i=="content"||i=="group"||i=="className"||i=="editable"||i=="type")&&(f=!1);return f&&(t.start=0,t.end=1,t.content=2,u>3&&(t.group=3),u>4&&(t.className=4),u>5&&(t.editable=5),u>6&&(t.type=6)),t};links.Timeline.prototype.setData=function(n){var u,t,i,r,f,e;if(this.unselectItem(),n||(n=[]),this.stackCancelAnimation(),this.clearItems(),this.data=n,u=this.items,this.deleteGroups(),google&&google.visualization&&n instanceof google.visualization.DataTable)for(t=links.Timeline.mapColumnIds(n),i=0,r=n.getNumberOfRows();i<r;i++)u.push(this.createItem({start:t.start!=undefined?n.getValue(i,t.start):undefined,end:t.end!=undefined?n.getValue(i,t.end):undefined,content:t.content!=undefined?n.getValue(i,t.content):undefined,group:t.group!=undefined?n.getValue(i,t.group):undefined,className:t.className!=undefined?n.getValue(i,t.className):undefined,editable:t.editable!=undefined?n.getValue(i,t.editable):undefined,type:t.type!=undefined?n.getValue(i,t.type):undefined}));else if(links.Timeline.isArray(n))for(i=0,r=n.length;i<r;i++)f=n[i],e=this.createItem(f),u.push(e);else throw"Unknown data type. DataTable or Array expected.";this.options.cluster&&this.clusterGenerator.setData(this.items);this.render({animate:!1})};links.Timeline.prototype.getData=function(){return this.data};links.Timeline.prototype.updateData=function(n,t){var r=this.data,i,s,h,e,o,u,f;if(google&&google.visualization&&r instanceof google.visualization.DataTable){s=n+1-r.getNumberOfRows();s>0&&r.addRows(s);h=links.Timeline.mapColumnIds(r);for(i in t)t.hasOwnProperty(i)&&(e=h[i],e==undefined&&(o=t[i],u="string",typeof o=="number"?u="number":typeof o=="boolean"?u="boolean":o instanceof Date&&(u="datetime"),e=r.addColumn(u,i)),r.setValue(n,e,t[i]))}else if(links.Timeline.isArray(r)){f=r[n];f==undefined&&(f={},r[n]=f);for(i in t)t.hasOwnProperty(i)&&(f[i]=t[i])}else throw"Cannot update data, unknown type of data";};links.Timeline.prototype.getItemIndex=function(n){for(var t=n,o=this.dom,r=o.items.frame,u=this.items,f=undefined,i,e;t.parentNode&&t.parentNode!==r;)t=t.parentNode;if(t.parentNode===r)for(i=0,e=u.length;i<e;i++)if(u[i].dom===t){f=i;break}return f};links.Timeline.prototype.getClusterIndex=function(n){var t=n,o=this.dom,r=o.items.frame,u=this.clusters,f=undefined,i,e;if(this.clusters){while(t.parentNode&&t.parentNode!==r)t=t.parentNode;if(t.parentNode===r)for(i=0,e=u.length;i<e;i++)if(u[i].dom===t){f=i;break}}return f};links.Timeline.prototype.getVisibleItems=function(n,t){var u=this.items,f=[],i,e,r;if(u)for(i=0,e=u.length;i<e;i++)r=u[i],r.end?n<=r.start&&r.end<=t&&f.push({row:i}):n<=r.start&&r.start<=t&&f.push({row:i});return f};links.Timeline.prototype.setSize=function(n,t){n&&(this.options.width=n,this.dom.frame.style.width=n);t&&(this.options.height=t,this.options.autoHeight=this.options.height==="auto",t!=="auto"&&(this.dom.frame.style.height=t));this.render({animate:!1})};links.Timeline.prototype.setVisibleChartRange=function(n,t,i){var r={},u,f;n&&t||(r=this.getDataRange(!0));n||(t?r.min&&r.min.valueOf()<t.valueOf()?n=r.min:(n=new Date(t.valueOf()),n.setDate(n.getDate()-7)):(n=new Date,n.setDate(n.getDate()-3)));t||(r.max?t=r.max:(t=new Date(n.valueOf()),t.setDate(t.getDate()+7)));t<=n&&(t=new Date(n.valueOf()),t.setDate(t.getDate()+7));u=this.options.min?this.options.min:undefined;u!=undefined&&n.valueOf()<u.valueOf()&&(n=new Date(u.valueOf()));f=this.options.max?this.options.max:undefined;f!=undefined&&t.valueOf()>f.valueOf()&&(t=new Date(f.valueOf()));this.applyRange(n,t);i==undefined||i==!0?this.render({animate:!1}):this.recalcConversion()};links.Timeline.prototype.setVisibleChartRangeAuto=function(){var n=this.getDataRange(!0);this.setVisibleChartRange(n.min,n.max)};links.Timeline.prototype.setVisibleChartRangeNow=function(){var i=new Date,n=this.end.valueOf()-this.start.valueOf(),t=new Date(i.valueOf()-n/2),r=new Date(t.valueOf()+n);this.setVisibleChartRange(t,r)};links.Timeline.prototype.getVisibleChartRange=function(){return{start:new Date(this.start.valueOf()),end:new Date(this.end.valueOf())}};links.Timeline.prototype.getDataRange=function(n){var e=this.items,t=undefined,i=undefined,r,h,s;if(e)for(r=0,h=e.length;r<h;r++){var u=e[r],f=u.start!=undefined?u.start.valueOf():undefined,o=u.end!=undefined?u.end.valueOf():f;f!=undefined&&(t=t!=undefined?Math.min(t.valueOf(),f.valueOf()):f);o!=undefined&&(i=i!=undefined?Math.max(i.valueOf(),o.valueOf()):o)}return t&&i&&n&&(s=i-t,t=t-s*.05,i=i+s*.05),{min:t!=undefined?new Date(t):undefined,max:i!=undefined?new Date(i):undefined}};links.Timeline.prototype.render=function(n){var u=this.reflowFrame(),f=this.reflowAxis(),e=this.reflowGroups(),o=this.reflowItems(),s=u||f||e||o,i=this.options.animate,r,t;n&&n.animate!=undefined&&(i=n.animate);this.recalcConversion();this.clusterItems();this.filterItems();this.stackItems(i);this.recalcItems();r=this.repaint();r&&(t=n?n.renderTimesLeft:undefined,t==undefined&&(t=5),t>0&&this.render({animate:n?n.animate:undefined,renderTimesLeft:t-1}))};links.Timeline.prototype.repaint=function(){var n=this.repaintFrame(),t=this.repaintAxis(),i=this.repaintGroups(),r=this.repaintItems();return this.repaintCurrentTime(),this.repaintCustomTime(),n||t||i||r};links.Timeline.prototype.reflowFrame=function(){var t=this.dom,f=this.options,i=this.size,n=!1,r=t.frame?t.frame.offsetWidth:0,u=t.frame?t.frame.clientHeight:0;return n=n||i.frameWidth!==r,n=n||i.frameHeight!==u,i.frameWidth=r,i.frameHeight=u,n};links.Timeline.prototype.repaintFrame=function(){var r=!1,n=this.dom,e=this.options,f=this.size,o,s,i,t,u;return n.frame||(n.frame=document.createElement("DIV"),n.frame.className="timeline-frame ui-widget ui-widget-content ui-corner-all",n.container.appendChild(n.frame),r=!0),o=e.autoHeight?f.actualHeight+"px":e.height||"100%",s=e.width||"100%",r=r||n.frame.style.height!=o,r=r||n.frame.style.width!=s,n.frame.style.height=o,n.frame.style.width=s,n.content||(n.content=document.createElement("DIV"),n.content.className="timeline-content",n.frame.appendChild(n.content),i=document.createElement("DIV"),i.style.position="absolute",i.style.left="0px",i.style.top="0px",i.style.height="100%",i.style.width="0px",n.content.appendChild(i),n.contentTimelines=i,t=this.eventParams,u=this,t.onMouseDown||(t.onMouseDown=function(n){u.onMouseDown(n)},links.Timeline.addEventListener(n.content,"mousedown",t.onMouseDown)),t.onTouchStart||(t.onTouchStart=function(n){u.onTouchStart(n)},links.Timeline.addEventListener(n.content,"touchstart",t.onTouchStart)),t.onMouseWheel||(t.onMouseWheel=function(n){u.onMouseWheel(n)},links.Timeline.addEventListener(n.content,"mousewheel",t.onMouseWheel)),t.onDblClick||(t.onDblClick=function(n){u.onDblClick(n)},links.Timeline.addEventListener(n.content,"dblclick",t.onDblClick)),r=!0),n.content.style.left=f.contentLeft+"px",n.content.style.top="0px",n.content.style.width=f.contentWidth+"px",n.content.style.height=f.frameHeight+"px",this.repaintNavigation(),r};links.Timeline.prototype.reflowAxis=function(){var i=!1,a=this.dom,r=this.options,n=this.size,t=a.axis,h=t&&t.characterMinor?t.characterMinor.clientWidth:0,e=t&&t.characterMinor?t.characterMinor.clientHeight:0,c=t&&t.characterMajor?t.characterMajor.clientWidth:0,u=t&&t.characterMajor?t.characterMajor.clientHeight:0,f=(r.showMinorLabels?e:0)+(r.showMajorLabels?u:0),s=r.axisOnTop?0:n.frameHeight-f,o=r.axisOnTop?f:s,l;return i=i||n.axis.top!==s,i=i||n.axis.line!==o,i=i||n.axis.height!==f,n.axis.top=s,n.axis.line=o,n.axis.height=f,n.axis.labelMajorTop=r.axisOnTop?0:o+(r.showMinorLabels?e:0),n.axis.labelMinorTop=r.axisOnTop?r.showMajorLabels?u:0:o,n.axis.lineMinorTop=r.axisOnTop?n.axis.labelMinorTop:0,n.axis.lineMinorHeight=r.showMajorLabels?n.frameHeight-u:n.frameHeight,n.axis.lineMinorWidth=t&&t.minorLines&&t.minorLines.length?t.minorLines[0].offsetWidth:1,n.axis.lineMajorWidth=t&&t.majorLines&&t.majorLines.length?t.majorLines[0].offsetWidth:1,i=i||n.axis.characterMinorWidth!==h,i=i||n.axis.characterMinorHeight!==e,i=i||n.axis.characterMajorWidth!==c,i=i||n.axis.characterMajorHeight!==u,n.axis.characterMinorWidth=h,n.axis.characterMinorHeight=e,n.axis.characterMajorWidth=c,n.axis.characterMajorHeight=u,l=Math.max(n.frameHeight-f,0),n.contentLeft=r.groupsOnRight?0:n.groupsWidth,n.contentWidth=Math.max(n.frameWidth-n.groupsWidth,0),n.contentHeight=l,i};links.Timeline.prototype.repaintAxis=function(){var o=!1,r=this.dom,u=this.options,t=this.size,i=this.step,n=r.axis,h,c,l,e,s;for(n||(n={},r.axis=n),t.axis.properties||(t.axis.properties={}),n.minorTexts||(n.minorTexts=[]),n.minorLines||(n.minorLines=[]),n.majorTexts||(n.majorTexts=[]),n.majorLines||(n.majorLines=[]),n.frame||(n.frame=document.createElement("DIV"),n.frame.style.position="absolute",n.frame.style.left="0px",n.frame.style.top="0px",r.content.appendChild(n.frame)),r.content.removeChild(n.frame),n.frame.style.width=t.contentWidth+"px",n.frame.style.height=t.axis.height+"px",h=this.screenToTime(0),c=this.screenToTime(t.contentWidth),t.axis.characterMinorWidth&&(this.minimumStep=this.screenToTime(t.axis.characterMinorWidth*6)-this.screenToTime(0),i.setRange(h,c,this.minimumStep)),l=this.repaintAxisCharacters(),o=o||l,this.repaintAxisStartOverwriting(),i.start(),e=undefined,s=0;!i.end()&&s<1e3;){s++;var y=i.getCurrent(),f=this.timeToScreen(y),p=i.isMajor();u.showMinorLabels&&this.repaintAxisMinorText(f,i.getLabelMinor(u));p&&u.showMajorLabels?(f>0&&(e==undefined&&(e=f),this.repaintAxisMajorText(f,i.getLabelMajor(u))),this.repaintAxisMajorLine(f)):this.repaintAxisMinorLine(f);i.next()}if(u.showMajorLabels){var a=this.screenToTime(0),v=this.step.getLabelMajor(u,a),w=v.length*t.axis.characterMajorWidth+10;(e==undefined||w<e)&&this.repaintAxisMajorText(0,v,a)}return this.repaintAxisEndOverwriting(),this.repaintAxisHorizontal(),r.content.insertBefore(n.frame,r.content.firstChild),o};links.Timeline.prototype.repaintAxisCharacters=function(){var u=!1,f=this.dom,i=f.axis,r,n,t;return i.characterMinor||(r=document.createTextNode("0"),n=document.createElement("DIV"),n.className="timeline-axis-text timeline-axis-text-minor",n.appendChild(r),n.style.position="absolute",n.style.visibility="hidden",n.style.paddingLeft="0px",n.style.paddingRight="0px",i.frame.appendChild(n),i.characterMinor=n,u=!0),i.characterMajor||(r=document.createTextNode("0"),t=document.createElement("DIV"),t.className="timeline-axis-text timeline-axis-text-major",t.appendChild(r),t.style.position="absolute",t.style.visibility="hidden",t.style.paddingLeft="0px",t.style.paddingRight="0px",i.frame.appendChild(t),i.characterMajor=t,u=!0),u};links.Timeline.prototype.repaintAxisStartOverwriting=function(){var n=this.size.axis.properties;n.minorTextNum=0;n.minorLineNum=0;n.majorTextNum=0;n.majorLineNum=0};links.Timeline.prototype.repaintAxisEndOverwriting=function(){for(var t=this.dom,i=this.size.axis.properties,r=this.dom.axis.frame,o=t.axis.minorTexts,s,u,h,f,c,e,l,n=i.minorTextNum;o.length>n;)s=o[n],r.removeChild(s),o.splice(n,1);for(u=t.axis.minorLines,n=i.minorLineNum;u.length>n;)h=u[n],r.removeChild(h),u.splice(n,1);for(f=t.axis.majorTexts,n=i.majorTextNum;f.length>n;)c=f[n],r.removeChild(c),f.splice(n,1);for(e=t.axis.majorLines,n=i.majorLineNum;e.length>n;)l=e[n],r.removeChild(l),e.splice(n,1)};links.Timeline.prototype.repaintAxisHorizontal=function(){var n=this.dom.axis,r=this.size,u=this.options,f=u.showMinorLabels||u.showMajorLabels,i,t;f?(n.backgroundLine||(i=document.createElement("DIV"),i.className="timeline-axis",i.style.position="absolute",i.style.left="0px",i.style.width="100%",i.style.border="none",n.frame.insertBefore(i,n.frame.firstChild),n.backgroundLine=i),n.backgroundLine&&(n.backgroundLine.style.top=r.axis.top+"px",n.backgroundLine.style.height=r.axis.height+"px")):n.backgroundLine&&(n.frame.removeChild(n.backgroundLine),delete n.backgroundLine);f?(n.line?(t=n.frame.removeChild(n.line),n.frame.appendChild(t)):(t=document.createElement("DIV"),t.className="timeline-axis",t.style.position="absolute",t.style.left="0px",t.style.width="100%",t.style.height="0px",n.frame.appendChild(t),n.line=t),n.line.style.top=r.axis.line+"px"):n.line&&n.line.parentElement&&(n.frame.removeChild(n.line),delete n.line)};links.Timeline.prototype.repaintAxisMinorText=function(n,t){var u=this.size,f=this.dom,e=u.axis.properties,h=f.axis.frame,r=f.axis.minorTexts,o=e.minorTextNum,i,s;o<r.length?i=r[o]:(s=document.createTextNode(""),i=document.createElement("DIV"),i.appendChild(s),i.className="timeline-axis-text timeline-axis-text-minor",i.style.position="absolute",h.appendChild(i),r.push(i));i.childNodes[0].nodeValue=t;i.style.left=n+"px";i.style.top=u.axis.labelMinorTop+"px";e.minorTextNum++};links.Timeline.prototype.repaintAxisMinorLine=function(n){var i=this.size.axis,u=this.dom,f=i.properties,o=u.axis.frame,r=u.axis.minorLines,e=f.minorLineNum,t;e<r.length?t=r[e]:(t=document.createElement("DIV"),t.className="timeline-axis-grid timeline-axis-grid-minor",t.style.position="absolute",t.style.width="0px",o.appendChild(t),r.push(t));t.style.top=i.lineMinorTop+"px";t.style.height=i.lineMinorHeight+"px";t.style.left=n-i.lineMinorWidth/2+"px";f.minorLineNum++};links.Timeline.prototype.repaintAxisMajorText=function(n,t){var u=this.size,f=u.axis.properties,s=this.dom.axis.frame,r=this.dom.axis.majorTexts,e=f.majorTextNum,i,o;e<r.length?i=r[e]:(o=document.createTextNode(t),i=document.createElement("DIV"),i.className="timeline-axis-text timeline-axis-text-major",i.appendChild(o),i.style.position="absolute",i.style.top="0px",s.appendChild(i),r.push(i));i.childNodes[0].nodeValue=t;i.style.top=u.axis.labelMajorTop+"px";i.style.left=n+"px";f.majorTextNum++};links.Timeline.prototype.repaintAxisMajorLine=function(n){var r=this.size,u=r.axis.properties,e=this.size.axis,o=this.dom.axis.frame,i=this.dom.axis.majorLines,f=u.majorLineNum,t;f<i.length?t=i[f]:(t=document.createElement("DIV"),t.className="timeline-axis-grid timeline-axis-grid-major",t.style.position="absolute",t.style.top="0px",t.style.width="0px",o.appendChild(t),i.push(t));t.style.left=n-e.lineMajorWidth/2+"px";t.style.height=r.frameHeight+"px";u.majorLineNum++};links.Timeline.prototype.reflowItems=function(){var i=!1,u,o,r,s=this.groups,h=this.renderedItems,n,t,f,e;for(s&&s.forEach(function(n){n.itemsHeight=0}),u=0,o=h.length;u<o;u++)n=h[u],t=n.dom,r=n.group,t&&(f=t?t.clientWidth:0,e=t?t.clientHeight:0,i=i||n.width!=f,i=i||n.height!=e,n.width=f,n.height=e,n.reflow()),r&&(r.itemsHeight=Math.max(this.options.groupMinHeight,r.itemsHeight?Math.max(r.itemsHeight,n.height):n.height));return i};links.Timeline.prototype.recalcItems=function(){var a=!1,n,r,u,e,o,t,v=this.groups,s=this.size,i=this.options,p=this.renderedItems,f=0,h,c,w,b;if(v.length==0){if(i.autoHeight||i.cluster){if(h=0,c=0,this.stack&&this.stack.finalItems)for(o=this.stack.finalItems,e=o[0],e&&e.top&&(h=e.top,c=e.top+e.height),n=1,r=o.length;n<r;n++)e=o[n],h=Math.min(h,e.top),c=Math.max(c,e.top+e.height);else for(u=p[0],u&&u.top&&(h=u.top,c=u.top+u.height),n=1,r=p.length;n<r;n++)u=p[n],u.top&&(h=Math.min(h,u.top),c=Math.max(c,u.top+u.height));if(f=c-h+2*i.eventMarginAxis+s.axis.height,f<i.minHeight&&(f=i.minHeight),s.actualHeight!=f&&i.autoHeight&&!i.axisOnTop)if(w=f-s.actualHeight,this.stack&&this.stack.finalItems)for(o=this.stack.finalItems,n=0,r=o.length;n<r;n++)o[n].top+=w,o[n].item.top+=w;else for(n=0,r=p.length;n<r;n++)p[n].top+=w}}else{for(f=s.axis.height+2*i.eventMarginAxis,n=0,r=v.length;n<r;n++)t=v[n],b=t.itemsHeight,a=a||b!=t.height,t.height=Math.max(b,i.groupMinHeight),f+=v[n].height+i.eventMargin;var y=i.eventMargin,l=i.axisOnTop?i.eventMarginAxis+y/2:s.contentHeight-i.eventMarginAxis+y/2,k=s.axis.height;for(n=0,r=v.length;n<r;n++)t=v[n],i.axisOnTop?(t.top=l+k,t.labelTop=l+k+(t.height-t.labelHeight)/2,t.lineTop=l+k+t.height+y/2,l+=t.height+y):(l-=t.height+y,t.top=l,t.labelTop=l+(t.height-t.labelHeight)/2,t.lineTop=l-y/2);a=!0}return f<i.minHeight&&(f=i.minHeight),a=a||f!=s.actualHeight,s.actualHeight=f,a};links.Timeline.prototype.clearItems=function(){var n=this.renderQueue.hide;this.renderedItems.forEach(function(t){n.push(t)});this.clusterGenerator.clear();this.items=[]};links.Timeline.prototype.repaintItems=function(){var t,u,o=!1,i=this.dom,l=this.size,s=this,e=this.renderedItems,n,r,f,h,c;for(i.items||(i.items={}),n=i.items.frame,n||(n=document.createElement("DIV"),n.style.position="relative",i.content.appendChild(n),i.items.frame=n),n.style.left="0px",n.style.top=l.items.top+"px",n.style.height="0px",i.content.removeChild(n),r=this.renderQueue,f=[],o=o||r.show.length>0||r.update.length>0||r.hide.length>0;t=r.show.shift();)t.showDOM(n),t.getImageUrls(f),e.push(t);while(t=r.update.shift())t.updateDOM(n),t.getImageUrls(f),u=this.renderedItems.indexOf(t),u==-1&&e.push(t);while(t=r.hide.shift())t.hideDOM(n),u=this.renderedItems.indexOf(t),u!=-1&&e.splice(u,1);return e.forEach(function(n){n.updatePosition(s)}),this.repaintDeleteButton(),this.repaintDragAreas(),i.content.appendChild(n),f.length&&(h=function(){s.render()},c=!1,links.imageloader.loadAll(f,h,c)),o};links.Timeline.prototype.reflowGroups=function(){for(var i=!1,o=this.options,r=this.size,s=this.dom,n=0,h=this.groups,l=this.dom.groups?this.dom.groups.labels:[],t,f,e,u=0,c=h.length;u<c;u++)t=h[u],f=l[u],t.labelWidth=f?f.clientWidth:0,t.labelHeight=f?f.clientHeight:0,t.width=t.labelWidth,n=Math.max(n,t.width);return o.groupsWidth!==undefined&&(n=s.groups.frame?s.groups.frame.clientWidth:0),n+=1,e=o.groupsOnRight?r.frameWidth-n:0,i=i||r.groupsWidth!==n,i=i||r.groupsLeft!==e,r.groupsWidth=n,r.groupsLeft=e,i};links.Timeline.prototype.repaintGroups=function(){var t=this.dom,nt=this,b=this.options,p=this.size,v=this.groups,e,h,c,i,y,o,s,r,f,u,n,w,l,a,k,d,g;for(t.groups===undefined&&(t.groups={}),e=t.groups.labels,e||(e=[],t.groups.labels=e),h=t.groups.labelLines,h||(h=[],t.groups.labelLines=h),c=t.groups.itemLines,c||(c=[],t.groups.itemLines=c),i=t.groups.frame,i||(i=document.createElement("DIV"),i.className="timeline-groups-axis",i.style.position="absolute",i.style.overflow="hidden",i.style.top="0px",i.style.height="100%",t.frame.appendChild(i),t.groups.frame=i),i.style.left=p.groupsLeft+"px",i.style.width=b.groupsWidth!==undefined?b.groupsWidth:p.groupsWidth+"px",i.style.display=v.length==0?"none":"",y=e.length,o=v.length,n=0,w=Math.min(y,o);n<w;n++)s=v[n],r=e[n],r.innerHTML=this.getGroupName(s),r.style.display="";for(n=y;n<o;n++)s=v[n],r=document.createElement("DIV"),r.className="timeline-groups-text",r.style.position="absolute",b.groupsWidth===undefined&&(r.style.whiteSpace="nowrap"),r.innerHTML=this.getGroupName(s),i.appendChild(r),e[n]=r,f=document.createElement("DIV"),f.className="timeline-axis-grid timeline-axis-grid-minor",f.style.position="absolute",f.style.left="0px",f.style.width="100%",f.style.height="0px",f.style.borderTopStyle="solid",i.appendChild(f),h[n]=f,u=document.createElement("DIV"),u.className="timeline-axis-grid timeline-axis-grid-minor",u.style.position="absolute",u.style.left="0px",u.style.width="100%",u.style.height="0px",u.style.borderTopStyle="solid",t.content.insertBefore(u,t.content.firstChild),c[n]=u;for(n=o;n<y;n++){var r=e[n],f=h[n],u=c[n];i.removeChild(r);i.removeChild(f);t.content.removeChild(u)}for(e.splice(o,y-o),h.splice(o,y-o),c.splice(o,y-o),links.Timeline.addClassName(i,b.groupsOnRight?"timeline-groups-axis-onright":"timeline-groups-axis-onleft"),n=0,w=v.length;n<w;n++){var s=v[n],r=e[n],f=h[n],u=c[n];r.style.top=s.labelTop+"px";f.style.top=s.lineTop+"px";u.style.top=s.lineTop+"px";u.style.width=p.contentWidth+"px"}t.groups.background||(l=document.createElement("DIV"),l.className="timeline-axis",l.style.position="absolute",l.style.left="0px",l.style.width="100%",l.style.border="none",i.appendChild(l),t.groups.background=l);t.groups.background.style.top=p.axis.top+"px";t.groups.background.style.height=p.axis.height+"px";t.groups.line||(a=document.createElement("DIV"),a.className="timeline-axis",a.style.position="absolute",a.style.left="0px",a.style.width="100%",a.style.height="0px",i.appendChild(a),t.groups.line=a);t.groups.line.style.top=p.axis.line+"px";t.groups.frame&&v.length&&(k=[],links.imageloader.filterImageUrls(t.groups.frame,k),k.length&&(d=function(){nt.render()},g=!1,links.imageloader.loadAll(k,d,g)))};links.Timeline.prototype.repaintCurrentTime=function(){var e=this.options,n=this.dom,u=this.size,t;if(!e.showCurrentTime){n.currentTime&&(n.contentTimelines.removeChild(n.currentTime),delete n.currentTime);return}n.currentTime||(t=document.createElement("DIV"),t.className="timeline-currenttime",t.style.position="absolute",t.style.top="0px",t.style.height="100%",n.contentTimelines.appendChild(t),n.currentTime=t);var o=new Date,f=new Date(o.valueOf()+this.clientTimeOffset),i=this.timeToScreen(f),s=i>-u.contentWidth&&i<2*u.contentWidth;n.currentTime.style.display=s?"":"none";n.currentTime.style.left=i+"px";n.currentTime.title="Current time: "+f;this.currentTimeTimer!=undefined&&(clearTimeout(this.currentTimeTimer),delete this.currentTimeTimer);var h=this,c=function(){h.repaintCurrentTime()},r=1/this.conversion.factor/2;r<30&&(r=30);this.currentTimeTimer=setTimeout(c,r)};links.Timeline.prototype.repaintCustomTime=function(){var e=this.options,n=this.dom,u=this.size,t,i,r,f;if(!e.showCustomTime){n.customTime&&(n.contentTimelines.removeChild(n.customTime),delete n.customTime);return}n.customTime||(t=document.createElement("DIV"),t.className="timeline-customtime",t.style.position="absolute",t.style.top="0px",t.style.height="100%",i=document.createElement("DIV"),i.style.position="relative",i.style.top="0px",i.style.left="-10px",i.style.height="100%",i.style.width="20px",t.appendChild(i),n.contentTimelines.appendChild(t),n.customTime=t,this.customTime=new Date);r=this.timeToScreen(this.customTime);f=r>-u.contentWidth&&r<2*u.contentWidth;n.customTime.style.display=f?"":"none";n.customTime.style.left=r+"px";n.customTime.title="Time: "+this.customTime};links.Timeline.prototype.repaintDeleteButton=function(){var o=this,i=this.dom,r=i.items.frame,n=i.items.deleteButton,u,t,f,e;n||(n=document.createElement("DIV"),n.className="timeline-navigation-delete",n.style.position="absolute",r.appendChild(n),i.items.deleteButton=n);u=this.selection&&this.selection.index!==undefined?this.selection.index:-1;t=this.selection&&this.selection.index!==undefined?this.items[u]:undefined;t&&t.rendered&&this.isEditable(t)?(f=t.getRight(this),e=t.top,n.style.left=f+"px",n.style.top=e+"px",n.style.display="",r.removeChild(n),r.appendChild(n)):n.style.display="none"};links.Timeline.prototype.repaintDragAreas=function(){var l=this,f=this.options,u=this.dom,r=this.dom.items.frame,t=u.items.dragLeft,n,e,i;if(t||(t=document.createElement("DIV"),t.className="timeline-event-range-drag-left",t.style.position="absolute",r.appendChild(t),u.items.dragLeft=t),n=u.items.dragRight,n||(n=document.createElement("DIV"),n.className="timeline-event-range-drag-right",n.style.position="absolute",r.appendChild(n),u.items.dragRight=n),e=this.selection&&this.selection.index!==undefined?this.selection.index:-1,i=this.selection&&this.selection.index!==undefined?this.items[e]:undefined,i&&i.rendered&&this.isEditable(i)&&(i instanceof links.Timeline.ItemRange||i instanceof links.Timeline.ItemFloatingRange)){var h=i.getLeft(this),c=i.getRight(this),o=i.top,s=i.height;t.style.left=h+"px";t.style.top=o+"px";t.style.width=f.dragAreaWidth+"px";t.style.height=s+"px";t.style.display="";r.removeChild(t);r.appendChild(t);n.style.left=c-f.dragAreaWidth+"px";n.style.top=o+"px";n.style.width=f.dragAreaWidth+"px";n.style.height=s+"px";n.style.display="";r.removeChild(n);r.appendChild(n)}else t.style.display="none",n.style.display="none"};links.Timeline.prototype.repaintNavigation=function(){var t=this,i=this.options,f=this.dom,w=f.frame,n=f.navBar,r,u,e,l,o,a,s,v,h,y,c,p;n||(r=i.showButtonNew&&i.editable,u=i.showNavigation&&(i.zoomable||i.moveable),(u||r)&&(n=document.createElement("DIV"),n.style.position="absolute",n.className="timeline-navigation ui-widget ui-state-highlight ui-corner-all",i.groupsOnRight?n.style.left="10px":n.style.right="10px",i.axisOnTop?n.style.bottom="10px":n.style.top="10px",f.navBar=n,w.appendChild(n)),r&&(n.addButton=document.createElement("DIV"),n.addButton.className="timeline-navigation-new",n.addButton.title=i.CREATE_NEW_EVENT,e=document.createElement("SPAN"),e.className="ui-icon ui-icon-circle-plus",n.addButton.appendChild(e),l=function(n){var r;links.Timeline.preventDefault(n);links.Timeline.stopPropagation(n);var f=t.size.contentWidth,e=f/2,u=t.screenToTime(e);i.snapEvents&&t.step.snap(u);var o=i.NEW,s=t.groups.length?t.groups[0].content:undefined;t.addItem({start:u,content:o,group:s},!0);r=t.items.length-1;t.selectItem(r);t.applyAdd=!0;t.trigger("add");t.applyAdd?(t.render({animate:!1}),t.selectItem(r)):t.deleteItem(r)},links.Timeline.addEventListener(n.addButton,"mousedown",l),n.appendChild(n.addButton)),r&&u&&links.Timeline.addClassName(n.addButton,"timeline-navigation-new-line"),u&&(i.zoomable&&(n.zoomInButton=document.createElement("DIV"),n.zoomInButton.className="timeline-navigation-zoom-in",n.zoomInButton.title=this.options.ZOOM_IN,o=document.createElement("SPAN"),o.className="ui-icon ui-icon-circle-zoomin",n.zoomInButton.appendChild(o),a=function(n){links.Timeline.preventDefault(n);links.Timeline.stopPropagation(n);t.zoom(.4);t.trigger("rangechange");t.trigger("rangechanged")},links.Timeline.addEventListener(n.zoomInButton,"mousedown",a),n.appendChild(n.zoomInButton),n.zoomOutButton=document.createElement("DIV"),n.zoomOutButton.className="timeline-navigation-zoom-out",n.zoomOutButton.title=this.options.ZOOM_OUT,s=document.createElement("SPAN"),s.className="ui-icon ui-icon-circle-zoomout",n.zoomOutButton.appendChild(s),v=function(n){links.Timeline.preventDefault(n);links.Timeline.stopPropagation(n);t.zoom(-.4);t.trigger("rangechange");t.trigger("rangechanged")},links.Timeline.addEventListener(n.zoomOutButton,"mousedown",v),n.appendChild(n.zoomOutButton)),i.moveable&&(n.moveLeftButton=document.createElement("DIV"),n.moveLeftButton.className="timeline-navigation-move-left",n.moveLeftButton.title=this.options.MOVE_LEFT,h=document.createElement("SPAN"),h.className="ui-icon ui-icon-circle-arrow-w",n.moveLeftButton.appendChild(h),y=function(n){links.Timeline.preventDefault(n);links.Timeline.stopPropagation(n);t.move(-.2);t.trigger("rangechange");t.trigger("rangechanged")},links.Timeline.addEventListener(n.moveLeftButton,"mousedown",y),n.appendChild(n.moveLeftButton),n.moveRightButton=document.createElement("DIV"),n.moveRightButton.className="timeline-navigation-move-right",n.moveRightButton.title=this.options.MOVE_RIGHT,c=document.createElement("SPAN"),c.className="ui-icon ui-icon-circle-arrow-e",n.moveRightButton.appendChild(c),p=function(n){links.Timeline.preventDefault(n);links.Timeline.stopPropagation(n);t.move(.2);t.trigger("rangechange");t.trigger("rangechanged")},links.Timeline.addEventListener(n.moveRightButton,"mousedown",p),n.appendChild(n.moveRightButton))))};links.Timeline.prototype.setCurrentTime=function(n){var t=new Date;this.clientTimeOffset=n.valueOf()-t.valueOf();this.repaintCurrentTime()};links.Timeline.prototype.getCurrentTime=function(){var n=new Date;return new Date(n.valueOf()+this.clientTimeOffset)};links.Timeline.prototype.setCustomTime=function(n){this.customTime=new Date(n.valueOf());this.repaintCustomTime()};links.Timeline.prototype.getCustomTime=function(){return new Date(this.customTime.valueOf())};links.Timeline.prototype.setScale=function(n,t){this.step.setScale(n,t);this.render()};links.Timeline.prototype.setAutoScale=function(n){this.step.setAutoScale(n);this.render()};links.Timeline.prototype.redraw=function(){this.setData(this.data)};links.Timeline.prototype.checkResize=function(){this.render()};links.Timeline.prototype.isEditable=function(n){return n?n.editable!=undefined?n.editable:this.options.editable:!1};links.Timeline.prototype.recalcConversion=function(){this.conversion.offset=this.start.valueOf();this.conversion.factor=this.size.contentWidth/(this.end.valueOf()-this.start.valueOf())};links.Timeline.prototype.screenToTime=function(n){var t=this.conversion;return new Date(n/t.factor+t.offset)};links.Timeline.prototype.timeToScreen=function(n){var t=this.conversion;return(n.valueOf()-t.offset)*t.factor};links.Timeline.prototype.onTouchStart=function(n){var t=this.eventParams,i=this,r,u;if(!t.touchDown){t.touchDown=!0;t.zoomed=!1;this.onMouseDown(n);t.onTouchMove||(t.onTouchMove=function(n){i.onTouchMove(n)},links.Timeline.addEventListener(document,"touchmove",t.onTouchMove));t.onTouchEnd||(t.onTouchEnd=function(n){i.onTouchEnd(n)},links.Timeline.addEventListener(document,"touchend",t.onTouchEnd));r=links.Timeline.getTarget(n);u=this.getItemIndex(r);t.doubleTapStartPrev=t.doubleTapStart;t.doubleTapStart=(new Date).valueOf();t.doubleTapItemPrev=t.doubleTapItem;t.doubleTapItem=u;links.Timeline.preventDefault(n)}};links.Timeline.prototype.onTouchMove=function(n){var t=this.eventParams;if(n.scale&&n.scale!==1&&(t.zoomed=!0),t.zoomed){if(this.options.zoomable){t.zoomed=!0;var u=n.scale,i=t.end.valueOf()-t.start.valueOf(),f=i/u,r=f-i,e=new Date(parseInt(t.start.valueOf()-r/2)),o=new Date(parseInt(t.end.valueOf()+r/2));this.setVisibleChartRange(e,o);this.trigger("rangechange")}}else this.onMouseMove(n);links.Timeline.preventDefault(n)};links.Timeline.prototype.onTouchEnd=function(n){var t=this.eventParams,i=this;t.touchDown=!1;t.zoomed&&this.trigger("rangechanged");t.onTouchMove&&(links.Timeline.removeEventListener(document,"touchmove",t.onTouchMove),delete t.onTouchMove);t.onTouchEnd&&(links.Timeline.removeEventListener(document,"touchend",t.onTouchEnd),delete t.onTouchEnd);this.onMouseUp(n);var r=(new Date).valueOf(),u=links.Timeline.getTarget(n),f=this.getItemIndex(u);if(t.doubleTapStartPrev&&r-t.doubleTapStartPrev<500&&t.doubleTapItem==t.doubleTapItemPrev){t.touchDown=!0;i.onDblClick(n);t.touchDown=!1}links.Timeline.preventDefault(n)};links.Timeline.prototype.onMouseDown=function(n){var o,s,r,h,e;n=n||window.event;var t=this.eventParams,u=this.options,i=this.dom,c=n.which?n.which==1:n.button==1;if(c||t.touchDown){if(t.mouseX=links.Timeline.getPageX(n),t.mouseY=links.Timeline.getPageY(n),t.frameLeft=links.Timeline.getAbsoluteLeft(this.dom.content),t.frameTop=links.Timeline.getAbsoluteTop(this.dom.content),t.previousLeft=0,t.previousOffset=0,t.moved=!1,t.start=new Date(this.start.valueOf()),t.end=new Date(this.end.valueOf()),t.target=links.Timeline.getTarget(n),o=i.items&&i.items.dragLeft?i.items.dragLeft:undefined,s=i.items&&i.items.dragRight?i.items.dragRight:undefined,t.itemDragLeft=t.target===o,t.itemDragRight=t.target===s,t.itemDragLeft||t.itemDragRight?(t.itemIndex=this.selection&&this.selection.index!==undefined?this.selection.index:undefined,delete t.clusterIndex):(t.itemIndex=this.getItemIndex(t.target),t.clusterIndex=this.getClusterIndex(t.target)),t.customTime=t.target===i.customTime||t.target.parentNode===i.customTime?this.customTime:undefined,t.addItem=u.editable&&n.ctrlKey,t.addItem){var l=t.mouseX-t.frameLeft,a=t.mouseY-t.frameTop,f=this.screenToTime(l);u.snapEvents&&this.step.snap(f);var v=new Date(f.valueOf()),y=u.NEW,p=this.getGroupFromHeight(a);this.addItem({start:f,end:v,content:y,group:this.getGroupName(p)});t.itemIndex=this.items.length-1;delete t.clusterIndex;this.selectItem(t.itemIndex);t.itemDragRight=!0}r=this.items[t.itemIndex];h=this.isSelected(t.itemIndex);t.editItem=h&&this.isEditable(r);t.editItem?(t.itemStart=r.start,t.itemEnd=r.end,t.itemGroup=r.group,t.itemLeft=r.getLeft(this),t.itemRight=r.getRight(this)):this.dom.frame.style.cursor="move";t.touchDown||(e=this,t.onMouseMove||(t.onMouseMove=function(n){e.onMouseMove(n)},links.Timeline.addEventListener(document,"mousemove",t.onMouseMove)),t.onMouseUp||(t.onMouseUp=function(n){e.onMouseUp(n)},links.Timeline.addEventListener(document,"mouseup",t.onMouseUp)),links.Timeline.preventDefault(n))}};links.Timeline.prototype.onMouseMove=function(n){var e,it,y,p,i,r,u,w,b,c,k,l;n=n||window.event;var t=this.eventParams,a=this.size,s=this.dom,f=this.options,v=links.Timeline.getPageX(n),h=links.Timeline.getPageY(n);if(t.mouseX==undefined&&(t.mouseX=v),t.mouseY==undefined&&(t.mouseY=h),e=v-t.mouseX,it=h-t.mouseY,Math.abs(e)>=1&&(t.moved=!0),t.customTime)y=this.timeToScreen(t.customTime),p=y+e,this.customTime=this.screenToTime(p),this.repaintCustomTime(),this.trigger("timechange");else if(t.editItem)i=this.items[t.itemIndex],t.itemDragLeft&&f.timeChangeable?(r=t.itemLeft+e,u=t.itemRight,i.start=this.screenToTime(r),f.snapEvents&&(this.step.snap(i.start),r=this.timeToScreen(i.start)),r>u&&(r=u,i.start=this.screenToTime(r)),this.trigger("change")):t.itemDragRight&&f.timeChangeable?(r=t.itemLeft,u=t.itemRight+e,i.end=this.screenToTime(u),f.snapEvents&&(this.step.snap(i.end),u=this.timeToScreen(i.end)),u<r&&(u=r,i.end=this.screenToTime(u)),this.trigger("change")):f.timeChangeable&&(r=t.itemLeft+e,i.start=this.screenToTime(r),f.snapEvents&&(this.step.snap(i.start),r=this.timeToScreen(i.start)),i.end&&(u=r+(t.itemRight-t.itemLeft),i.end=this.screenToTime(u)),this.trigger("change")),i.setPosition(r,u),w=t.itemDragLeft||t.itemDragRight,this.groups.length&&!w?(b=h-t.frameTop,c=this.getGroupFromHeight(b),f.groupsChangeable&&i.group!==c?(k=this.items.indexOf(i),this.changeItem(k,{group:this.getGroupName(c)})):(this.repaintDeleteButton(),this.repaintDragAreas())):this.render();else if(f.moveable){var d=t.end.valueOf()-t.start.valueOf(),o=Math.round(-e/a.contentWidth*d),g=new Date(t.start.valueOf()+o),rt=new Date(t.end.valueOf()+o);this.applyRange(g,rt);l=this.start.valueOf()-g.valueOf();l&&(o+=l);this.recalcConversion();var ut=t.previousLeft||0,ft=parseFloat(s.items.frame.style.left)||0,et=t.previousOffset||0,nt=et+(ft-ut),tt=-o/d*a.contentWidth+nt;s.items.frame.style.left=tt+"px";t.previousOffset=nt;t.previousLeft=parseFloat(s.items.frame.style.left)||tt;this.repaintCurrentTime();this.repaintCustomTime();this.repaintAxis();this.trigger("rangechange")}links.Timeline.preventDefault(n)};links.Timeline.prototype.onMouseUp=function(n){var t=this.eventParams,r=this.options,i,u;n=n||window.event;this.dom.frame.style.cursor="auto";t.onMouseMove&&(links.Timeline.removeEventListener(document,"mousemove",t.onMouseMove),delete t.onMouseMove);t.onMouseUp&&(links.Timeline.removeEventListener(document,"mouseup",t.onMouseUp),delete t.onMouseUp);t.customTime?this.trigger("timechanged"):t.editItem?(i=this.items[t.itemIndex],(t.moved||t.addItem)&&(this.applyChange=!0,this.applyAdd=!0,this.updateData(t.itemIndex,{start:i.start,end:i.end}),this.trigger(t.addItem?"add":"changed"),i=this.items[t.itemIndex],t.addItem?this.applyAdd?this.updateData(t.itemIndex,{start:i.start,end:i.end,content:i.content,group:this.getGroupName(i.group)}):this.deleteItem(t.itemIndex):this.applyChange?this.updateData(t.itemIndex,{start:i.start,end:i.end}):(delete this.applyChange,delete this.applyAdd,i=this.items[t.itemIndex],u=i.dom,i.start=t.itemStart,i.end=t.itemEnd,i.group=t.itemGroup,i.setPosition(t.itemLeft,t.itemRight),this.updateData(t.itemIndex,{start:t.itemStart,end:t.itemEnd})),this.options.cluster&&this.clusterGenerator.updateData(),this.render())):t.moved||t.zoomed?(this.render(),(t.moved&&r.moveable||t.zoomed&&r.zoomable)&&this.trigger("rangechanged")):t.target===this.dom.items.deleteButton?this.selection&&this.selection.index!==undefined&&this.confirmDeleteItem(this.selection.index):r.selectable&&(t.itemIndex!=undefined?this.isSelected(t.itemIndex)||(this.selectItem(t.itemIndex),this.trigger("select")):t.clusterIndex!=undefined?(this.selectCluster(t.clusterIndex),this.trigger("select")):r.unselectable&&(this.unselectItem(),this.trigger("select")))};links.Timeline.prototype.onDblClick=function(n){var t=this.eventParams,i=this.options,u=this.dom,c=this.size,r;if(n=n||window.event,t.itemIndex!=undefined)r=this.items[t.itemIndex],r&&this.isEditable(r)&&this.trigger("edit");else if(i.editable){t.mouseX=links.Timeline.getPageX(n);t.mouseY=links.Timeline.getPageY(n);var e=t.mouseX-links.Timeline.getAbsoluteLeft(u.content),o=t.mouseY-links.Timeline.getAbsoluteTop(u.content),f=this.screenToTime(e);i.snapEvents&&this.step.snap(f);var s=i.NEW,h=this.getGroupFromHeight(o);this.addItem({start:f,content:s,group:this.getGroupName(h)},!0);t.itemIndex=this.items.length-1;this.selectItem(t.itemIndex);this.applyAdd=!0;this.trigger("add");this.applyAdd?(this.render({animate:!1}),this.selectItem(t.itemIndex)):this.deleteItem(t.itemIndex)}links.Timeline.preventDefault(n)};links.Timeline.prototype.onMouseWheel=function(n){var i;if(this.options.zoomable){if(n||(n=window.event),i=0,n.wheelDelta?i=n.wheelDelta/120:n.detail&&(i=-n.detail/3),i){var t=this,r=function(){var f=i/5,r=links.Timeline.getAbsoluteLeft(t.dom.content),u=links.Timeline.getPageX(n),e=u!=undefined&&r!=undefined?t.screenToTime(u-r):undefined;t.zoom(f,e);t.trigger("rangechange");t.trigger("rangechanged")},u=function(){t.move(i*-.2);t.trigger("rangechange");t.trigger("rangechanged")};n.shiftKey?u():r()}links.Timeline.preventDefault(n)}};links.Timeline.prototype.zoom=function(n,t){t==undefined&&(t=new Date((this.start.valueOf()+this.end.valueOf())/2));n>=1&&(n=.9);n<=-1&&(n=-.9);n<0&&(n=n/(1+n));var f=this.start.valueOf()-t,e=this.end.valueOf()-t,r=new Date(this.start.valueOf()-f*n),u=new Date(this.end.valueOf()-e*n),o=u.valueOf()-r.valueOf(),i=Number(this.options.zoomMin)||10;i<10&&(i=10);o>=i&&(this.applyRange(r,u,t),this.render({animate:this.options.animate&&this.options.animateZoom}))};links.Timeline.prototype.move=function(n){var t=this.end.valueOf()-this.start.valueOf(),i=new Date(this.start.valueOf()+t*n),r=new Date(this.end.valueOf()+t*n);this.applyRange(i,r);this.render()};links.Timeline.prototype.applyRange=function(n,t,i){var u=n.valueOf(),o=t.valueOf(),l=o-u,a=this.options,v=31536e6,h=Number(a.zoomMin)||10,s,f,e,y,c,r;h<10&&(h=10);s=Number(a.zoomMax)||1e4*v;s>1e4*v&&(s=1e4*v);s<h&&(s=h);f=a.min?a.min.valueOf():undefined;e=a.max?a.max.valueOf():undefined;f!=undefined&&e!=undefined&&(f>=e&&(y=864e5,e=f+y),s>e-f&&(s=e-f),h>e-f&&(h=e-f));u>=o&&(o+=864e5);l<h&&(r=h-l,c=i?(i.valueOf()-u)/l:.5,u-=Math.round(r*c),o+=Math.round(r*(1-c)));l>s&&(r=l-s,c=i?(i.valueOf()-u)/l:.5,u+=Math.round(r*c),o-=Math.round(r*(1-c)));f!=undefined&&(r=u-f,r<0&&(u-=r,o-=r));e!=undefined&&(r=e-o,r<0&&(u+=r,o+=r));this.start=new Date(u);this.end=new Date(o)};links.Timeline.prototype.confirmDeleteItem=function(n){this.applyDelete=!0;this.isSelected(n)||this.selectItem(n);this.trigger("delete");this.applyDelete&&this.deleteItem(n);delete this.applyDelete};links.Timeline.prototype.deleteItem=function(n,t){if(n>=this.items.length)throw"Cannot delete row, index out of range";this.selection&&this.selection.index!==undefined&&(this.selection.index==n?this.unselectItem():this.selection.index>n&&this.selection.index--);var i=this.items.splice(n,1)[0];if(this.renderQueue.hide.push(i),this.data)if(google&&google.visualization&&this.data instanceof google.visualization.DataTable)this.data.removeRow(n);else if(links.Timeline.isArray(this.data))this.data.splice(n,1);else throw"Cannot delete row from data, unknown data type";this.options.cluster&&this.clusterGenerator.updateData();t||this.render()};links.Timeline.prototype.deleteAllItems=function(){if(this.unselectItem(),this.clearItems(),this.deleteGroups(),this.data)if(google&&google.visualization&&this.data instanceof google.visualization.DataTable)this.data.removeRows(0,this.data.getNumberOfRows());else if(links.Timeline.isArray(this.data))this.data.splice(0,this.data.length);else throw"Cannot delete row from data, unknown data type";this.options.cluster&&this.clusterGenerator.updateData();this.render()};links.Timeline.prototype.getGroupFromHeight=function(n){var t,i,r=this.groups;if(r.length){if(this.options.axisOnTop){for(t=r.length-1;t>=0;t--)if(i=r[t],n>i.top)return i}else for(t=0;t<r.length;t++)if(i=r[t],n>i.top)return i;return i}return undefined};links.Timeline.Item=function(n,t){if(n&&(this.start=n.start,this.end=n.end,this.content=n.content,this.className=n.className,this.editable=n.editable,this.group=n.group,this.type=n.type),this.top=0,this.left=0,this.width=0,this.height=0,this.lineWidth=0,this.dotWidth=0,this.dotHeight=0,this.rendered=!1,t)for(var i in t)t.hasOwnProperty(i)&&(this[i]=t[i])};links.Timeline.Item.prototype.reflow=function(){return!1};links.Timeline.Item.prototype.getImageUrls=function(n){this.dom&&links.imageloader.filterImageUrls(this.dom,n)};links.Timeline.Item.prototype.select=function(){};links.Timeline.Item.prototype.unselect=function(){};links.Timeline.Item.prototype.createDOM=function(){};links.Timeline.Item.prototype.showDOM=function(){};links.Timeline.Item.prototype.hideDOM=function(){};links.Timeline.Item.prototype.updateDOM=function(){};links.Timeline.Item.prototype.updatePosition=function(){};links.Timeline.Item.prototype.isRendered=function(){return this.rendered};links.Timeline.Item.prototype.isVisible=function(){return!1};links.Timeline.Item.prototype.setPosition=function(){};links.Timeline.Item.prototype.getLeft=function(){return 0};links.Timeline.Item.prototype.getRight=function(){return 0};links.Timeline.Item.prototype.getWidth=function(){return this.width||0};links.Timeline.ItemBox=function(n,t){links.Timeline.Item.call(this,n,t)};links.Timeline.ItemBox.prototype=new links.Timeline.Item;links.Timeline.ItemBox.prototype.reflow=function(){var n=this.dom,t=n.dot.offsetHeight,i=n.dot.offsetWidth,r=n.line.offsetWidth,u=this.dotHeight!=t||this.dotWidth!=i||this.lineWidth!=r;return this.dotHeight=t,this.dotWidth=i,this.lineWidth=r,u};links.Timeline.ItemBox.prototype.select=function(){var n=this.dom;links.Timeline.addClassName(n,"timeline-event-selected ui-state-active");links.Timeline.addClassName(n.line,"timeline-event-selected ui-state-active");links.Timeline.addClassName(n.dot,"timeline-event-selected ui-state-active")};links.Timeline.ItemBox.prototype.unselect=function(){var n=this.dom;links.Timeline.removeClassName(n,"timeline-event-selected ui-state-active");links.Timeline.removeClassName(n.line,"timeline-event-selected ui-state-active");links.Timeline.removeClassName(n.dot,"timeline-event-selected ui-state-active")};links.Timeline.ItemBox.prototype.createDOM=function(){var n=document.createElement("DIV"),i,r,t;return n.style.position="absolute",n.style.left=this.left+"px",n.style.top=this.top+"px",i=document.createElement("DIV"),i.className="timeline-event-content",i.innerHTML=this.content,n.appendChild(i),r=document.createElement("DIV"),r.style.position="absolute",r.style.width="0px",n.line=r,t=document.createElement("DIV"),t.style.position="absolute",t.style.width="0px",t.style.height="0px",n.dot=t,this.dom=n,this.updateDOM(),n};links.Timeline.ItemBox.prototype.showDOM=function(n){var t=this.dom;t||(t=this.createDOM());t.parentNode!=n&&(t.parentNode&&this.hideDOM(),n.appendChild(t),n.insertBefore(t.line,n.firstChild),n.appendChild(t.dot),this.rendered=!0)};links.Timeline.ItemBox.prototype.hideDOM=function(){var n=this.dom;n&&(n.parentNode&&n.parentNode.removeChild(n),n.line&&n.line.parentNode&&n.line.parentNode.removeChild(n.line),n.dot&&n.dot.parentNode&&n.dot.parentNode.removeChild(n.dot),this.rendered=!1)};links.Timeline.ItemBox.prototype.updateDOM=function(){var n=this.dom,t,i;n&&(t=n.line,i=n.dot,n.firstChild.innerHTML=this.content,n.className="timeline-event timeline-event-box ui-widget ui-state-default",t.className="timeline-event timeline-event-line ui-widget ui-state-default",i.className="timeline-event timeline-event-dot ui-widget ui-state-default",this.isCluster&&(links.Timeline.addClassName(n,"timeline-event-cluster ui-widget-header"),links.Timeline.addClassName(t,"timeline-event-cluster ui-widget-header"),links.Timeline.addClassName(i,"timeline-event-cluster ui-widget-header")),this.className&&(links.Timeline.addClassName(n,this.className),links.Timeline.addClassName(t,this.className),links.Timeline.addClassName(i,this.className)))};links.Timeline.ItemBox.prototype.updatePosition=function(n){var i=this.dom,t,u;if(i){var r=n.timeToScreen(this.start),s=n.options.axisOnTop,e=n.size.axis.top,f=n.size.axis.height,o=n.options.box&&n.options.box.align?n.options.box.align:undefined;i.style.top=this.top+"px";i.style.left=o=="right"?r-this.width+"px":o=="left"?r+"px":r-this.width/2+"px";t=i.line;u=i.dot;t.style.left=r-this.lineWidth/2+"px";u.style.left=r-this.dotWidth/2+"px";s?(t.style.top=f+"px",t.style.height=Math.max(this.top-f,0)+"px",u.style.top=f-this.dotHeight/2+"px"):(t.style.top=this.top+this.height+"px",t.style.height=Math.max(e-this.top-this.height,0)+"px",u.style.top=e-this.dotHeight/2+"px")}};links.Timeline.ItemBox.prototype.isVisible=function(n,t){return this.cluster?!1:this.start>n&&this.start<t};links.Timeline.ItemBox.prototype.setPosition=function(n){var t=this.dom;t.style.left=n-this.width/2+"px";t.line.style.left=n-this.lineWidth/2+"px";t.dot.style.left=n-this.dotWidth/2+"px";this.group&&(this.top=this.group.top,t.style.top=this.top+"px")};links.Timeline.ItemBox.prototype.getLeft=function(n){var i=n.options.box&&n.options.box.align?n.options.box.align:undefined,t=n.timeToScreen(this.start);return i=="right"?t-width:t-this.width/2};links.Timeline.ItemBox.prototype.getRight=function(n){var i=n.options.box&&n.options.box.align?n.options.box.align:undefined,t=n.timeToScreen(this.start);return i=="right"?t:i=="left"?t+this.width:t+this.width/2};links.Timeline.ItemRange=function(n,t){links.Timeline.Item.call(this,n,t)};links.Timeline.ItemRange.prototype=new links.Timeline.Item;links.Timeline.ItemRange.prototype.select=function(){var n=this.dom;links.Timeline.addClassName(n,"timeline-event-selected ui-state-active")};links.Timeline.ItemRange.prototype.unselect=function(){var n=this.dom;links.Timeline.removeClassName(n,"timeline-event-selected ui-state-active")};links.Timeline.ItemRange.prototype.createDOM=function(){var n=document.createElement("DIV"),t;return n.style.position="absolute",t=document.createElement("DIV"),t.className="timeline-event-content",n.appendChild(t),this.dom=n,this.updateDOM(),n};links.Timeline.ItemRange.prototype.showDOM=function(n){var t=this.dom;t||(t=this.createDOM());t.parentNode!=n&&(t.parentNode&&this.hideDOM(),n.appendChild(t),this.rendered=!0)};links.Timeline.ItemRange.prototype.hideDOM=function(){var n=this.dom;n&&(n.parentNode&&n.parentNode.removeChild(n),this.rendered=!1)};links.Timeline.ItemRange.prototype.updateDOM=function(){var n=this.dom;n&&(n.firstChild.innerHTML=this.content,n.className="timeline-event timeline-event-range ui-widget ui-state-default",this.isCluster&&links.Timeline.addClassName(n,"timeline-event-cluster ui-widget-header"),this.className&&links.Timeline.addClassName(n,this.className))};links.Timeline.ItemRange.prototype.updatePosition=function(n){var t=this.dom;if(t){var i=n.size.contentWidth,r=n.timeToScreen(this.start),u=n.timeToScreen(this.end);r<-i&&(r=-i);u>2*i&&(u=2*i);t.style.top=this.top+"px";t.style.left=r+"px";t.style.width=Math.max(u-r,1)+"px"}};links.Timeline.ItemRange.prototype.isVisible=function(n,t){return this.cluster?!1:this.end>n&&this.start<t};links.Timeline.ItemRange.prototype.setPosition=function(n,t){var i=this.dom;i.style.left=n+"px";i.style.width=t-n+"px";this.group&&(this.top=this.group.top,i.style.top=this.top+"px")};links.Timeline.ItemRange.prototype.getLeft=function(n){return n.timeToScreen(this.start)};links.Timeline.ItemRange.prototype.getRight=function(n){return n.timeToScreen(this.end)};links.Timeline.ItemRange.prototype.getWidth=function(n){return n.timeToScreen(this.end)-n.timeToScreen(this.start)};links.Timeline.ItemFloatingRange=function(n,t){links.Timeline.Item.call(this,n,t)};links.Timeline.ItemFloatingRange.prototype=new links.Timeline.Item;links.Timeline.ItemFloatingRange.prototype.select=function(){var n=this.dom;links.Timeline.addClassName(n,"timeline-event-selected ui-state-active")};links.Timeline.ItemFloatingRange.prototype.unselect=function(){var n=this.dom;links.Timeline.removeClassName(n,"timeline-event-selected ui-state-active")};links.Timeline.ItemFloatingRange.prototype.createDOM=function(){var n=document.createElement("DIV"),t;return n.style.position="absolute",t=document.createElement("DIV"),t.className="timeline-event-content",n.appendChild(t),this.dom=n,this.updateDOM(),n};links.Timeline.ItemFloatingRange.prototype.showDOM=function(n){var t=this.dom;t||(t=this.createDOM());t.parentNode!=n&&(t.parentNode&&this.hideDOM(),n.appendChild(t),this.rendered=!0)};links.Timeline.ItemFloatingRange.prototype.hideDOM=function(){var n=this.dom;n&&(n.parentNode&&n.parentNode.removeChild(n),this.rendered=!1)};links.Timeline.ItemFloatingRange.prototype.updateDOM=function(){var n=this.dom;n&&(n.firstChild.innerHTML=this.content,n.className="timeline-event timeline-event-range ui-widget ui-state-default",this.isCluster&&links.Timeline.addClassName(n,"timeline-event-cluster ui-widget-header"),this.className&&links.Timeline.addClassName(n,this.className))};links.Timeline.ItemFloatingRange.prototype.updatePosition=function(n){var t=this.dom;if(t){var i=n.size.contentWidth,r=this.getLeft(n),u=this.getRight(n);r<-i&&(r=-i);u>2*i&&(u=2*i);t.style.top=this.top+"px";t.style.left=r+"px";t.style.width=Math.max(u-r,1)+"px"}};links.Timeline.ItemFloatingRange.prototype.isVisible=function(n,t){return this.cluster?!1:this.end&&this.start?this.end>n&&this.start<t:this.start?this.start<t:this.end?this.end>n:!0};links.Timeline.ItemFloatingRange.prototype.setPosition=function(n,t){var i=this.dom;i.style.left=n+"px";i.style.width=t-n+"px";this.group&&(this.top=this.group.top,i.style.top=this.top+"px")};links.Timeline.ItemFloatingRange.prototype.getLeft=function(n){return this.start?n.timeToScreen(this.start):0};links.Timeline.ItemFloatingRange.prototype.getRight=function(n){return this.end?n.timeToScreen(this.end):n.size.contentWidth};links.Timeline.ItemFloatingRange.prototype.getWidth=function(n){return this.getRight(n)-this.getLeft(n)};links.Timeline.ItemDot=function(n,t){links.Timeline.Item.call(this,n,t)};links.Timeline.ItemDot.prototype=new links.Timeline.Item;links.Timeline.ItemDot.prototype.reflow=function(){var n=this.dom,t=n.dot.offsetHeight,i=n.dot.offsetWidth,r=n.content.offsetHeight,u=this.dotHeight!=t||this.dotWidth!=i||this.contentHeight!=r;return this.dotHeight=t,this.dotWidth=i,this.contentHeight=r,u};links.Timeline.ItemDot.prototype.select=function(){var n=this.dom;links.Timeline.addClassName(n,"timeline-event-selected ui-state-active")};links.Timeline.ItemDot.prototype.unselect=function(){var n=this.dom;links.Timeline.removeClassName(n,"timeline-event-selected ui-state-active")};links.Timeline.ItemDot.prototype.createDOM=function(){var n=document.createElement("DIV"),i,t;return n.style.position="absolute",i=document.createElement("DIV"),i.className="timeline-event-content",n.appendChild(i),t=document.createElement("DIV"),t.style.position="absolute",t.style.width="0px",t.style.height="0px",n.appendChild(t),n.content=i,n.dot=t,this.dom=n,this.updateDOM(),n};links.Timeline.ItemDot.prototype.showDOM=function(n){var t=this.dom;t||(t=this.createDOM());t.parentNode!=n&&(t.parentNode&&this.hideDOM(),n.appendChild(t),this.rendered=!0)};links.Timeline.ItemDot.prototype.hideDOM=function(){var n=this.dom;n&&(n.parentNode&&n.parentNode.removeChild(n),this.rendered=!1)};links.Timeline.ItemDot.prototype.updateDOM=function(){if(this.dom){var n=this.dom,t=n.dot;n.firstChild.innerHTML=this.content;n.className="timeline-event-dot-container";t.className="timeline-event timeline-event-dot ui-widget ui-state-default";this.isCluster&&(links.Timeline.addClassName(n,"timeline-event-cluster ui-widget-header"),links.Timeline.addClassName(t,"timeline-event-cluster ui-widget-header"));this.className&&(links.Timeline.addClassName(n,this.className),links.Timeline.addClassName(t,this.className))}};links.Timeline.ItemDot.prototype.updatePosition=function(n){var t=this.dom,i;t&&(i=n.timeToScreen(this.start),t.style.top=this.top+"px",t.style.left=i-this.dotWidth/2+"px",t.content.style.marginLeft=1.5*this.dotWidth+"px",t.dot.style.top=(this.height-this.dotHeight)/2+"px")};links.Timeline.ItemDot.prototype.isVisible=function(n,t){return this.cluster?!1:this.start>n&&this.start<t};links.Timeline.ItemDot.prototype.setPosition=function(n){var t=this.dom;t.style.left=n-this.dotWidth/2+"px";this.group&&(this.top=this.group.top,t.style.top=this.top+"px")};links.Timeline.ItemDot.prototype.getLeft=function(n){return n.timeToScreen(this.start)};links.Timeline.ItemDot.prototype.getRight=function(n){return n.timeToScreen(this.start)+this.width};links.Timeline.prototype.getItem=function(n){var f,i,r,u,t;if(n>=this.items.length)throw"Cannot get item, index out of range";if(f=this.data,google&&google.visualization&&f instanceof google.visualization.DataTable){r=links.Timeline.mapColumnIds(f);i={};for(u in r)r.hasOwnProperty(u)&&(i[u]=this.data.getValue(n,r[u]))}else if(links.Timeline.isArray(this.data))i=links.Timeline.clone(this.data[n]);else throw"Unknown data type. DataTable or Array expected.";return t=this.items[n],i.start=new Date(t.start.valueOf()),t.end&&(i.end=new Date(t.end.valueOf())),i.content=t.content,t.group&&(i.group=this.getGroupName(t.group)),t.className&&(i.className=t.className),typeof t.editable!="undefined"&&(i.editable=t.editable),t.type&&(i.type=t.type),i};links.Timeline.prototype.getCluster=function(n){var u,i;if(n>=this.clusters.length)throw"Cannot get cluster, index out of range";var t={},r=this.clusters[n],f=r.items;for(t.start=new Date(r.start.valueOf()),r.type&&(t.type=r.type),t.items=[],u=0;u<f.length;u++)for(i=0;i<this.items.length;i++)if(this.items[i]==f[u]){t.items.push(this.getItem(i));break}return t};links.Timeline.prototype.addItem=function(n,t){var i=[n];this.addItems(i,t)};links.Timeline.prototype.addItems=function(n,t){var i=this,r=this.items;n.forEach(function(n){var t=r.length;r.push(i.createItem(n));i.updateData(t,n)});this.options.cluster&&this.clusterGenerator.updateData();t||this.render({animate:!1})};links.Timeline.prototype.createItem=function(n){var i=n.type||(n.end?"range":this.options.style),r=links.Timeline.clone(n),u,t;return(r.type=i,r.group=this.getGroup(n.group),t=this.options,u=t.axisOnTop?this.size.axis.height+t.eventMarginAxis+t.eventMargin/2:this.size.contentHeight-t.eventMarginAxis-t.eventMargin/2,i in this.itemTypes)?new this.itemTypes[i](r,{top:u}):(console.log('ERROR: Unknown event type "'+i+'"'),new links.Timeline.Item(r,{top:u}))};links.Timeline.prototype.changeItem=function(n,t,i){var r=this.items[n],u;if(!r)throw"Cannot change item, index out of range";u=this.createItem({start:t.hasOwnProperty("start")?t.start:r.start,end:t.hasOwnProperty("end")?t.end:r.end,content:t.hasOwnProperty("content")?t.content:r.content,group:t.hasOwnProperty("group")?t.group:this.getGroupName(r.group),className:t.hasOwnProperty("className")?t.className:r.className,editable:t.hasOwnProperty("editable")?t.editable:r.editable,type:t.hasOwnProperty("type")?t.type:r.type});this.items[n]=u;this.renderQueue.hide.push(r);this.renderQueue.show.push(u);this.updateData(n,t);this.options.cluster&&this.clusterGenerator.updateData();i||(this.render({animate:!1}),this.selection&&this.selection.index==n&&u.select())};links.Timeline.prototype.deleteGroups=function(){this.groups=[];this.groupIndexes={}};links.Timeline.prototype.getGroup=function(n){var t=this.groups,u=this.groupIndexes,r=undefined,f=u[n],i,e;if(f==undefined&&n!=undefined)for(r={content:n,labelTop:0,lineTop:0},t.push(r),this.options.groupsOrder==!0?t=t.sort(function(n,t){return n.content>t.content?1:n.content<t.content?-1:0}):typeof this.options.groupsOrder=="function"&&(t=t.sort(this.options.groupsOrder)),i=0,e=t.length;i<e;i++)u[t[i].content]=i;else r=t[f];return r};links.Timeline.prototype.getGroupName=function(n){return n?n.content:undefined};links.Timeline.prototype.cancelChange=function(){this.applyChange=!1};links.Timeline.prototype.cancelDelete=function(){this.applyDelete=!1};links.Timeline.prototype.cancelAdd=function(){this.applyAdd=!1};links.Timeline.prototype.setSelection=function(n){var t,i,r,u,f;if(n!=undefined&&n.length>0){if(n[0].row!=undefined&&(t=n[0].row,this.items[t])){i=this.items[t];this.selectItem(t);r=i.start;u=i.end;f=u!=undefined?(u.valueOf()+r.valueOf())/2:r.valueOf();var e=this.end.valueOf()-this.start.valueOf(),o=new Date(f-e/2),s=new Date(f+e/2);return this.setVisibleChartRange(o,s),!0}}else this.unselectItem();return!1};links.Timeline.prototype.getSelection=function(){var n=[];return this.selection&&(this.selection.index!==undefined?n.push({row:this.selection.index}):n.push({cluster:this.selection.cluster})),n};links.Timeline.prototype.selectItem=function(n){if(this.unselectItem(),this.selection=undefined,this.items[n]!=undefined){var t=this.items[n],i=t.dom;this.selection={index:n};t&&t.dom&&(this.isEditable(t)&&(t.dom.style.cursor="move"),t.select());this.repaintDeleteButton();this.repaintDragAreas()}};links.Timeline.prototype.selectCluster=function(n){this.unselectItem();this.selection=undefined;this.clusters[n]!=undefined&&(this.selection={cluster:n},this.repaintDeleteButton(),this.repaintDragAreas())};links.Timeline.prototype.isSelected=function(n){return this.selection&&this.selection.index==n};links.Timeline.prototype.unselectItem=function(){var n,t;this.selection&&this.selection.index!==undefined&&(n=this.items[this.selection.index],n&&n.dom&&(t=n.dom,t.style.cursor="",n.unselect()),this.selection=undefined,this.repaintDeleteButton(),this.repaintDragAreas())};links.Timeline.prototype.stackItems=function(n){var t,i,r;n==undefined&&(n=!1);t=this.stack;t||(t={},this.stack=t);t.sortedItems=this.stackOrder(this.renderedItems);t.finalItems=this.stackCalculateFinal(t.sortedItems);n||t.timer?(i=this,r=function(){var n=i.stackMoveOneStep(t.sortedItems,t.finalItems);i.repaint();n?delete t.timer:t.timer=setTimeout(r,30)},t.timer||(t.timer=setTimeout(r,30))):this.stackMoveToFinal(t.sortedItems,t.finalItems)};links.Timeline.prototype.stackCancelAnimation=function(){this.stack&&this.stack.timer&&(clearTimeout(this.stack.timer),delete this.stack.timer)};links.Timeline.prototype.getItemsByGroup=function(n){for(var r={},t,i,u=0;u<n.length;++u)t=n[u],i="undefined",t.group&&(i=t.group.content?t.group.content:t.group),r[i]||(r[i]=[]),r[i].push(t);return r};links.Timeline.prototype.stackOrder=function(n){var t=n.concat([]),i=this.options.customStackOrder&&typeof this.options.customStackOrder=="function"?this.options.customStackOrder:function(n,t){return(n instanceof links.Timeline.ItemRange||n instanceof links.Timeline.ItemFloatingRange)&&!(t instanceof links.Timeline.ItemRange||t instanceof links.Timeline.ItemFloatingRange)?-1:!(n instanceof links.Timeline.ItemRange||n instanceof links.Timeline.ItemFloatingRange)&&(t instanceof links.Timeline.ItemRange||t instanceof links.Timeline.ItemFloatingRange)?1:n.left-t.left};return t.sort(i),t};links.Timeline.prototype.stackCalculateFinal=function(n){var h=this.size,u=this.options,o=u.axisOnTop,t=u.eventMargin,c=u.eventMarginAxis,i=o?h.axis.height+c+t/2:h.contentHeight-c-t/2,f,e,s=[],r;for(f=this.getItemsByGroup(n),j=0;j<this.groups.length;++j){if(r=this.groups[j],!f[r.content]){o?i+=u.groupMinHeight+t:i-=u.groupMinHeight+t;continue}e=this.finalItemsPosition(f[r.content],i,r);e.forEach(function(n){s.push(n)});o?i+=r.itemsHeight+t:i-=r.itemsHeight+t}return f.undefined&&(e=this.finalItemsPosition(f.undefined,i),e.forEach(function(n){s.push(n)})),s};links.Timeline.prototype.finalItemsPosition=function(n,t,i){var f,s,h=this.options,c=h.axisOnTop,o=h.eventMargin,e,r,u;for(e=this.initialItemsPosition(n,t),f=0,s=e.length;f<s;f++){if(r=e[f],u=null,this.options.stackEvents)do u=this.stackItemsCheckOverlap(e,f,0,f-1),u!=null&&(r.top=c?u.top+u.height+o:u.top-r.height-o,r.bottom=r.top+r.height);while(u);i&&(i.itemsHeight=c?i.itemsHeight?Math.max(i.itemsHeight,r.bottom-t):r.height+o:i.itemsHeight?Math.max(i.itemsHeight,t-r.top):r.height+o)}return e};links.Timeline.prototype.initialItemsPosition=function(n,t){for(var c=this.options,l=c.axisOnTop,e=[],i=0,o=n.length;i<o;++i){var r=n[i],u,s,f=r.height,a=r.getWidth(this),h=r.getRight(this),v=h-a;u=l?t:t-f;s=u+f;e.push({left:v,top:u,right:h,bottom:s,height:f,item:r})}return e};links.Timeline.prototype.stackMoveOneStep=function(n,t){for(var c=!0,s,h,u=0,l=t.length;u<l;u++){var r=t[u],i=r.item,f=parseInt(i.top),e=parseInt(r.top),o=e-f;o?(s=e==f?0:e>f?1:-1,Math.abs(o)>4&&(s=o/4),h=parseInt(f+s),h!=e&&(c=!1),i.top=h,i.bottom=i.top+i.height):(i.top=r.top,i.bottom=r.bottom);i.left=r.left;i.right=r.right}return c};links.Timeline.prototype.stackMoveToFinal=function(n,t){for(var i,r,u=0,f=t.length;u<f;u++)i=t[u],r=i.item,r.left=i.left,r.top=i.top,r.right=i.right,r.bottom=i.bottom};links.Timeline.prototype.stackItemsCheckOverlap=function(n,t,i,r){for(var e=this.options.eventMargin,o=this.collision,s=n[t],f,u=r;u>=i;u--)if(f=n[u],o(s,f,e)&&u!=t)return f;return undefined};links.Timeline.prototype.collision=function(n,t,i){return i==undefined&&(i=0),n.left-i<t.right&&n.right+i>t.left&&n.top-i<t.bottom&&n.bottom+i>t.top};links.Timeline.prototype.trigger=function(n){var t=null;switch(n){case"rangechange":case"rangechanged":t={start:new Date(this.start.valueOf()),end:new Date(this.end.valueOf())};break;case"timechange":case"timechanged":t={time:new Date(this.customTime.valueOf())}}links.events.trigger(this,n,t);google&&google.visualization&&google.visualization.events.trigger(this,n,t)};links.Timeline.prototype.clusterItems=function(){var n,t;this.options.cluster&&(n=this.clusterGenerator.getClusters(this.conversion.factor,this.options.clusterMaxItems),this.clusters!=n&&(t=this.renderQueue,this.clusters&&this.clusters.forEach(function(n){t.hide.push(n);n.items.forEach(function(n){n.cluster=undefined})}),n.forEach(function(n){n.items.forEach(function(t){t.cluster=n})}),this.clusters=n))};links.Timeline.prototype.filterItems=function(){function i(t){t.forEach(function(t){var i=t.rendered,f=t.isVisible(r,u);i!=f&&(i&&n.hide.push(t),f&&n.show.indexOf(t)==-1&&n.show.push(t))})}var n=this.renderQueue,t=this.end-this.start,r=new Date(this.start.valueOf()-t),u=new Date(this.end.valueOf()+t);i(this.items);this.clusters&&i(this.clusters)};links.Timeline.ClusterGenerator=function(n){this.timeline=n;this.clear()};links.Timeline.ClusterGenerator.prototype.clear=function(){this.items=[];this.groups={};this.clearCache()};links.Timeline.ClusterGenerator.prototype.clearCache=function(){this.cache={};this.cacheLevel=-1;this.cache[this.cacheLevel]=[]};links.Timeline.ClusterGenerator.prototype.setData=function(n,t){this.items=n||[];this.dataChanged=!0;this.applyOnChangedLevel=!0;t&&t.applyOnChangedLevel&&(this.applyOnChangedLevel=t.applyOnChangedLevel)};links.Timeline.ClusterGenerator.prototype.updateData=function(){this.dataChanged=!0;this.applyOnChangedLevel=!1};links.Timeline.ClusterGenerator.prototype.filterData=function(){var i=this.items||[],n={},t;this.groups=n;i.forEach(function(t){var r=t.group?t.group.content:"",i=n[r];i||(i=[],n[r]=i);i.push(t);t.start&&(t.center=t.end?(t.start.valueOf()+t.end.valueOf())/2:t.start.valueOf())});for(t in n)n.hasOwnProperty(t)&&n[t].sort(function(n,t){return n.center-t.center});this.dataChanged=!1};links.Timeline.ClusterGenerator.prototype.getClusters=function(n,t){var s=-1,tt=2,a=0,it,rt,i,b,y,l;if(n>0&&(s=Math.round(Math.log(100/n)/Math.log(tt)),a=Math.pow(tt,s)),this.dataChanged&&(it=s!=this.cacheLevel,rt=this.applyOnChangedLevel?it:!0,rt&&(this.clearCache(),this.filterData())),this.cacheLevel=s,i=this.cache[s],!i){i=[];for(b in this.groups)if(this.groups.hasOwnProperty(b))for(var u=this.groups[b],ht=u.length,f=0;f<ht;){for(var e=u[f],c=1,v=f-1;v>=0&&e.center-u[v].center<a/2;)u[v].cluster||c++,v--;for(y=f+1;y<u.length&&u[y].center-e.center<a/2;)c++,y++;for(l=i.length-1;l>=0&&e.center-i[l].center<a/2;)e.group==i[l].group&&c++,l--;if(c>t){for(var ut=c-t+1,k=[],d=undefined,p=undefined,w=undefined,g=!1,o=0,nt=f;k.length<ut&&nt<u.length;){var r=u[nt],ft=r.start.valueOf(),et=r.end?r.end.valueOf():r.start.valueOf();k.push(r);d=o?o/(o+1)*d+1/(o+1)*r.center:r.center;p=p!=undefined?Math.min(p,ft):ft;w=w!=undefined?Math.max(w,et):et;g=g||r instanceof links.Timeline.ItemRange||r instanceof links.Timeline.ItemFloatingRange;o++;nt++}var h,ct="Cluster containing "+o+" events. Zoom in to see the individual events.",ot='<div title="'+ct+'">'+o+" events<\/div>",st=e.group?e.group.content:undefined;h=g?this.timeline.createItem({start:new Date(p),end:new Date(w),content:ot,group:st}):this.timeline.createItem({start:new Date(d),content:ot,group:st});h.isCluster=!0;h.items=k;h.items.forEach(function(n){n.cluster=h});i.push(h);f+=ut}else delete e.cluster,f+=1}this.cache[s]=i}return i};links.events=links.events||{listeners:[],indexOf:function(n){for(var u=this.listeners,i,t=0,r=this.listeners.length;t<r;t++)if(i=u[t],i&&i.object==n)return t;return-1},addListener:function(n,t,i){var f=this.indexOf(n),u=this.listeners[f],r;u||(u={object:n,events:{}},this.listeners.push(u));r=u.events[t];r||(r=[],u.events[t]=r);r.indexOf(i)==-1&&r.push(i)},removeListener:function(n,t,i){var r=this.indexOf(n),f=this.listeners[r],u,e,o,s;if(f){u=f.events[t];u&&(r=u.indexOf(i),r!=-1&&u.splice(r,1),u.length==0&&delete f.events[t]);e=0;o=f.events;for(s in o)o.hasOwnProperty(s)&&e++;e==0&&delete this.listeners[r]}},removeAllListeners:function(){this.listeners=[]},trigger:function(n,t,i){var o=this.indexOf(n),f=this.listeners[o],r,u,e;if(f&&(r=f.events[t],r))for(u=0,e=r.length;u<e;u++)r[u](i)}};links.Timeline.StepDate=function(n,t,i){this.current=new Date;this._start=new Date;this._end=new Date;this.autoScale=!0;this.scale=links.Timeline.StepDate.SCALE.DAY;this.step=1;this.setRange(n,t,i)};links.Timeline.StepDate.SCALE={MILLISECOND:1,SECOND:2,MINUTE:3,HOUR:4,DAY:5,WEEKDAY:6,MONTH:7,YEAR:8};links.Timeline.StepDate.prototype.setRange=function(n,t,i){n instanceof Date&&t instanceof Date&&(this._start=n!=undefined?new Date(n.valueOf()):new Date,this._end=t!=undefined?new Date(t.valueOf()):new Date,this.autoScale&&this.setMinimumStep(i))};links.Timeline.StepDate.prototype.start=function(){this.current=new Date(this._start.valueOf());this.roundToMinor()};links.Timeline.StepDate.prototype.roundToMinor=function(){switch(this.scale){case links.Timeline.StepDate.SCALE.YEAR:this.current.setFullYear(this.step*Math.floor(this.current.getFullYear()/this.step));this.current.setMonth(0);case links.Timeline.StepDate.SCALE.MONTH:this.current.setDate(1);case links.Timeline.StepDate.SCALE.DAY:case links.Timeline.StepDate.SCALE.WEEKDAY:this.current.setHours(0);case links.Timeline.StepDate.SCALE.HOUR:this.current.setMinutes(0);case links.Timeline.StepDate.SCALE.MINUTE:this.current.setSeconds(0);case links.Timeline.StepDate.SCALE.SECOND:this.current.setMilliseconds(0)}if(this.step!=1)switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:this.current.setMilliseconds(this.current.getMilliseconds()-this.current.getMilliseconds()%this.step);break;case links.Timeline.StepDate.SCALE.SECOND:this.current.setSeconds(this.current.getSeconds()-this.current.getSeconds()%this.step);break;case links.Timeline.StepDate.SCALE.MINUTE:this.current.setMinutes(this.current.getMinutes()-this.current.getMinutes()%this.step);break;case links.Timeline.StepDate.SCALE.HOUR:this.current.setHours(this.current.getHours()-this.current.getHours()%this.step);break;case links.Timeline.StepDate.SCALE.WEEKDAY:case links.Timeline.StepDate.SCALE.DAY:this.current.setDate(this.current.getDate()-1-(this.current.getDate()-1)%this.step+1);break;case links.Timeline.StepDate.SCALE.MONTH:this.current.setMonth(this.current.getMonth()-this.current.getMonth()%this.step);break;case links.Timeline.StepDate.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()-this.current.getFullYear()%this.step)}};links.Timeline.StepDate.prototype.end=function(){return this.current.valueOf()>this._end.valueOf()};links.Timeline.StepDate.prototype.next=function(){var t=this.current.valueOf(),n;if(this.current.getMonth()<6)switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:this.current=new Date(this.current.valueOf()+this.step);break;case links.Timeline.StepDate.SCALE.SECOND:this.current=new Date(this.current.valueOf()+this.step*1e3);break;case links.Timeline.StepDate.SCALE.MINUTE:this.current=new Date(this.current.valueOf()+this.step*6e4);break;case links.Timeline.StepDate.SCALE.HOUR:this.current=new Date(this.current.valueOf()+this.step*36e5);n=this.current.getHours();this.current.setHours(n-n%this.step);break;case links.Timeline.StepDate.SCALE.WEEKDAY:case links.Timeline.StepDate.SCALE.DAY:this.current.setDate(this.current.getDate()+this.step);break;case links.Timeline.StepDate.SCALE.MONTH:this.current.setMonth(this.current.getMonth()+this.step);break;case links.Timeline.StepDate.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()+this.step)}else switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:this.current=new Date(this.current.valueOf()+this.step);break;case links.Timeline.StepDate.SCALE.SECOND:this.current.setSeconds(this.current.getSeconds()+this.step);break;case links.Timeline.StepDate.SCALE.MINUTE:this.current.setMinutes(this.current.getMinutes()+this.step);break;case links.Timeline.StepDate.SCALE.HOUR:this.current.setHours(this.current.getHours()+this.step);break;case links.Timeline.StepDate.SCALE.WEEKDAY:case links.Timeline.StepDate.SCALE.DAY:this.current.setDate(this.current.getDate()+this.step);break;case links.Timeline.StepDate.SCALE.MONTH:this.current.setMonth(this.current.getMonth()+this.step);break;case links.Timeline.StepDate.SCALE.YEAR:this.current.setFullYear(this.current.getFullYear()+this.step)}if(this.step!=1)switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:this.current.getMilliseconds()<this.step&&this.current.setMilliseconds(0);break;case links.Timeline.StepDate.SCALE.SECOND:this.current.getSeconds()<this.step&&this.current.setSeconds(0);break;case links.Timeline.StepDate.SCALE.MINUTE:this.current.getMinutes()<this.step&&this.current.setMinutes(0);break;case links.Timeline.StepDate.SCALE.HOUR:this.current.getHours()<this.step&&this.current.setHours(0);break;case links.Timeline.StepDate.SCALE.WEEKDAY:case links.Timeline.StepDate.SCALE.DAY:this.current.getDate()<this.step+1&&this.current.setDate(1);break;case links.Timeline.StepDate.SCALE.MONTH:this.current.getMonth()<this.step&&this.current.setMonth(0)}this.current.valueOf()==t&&(this.current=new Date(this._end.valueOf()))};links.Timeline.StepDate.prototype.getCurrent=function(){return this.current};links.Timeline.StepDate.prototype.setScale=function(n,t){this.scale=n;t>0&&(this.step=t);this.autoScale=!1};links.Timeline.StepDate.prototype.setAutoScale=function(n){this.autoScale=n};links.Timeline.StepDate.prototype.setMinimumStep=function(n){if(n!=undefined){var t=31104e6,e=2592e6,r=864e5,o=36e5,u=6e4,f=1e3,i=1;t*1e3>n&&(this.scale=links.Timeline.StepDate.SCALE.YEAR,this.step=1e3);t*500>n&&(this.scale=links.Timeline.StepDate.SCALE.YEAR,this.step=500);t*100>n&&(this.scale=links.Timeline.StepDate.SCALE.YEAR,this.step=100);t*50>n&&(this.scale=links.Timeline.StepDate.SCALE.YEAR,this.step=50);t*10>n&&(this.scale=links.Timeline.StepDate.SCALE.YEAR,this.step=10);t*5>n&&(this.scale=links.Timeline.StepDate.SCALE.YEAR,this.step=5);t>n&&(this.scale=links.Timeline.StepDate.SCALE.YEAR,this.step=1);e*3>n&&(this.scale=links.Timeline.StepDate.SCALE.MONTH,this.step=3);e>n&&(this.scale=links.Timeline.StepDate.SCALE.MONTH,this.step=1);r*5>n&&(this.scale=links.Timeline.StepDate.SCALE.DAY,this.step=5);r*2>n&&(this.scale=links.Timeline.StepDate.SCALE.DAY,this.step=2);r>n&&(this.scale=links.Timeline.StepDate.SCALE.DAY,this.step=1);r/2>n&&(this.scale=links.Timeline.StepDate.SCALE.WEEKDAY,this.step=1);o*4>n&&(this.scale=links.Timeline.StepDate.SCALE.HOUR,this.step=4);o>n&&(this.scale=links.Timeline.StepDate.SCALE.HOUR,this.step=1);u*15>n&&(this.scale=links.Timeline.StepDate.SCALE.MINUTE,this.step=15);u*10>n&&(this.scale=links.Timeline.StepDate.SCALE.MINUTE,this.step=10);u*5>n&&(this.scale=links.Timeline.StepDate.SCALE.MINUTE,this.step=5);u>n&&(this.scale=links.Timeline.StepDate.SCALE.MINUTE,this.step=1);f*15>n&&(this.scale=links.Timeline.StepDate.SCALE.SECOND,this.step=15);f*10>n&&(this.scale=links.Timeline.StepDate.SCALE.SECOND,this.step=10);f*5>n&&(this.scale=links.Timeline.StepDate.SCALE.SECOND,this.step=5);f>n&&(this.scale=links.Timeline.StepDate.SCALE.SECOND,this.step=1);i*200>n&&(this.scale=links.Timeline.StepDate.SCALE.MILLISECOND,this.step=200);i*100>n&&(this.scale=links.Timeline.StepDate.SCALE.MILLISECOND,this.step=100);i*50>n&&(this.scale=links.Timeline.StepDate.SCALE.MILLISECOND,this.step=50);i*10>n&&(this.scale=links.Timeline.StepDate.SCALE.MILLISECOND,this.step=10);i*5>n&&(this.scale=links.Timeline.StepDate.SCALE.MILLISECOND,this.step=5);i>n&&(this.scale=links.Timeline.StepDate.SCALE.MILLISECOND,this.step=1)}};links.Timeline.StepDate.prototype.snap=function(n){var i,t;if(this.scale==links.Timeline.StepDate.SCALE.YEAR)i=n.getFullYear()+Math.round(n.getMonth()/12),n.setFullYear(Math.round(i/this.step)*this.step),n.setMonth(0),n.setDate(0),n.setHours(0),n.setMinutes(0),n.setSeconds(0),n.setMilliseconds(0);else if(this.scale==links.Timeline.StepDate.SCALE.MONTH)n.getDate()>15?(n.setDate(1),n.setMonth(n.getMonth()+1)):n.setDate(1),n.setHours(0),n.setMinutes(0),n.setSeconds(0),n.setMilliseconds(0);else if(this.scale==links.Timeline.StepDate.SCALE.DAY||this.scale==links.Timeline.StepDate.SCALE.WEEKDAY){switch(this.step){case 5:case 2:n.setHours(Math.round(n.getHours()/24)*24);break;default:n.setHours(Math.round(n.getHours()/12)*12)}n.setMinutes(0);n.setSeconds(0);n.setMilliseconds(0)}else if(this.scale==links.Timeline.StepDate.SCALE.HOUR){switch(this.step){case 4:n.setMinutes(Math.round(n.getMinutes()/60)*60);break;default:n.setMinutes(Math.round(n.getMinutes()/30)*30)}n.setSeconds(0);n.setMilliseconds(0)}else if(this.scale==links.Timeline.StepDate.SCALE.MINUTE){switch(this.step){case 15:case 10:n.setMinutes(Math.round(n.getMinutes()/5)*5);n.setSeconds(0);break;case 5:n.setSeconds(Math.round(n.getSeconds()/60)*60);break;default:n.setSeconds(Math.round(n.getSeconds()/30)*30)}n.setMilliseconds(0)}else if(this.scale==links.Timeline.StepDate.SCALE.SECOND)switch(this.step){case 15:case 10:n.setSeconds(Math.round(n.getSeconds()/5)*5);n.setMilliseconds(0);break;case 5:n.setMilliseconds(Math.round(n.getMilliseconds()/1e3)*1e3);break;default:n.setMilliseconds(Math.round(n.getMilliseconds()/500)*500)}else this.scale==links.Timeline.StepDate.SCALE.MILLISECOND&&(t=this.step>5?this.step/2:1,n.setMilliseconds(Math.round(n.getMilliseconds()/t)*t))};links.Timeline.StepDate.prototype.isMajor=function(){switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:return this.current.getMilliseconds()==0;case links.Timeline.StepDate.SCALE.SECOND:return this.current.getSeconds()==0;case links.Timeline.StepDate.SCALE.MINUTE:return this.current.getHours()==0&&this.current.getMinutes()==0;case links.Timeline.StepDate.SCALE.HOUR:return this.current.getHours()==0;case links.Timeline.StepDate.SCALE.WEEKDAY:case links.Timeline.StepDate.SCALE.DAY:return this.current.getDate()==1;case links.Timeline.StepDate.SCALE.MONTH:return this.current.getMonth()==0;case links.Timeline.StepDate.SCALE.YEAR:return!1;default:return!1}};links.Timeline.StepDate.prototype.getLabelMinor=function(n,t){t==undefined&&(t=this.current);switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:return String(t.getMilliseconds());case links.Timeline.StepDate.SCALE.SECOND:return String(t.getSeconds());case links.Timeline.StepDate.SCALE.MINUTE:return this.addZeros(t.getHours(),2)+":"+this.addZeros(t.getMinutes(),2);case links.Timeline.StepDate.SCALE.HOUR:return this.addZeros(t.getHours(),2)+":"+this.addZeros(t.getMinutes(),2);case links.Timeline.StepDate.SCALE.WEEKDAY:return n.DAYS_SHORT[t.getDay()]+" "+t.getDate();case links.Timeline.StepDate.SCALE.DAY:return String(t.getDate());case links.Timeline.StepDate.SCALE.MONTH:return n.MONTHS_SHORT[t.getMonth()];case links.Timeline.StepDate.SCALE.YEAR:return String(t.getFullYear());default:return""}};links.Timeline.StepDate.prototype.getLabelMajor=function(n,t){t==undefined&&(t=this.current);switch(this.scale){case links.Timeline.StepDate.SCALE.MILLISECOND:return this.addZeros(t.getHours(),2)+":"+this.addZeros(t.getMinutes(),2)+":"+this.addZeros(t.getSeconds(),2);case links.Timeline.StepDate.SCALE.SECOND:return t.getDate()+" "+n.MONTHS[t.getMonth()]+" "+this.addZeros(t.getHours(),2)+":"+this.addZeros(t.getMinutes(),2);case links.Timeline.StepDate.SCALE.MINUTE:return n.DAYS[t.getDay()]+" "+t.getDate()+" "+n.MONTHS[t.getMonth()]+" "+t.getFullYear();case links.Timeline.StepDate.SCALE.HOUR:return n.DAYS[t.getDay()]+" "+t.getDate()+" "+n.MONTHS[t.getMonth()]+" "+t.getFullYear();case links.Timeline.StepDate.SCALE.WEEKDAY:case links.Timeline.StepDate.SCALE.DAY:return n.MONTHS[t.getMonth()]+" "+t.getFullYear();case links.Timeline.StepDate.SCALE.MONTH:return String(t.getFullYear());default:return""}};links.Timeline.StepDate.prototype.addZeros=function(n,t){for(var i=""+n;i.length<t;)i="0"+i;return i};links.imageloader=function(){function t(n){if(i[n]==!0)return!0;var t=new Image;return(t.src=n,t.complete)?!0:!1}function r(t){return n[t]!=undefined}function u(u,f,e){var o,s;if(e==undefined&&(e=!0),t(u)){e&&f(u);return}(!r(u)||e)&&(o=n[u],o||(s=new Image,s.src=u,o=[],n[u]=o,s.onload=function(){i[u]=!0;delete n[u];for(var t=0;t<o.length;t++)o[t](u)}),o.indexOf(f)==-1&&o.push(f))}function e(n,i,r){var f=[],e;n.forEach(function(n){t(n)||f.push(n)});f.length?(e=f.length,f.forEach(function(n){u(n,function(){e--;e==0&&i()},r)})):r&&i()}function f(n,t){for(var i=n.firstChild,r;i;)i.tagName=="IMG"&&(r=i.src,t.indexOf(r)==-1&&t.push(r)),f(i,t),i=i.nextSibling}var i={},n={};return{isLoaded:t,isLoading:r,load:u,loadAll:e,filterImageUrls:f}}();links.Timeline.addEventListener=function(n,t,i,r){n.addEventListener?(r===undefined&&(r=!1),t==="mousewheel"&&navigator.userAgent.indexOf("Firefox")>=0&&(t="DOMMouseScroll"),n.addEventListener(t,i,r)):n.attachEvent("on"+t,i)};links.Timeline.removeEventListener=function(n,t,i,r){n.removeEventListener?(r===undefined&&(r=!1),t==="mousewheel"&&navigator.userAgent.indexOf("Firefox")>=0&&(t="DOMMouseScroll"),n.removeEventListener(t,i,r)):n.detachEvent("on"+t,i)};links.Timeline.getTarget=function(n){n||(n=window.event);var t;return n.target?t=n.target:n.srcElement&&(t=n.srcElement),t.nodeType!=undefined&&t.nodeType==3&&(t=t.parentNode),t};links.Timeline.stopPropagation=function(n){n||(n=window.event);n.stopPropagation?n.stopPropagation():n.cancelBubble=!0};links.Timeline.preventDefault=function(n){n||(n=window.event);n.preventDefault?n.preventDefault():n.returnValue=!1};links.Timeline.getAbsoluteLeft=function(n){for(var r=document.documentElement,u=document.body,i=n.offsetLeft,t=n.offsetParent;t!=null&&t!=u&&t!=r;)i+=t.offsetLeft,i-=t.scrollLeft,t=t.offsetParent;return i};links.Timeline.getAbsoluteTop=function(n){for(var r=document.documentElement,u=document.body,i=n.offsetTop,t=n.offsetParent;t!=null&&t!=u&&t!=r;)i+=t.offsetTop,i-=t.scrollTop,t=t.offsetParent;return i};links.Timeline.getPageY=function(n){if("targetTouches"in n&&n.targetTouches.length&&(n=n.targetTouches[0]),"pageY"in n)return n.pageY;var r=n.clientY,t=document.documentElement,i=document.body;return r+(t&&t.scrollTop||i&&i.scrollTop||0)-(t&&t.clientTop||i&&i.clientTop||0)};links.Timeline.getPageX=function(n){if("targetTouches"in n&&n.targetTouches.length&&(n=n.targetTouches[0]),"pageX"in n)return n.pageX;var r=n.clientX,t=document.documentElement,i=document.body;return r+(t&&t.scrollLeft||i&&i.scrollLeft||0)-(t&&t.clientLeft||i&&i.clientLeft||0)};links.Timeline.addClassName=function(n,t){for(var r=n.className.split(" "),u=t.split(" "),f=!1,i=0;i<u.length;i++)r.indexOf(u[i])==-1&&(r.push(u[i]),f=!0);f&&(n.className=r.join(" "))};links.Timeline.removeClassName=function(n,t){for(var r=n.className.split(" "),f=t.split(" "),e=!1,u,i=0;i<f.length;i++)u=r.indexOf(f[i]),u!=-1&&(r.splice(u,1),e=!0);e&&(n.className=r.join(" "))};links.Timeline.isArray=function(n){return n instanceof Array?!0:Object.prototype.toString.call(n)==="[object Array]"};links.Timeline.clone=function(n){var i={},t;for(t in n)n.hasOwnProperty(t)&&(i[t]=n[t]);return i};links.Timeline.parseJSONDate=function(n){var t,i;return n==undefined?undefined:n instanceof Date?n:(t=n.match(/\/Date\((-?\d+)([-\+]?\d{2})?(\d{2})?\)\//i),t)?(i=t[2]?36e5*t[2]+6e4*t[3]*(t[2]/Math.abs(t[2])):0,new Date(1*t[1]+i)):Date.parse(n)};typeof links=="undefined"?(links={},links.locales={}):typeof links.locales=="undefined"&&(links.locales={});links.locales.en={MONTHS:["January","February","March","April","May","June","July","August","September","October","November","December"],MONTHS_SHORT:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],DAYS:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],DAYS_SHORT:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ZOOM_IN:"Zoom in",ZOOM_OUT:"Zoom out",MOVE_LEFT:"Move left",MOVE_RIGHT:"Move right",NEW:"New",CREATE_NEW_EVENT:"Create new event"};links.locales.en_US=links.locales.en;links.locales.en_UK=links.locales.en;links.locales.fr={MONTHS:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Août","Septembre","Octobre","Novembre","Décembre"],MONTHS_SHORT:["Jan","Fev","Mar","Avr","Mai","Jun","Jul","Aou","Sep","Oct","Nov","Dec"],DAYS:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],DAYS_SHORT:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],ZOOM_IN:"Zoomer",ZOOM_OUT:"Dézoomer",MOVE_LEFT:"Déplacer à gauche",MOVE_RIGHT:"Déplacer à droite",NEW:"Nouveau",CREATE_NEW_EVENT:"Créer un nouvel évènement"};links.locales.fr_FR=links.locales.fr;links.locales.fr_BE=links.locales.fr;links.locales.fr_CA=links.locales.fr;links.locales.ca={MONTHS:["Gener","Febrer","Març","Abril","Maig","Juny","Juliol","Setembre","Octubre","Novembre","Desembre"],MONTHS_SHORT:["Gen","Feb","Mar","Abr","Mai","Jun","Jul","Ago","Set","Oct","Nov","Des"],DAYS:["Diumenge","Dilluns","Dimarts","Dimecres","Dijous","Divendres","Dissabte"],DAYS_SHORT:["Dm.","Dl.","Dm.","Dc.","Dj.","Dv.","Ds."],ZOOM_IN:"Augmentar zoom",ZOOM_OUT:"Disminuir zoom",MOVE_LEFT:"Moure esquerra",MOVE_RIGHT:"Moure dreta",NEW:"Nou",CREATE_NEW_EVENT:"Crear nou event"};links.locales.ca_ES=links.locales.ca;links.locales.de={MONTHS:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],MONTHS_SHORT:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],DAYS:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],DAYS_SHORT:["Son","Mon","Die","Mit","Don","Fre","Sam"],ZOOM_IN:"Vergrößern",ZOOM_OUT:"Verkleinern",MOVE_LEFT:"Nach links verschieben",MOVE_RIGHT:"Nach rechts verschieben",NEW:"Neu",CREATE_NEW_EVENT:"Neues Ereignis erzeugen"};links.locales.de_DE=links.locales.de;links.locales.de_CH=links.locales.de;links.locales.da={MONTHS:["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"],MONTHS_SHORT:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"],DAYS:["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],DAYS_SHORT:["søn","man","tir","ons","tor","fre","lør"],ZOOM_IN:"Zoom in",ZOOM_OUT:"Zoom out",MOVE_LEFT:"Move left",MOVE_RIGHT:"Move right",NEW:"New",CREATE_NEW_EVENT:"Create new event"};links.locales.da_DK=links.locales.da;links.locales.ru={MONTHS:["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],MONTHS_SHORT:["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],DAYS:["Воскресенье","Понедельник","Вторник","Среда","Четверг","Пятница","Суббота"],DAYS_SHORT:["Вос","Пон","Втo","Срe","Чет","Пят","Суб"],ZOOM_IN:"Увeличить",ZOOM_OUT:"Умeньшить",MOVE_LEFT:"Сдвинуть налeво",MOVE_RIGHT:"Сдвинуть направо",NEW:"Новый",CREATE_NEW_EVENT:"Создать новоe событиe"};links.locales.ru_RU=links.locales.ru;links.locales.es={MONTHS:["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"],MONTHS_SHORT:["Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"],DAYS:["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"],DAYS_SHORT:["Dom","Lun","Mar","Mié","Jue","Vie","Sáb"],ZOOM_IN:"Aumentar zoom",ZOOM_OUT:"Disminuir zoom",MOVE_LEFT:"Mover izquierda",MOVE_RIGHT:"Mover derecha",NEW:"Nuevo",CREATE_NEW_EVENT:"Crear nuevo evento"};links.locales.es_ES=links.locales.es;links.locales.nl={MONTHS:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],MONTHS_SHORT:["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec"],DAYS:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],DAYS_SHORT:["zo","ma","di","wo","do","vr","za"],ZOOM_IN:"Inzoomen",ZOOM_OUT:"Uitzoomen",MOVE_LEFT:"Naar links",MOVE_RIGHT:"Naar rechts",NEW:"Nieuw",CREATE_NEW_EVENT:"Nieuwe gebeurtenis maken"};links.locales.nl_NL=links.locales.nl;links.locales.nl_BE=links.locales.nl;links.locales.tr={MONTHS:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],MONTHS_SHORT:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],DAYS:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],DAYS_SHORT:["Paz","Pzt","Sal","Çar","Per","Cum","Cmt"],ZOOM_IN:"Büyült",ZOOM_OUT:"Küçült",MOVE_LEFT:"Sola Taşı",MOVE_RIGHT:"Sağa Taşı",NEW:"Yeni",CREATE_NEW_EVENT:"Yeni etkinlik oluştur"};links.locales.tr_TR=links.locales.tr;links.locales.hu={MONTHS:["január","február","március","április","május","június","július","augusztus","szeptember","október","november","december"],MONTHS_SHORT:["jan","feb","márc","ápr","máj","jún","júl","aug","szep","okt","nov","dec"],DAYS:["vasárnap","hétfő","kedd","szerda","csütörtök","péntek","szombat"],DAYS_SHORT:["vas","hét","kedd","sze","csü","pé","szo"],ZOOM_IN:"Nagyítás",ZOOM_OUT:"Kicsinyítés",MOVE_LEFT:"Balra",MOVE_RIGHT:"Jobbra",NEW:"Új",CREATE_NEW_EVENT:"Új esemény készítése"};links.locales.hu_HU=links.locales.hu