/* band.js */ Timeline._Band=function(F,G,B){if(F.autoWidth&&typeof G.width=="string"){G.width=G.width.indexOf("%")>-1?0:parseInt(G.width); }this._timeline=F; this._bandInfo=G; this._index=B; this._locale=("locale" in G)?G.locale:Timeline.getDefaultLocale(); this._timeZone=("timeZone" in G)?G.timeZone:0; this._labeller=("labeller" in G)?G.labeller:(("createLabeller" in F.getUnit())?F.getUnit().createLabeller(this._locale,this._timeZone):new Timeline.GregorianDateLabeller(this._locale,this._timeZone)); this._theme=G.theme; this._zoomIndex=("zoomIndex" in G)?G.zoomIndex:0; this._zoomSteps=("zoomSteps" in G)?G.zoomSteps:null; this._dragging=false; this._changing=false; this._originalScrollSpeed=5; this._scrollSpeed=this._originalScrollSpeed; this._onScrollListeners=[]; var A=this; this._syncWithBand=null; this._syncWithBandHandler=function(H){A._onHighlightBandScroll(); }; this._selectorListener=function(H){A._onHighlightBandScroll(); }; var D=this._timeline.getDocument().createElement("div"); D.className="timeline-band-input"; this._timeline.addDiv(D); this._keyboardInput=document.createElement("input"); this._keyboardInput.type="text"; D.appendChild(this._keyboardInput); SimileAjax.DOM.registerEventWithObject(this._keyboardInput,"keydown",this,"_onKeyDown"); SimileAjax.DOM.registerEventWithObject(this._keyboardInput,"keyup",this,"_onKeyUp"); this._div=this._timeline.getDocument().createElement("div"); this._div.id="timeline-band-"+B; this._div.className="timeline-band timeline-band-"+B; this._timeline.addDiv(this._div); SimileAjax.DOM.registerEventWithObject(this._div,"mousedown",this,"_onMouseDown"); SimileAjax.DOM.registerEventWithObject(this._div,"mousemove",this,"_onMouseMove"); SimileAjax.DOM.registerEventWithObject(this._div,"mouseup",this,"_onMouseUp"); SimileAjax.DOM.registerEventWithObject(this._div,"mouseout",this,"_onMouseOut"); SimileAjax.DOM.registerEventWithObject(this._div,"dblclick",this,"_onDblClick"); var E=this._theme!=null?this._theme.mouseWheel:"scroll"; if(E==="zoom"||E==="scroll"||this._zoomSteps){if(SimileAjax.Platform.browser.isFirefox){SimileAjax.DOM.registerEventWithObject(this._div,"DOMMouseScroll",this,"_onMouseScroll"); }else{SimileAjax.DOM.registerEventWithObject(this._div,"mousewheel",this,"_onMouseScroll"); }}this._innerDiv=this._timeline.getDocument().createElement("div"); this._innerDiv.className="timeline-band-inner"; this._div.appendChild(this._innerDiv); this._ether=G.ether; G.ether.initialize(this,F); this._etherPainter=G.etherPainter; G.etherPainter.initialize(this,F); this._eventSource=G.eventSource; if(this._eventSource){this._eventListener={onAddMany:function(){A._onAddMany(); },onClear:function(){A._onClear(); }}; this._eventSource.addListener(this._eventListener); }this._eventPainter=G.eventPainter; this._eventTracksNeeded=0; this._eventTrackIncrement=0; G.eventPainter.initialize(this,F); this._decorators=("decorators" in G)?G.decorators:[]; for(var C=0; Cthis._eventTracksNeeded){this._eventTracksNeeded=B; }}; Timeline._Band.prototype.checkAutoWidth=function(){if(!this._timeline.autoWidth){return ; }var A=this._eventPainter.getType()=="overview"; var C=A?this._theme.event.overviewTrack.autoWidthMargin:this._theme.event.track.autoWidthMargin; var B=Math.ceil((this._eventTracksNeeded+C)*this._eventTrackIncrement); B+=A?this._theme.event.overviewTrack.offset:this._theme.event.track.offset; var D=this._bandInfo; if(B!=D.width){D.width=B; }}; Timeline._Band.prototype.layout=function(){this.paint(); }; Timeline._Band.prototype.paint=function(){this._etherPainter.paint(); this._paintDecorators(); this._paintEvents(); }; Timeline._Band.prototype.softLayout=function(){this.softPaint(); }; Timeline._Band.prototype.softPaint=function(){this._etherPainter.softPaint(); this._softPaintDecorators(); this._softPaintEvents(); }; Timeline._Band.prototype.setBandShiftAndWidth=function(A,D){var C=this._keyboardInput.parentNode; var B=A+Math.floor(D/2); if(this._timeline.isHorizontal()){this._div.style.top=A+"px"; this._div.style.height=D+"px"; C.style.top=B+"px"; C.style.left="-1em"; }else{this._div.style.left=A+"px"; this._div.style.width=D+"px"; C.style.left=B+"px"; C.style.top="-1em"; }}; Timeline._Band.prototype.getViewWidth=function(){if(this._timeline.isHorizontal()){return this._div.offsetHeight; }else{return this._div.offsetWidth; }}; Timeline._Band.prototype.setViewLength=function(A){this._viewLength=A; this._recenterDiv(); this._onChanging(); }; Timeline._Band.prototype.getViewLength=function(){return this._viewLength; }; Timeline._Band.prototype.getTotalViewLength=function(){return Timeline._Band.SCROLL_MULTIPLES*this._viewLength; }; Timeline._Band.prototype.getViewOffset=function(){return this._viewOffset; }; Timeline._Band.prototype.getMinDate=function(){return this._ether.pixelOffsetToDate(this._viewOffset); }; Timeline._Band.prototype.getMaxDate=function(){return this._ether.pixelOffsetToDate(this._viewOffset+Timeline._Band.SCROLL_MULTIPLES*this._viewLength); }; Timeline._Band.prototype.getMinVisibleDate=function(){return this._ether.pixelOffsetToDate(0); }; Timeline._Band.prototype.getMinVisibleDateAfterDelta=function(A){return this._ether.pixelOffsetToDate(A); }; Timeline._Band.prototype.getMaxVisibleDate=function(){return this._ether.pixelOffsetToDate(this._viewLength); }; Timeline._Band.prototype.getMaxVisibleDateAfterDelta=function(A){return this._ether.pixelOffsetToDate(this._viewLength+A); }; Timeline._Band.prototype.getCenterVisibleDate=function(){return this._ether.pixelOffsetToDate(this._viewLength/2); }; Timeline._Band.prototype.setMinVisibleDate=function(A){if(!this._changing){this._moveEther(Math.round(-this._ether.dateToPixelOffset(A))); }}; Timeline._Band.prototype.setMaxVisibleDate=function(A){if(!this._changing){this._moveEther(Math.round(this._viewLength-this._ether.dateToPixelOffset(A))); }}; Timeline._Band.prototype.setCenterVisibleDate=function(A){if(!this._changing){this._moveEther(Math.round(this._viewLength/2-this._ether.dateToPixelOffset(A))); }}; Timeline._Band.prototype.dateToPixelOffset=function(A){return this._ether.dateToPixelOffset(A)-this._viewOffset; }; Timeline._Band.prototype.pixelOffsetToDate=function(A){return this._ether.pixelOffsetToDate(A+this._viewOffset); }; Timeline._Band.prototype.createLayerDiv=function(D,B){var C=this._timeline.getDocument().createElement("div"); C.className="timeline-band-layer"+(typeof B=="string"?(" "+B):""); C.style.zIndex=D; this._innerDiv.appendChild(C); var A=this._timeline.getDocument().createElement("div"); A.className="timeline-band-layer-inner"; if(SimileAjax.Platform.browser.isIE){A.style.cursor="move"; }else{A.style.cursor="-moz-grab"; }C.appendChild(A); return A; }; Timeline._Band.prototype.removeLayerDiv=function(A){this._innerDiv.removeChild(A.parentNode); }; Timeline._Band.prototype.scrollToCenter=function(B,C){var A=this._ether.dateToPixelOffset(B); if(A<-this._viewLength/2){this.setCenterVisibleDate(this.pixelOffsetToDate(A+this._viewLength)); }else{if(A>3*this._viewLength/2){this.setCenterVisibleDate(this.pixelOffsetToDate(A-this._viewLength)); }}this._autoScroll(Math.round(this._viewLength/2-this._ether.dateToPixelOffset(B)),C); }; Timeline._Band.prototype.showBubbleForEvent=function(C){var A=this.getEventSource().getEvent(C); if(A){var B=this; this.scrollToCenter(A.getStart(),function(){B._eventPainter.showBubble(A); }); }}; Timeline._Band.prototype.zoom=function(F,A,E,C){if(!this._zoomSteps){return ; }A+=this._viewOffset; var D=this._ether.pixelOffsetToDate(A); var B=this._ether.zoom(F); this._etherPainter.zoom(B); this._moveEther(Math.round(-this._ether.dateToPixelOffset(D))); this._moveEther(A); }; Timeline._Band.prototype._onMouseDown=function(B,A,C){this.closeBubble(); this._dragging=true; this._dragX=A.clientX; this._dragY=A.clientY; }; Timeline._Band.prototype._onMouseMove=function(D,A,E){if(this._dragging){var C=A.clientX-this._dragX; var B=A.clientY-this._dragY; this._dragX=A.clientX; this._dragY=A.clientY; this._moveEther(this._timeline.isHorizontal()?C:B); this._positionHighlight(); }}; Timeline._Band.prototype._onMouseUp=function(B,A,C){this._dragging=false; this._keyboardInput.focus(); }; Timeline._Band.prototype._onMouseOut=function(B,A,D){var C=SimileAjax.DOM.getEventRelativeCoordinates(A,B); C.x+=this._viewOffset; if(C.x<0||C.x>B.offsetWidth||C.y<0||C.y>B.offsetHeight){this._dragging=false; }}; Timeline._Band.prototype._onMouseScroll=function(G,I,E){var A=new Date(); A=A.getTime(); if(!this._lastScrollTime||((A-this._lastScrollTime)>50)){this._lastScrollTime=A; var H=0; if(I.wheelDelta){H=I.wheelDelta/120; }else{if(I.detail){H=-I.detail/3; }}var F=this._theme.mouseWheel; if(this._zoomSteps||F==="zoom"){var D=SimileAjax.DOM.getEventRelativeCoordinates(I,G); if(H!=0){var C; if(H>0){C=true; }if(H<0){C=false; }this._timeline.zoom(C,D.x,D.y,G); }}else{if(F==="scroll"){var B=50*(H<0?-1:1); this._moveEther(B); }}}if(I.stopPropagation){I.stopPropagation(); }I.cancelBubble=true; if(I.preventDefault){I.preventDefault(); }I.returnValue=false; }; Timeline._Band.prototype._onDblClick=function(B,A,D){var C=SimileAjax.DOM.getEventRelativeCoordinates(A,B); var E=C.x-(this._viewLength/2-this._viewOffset); this._autoScroll(-E); }; Timeline._Band.prototype._onKeyDown=function(B,A,C){if(!this._dragging){switch(A.keyCode){case 27:break; case 37:case 38:this._scrollSpeed=Math.min(50,Math.abs(this._scrollSpeed*1.05)); this._moveEther(this._scrollSpeed); break; case 39:case 40:this._scrollSpeed=-Math.min(50,Math.abs(this._scrollSpeed*1.05)); this._moveEther(this._scrollSpeed); break; default:return true; }this.closeBubble(); SimileAjax.DOM.cancelEvent(A); return false; }return true; }; Timeline._Band.prototype._onKeyUp=function(B,A,C){if(!this._dragging){this._scrollSpeed=this._originalScrollSpeed; switch(A.keyCode){case 35:this.setCenterVisibleDate(this._eventSource.getLatestDate()); break; case 36:this.setCenterVisibleDate(this._eventSource.getEarliestDate()); break; case 33:this._autoScroll(this._timeline.getPixelLength()); break; case 34:this._autoScroll(-this._timeline.getPixelLength()); break; default:return true; }this.closeBubble(); SimileAjax.DOM.cancelEvent(A); return false; }return true; }; Timeline._Band.prototype._autoScroll=function(D,C){var A=this; var B=SimileAjax.Graphics.createAnimation(function(E,F){A._moveEther(F); },0,D,1000,C); B.run(); }; Timeline._Band.prototype._moveEther=function(A){this.closeBubble(); if(!this._timeline.shiftOK(this._index,A)){return ; }this._viewOffset+=A; this._ether.shiftPixels(-A); if(this._timeline.isHorizontal()){this._div.style.left=this._viewOffset+"px"; }else{this._div.style.top=this._viewOffset+"px"; }if(this._viewOffset>-this._viewLength*0.5||this._viewOffset<-this._viewLength*(Timeline._Band.SCROLL_MULTIPLES-1.5)){this._recenterDiv(); }else{this.softLayout(); }this._onChanging(); }; Timeline._Band.prototype._onChanging=function(){this._changing=true; this._fireOnScroll(); this._setSyncWithBandDate(); this._changing=false; }; Timeline._Band.prototype.busy=function(){return(this._changing); }; Timeline._Band.prototype._fireOnScroll=function(){for(var A=0; A0){b[O-1].end=Math.max(b[O-1].end,U); }var J=E.height+V.iconBottomMargin+N; while(J>0){b.push({start:B,end:U}); J-=V.trackHeight; }}var P=X.text; var G=this._frc.computeSize(P); var C=G.height+V.labelBottomMargin+N; var F=U+G.width+V.labelRightMargin; if(O>0){b[O-1].end=Math.max(b[O-1].end,F); }for(var W=0; C>0; W++){if(O+W=0){var D=this._timeline.getDocument(); var G=E.event; var B=G.highlightColors[Math.min(A,G.highlightColors.length-1)]; var F=D.createElement("div"); F.style.position="absolute"; F.style.overflow="hidden"; F.style.left=(C.left-2)+"px"; F.style.width=(C.width+4)+"px"; F.style.top=(C.top-2)+"px"; F.style.height=(C.height+4)+"px"; this._highlightLayer.appendChild(F); }}; Timeline.CompactEventPainter.prototype._onClickMultiplePreciseInstantEvent=function(D,E,B){var F=SimileAjax.DOM.getPageCoordinates(D); this._showBubble(F.left+Math.ceil(D.offsetWidth/2),F.top+Math.ceil(D.offsetHeight/2),B); var C=[]; for(var A=0; A0){F=this._unit.later(F,this._startDate); C=this._unit.earlier(C,this._endDate); var D=this._band.dateToPixelOffset(F); var K=this._band.dateToPixelOffset(C); var I=this._timeline.getDocument(); var H=function(){var L=I.createElement("table"); L.insertRow(0).insertCell(0); return L; }; var B=I.createElement("div"); B.className="timeline-highlight-decorator"; if(this._cssClass){B.className+=" "+this._cssClass; }if(this._color!=null){B.style.backgroundColor=this._color; }if(this._opacity<100){SimileAjax.Graphics.setOpacity(B,this._opacity); }this._layerDiv.appendChild(B); var J=H(); J.className="timeline-highlight-label timeline-highlight-label-start"; var G=J.rows[0].cells[0]; G.innerHTML=this._startLabel; if(this._cssClass){G.className="label_"+this._cssClass; }this._layerDiv.appendChild(J); var A=H(); A.className="timeline-highlight-label timeline-highlight-label-end"; var E=A.rows[0].cells[0]; E.innerHTML=this._endLabel; if(this._cssClass){E.className="label_"+this._cssClass; }this._layerDiv.appendChild(A); if(this._timeline.isHorizontal()){B.style.left=D+"px"; B.style.width=(K-D)+"px"; J.style.right=(this._band.getTotalViewLength()-D)+"px"; J.style.width=(this._startLabel.length)+"em"; A.style.left=K+"px"; A.style.width=(this._endLabel.length)+"em"; }else{B.style.top=D+"px"; B.style.height=(K-D)+"px"; J.style.bottom=D+"px"; J.style.height="1.5px"; A.style.top=K+"px"; A.style.height="1.5px"; }}this._layerDiv.style.display="block"; }; Timeline.SpanHighlightDecorator.prototype.softPaint=function(){}; Timeline.PointHighlightDecorator=function(A){this._unit=A.unit!=null?A.unit:SimileAjax.NativeDateUnit; this._date=(typeof A.date=="string")?this._unit.parseFromObject(A.date):A.date; this._width=A.width!=null?A.width:10; this._color=A.color; this._cssClass=A.cssClass!=null?A.cssClass:""; this._opacity=A.opacity!=null?A.opacity:100; }; Timeline.PointHighlightDecorator.prototype.initialize=function(B,A){this._band=B; this._timeline=A; this._layerDiv=null; }; Timeline.PointHighlightDecorator.prototype.paint=function(){if(this._layerDiv!=null){this._band.removeLayerDiv(this._layerDiv); }this._layerDiv=this._band.createLayerDiv(10); this._layerDiv.setAttribute("name","span-highlight-decorator"); this._layerDiv.style.display="none"; var C=this._band.getMinDate(); var E=this._band.getMaxDate(); if(this._unit.compare(this._date,E)<0&&this._unit.compare(this._date,C)>0){var B=this._band.dateToPixelOffset(this._date); var A=B-Math.round(this._width/2); var D=this._timeline.getDocument(); var F=D.createElement("div"); F.className="timeline-highlight-point-decorator"; F.className+=" "+this._cssClass; if(this._color!=null){F.style.backgroundColor=this._color; }if(this._opacity<100){SimileAjax.Graphics.setOpacity(F,this._opacity); }this._layerDiv.appendChild(F); if(this._timeline.isHorizontal()){F.style.left=A+"px"; F.style.width=this._width; }else{F.style.top=A+"px"; F.style.height=this._width; }}this._layerDiv.style.display="block"; }; Timeline.PointHighlightDecorator.prototype.softPaint=function(){}; /* detailed-painter.js */ Timeline.DetailedEventPainter=function(A){this._params=A; this._onSelectListeners=[]; this._filterMatcher=null; this._highlightMatcher=null; this._frc=null; this._eventIdToElmt={}; }; Timeline.DetailedEventPainter.prototype.initialize=function(B,A){this._band=B; this._timeline=A; this._backLayer=null; this._eventLayer=null; this._lineLayer=null; this._highlightLayer=null; this._eventIdToElmt=null; }; Timeline.DetailedEventPainter.prototype.getType=function(){return"detailed"; }; Timeline.DetailedEventPainter.prototype.addOnSelectListener=function(A){this._onSelectListeners.push(A); }; Timeline.DetailedEventPainter.prototype.removeOnSelectListener=function(B){for(var A=0; A=T+G.width){F.solid=I; F.text=T; }else{F.solid=I; T=C+Q.event.label.offsetFromLine; P=this._findFreeTrackForText(D,T+G.width,function(U){U.line=C-2; }); this._getTrackData(P).text=I; this._paintEventLine(K,C,D,P,N,Q); }var R=Math.round(N.trackOffset+P*N.trackIncrement+N.trackHeight/2-G.height/2); var M=this._paintEventLabel(K,J,T,R,G.width,G.height,Q); var L=this; var H=function(U,V,W){return L._onClickInstantEvent(B.elmt,V,K); }; SimileAjax.DOM.registerEvent(B.elmt,"mousedown",H); SimileAjax.DOM.registerEvent(M.elmt,"mousedown",H); this._createHighlightDiv(O,B,Q); this._eventIdToElmt[K.getID()]=B.elmt; }; Timeline.DetailedEventPainter.prototype.paintImpreciseInstantEvent=function(N,Q,V,R){var X=this._timeline.getDocument(); var M=N.getText(); var H=N.getStart(); var S=N.getEnd(); var E=Math.round(this._band.dateToPixelOffset(H)); var B=Math.round(this._band.dateToPixelOffset(S)); var A=Math.round(E+Q.iconWidth/2); var L=Math.round(E-Q.iconWidth/2); var J=this._frc.computeSize(M); var F=this._findFreeTrackForSolid(B,E); var G=this._paintEventTape(N,F,E,B,V.event.instant.impreciseColor,V.event.instant.impreciseOpacity,Q,V); var C=this._paintEventIcon(N,F,L,Q,V); var I=this._getTrackData(F); I.solid=L; var W=A+V.event.label.offsetFromLine; var D=W+J.width; var T; if(DB&&(!(A)||C.line>A)){return D; }}else{this._lowerTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY}); return D; }if(DB&&(!(A)||C.line>A)){return -1-D; }}else{this._upperTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY}); return -1-D; }}}; Timeline.DetailedEventPainter.prototype._findFreeTrackForText=function(D,C,H){var F; var G; var B; var J; if(D<0){F=true; B=-D; G=this._findFreeUpperTrackForText(B,C); J=-1-G; }else{if(D>0){F=false; B=D+1; G=this._findFreeLowerTrackForText(B,C); J=G; }else{var A=this._findFreeUpperTrackForText(0,C); var I=this._findFreeLowerTrackForText(1,C); if(I-1<=A){F=false; B=1; G=I; J=G; }else{F=true; B=0; G=A; J=-1-G; }}}if(F){if(G==this._upperTracks.length){this._upperTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY}); }for(var E=B; E=C){break; }}return A; }; Timeline.DetailedEventPainter.prototype._findFreeUpperTrackForText=function(A,C){for(; A=C){break; }}return A; }; Timeline.DetailedEventPainter.prototype._getTrackData=function(A){return(A<0)?this._upperTracks[-A-1]:this._lowerTracks[A]; }; Timeline.DetailedEventPainter.prototype._paintEventLine=function(I,C,F,A,G,D){var H=Math.round(G.trackOffset+F*G.trackIncrement+G.trackHeight/2); var J=Math.round(Math.abs(A-F)*G.trackIncrement); var E="1px solid "+D.event.label.lineColor; var B=this._timeline.getDocument().createElement("div"); B.style.position="absolute"; B.style.left=C+"px"; B.style.width=D.event.label.offsetFromLine+"px"; B.style.height=J+"px"; if(F>A){B.style.top=(H-J)+"px"; B.style.borderTop=E; }else{B.style.top=H+"px"; B.style.borderBottom=E; }B.style.borderLeft=E; this._lineLayer.appendChild(B); }; Timeline.DetailedEventPainter.prototype._paintEventIcon=function(I,E,B,F,D){var H=I.getIcon(); H=H!=null?H:F.icon; var J=F.trackOffset+E*F.trackIncrement+F.trackHeight/2; var G=Math.round(J-F.iconHeight/2); var C=SimileAjax.Graphics.createTranslucentImage(H); var A=this._timeline.getDocument().createElement("div"); A.style.position="absolute"; A.style.left=B+"px"; A.style.top=G+"px"; A.appendChild(C); A.style.cursor="pointer"; if(I._title!=null){A.title=I._title; }this._eventLayer.appendChild(A); return{left:B,top:G,width:F.iconWidth,height:F.iconHeight,elmt:A}; }; Timeline.DetailedEventPainter.prototype._paintEventLabel=function(H,I,B,F,A,J,D){var G=this._timeline.getDocument(); var K=G.createElement("div"); K.style.position="absolute"; K.style.left=B+"px"; K.style.width=A+"px"; K.style.top=F+"px"; K.style.height=J+"px"; K.style.backgroundColor=D.event.label.backgroundColor; SimileAjax.Graphics.setOpacity(K,D.event.label.backgroundOpacity); this._eventLayer.appendChild(K); var E=G.createElement("div"); E.style.position="absolute"; E.style.left=B+"px"; E.style.width=A+"px"; E.style.top=F+"px"; E.innerHTML=I; E.style.cursor="pointer"; if(H._title!=null){E.title=H._title; }var C=H.getTextColor(); if(C==null){C=H.getColor(); }if(C!=null){E.style.color=C; }this._eventLayer.appendChild(E); return{left:B,top:F,width:A,height:J,elmt:E}; }; Timeline.DetailedEventPainter.prototype._paintEventTape=function(L,H,E,A,C,G,I,F){var B=A-E; var D=F.event.tape.height; var M=I.trackOffset+H*I.trackIncrement+I.trackHeight/2; var J=Math.round(M-D/2); var K=this._timeline.getDocument().createElement("div"); K.style.position="absolute"; K.style.left=E+"px"; K.style.width=B+"px"; K.style.top=J+"px"; K.style.height=D+"px"; K.style.backgroundColor=C; K.style.overflow="hidden"; K.style.cursor="pointer"; if(L._title!=null){K.title=L._title; }SimileAjax.Graphics.setOpacity(K,G); this._eventLayer.appendChild(K); return{left:E,top:J,width:B,height:D,elmt:K}; }; Timeline.DetailedEventPainter.prototype._createHighlightDiv=function(A,C,E){if(A>=0){var D=this._timeline.getDocument(); var G=E.event; var B=G.highlightColors[Math.min(A,G.highlightColors.length-1)]; var F=D.createElement("div"); F.style.position="absolute"; F.style.overflow="hidden"; F.style.left=(C.left-2)+"px"; F.style.width=(C.width+4)+"px"; F.style.top=(C.top-2)+"px"; F.style.height=(C.height+4)+"px"; F.style.background=B; this._highlightLayer.appendChild(F); }}; Timeline.DetailedEventPainter.prototype._onClickInstantEvent=function(B,C,A){var D=SimileAjax.DOM.getPageCoordinates(B); this._showBubble(D.left+Math.ceil(B.offsetWidth/2),D.top+Math.ceil(B.offsetHeight/2),A); this._fireOnSelect(A.getID()); C.cancelBubble=true; SimileAjax.DOM.cancelEvent(C); return false; }; Timeline.DetailedEventPainter.prototype._onClickDurationEvent=function(D,C,B){if("pageX" in C){var A=C.pageX; var F=C.pageY; }else{var E=SimileAjax.DOM.getPageCoordinates(D); var A=C.offsetX+E.left; var F=C.offsetY+E.top; }this._showBubble(A,F,B); this._fireOnSelect(B.getID()); C.cancelBubble=true; SimileAjax.DOM.cancelEvent(C); return false; }; Timeline.DetailedEventPainter.prototype.showBubble=function(A){var B=this._eventIdToElmt[A.getID()]; if(B){var C=SimileAjax.DOM.getPageCoordinates(B); this._showBubble(C.left+B.offsetWidth/2,C.top+B.offsetHeight/2,A); }}; Timeline.DetailedEventPainter.prototype._showBubble=function(A,E,B){var D=document.createElement("div"); var C=this._params.theme.event.bubble; B.fillInfoBubble(D,this._params.theme,this._band.getLabeller()); SimileAjax.WindowManager.cancelPopups(); SimileAjax.Graphics.createBubbleForContentAndPoint(D,A,E,C.width,null,C.maxHeight); }; Timeline.DetailedEventPainter.prototype._fireOnSelect=function(B){for(var A=0; AD; C++){var A=this._zones[C]; if(DA.startTime){this._zones.splice(C,0,{startTime:A.startTime,endTime:D,unit:A.unit,multiple:A.multiple}); C++; A.startTime=D; }if(F=0){if(A.getTime()>this._zones[E].startTime){break; }E--; }for(var H=C; H<=E; H++){var G=this._zones[H]; var J=new Date(Math.max(D.getTime(),G.startTime)); var F=new Date(Math.min(A.getTime(),G.endTime)); SimileAjax.DateTime.roundDownToInterval(J,G.unit,K,G.multiple,this._theme.firstDayOfWeek); SimileAjax.DateTime.roundUpToInterval(F,G.unit,K,G.multiple,this._theme.firstDayOfWeek); while(J.getTime()0)){C=A-1; }if(!D&&(A<(this._band._zoomSteps.length-1))){C=A+1; }this._band._zoomIndex=C; this._interval=SimileAjax.DateTime.gregorianUnitLengths[this._band._zoomSteps[C].unit]; this._pixelsPerInterval=this._band._zoomSteps[C].pixelsPerInterval; B=this._band._zoomSteps[C].unit-this._band._zoomSteps[A].unit; return B; }; Timeline.HotZoneEther=function(A){this._params=A; this._interval=A.interval; this._pixelsPerInterval=A.pixelsPerInterval; this._theme=A.theme; }; Timeline.HotZoneEther.prototype.initialize=function(H,I){this._band=H; this._timeline=I; this._unit=I.getUnit(); this._zones=[{startTime:Number.NEGATIVE_INFINITY,endTime:Number.POSITIVE_INFINITY,magnify:1}]; var B=this._params; for(var D=0; D0; C++){var A=this._zones[C]; if(this._unit.compare(E,A.endTime)<0){if(this._unit.compare(E,A.startTime)>0){this._zones.splice(C,0,{startTime:A.startTime,endTime:E,magnify:A.magnify}); C++; A.startTime=E; }if(this._unit.compare(F,A.endTime)<0){this._zones.splice(C,0,{startTime:E,endTime:F,magnify:G.magnify*A.magnify}); C++; A.startTime=F; E=F; }else{A.magnify*=G.magnify; E=A.endTime; }}}}if("startsOn" in this._params){this._start=this._unit.parseFromObject(this._params.startsOn); }else{if("endsOn" in this._params){this._start=this._unit.parseFromObject(this._params.endsOn); this.shiftPixels(-this._timeline.getPixelLength()); }else{if("centersOn" in this._params){this._start=this._unit.parseFromObject(this._params.centersOn); this.shiftPixels(-this._timeline.getPixelLength()/2); }else{this._start=this._unit.makeDefaultValue(); this.shiftPixels(-this._timeline.getPixelLength()/2); }}}}; Timeline.HotZoneEther.prototype.setDate=function(A){this._start=this._unit.cloneValue(A); }; Timeline.HotZoneEther.prototype.shiftPixels=function(A){this._start=this.pixelOffsetToDate(A); }; Timeline.HotZoneEther.prototype.dateToPixelOffset=function(A){return this._dateDiffToPixelOffset(this._start,A); }; Timeline.HotZoneEther.prototype.pixelOffsetToDate=function(A){return this._pixelOffsetToDate(A,this._start); }; Timeline.HotZoneEther.prototype.zoom=function(D){var B=0; var A=this._band._zoomIndex; var C=A; if(D&&(A>0)){C=A-1; }if(!D&&(A<(this._band._zoomSteps.length-1))){C=A+1; }this._band._zoomIndex=C; this._interval=SimileAjax.DateTime.gregorianUnitLengths[this._band._zoomSteps[C].unit]; this._pixelsPerInterval=this._band._zoomSteps[C].pixelsPerInterval; B=this._band._zoomSteps[C].unit-this._band._zoomSteps[A].unit; return B; }; Timeline.HotZoneEther.prototype._dateDiffToPixelOffset=function(I,D){var B=this._getScale(); var H=I; var C=D; var A=0; if(this._unit.compare(H,C)<0){var G=0; while(G=0){if(this._unit.compare(H,this._zones[G].startTime)>0){break; }G--; }while(this._unit.compare(H,C)>0){var E=this._zones[G]; var F=this._unit.later(C,E.startTime); A+=(this._unit.compare(F,H)/(B/E.magnify)); H=F; G--; }}return A; }; Timeline.HotZoneEther.prototype._pixelOffsetToDate=function(H,C){var G=this._getScale(); var E=C; if(H>0){var F=0; while(F0){var A=this._zones[F]; var D=G/A.magnify; if(A.endTime==Number.POSITIVE_INFINITY){E=this._unit.change(E,H*D); H=0; }else{var B=this._unit.compare(A.endTime,E)/D; if(B>H){E=this._unit.change(E,H*D); H=0; }else{E=A.endTime; H-=B; }}F++; }}else{var F=this._zones.length-1; while(F>=0){if(this._unit.compare(E,this._zones[F].startTime)>0){break; }F--; }H=-H; while(H>0){var A=this._zones[F]; var D=G/A.magnify; if(A.startTime==Number.NEGATIVE_INFINITY){E=this._unit.change(E,-H*D); H=0; }else{var B=this._unit.compare(E,A.startTime)/D; if(B>H){E=this._unit.change(E,-H*D); H=0; }else{E=A.startTime; H-=B; }}F--; }}return E; }; Timeline.HotZoneEther.prototype._getScale=function(){return this._interval/this._pixelsPerInterval; }; /* event-utils.js */ Timeline.EventUtils={}; Timeline.EventUtils.getNewEventID=function(){if(this._lastEventID==null){this._lastEventID=0; }this._lastEventID+=1; return"e"+this._lastEventID; }; Timeline.EventUtils.decodeEventElID=function(B){var D=B.split("-"); if(D[1]!="tl"){alert("Internal Timeline problem 101, please consult support"); return{band:null,evt:null}; }var C=Timeline.getTimelineFromID(D[2]); var E=C.getBand(D[3]); var A=E.getEventSource.getEvent(D[4]); return{band:E,evt:A}; }; Timeline.EventUtils.encodeEventElID=function(C,D,B,A){return B+"-tl-"+C.timelineID+"-"+D.getIndex()+"-"+A.getID(); }; /* labellers.js */ Timeline.GregorianDateLabeller=function(A,B){this._locale=A; this._timeZone=B; }; Timeline.GregorianDateLabeller.monthNames=[]; Timeline.GregorianDateLabeller.dayNames=[]; Timeline.GregorianDateLabeller.labelIntervalFunctions=[]; Timeline.GregorianDateLabeller.getMonthName=function(B,A){return Timeline.GregorianDateLabeller.monthNames[A][B]; }; Timeline.GregorianDateLabeller.prototype.labelInterval=function(A,C){var B=Timeline.GregorianDateLabeller.labelIntervalFunctions[this._locale]; if(B==null){B=Timeline.GregorianDateLabeller.prototype.defaultLabelInterval; }return B.call(this,A,C); }; Timeline.GregorianDateLabeller.prototype.labelPrecise=function(A){return SimileAjax.DateTime.removeTimeZoneOffset(A,this._timeZone).toUTCString(); }; Timeline.GregorianDateLabeller.prototype.defaultLabelInterval=function(B,F){var C; var E=false; B=SimileAjax.DateTime.removeTimeZoneOffset(B,this._timeZone); switch(F){case SimileAjax.DateTime.MILLISECOND:C=B.getUTCMilliseconds(); break; case SimileAjax.DateTime.SECOND:C=B.getUTCSeconds(); break; case SimileAjax.DateTime.MINUTE:var A=B.getUTCMinutes(); if(A==0){C=B.getUTCHours()+":00"; E=true; }else{C=A; }break; case SimileAjax.DateTime.HOUR:C=B.getUTCHours()+"hr"; break; case SimileAjax.DateTime.DAY:C=Timeline.GregorianDateLabeller.getMonthName(B.getUTCMonth(),this._locale)+" "+B.getUTCDate(); break; case SimileAjax.DateTime.WEEK:C=Timeline.GregorianDateLabeller.getMonthName(B.getUTCMonth(),this._locale)+" "+B.getUTCDate(); break; case SimileAjax.DateTime.MONTH:var A=B.getUTCMonth(); if(A!=0){C=Timeline.GregorianDateLabeller.getMonthName(A,this._locale); break; }case SimileAjax.DateTime.YEAR:case SimileAjax.DateTime.DECADE:case SimileAjax.DateTime.CENTURY:case SimileAjax.DateTime.MILLENNIUM:var D=B.getUTCFullYear(); if(D>0){C=B.getUTCFullYear(); }else{C=(1-D)+"BC"; }E=(F==SimileAjax.DateTime.MONTH)||(F==SimileAjax.DateTime.DECADE&&D%100==0)||(F==SimileAjax.DateTime.CENTURY&&D%1000==0); break; default:C=B.toUTCString(); }return{text:C,emphasized:E}; }; /* original-painter.js */ Timeline.OriginalEventPainter=function(A){this._params=A; this._onSelectListeners=[]; this._eventPaintListeners=[]; this._filterMatcher=null; this._highlightMatcher=null; this._frc=null; this._eventIdToElmt={}; }; Timeline.OriginalEventPainter.prototype.initialize=function(B,A){this._band=B; this._timeline=A; this._backLayer=null; this._eventLayer=null; this._lineLayer=null; this._highlightLayer=null; this._eventIdToElmt=null; }; Timeline.OriginalEventPainter.prototype.getType=function(){return"original"; }; Timeline.OriginalEventPainter.prototype.addOnSelectListener=function(A){this._onSelectListeners.push(A); }; Timeline.OriginalEventPainter.prototype.removeOnSelectListener=function(B){for(var A=0; AA){break; }}return C; }; Timeline.OriginalEventPainter.prototype._paintEventIcon=function(J,F,B,G,E,C){var I=J.getIcon(); I=I!=null?I:G.icon; var H; if(C>0){H=G.trackOffset+F*G.trackIncrement+C+G.impreciseIconMargin; }else{var K=G.trackOffset+F*G.trackIncrement+G.trackHeight/2; H=Math.round(K-G.iconHeight/2); }var D=SimileAjax.Graphics.createTranslucentImage(I); var A=this._timeline.getDocument().createElement("div"); A.className=this._getElClassName("timeline-event-icon",J,"icon"); A.id=this._encodeEventElID("icon",J); A.style.left=B+"px"; A.style.top=H+"px"; A.appendChild(D); if(J._title!=null){A.title=J._title; }this._eventLayer.appendChild(A); return{left:B,top:H,width:G.iconWidth,height:G.iconHeight,elmt:A}; }; Timeline.OriginalEventPainter.prototype._paintEventLabel=function(J,K,C,H,A,L,E,F,B){var I=this._timeline.getDocument(); var G=I.createElement("div"); G.className=F; G.id=this._encodeEventElID("label",J); G.style.left=C+"px"; G.style.width=A+"px"; G.style.top=H+"px"; G.innerHTML=K; if(J._title!=null){G.title=J._title; }var D=J.getTextColor(); if(D==null){D=J.getColor(); }if(D!=null){G.style.color=D; }if(E.event.highlightLabelBackground&&B>=0){G.style.background=this._getHighlightColor(B,E); }this._eventLayer.appendChild(G); return{left:C,top:H,width:A,height:L,elmt:G}; }; Timeline.OriginalEventPainter.prototype._paintEventTape=function(N,I,F,A,C,H,J,G,O){var B=A-F; var E=G.event.tape.height; var K=J.trackOffset+I*J.trackIncrement; var M=this._timeline.getDocument().createElement("div"); M.className=this._getElClassName("timeline-event-tape",N,"tape"); M.id=this._encodeEventElID("tape"+O,N); M.style.left=F+"px"; M.style.width=B+"px"; M.style.height=E+"px"; M.style.top=K+"px"; if(N._title!=null){M.title=N._title; }if(C!=null){M.style.backgroundColor=C; }var L=N.getTapeImage(); var D=N.getTapeRepeat(); D=D!=null?D:"repeat"; if(L!=null){M.style.backgroundImage="url("+L+")"; M.style.backgroundRepeat=D; }SimileAjax.Graphics.setOpacity(M,H); this._eventLayer.appendChild(M); return{left:F,top:K,width:B,height:E,elmt:M}; }; Timeline.OriginalEventPainter.prototype._getLabelDivClassName=function(A){return this._getElClassName("timeline-event-label",A,"label"); }; Timeline.OriginalEventPainter.prototype._getElClassName=function(B,A,D){var E=A.getClassName(),C=[]; if(E){if(D){C.push(D+"-"+E+" "); }C.push(E+" "); }C.push(B); return(C.join("")); }; Timeline.OriginalEventPainter.prototype._getHighlightColor=function(A,C){var B=C.event.highlightColors; return B[Math.min(A,B.length-1)]; }; Timeline.OriginalEventPainter.prototype._createHighlightDiv=function(A,D,F,B){var G=null; if(A>=0){var E=this._timeline.getDocument(); var C=this._getHighlightColor(A,F); G=E.createElement("div"); G.className=this._getElClassName("timeline-event-highlight",B,"highlight"); G.id=this._encodeEventElID("highlight0",B); G.style.position="absolute"; G.style.overflow="hidden"; G.style.left=(D.left-2)+"px"; G.style.width=(D.width+4)+"px"; G.style.top=(D.top-2)+"px"; G.style.height=(D.height+4)+"px"; G.style.background=C; this._highlightLayer.appendChild(G); }return G; }; Timeline.OriginalEventPainter.prototype._onClickInstantEvent=function(B,C,A){var D=SimileAjax.DOM.getPageCoordinates(B); this._showBubble(D.left+Math.ceil(B.offsetWidth/2),D.top+Math.ceil(B.offsetHeight/2),A); this._fireOnSelect(A.getID()); C.cancelBubble=true; SimileAjax.DOM.cancelEvent(C); return false; }; Timeline.OriginalEventPainter.prototype._onClickDurationEvent=function(D,C,B){if("pageX" in C){var A=C.pageX; var F=C.pageY; }else{var E=SimileAjax.DOM.getPageCoordinates(D); var A=C.offsetX+E.left; var F=C.offsetY+E.top; }this._showBubble(A,F,B); this._fireOnSelect(B.getID()); C.cancelBubble=true; SimileAjax.DOM.cancelEvent(C); return false; }; Timeline.OriginalEventPainter.prototype.showBubble=function(A){var B=this._eventIdToElmt[A.getID()]; if(B){var C=SimileAjax.DOM.getPageCoordinates(B); this._showBubble(C.left+B.offsetWidth/2,C.top+B.offsetHeight/2,A); }}; Timeline.OriginalEventPainter.prototype._showBubble=function(A,E,B){var D=document.createElement("div"); var C=this._params.theme.event.bubble; B.fillInfoBubble(D,this._params.theme,this._band.getLabeller()); SimileAjax.WindowManager.cancelPopups(); SimileAjax.Graphics.createBubbleForContentAndPoint(D,A,E,C.width,null,C.maxHeight); }; Timeline.OriginalEventPainter.prototype._fireOnSelect=function(B){for(var A=0; A=0){var D=this._timeline.getDocument(); var G=E.event; var B=G.highlightColors[Math.min(A,G.highlightColors.length-1)]; var F=D.createElement("div"); F.style.position="absolute"; F.style.overflow="hidden"; F.style.left=(C.left-1)+"px"; F.style.width=(C.width+2)+"px"; F.style.top=(C.top-1)+"px"; F.style.height=(C.height+2)+"px"; F.style.background=B; this._highlightLayer.appendChild(F); }}; Timeline.OverviewEventPainter.prototype.showBubble=function(A){}; /* sources.js */ Timeline.DefaultEventSource=function(A){this._events=(A instanceof Object)?A:new SimileAjax.EventIndex(); this._listeners=[]; }; Timeline.DefaultEventSource.prototype.addListener=function(A){this._listeners.push(A); }; Timeline.DefaultEventSource.prototype.removeListener=function(B){for(var A=0; A0){return A; }else{if(A.substr(0,1)=="/"){return B.substr(0,B.indexOf("/",B.indexOf("://")+3))+A; }else{return B+A; }}}}; Timeline.DefaultEventSource.Event=function(A){function D(E){return(A[E]!=null&&A[E]!="")?A[E]:null; }var C=A.id?A.id.trim():""; this._id=C.length>0?C:Timeline.EventUtils.getNewEventID(); this._instant=A.instant||(A.end==null); this._start=A.start; this._end=(A.end!=null)?A.end:A.start; this._latestStart=(A.latestStart!=null)?A.latestStart:(A.instant?this._end:this._start); this._earliestEnd=(A.earliestEnd!=null)?A.earliestEnd:this._end; var B=[]; if(this._start>this._latestStart){this._latestStart=this._start; B.push("start is > latestStart"); }if(this._start>this._earliestEnd){this._earliestEnd=this._latestStart; B.push("start is > earliestEnd"); }if(this._start>this._end){this._end=this._earliestEnd; B.push("start is > end"); }if(this._latestStart>this._earliestEnd){this._earliestEnd=this._latestStart; B.push("latestStart is > earliestEnd"); }if(this._latestStart>this._end){this._end=this._earliestEnd; B.push("latestStart is > end"); }if(this._earliestEnd>this._end){this._end=this._earliestEnd; B.push("earliestEnd is > end"); }this._eventID=D("eventID"); this._text=(A.text!=null)?SimileAjax.HTML.deEntify(A.text):""; if(B.length>0){this._text+=" PROBLEM: "+B.join(", "); }this._description=SimileAjax.HTML.deEntify(A.description); this._image=D("image"); this._link=D("link"); this._title=D("hoverText"); this._title=D("caption"); this._icon=D("icon"); this._color=D("color"); this._textColor=D("textColor"); this._classname=D("classname"); this._tapeImage=D("tapeImage"); this._tapeRepeat=D("tapeRepeat"); this._trackNum=D("trackNum"); if(this._trackNum!=null){this._trackNum=parseInt(this._trackNum); }this._wikiURL=null; this._wikiSection=null; }; Timeline.DefaultEventSource.Event.prototype={getID:function(){return this._id; },isInstant:function(){return this._instant; },isImprecise:function(){return this._start!=this._latestStart||this._end!=this._earliestEnd; },getStart:function(){return this._start; },getEnd:function(){return this._end; },getLatestStart:function(){return this._latestStart; },getEarliestEnd:function(){return this._earliestEnd; },getEventID:function(){return this._eventID; },getText:function(){return this._text; },getDescription:function(){return this._description; },getImage:function(){return this._image; },getLink:function(){return this._link; },getIcon:function(){return this._icon; },getColor:function(){return this._color; },getTextColor:function(){return this._textColor; },getClassName:function(){return this._classname; },getTapeImage:function(){return this._tapeImage; },getTapeRepeat:function(){return this._tapeRepeat; },getTrackNum:function(){return this._trackNum; },getProperty:function(A){return null; },getWikiURL:function(){return this._wikiURL; },getWikiSection:function(){return this._wikiSection; },setWikiInfo:function(B,A){this._wikiURL=B; this._wikiSection=A; },fillDescription:function(A){A.innerHTML=this._description; },fillWikiInfo:function(D){D.style.display="none"; if(this._wikiURL==null||this._wikiSection==null){return ; }var C=this.getProperty("wikiID"); if(C==null||C.length==0){C=this.getText(); }if(C==null||C.length==0){return ; }D.style.display="inline"; C=C.replace(/\s/g,"_"); var B=this._wikiURL+this._wikiSection.replace(/\s/g,"_")+"/"+C; var A=document.createElement("a"); A.href=B; A.target="new"; A.innerHTML=Timeline.strings[Timeline.clientLocale].wikiLinkLabel; D.appendChild(document.createTextNode("[")); D.appendChild(A); D.appendChild(document.createTextNode("]")); },fillTime:function(A,B){if(this._instant){if(this.isImprecise()){A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start))); A.appendChild(A.ownerDocument.createElement("br")); A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._end))); }else{A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start))); }}else{if(this.isImprecise()){A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start)+" ~ "+B.labelPrecise(this._latestStart))); A.appendChild(A.ownerDocument.createElement("br")); A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._earliestEnd)+" ~ "+B.labelPrecise(this._end))); }else{A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start))); A.appendChild(A.ownerDocument.createElement("br")); A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._end))); }}},fillInfoBubble:function(A,D,K){var L=A.ownerDocument; var J=this.getText(); var H=this.getLink(); var C=this.getImage(); if(C!=null){var E=L.createElement("img"); E.src=C; D.event.bubble.imageStyler(E); A.appendChild(E); }var M=L.createElement("div"); var B=L.createTextNode(J); if(H!=null){var I=L.createElement("a"); I.href=H; I.appendChild(B); M.appendChild(I); }else{M.appendChild(B); }D.event.bubble.titleStyler(M); A.appendChild(M); var N=L.createElement("div"); this.fillDescription(N); D.event.bubble.bodyStyler(N); A.appendChild(N); var G=L.createElement("div"); this.fillTime(G,K); D.event.bubble.timeStyler(G); A.appendChild(G); var F=L.createElement("div"); this.fillWikiInfo(F); D.event.bubble.wikiStyler(F); A.appendChild(F); }}; /* themes.js */ Timeline.ClassicTheme=new Object(); Timeline.ClassicTheme.implementations=[]; Timeline.ClassicTheme.create=function(A){if(A==null){A=Timeline.getDefaultLocale(); }var B=Timeline.ClassicTheme.implementations[A]; if(B==null){B=Timeline.ClassicTheme._Impl; }return new B(); }; Timeline.ClassicTheme._Impl=function(){this.firstDayOfWeek=0; this.autoWidth=false; this.autoWidthAnimationTime=500; this.timeline_start=null; this.timeline_stop=null; this.ether={backgroundColors:[],highlightOpacity:50,interval:{line:{show:true,opacity:25},weekend:{opacity:30},marker:{hAlign:"Bottom",vAlign:"Right"}}}; this.event={track:{height:10,gap:2,offset:2,autoWidthMargin:1.5},overviewTrack:{offset:20,tickHeight:6,height:2,gap:1,autoWidthMargin:5},tape:{height:4},instant:{icon:Timeline.urlPrefix+"images/dull-blue-circle.png",iconWidth:10,iconHeight:10,impreciseOpacity:20,impreciseIconMargin:3},duration:{impreciseOpacity:20},label:{backgroundOpacity:50,offsetFromLine:3},highlightColors:["#FFFF00","#FFC000","#FF0000","#0000FF"],highlightLabelBackground:false,bubble:{width:250,maxHeight:0,titleStyler:function(A){A.className="timeline-event-bubble-title"; },bodyStyler:function(A){A.className="timeline-event-bubble-body"; },imageStyler:function(A){A.className="timeline-event-bubble-image"; },wikiStyler:function(A){A.className="timeline-event-bubble-wiki"; },timeStyler:function(A){A.className="timeline-event-bubble-time"; }}}; this.mouseWheel="scroll"; }; /* timeline.js */ Timeline.version="2.3.1"; Timeline.ajax_lib_version=SimileAjax.version; Timeline.display_version=Timeline.version+" (with Ajax lib "+Timeline.ajax_lib_version+")"; Timeline.strings={}; Timeline.HORIZONTAL=0; Timeline.VERTICAL=1; Timeline._defaultTheme=null; Timeline.getDefaultLocale=function(){return Timeline.clientLocale; }; Timeline.create=function(D,C,B,F){if(Timeline.timelines==null){Timeline.timelines=[]; }var A=Timeline.timelines.length; Timeline.timelines[A]=null; var E=new Timeline._Impl(D,C,B,F,A); Timeline.timelines[A]=E; return E; }; Timeline.createBandInfo=function(D){var E=("theme" in D)?D.theme:Timeline.getDefaultTheme(); var B=("eventSource" in D)?D.eventSource:null; var F=new Timeline.LinearEther({centersOn:("date" in D)?D.date:new Date(),interval:SimileAjax.DateTime.gregorianUnitLengths[D.intervalUnit],pixelsPerInterval:D.intervalPixels,theme:E}); var G=new Timeline.GregorianEtherPainter({unit:D.intervalUnit,multiple:("multiple" in D)?D.multiple:1,theme:E,align:("align" in D)?D.align:undefined}); var I={showText:("showEventText" in D)?D.showEventText:true,theme:E}; if("eventPainterParams" in D){for(var A in D.eventPainterParams){I[A]=D.eventPainterParams[A]; }}if("trackHeight" in D){I.trackHeight=D.trackHeight; }if("trackGap" in D){I.trackGap=D.trackGap; }var H=("overview" in D&&D.overview)?"overview":("layout" in D?D.layout:"original"); var C; if("eventPainter" in D){C=new D.eventPainter(I); }else{switch(H){case"overview":C=new Timeline.OverviewEventPainter(I); break; case"detailed":C=new Timeline.DetailedEventPainter(I); break; default:C=new Timeline.OriginalEventPainter(I); }}return{width:D.width,eventSource:B,timeZone:("timeZone" in D)?D.timeZone:0,ether:F,etherPainter:G,eventPainter:C,theme:E,zoomIndex:("zoomIndex" in D)?D.zoomIndex:0,zoomSteps:("zoomSteps" in D)?D.zoomSteps:null}; }; Timeline.createHotZoneBandInfo=function(D){var E=("theme" in D)?D.theme:Timeline.getDefaultTheme(); var B=("eventSource" in D)?D.eventSource:null; var F=new Timeline.HotZoneEther({centersOn:("date" in D)?D.date:new Date(),interval:SimileAjax.DateTime.gregorianUnitLengths[D.intervalUnit],pixelsPerInterval:D.intervalPixels,zones:D.zones,theme:E}); var G=new Timeline.HotZoneGregorianEtherPainter({unit:D.intervalUnit,zones:D.zones,theme:E,align:("align" in D)?D.align:undefined}); var I={showText:("showEventText" in D)?D.showEventText:true,theme:E}; if("eventPainterParams" in D){for(var A in D.eventPainterParams){I[A]=D.eventPainterParams[A]; }}if("trackHeight" in D){I.trackHeight=D.trackHeight; }if("trackGap" in D){I.trackGap=D.trackGap; }var H=("overview" in D&&D.overview)?"overview":("layout" in D?D.layout:"original"); var C; if("eventPainter" in D){C=new D.eventPainter(I); }else{switch(H){case"overview":C=new Timeline.OverviewEventPainter(I); break; case"detailed":C=new Timeline.DetailedEventPainter(I); break; default:C=new Timeline.OriginalEventPainter(I); }}return{width:D.width,eventSource:B,timeZone:("timeZone" in D)?D.timeZone:0,ether:F,etherPainter:G,eventPainter:C,theme:E,zoomIndex:("zoomIndex" in D)?D.zoomIndex:0,zoomSteps:("zoomSteps" in D)?D.zoomSteps:null}; }; Timeline.getDefaultTheme=function(){if(Timeline._defaultTheme==null){Timeline._defaultTheme=Timeline.ClassicTheme.create(Timeline.getDefaultLocale()); }return Timeline._defaultTheme; }; Timeline.setDefaultTheme=function(A){Timeline._defaultTheme=A; }; Timeline.loadXML=function(A,C){var D=function(G,E,F){alert("Failed to load data xml from "+A+"\n"+G); }; var B=function(F){var E=F.responseXML; if(!E.documentElement&&F.responseStream){E.load(F.responseStream); }C(E,A); }; SimileAjax.XmlHttp.get(A,D,B); }; Timeline.loadJSON=function(url,f){var fError=function(statusText,status,xmlhttp){alert("Failed to load json data from "+url+"\n"+statusText); }; var fDone=function(xmlhttp){f(eval("("+xmlhttp.responseText+")"),url); }; SimileAjax.XmlHttp.get(url,fError,fDone); }; Timeline.getTimelineFromID=function(A){return Timeline.timelines[A]; }; Timeline.writeVersion=function(A){document.getElementById(A).innerHTML=this.display_version; }; Timeline._Impl=function(D,C,B,E,A){SimileAjax.WindowManager.initialize(); this._containerDiv=D; this._bandInfos=C; this._orientation=B==null?Timeline.HORIZONTAL:B; this._unit=(E!=null)?E:SimileAjax.NativeDateUnit; this._starting=true; this._autoResizing=false; this.autoWidth=C&&C[0]&&C[0].theme&&C[0].theme.autoWidth; this.autoWidthAnimationTime=C&&C[0]&&C[0].theme&&C[0].theme.autoWidthAnimationTime; this.timelineID=A; this.timeline_start=C&&C[0]&&C[0].theme&&C[0].theme.timeline_start; this.timeline_stop=C&&C[0]&&C[0].theme&&C[0].theme.timeline_stop; this.timeline_at_start=false; this.timeline_at_stop=false; this._initialize(); }; Timeline._Impl.prototype.dispose=function(){for(var A=0; AG||C){D=I; A(); E._distributeWidths(); }}if(!E.autoWidth){return ; }F(); }; Timeline._Impl.prototype._initialize=function(){var H=this._containerDiv; var E=H.ownerDocument; H.className=H.className.split(" ").concat("timeline-container").join(" "); var B=(this.isHorizontal())?"horizontal":"vertical"; H.className+=" timeline-"+B; while(H.firstChild){H.removeChild(H.firstChild); }var A=SimileAjax.Graphics.createTranslucentImage(Timeline.urlPrefix+(this.isHorizontal()?"images/copyright-vertical.png":"images/copyright.png")); A.className="timeline-copyright"; A.title="Timeline copyright SIMILE - www.simile-widgets.org/"; SimileAjax.DOM.registerEvent(A,"click",function(){window.location="http://www.simile-widgets.org/"; }); H.appendChild(A); this._bands=[]; for(var C=0; C Loading..."; this.showLoadingMessage=function(){D.containerDiv.style.display="block"; }; this.hideLoadingMessage=function(){D.containerDiv.style.display="none"; }; }; Timeline._Impl.prototype._distributeWidths=function(){var B=this.getPixelLength(); var A=this.getPixelWidth(); var C=0; for(var E=0; E0){var G=parseInt(F.substr(0,H)); D=Math.round(G*A/100); }else{D=parseInt(F); }}else{D=F; }I.setBandShiftAndWidth(C,D); I.setViewLength(B); C+=D; }}; Timeline._Impl.prototype.shiftOK=function(D,B){var C=B>0,A=B<0; if((C&&this.timeline_start==null)||(A&&this.timeline_stop==null)||(B==0)){return(true); }var G=false; for(var F=0; F=this.timeline_start; }else{E=(F==D?H.getMaxVisibleDateAfterDelta(B):H.getMaxVisibleDate())<=this.timeline_stop; }}if(C){this.timeline_at_start=!E; this.timeline_at_stop=false; }else{this.timeline_at_stop=!E; this.timeline_at_start=false; }return(E); }; Timeline._Impl.prototype.zoom=function(G,B,F,D){var C=new RegExp("^timeline-band-([0-9]+)$"); var E=null; var A=C.exec(D.id); if(A){E=parseInt(A[1]); }if(E!=null){this._bands[E].zoom(G,B,F,D); }this.paint(); }; /* units.js */ Timeline.NativeDateUnit=new Object(); Timeline.NativeDateUnit.createLabeller=function(A,B){return new Timeline.GregorianDateLabeller(A,B); }; Timeline.NativeDateUnit.makeDefaultValue=function(){return new Date(); }; Timeline.NativeDateUnit.cloneValue=function(A){return new Date(A.getTime()); }; Timeline.NativeDateUnit.getParser=function(A){if(typeof A=="string"){A=A.toLowerCase(); }return(A=="iso8601"||A=="iso 8601")?Timeline.DateTime.parseIso8601DateTime:Timeline.DateTime.parseGregorianDateTime; }; Timeline.NativeDateUnit.parseFromObject=function(A){return Timeline.DateTime.parseGregorianDateTime(A); }; Timeline.NativeDateUnit.toNumber=function(A){return A.getTime(); }; Timeline.NativeDateUnit.fromNumber=function(A){return new Date(A); }; Timeline.NativeDateUnit.compare=function(D,C){var B,A; if(typeof D=="object"){B=D.getTime(); }else{B=Number(D); }if(typeof C=="object"){A=C.getTime(); }else{A=Number(C); }return B-A; }; Timeline.NativeDateUnit.earlier=function(B,A){return Timeline.NativeDateUnit.compare(B,A)<0?B:A; }; Timeline.NativeDateUnit.later=function(B,A){return Timeline.NativeDateUnit.compare(B,A)>0?B:A; }; Timeline.NativeDateUnit.change=function(A,B){return new Date(A.getTime()+B); };