muruca_widgets 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. data/LICENSE +20 -0
  2. data/README.rdoc +12 -0
  3. data/generators/colorbox/colorbox_generator.rb +21 -0
  4. data/generators/colorbox/templates/README +10 -0
  5. data/generators/colorbox/templates/_colorbox.html.erb +10 -0
  6. data/generators/colorbox/templates/colorbox/colorbox.css +62 -0
  7. data/generators/colorbox/templates/colorbox/images/border.png +0 -0
  8. data/generators/colorbox/templates/colorbox/images/controls.png +0 -0
  9. data/generators/colorbox/templates/colorbox/images/internet_explorer/borderBottomCenter.png +0 -0
  10. data/generators/colorbox/templates/colorbox/images/internet_explorer/borderBottomLeft.png +0 -0
  11. data/generators/colorbox/templates/colorbox/images/internet_explorer/borderBottomRight.png +0 -0
  12. data/generators/colorbox/templates/colorbox/images/internet_explorer/borderMiddleLeft.png +0 -0
  13. data/generators/colorbox/templates/colorbox/images/internet_explorer/borderMiddleRight.png +0 -0
  14. data/generators/colorbox/templates/colorbox/images/internet_explorer/borderTopCenter.png +0 -0
  15. data/generators/colorbox/templates/colorbox/images/internet_explorer/borderTopLeft.png +0 -0
  16. data/generators/colorbox/templates/colorbox/images/internet_explorer/borderTopRight.png +0 -0
  17. data/generators/colorbox/templates/colorbox/images/loading.gif +0 -0
  18. data/generators/colorbox/templates/colorbox/images/loading_background.png +0 -0
  19. data/generators/colorbox/templates/colorbox/images/overlay.png +0 -0
  20. data/generators/colorbox/templates/jquery-1.3.2.min.js +19 -0
  21. data/generators/colorbox/templates/jquery.colorbox.js +698 -0
  22. data/generators/generator_helpers.rb +17 -0
  23. data/generators/iip_viewer/iip_viewer_generator.rb +18 -0
  24. data/generators/iip_viewer/templates/README +8 -0
  25. data/generators/iip_viewer/templates/_iip_flash_viewer.html.erb +14 -0
  26. data/generators/iip_viewer/templates/fliipish.swf +0 -0
  27. data/generators/iip_viewer/templates/iip_flashclient.js +24 -0
  28. data/generators/iip_viewer/templates/iip_helper.rb +24 -0
  29. data/generators/iip_viewer/templates/swfobject.js +8 -0
  30. data/generators/ipod_dropdown/ipod_dropdown_generator.rb +24 -0
  31. data/generators/ipod_dropdown/templates/README +8 -0
  32. data/generators/ipod_dropdown/templates/_ipod_dropdown.html.erb +25 -0
  33. data/generators/ipod_dropdown/templates/fg.menu.js +645 -0
  34. data/generators/ipod_dropdown/templates/ipod-menu/fg.menu.css +129 -0
  35. data/generators/ipod_dropdown/templates/ipod-menu/theme/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  36. data/generators/ipod_dropdown/templates/ipod-menu/theme/images/ui-bg_flat_55_fbec88_40x100.png +0 -0
  37. data/generators/ipod_dropdown/templates/ipod-menu/theme/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
  38. data/generators/ipod_dropdown/templates/ipod-menu/theme/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
  39. data/generators/ipod_dropdown/templates/ipod-menu/theme/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  40. data/generators/ipod_dropdown/templates/ipod-menu/theme/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
  41. data/generators/ipod_dropdown/templates/ipod-menu/theme/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
  42. data/generators/ipod_dropdown/templates/ipod-menu/theme/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
  43. data/generators/ipod_dropdown/templates/ipod-menu/theme/images/ui-icons_217bc0_256x240.png +0 -0
  44. data/generators/ipod_dropdown/templates/ipod-menu/theme/images/ui-icons_2e83ff_256x240.png +0 -0
  45. data/generators/ipod_dropdown/templates/ipod-menu/theme/images/ui-icons_469bdd_256x240.png +0 -0
  46. data/generators/ipod_dropdown/templates/ipod-menu/theme/images/ui-icons_6da8d5_256x240.png +0 -0
  47. data/generators/ipod_dropdown/templates/ipod-menu/theme/images/ui-icons_cd0a0a_256x240.png +0 -0
  48. data/generators/ipod_dropdown/templates/ipod-menu/theme/images/ui-icons_d8e7f3_256x240.png +0 -0
  49. data/generators/ipod_dropdown/templates/ipod-menu/theme/images/ui-icons_f9bd01_256x240.png +0 -0
  50. data/generators/ipod_dropdown/templates/ipod-menu/theme/ui.accordion.css +9 -0
  51. data/generators/ipod_dropdown/templates/ipod-menu/theme/ui.all.css +2 -0
  52. data/generators/ipod_dropdown/templates/ipod-menu/theme/ui.base.css +1 -0
  53. data/generators/ipod_dropdown/templates/ipod-menu/theme/ui.core.css +37 -0
  54. data/generators/ipod_dropdown/templates/ipod-menu/theme/ui.datepicker.css +62 -0
  55. data/generators/ipod_dropdown/templates/ipod-menu/theme/ui.dialog.css +13 -0
  56. data/generators/ipod_dropdown/templates/ipod-menu/theme/ui.progressbar.css +4 -0
  57. data/generators/ipod_dropdown/templates/ipod-menu/theme/ui.resizable.css +13 -0
  58. data/generators/ipod_dropdown/templates/ipod-menu/theme/ui.slider.css +17 -0
  59. data/generators/ipod_dropdown/templates/ipod-menu/theme/ui.tabs.css +11 -0
  60. data/generators/ipod_dropdown/templates/ipod-menu/theme/ui.theme.css +247 -0
  61. data/generators/ipod_dropdown/templates/ipod_dropdown_helper.rb +52 -0
  62. data/generators/ipod_dropdown/templates/jquery-1.3.2.min.js +19 -0
  63. data/generators/simile_timeline/simile_timeline_generator.rb +24 -0
  64. data/generators/simile_timeline/templates/README +8 -0
  65. data/generators/simile_timeline/templates/_timeline.html.erb +7 -0
  66. data/generators/simile_timeline/templates/_timeline_include.html.erb +6 -0
  67. data/generators/simile_timeline/templates/timeline.js +82 -0
  68. data/generators/simile_timeline/templates/timeline_ajax/content/history.html +7 -0
  69. data/generators/simile_timeline/templates/timeline_ajax/images/bubble-arrow-point-down.png +0 -0
  70. data/generators/simile_timeline/templates/timeline_ajax/images/bubble-arrow-point-left.png +0 -0
  71. data/generators/simile_timeline/templates/timeline_ajax/images/bubble-arrow-point-right.png +0 -0
  72. data/generators/simile_timeline/templates/timeline_ajax/images/bubble-arrow-point-up.png +0 -0
  73. data/generators/simile_timeline/templates/timeline_ajax/images/bubble-bottom-left.png +0 -0
  74. data/generators/simile_timeline/templates/timeline_ajax/images/bubble-bottom-right.png +0 -0
  75. data/generators/simile_timeline/templates/timeline_ajax/images/bubble-bottom.png +0 -0
  76. data/generators/simile_timeline/templates/timeline_ajax/images/bubble-left.png +0 -0
  77. data/generators/simile_timeline/templates/timeline_ajax/images/bubble-right.png +0 -0
  78. data/generators/simile_timeline/templates/timeline_ajax/images/bubble-top-left.png +0 -0
  79. data/generators/simile_timeline/templates/timeline_ajax/images/bubble-top-right.png +0 -0
  80. data/generators/simile_timeline/templates/timeline_ajax/images/bubble-top.png +0 -0
  81. data/generators/simile_timeline/templates/timeline_ajax/images/close-button.png +0 -0
  82. data/generators/simile_timeline/templates/timeline_ajax/images/copy.png +0 -0
  83. data/generators/simile_timeline/templates/timeline_ajax/images/message-bottom-left.png +0 -0
  84. data/generators/simile_timeline/templates/timeline_ajax/images/message-bottom-right.png +0 -0
  85. data/generators/simile_timeline/templates/timeline_ajax/images/message-left.png +0 -0
  86. data/generators/simile_timeline/templates/timeline_ajax/images/message-right.png +0 -0
  87. data/generators/simile_timeline/templates/timeline_ajax/images/message-top-left.png +0 -0
  88. data/generators/simile_timeline/templates/timeline_ajax/images/message-top-right.png +0 -0
  89. data/generators/simile_timeline/templates/timeline_ajax/scripts/signal.js +43 -0
  90. data/generators/simile_timeline/templates/timeline_ajax/simile-ajax-api.js +212 -0
  91. data/generators/simile_timeline/templates/timeline_ajax/simile-ajax-bundle.js +2623 -0
  92. data/generators/simile_timeline/templates/timeline_ajax/styles/graphics-ie6.css +77 -0
  93. data/generators/simile_timeline/templates/timeline_ajax/styles/graphics.css +171 -0
  94. data/generators/simile_timeline/templates/timeline_helper.rb +36 -0
  95. data/generators/simile_timeline/templates/timeline_js/images/blue-circle.png +0 -0
  96. data/generators/simile_timeline/templates/timeline_js/images/bubble-bottom-arrow.png +0 -0
  97. data/generators/simile_timeline/templates/timeline_js/images/bubble-bottom-left.png +0 -0
  98. data/generators/simile_timeline/templates/timeline_js/images/bubble-bottom-right.png +0 -0
  99. data/generators/simile_timeline/templates/timeline_js/images/bubble-bottom.png +0 -0
  100. data/generators/simile_timeline/templates/timeline_js/images/bubble-left-arrow.png +0 -0
  101. data/generators/simile_timeline/templates/timeline_js/images/bubble-left.png +0 -0
  102. data/generators/simile_timeline/templates/timeline_js/images/bubble-right-arrow.png +0 -0
  103. data/generators/simile_timeline/templates/timeline_js/images/bubble-right.png +0 -0
  104. data/generators/simile_timeline/templates/timeline_js/images/bubble-top-arrow.png +0 -0
  105. data/generators/simile_timeline/templates/timeline_js/images/bubble-top-left.png +0 -0
  106. data/generators/simile_timeline/templates/timeline_js/images/bubble-top-right.png +0 -0
  107. data/generators/simile_timeline/templates/timeline_js/images/bubble-top.png +0 -0
  108. data/generators/simile_timeline/templates/timeline_js/images/close-button.png +0 -0
  109. data/generators/simile_timeline/templates/timeline_js/images/copyright-vertical.png +0 -0
  110. data/generators/simile_timeline/templates/timeline_js/images/copyright.png +0 -0
  111. data/generators/simile_timeline/templates/timeline_js/images/dark-blue-circle.png +0 -0
  112. data/generators/simile_timeline/templates/timeline_js/images/dark-green-circle.png +0 -0
  113. data/generators/simile_timeline/templates/timeline_js/images/dark-red-circle.png +0 -0
  114. data/generators/simile_timeline/templates/timeline_js/images/dull-blue-circle.png +0 -0
  115. data/generators/simile_timeline/templates/timeline_js/images/dull-green-circle.png +0 -0
  116. data/generators/simile_timeline/templates/timeline_js/images/dull-red-circle.png +0 -0
  117. data/generators/simile_timeline/templates/timeline_js/images/gray-circle.png +0 -0
  118. data/generators/simile_timeline/templates/timeline_js/images/green-circle.png +0 -0
  119. data/generators/simile_timeline/templates/timeline_js/images/message-bottom-left.png +0 -0
  120. data/generators/simile_timeline/templates/timeline_js/images/message-bottom-right.png +0 -0
  121. data/generators/simile_timeline/templates/timeline_js/images/message-left.png +0 -0
  122. data/generators/simile_timeline/templates/timeline_js/images/message-right.png +0 -0
  123. data/generators/simile_timeline/templates/timeline_js/images/message-top-left.png +0 -0
  124. data/generators/simile_timeline/templates/timeline_js/images/message-top-right.png +0 -0
  125. data/generators/simile_timeline/templates/timeline_js/images/progress-running.gif +0 -0
  126. data/generators/simile_timeline/templates/timeline_js/images/red-circle.png +0 -0
  127. data/generators/simile_timeline/templates/timeline_js/images/top-bubble.png +0 -0
  128. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/cs/labellers.js +30 -0
  129. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/cs/timeline.js +9 -0
  130. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/de/labellers.js +27 -0
  131. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/de/timeline.js +8 -0
  132. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/en/labellers.js +12 -0
  133. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/en/timeline.js +9 -0
  134. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/es/labellers.js +8 -0
  135. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/es/timeline.js +9 -0
  136. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/fr/labellers.js +8 -0
  137. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/fr/timeline.js +9 -0
  138. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/it/labellers.js +8 -0
  139. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/it/timeline.js +9 -0
  140. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/nl/labellers.js +11 -0
  141. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/nl/timeline.js +9 -0
  142. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/ru/labellers.js +10 -0
  143. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/ru/timeline.js +9 -0
  144. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/se/labellers.js +12 -0
  145. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/se/timeline.js +9 -0
  146. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/tr/labellers.js +8 -0
  147. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/tr/timeline.js +9 -0
  148. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/vi/labellers.js +26 -0
  149. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/vi/timeline.js +9 -0
  150. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/zh/labellers.js +27 -0
  151. data/generators/simile_timeline/templates/timeline_js/scripts/l10n/zh/timeline.js +9 -0
  152. data/generators/simile_timeline/templates/timeline_js/timeline-api.js +280 -0
  153. data/generators/simile_timeline/templates/timeline_js/timeline-bundle.css +229 -0
  154. data/generators/simile_timeline/templates/timeline_js/timeline-bundle.js +2835 -0
  155. data/lib/muruca_widgets.rb +1 -0
  156. data/lib/timeline.rb +63 -0
  157. data/lib/timeline_source.rb +211 -0
  158. data/test/muruca_widgets_test.rb +8 -0
  159. data/test/test_helper.rb +3 -0
  160. metadata +213 -0
@@ -0,0 +1,229 @@
1
+
2
+
3
+ /*------------------- Horizontal / Vertical lines ----------------*/
4
+
5
+ /* style for ethers */
6
+ .timeline-ether-lines{border-color:#666; border-style:dotted; position:absolute;}
7
+ .timeline-horizontal .timeline-ether-lines{border-width:0 0 0 1px; height:100%; top: 0; width: 1px;}
8
+ .timeline-vertical .timeline-ether-lines{border-width:1px 0 0; height:1px; left: 0; width: 100%;}
9
+
10
+
11
+
12
+ /*---------------- Weekends ---------------------------*/
13
+ .timeline-ether-weekends{
14
+ position:absolute;
15
+ background-color:#FFFFE0;
16
+ }
17
+
18
+ .timeline-vertical .timeline-ether-weekends{left:0;width:100%;}
19
+ .timeline-horizontal .timeline-ether-weekends{top:0; height:100%;}
20
+
21
+
22
+ /*-------------------------- HIGHLIGHT DECORATORS -------------------*/
23
+ /* Used for decorators, not used for Timeline Highlight */
24
+ .timeline-highlight-decorator,
25
+ .timeline-highlight-point-decorator{
26
+ position:absolute;
27
+ overflow:hidden;
28
+ }
29
+
30
+ /* Width of horizontal decorators and Height of vertical decorators is
31
+ set in the decorator function params */
32
+ .timeline-horizontal .timeline-highlight-point-decorator,
33
+ .timeline-horizontal .timeline-highlight-decorator{
34
+ top:0;
35
+ height:100%;
36
+ }
37
+
38
+ .timeline-vertical .timeline-highlight-point-decorator,
39
+ .timeline-vertical .timeline-highlight-decorator{
40
+ width:100%;
41
+ left:0;
42
+ }
43
+
44
+ .timeline-highlight-decorator{background-color:#FFC080;}
45
+ .timeline-highlight-point-decorator{background-color:#ff5;}
46
+
47
+
48
+ /*---------------------------- LABELS -------------------------*/
49
+ .timeline-highlight-label {
50
+ position:absolute; overflow:hidden; font-size:200%;
51
+ font-weight:bold; color:#999; }
52
+
53
+
54
+ /*---------------- VERTICAL LABEL -------------------*/
55
+ .timeline-horizontal .timeline-highlight-label {top:0; height:100%;}
56
+ .timeline-horizontal .timeline-highlight-label td {vertical-align:middle;}
57
+ .timeline-horizontal .timeline-highlight-label-start {text-align:right;}
58
+ .timeline-horizontal .timeline-highlight-label-end {text-align:left;}
59
+
60
+
61
+ /*---------------- HORIZONTAL LABEL -------------------*/
62
+ .timeline-vertical .timeline-highlight-label {left:0;width:100%;}
63
+ .timeline-vertical .timeline-highlight-label td {vertical-align:top;}
64
+ .timeline-vertical .timeline-highlight-label-start {text-align:center;}
65
+ .timeline-vertical .timeline-highlight-label-end {text-align:center;}
66
+
67
+
68
+ /*-------------------------------- DATE LABELS --------------------------------*/
69
+ .timeline-date-label {
70
+ position: absolute;
71
+ border: solid #aaa;
72
+ color: #aaa;
73
+ width: 5em;
74
+ height: 1.5em;}
75
+ .timeline-date-label-em {color: #000;}
76
+
77
+ /* horizontal */
78
+ .timeline-horizontal .timeline-date-label{padding-left:2px;}
79
+ .timeline-horizontal .timeline-date-label{border-width:0 0 0 1px;}
80
+ .timeline-horizontal .timeline-date-label-em{height:2em}
81
+
82
+ /* vertical */
83
+ .timeline-vertical .timeline-date-label{padding-top:2px;}
84
+ .timeline-vertical .timeline-date-label{border-width:1px 0 0;}
85
+ .timeline-vertical .timeline-date-label-em{width:7em}
86
+
87
+
88
+ /*------------------------------- Ether.highlight -------------------------*/
89
+ .timeline-ether-highlight{position:absolute; background-color:#fff;}
90
+ .timeline-horizontal .timeline-ether-highlight{top:2px;}
91
+ .timeline-vertical .timeline-ether-highlight{left:2px;}
92
+
93
+
94
+ /*------------------------------ EVENTS ------------------------------------*/
95
+ .timeline-event-icon, .timeline-event-label,.timeline-event-tape{
96
+ position:absolute;
97
+ cursor:pointer;
98
+ }
99
+
100
+ .timeline-event-tape,
101
+ .timeline-small-event-tape,
102
+ .timeline-small-event-icon{
103
+ background-color:#58A0DC;
104
+ overflow:hidden;
105
+ }
106
+
107
+ .timeline-small-event-tape,
108
+ .timeline-small-event-icon{
109
+ position:absolute;
110
+ }
111
+
112
+ .timeline-small-event-icon{width:1px; height:6px;}
113
+
114
+
115
+ /*--------------------------------- TIMELINE-------------------------*/
116
+ .timeline-ether-bg{width:100%; height:100%;}
117
+ .timeline-band-0 .timeline-ether-bg{background-color:#eee}
118
+ .timeline-band-1 .timeline-ether-bg{background-color:#ddd}
119
+ .timeline-band-2 .timeline-ether-bg{background-color:#ccc}
120
+ .timeline-band-3 .timeline-ether-bg{background-color:#aaa}
121
+ .timeline-duration-event {
122
+ position: absolute;
123
+ overflow: hidden;
124
+ border: 1px solid blue;
125
+ }
126
+
127
+ .timeline-instant-event2 {
128
+ position: absolute;
129
+ overflow: hidden;
130
+ border-left: 1px solid blue;
131
+ padding-left: 2px;
132
+ }
133
+
134
+ .timeline-instant-event {
135
+ position: absolute;
136
+ overflow: hidden;
137
+ }
138
+
139
+ .timeline-event-bubble-title {
140
+ font-weight: bold;
141
+ border-bottom: 1px solid #888;
142
+ margin-bottom: 0.5em;
143
+ }
144
+
145
+ .timeline-event-bubble-body {
146
+ }
147
+
148
+ .timeline-event-bubble-wiki {
149
+ margin: 0.5em;
150
+ text-align: right;
151
+ color: #A0A040;
152
+ }
153
+ .timeline-event-bubble-wiki a {
154
+ color: #A0A040;
155
+ }
156
+
157
+ .timeline-event-bubble-time {
158
+ color: #aaa;
159
+ }
160
+
161
+ .timeline-event-bubble-image {
162
+ float: right;
163
+ padding-left: 5px;
164
+ padding-bottom: 5px;
165
+ }.timeline-container {
166
+ position: relative;
167
+ overflow: hidden;
168
+ }
169
+
170
+ .timeline-copyright {
171
+ position: absolute;
172
+ bottom: 0px;
173
+ left: 0px;
174
+ z-index: 1000;
175
+ cursor: pointer;
176
+ }
177
+
178
+ .timeline-message-container {
179
+ position: absolute;
180
+ top: 30%;
181
+ left: 35%;
182
+ right: 35%;
183
+ z-index: 1000;
184
+ display: none;
185
+ }
186
+ .timeline-message {
187
+ font-size: 120%;
188
+ font-weight: bold;
189
+ text-align: center;
190
+ }
191
+ .timeline-message img {
192
+ vertical-align: middle;
193
+ }
194
+
195
+ .timeline-band {
196
+ position: absolute;
197
+ background: #eee;
198
+ z-index: 10;
199
+ }
200
+
201
+ .timeline-band-inner {
202
+ position: relative;
203
+ width: 100%;
204
+ height: 100%;
205
+ }
206
+
207
+ .timeline-band-input {
208
+ position: absolute;
209
+ width: 1em;
210
+ height: 1em;
211
+ overflow: hidden;
212
+ z-index: 0;
213
+ }
214
+ .timeline-band-input input{
215
+ width: 0;
216
+ }
217
+
218
+ .timeline-band-layer {
219
+ position: absolute;
220
+ width: 100%;
221
+ height: 100%;
222
+ }
223
+
224
+ .timeline-band-layer-inner {
225
+ position: relative;
226
+ width: 100%;
227
+ height: 100%;
228
+ }
229
+
@@ -0,0 +1,2835 @@
1
+ 
2
+
3
+ /* band.js */
4
+ Timeline._Band=function(B,G,C){if(B.autoWidth&&typeof G.width=="string"){G.width=G.width.indexOf("%")>-1?0:parseInt(G.width);
5
+ }this._timeline=B;
6
+ this._bandInfo=G;
7
+ this._index=C;
8
+ this._locale=("locale" in G)?G.locale:Timeline.getDefaultLocale();
9
+ this._timeZone=("timeZone" in G)?G.timeZone:0;
10
+ this._labeller=("labeller" in G)?G.labeller:(("createLabeller" in B.getUnit())?B.getUnit().createLabeller(this._locale,this._timeZone):new Timeline.GregorianDateLabeller(this._locale,this._timeZone));
11
+ this._theme=G.theme;
12
+ this._zoomIndex=("zoomIndex" in G)?G.zoomIndex:0;
13
+ this._zoomSteps=("zoomSteps" in G)?G.zoomSteps:null;
14
+ this._dragging=false;
15
+ this._changing=false;
16
+ this._originalScrollSpeed=5;
17
+ this._scrollSpeed=this._originalScrollSpeed;
18
+ this._onScrollListeners=[];
19
+ var A=this;
20
+ this._syncWithBand=null;
21
+ this._syncWithBandHandler=function(H){A._onHighlightBandScroll();
22
+ };
23
+ this._selectorListener=function(H){A._onHighlightBandScroll();
24
+ };
25
+ var E=this._timeline.getDocument().createElement("div");
26
+ E.className="timeline-band-input";
27
+ this._timeline.addDiv(E);
28
+ this._keyboardInput=document.createElement("input");
29
+ this._keyboardInput.type="text";
30
+ E.appendChild(this._keyboardInput);
31
+ SimileAjax.DOM.registerEventWithObject(this._keyboardInput,"keydown",this,"_onKeyDown");
32
+ SimileAjax.DOM.registerEventWithObject(this._keyboardInput,"keyup",this,"_onKeyUp");
33
+ this._div=this._timeline.getDocument().createElement("div");
34
+ this._div.id="timeline-band-"+C;
35
+ this._div.className="timeline-band timeline-band-"+C;
36
+ this._timeline.addDiv(this._div);
37
+ SimileAjax.DOM.registerEventWithObject(this._div,"mousedown",this,"_onMouseDown");
38
+ SimileAjax.DOM.registerEventWithObject(this._div,"mousemove",this,"_onMouseMove");
39
+ SimileAjax.DOM.registerEventWithObject(this._div,"mouseup",this,"_onMouseUp");
40
+ SimileAjax.DOM.registerEventWithObject(this._div,"mouseout",this,"_onMouseOut");
41
+ SimileAjax.DOM.registerEventWithObject(this._div,"dblclick",this,"_onDblClick");
42
+ var F=this._theme!=null?this._theme.mouseWheel:"scroll";
43
+ if(F==="zoom"||F==="scroll"||this._zoomSteps){if(SimileAjax.Platform.browser.isFirefox){SimileAjax.DOM.registerEventWithObject(this._div,"DOMMouseScroll",this,"_onMouseScroll");
44
+ }else{SimileAjax.DOM.registerEventWithObject(this._div,"mousewheel",this,"_onMouseScroll");
45
+ }}this._innerDiv=this._timeline.getDocument().createElement("div");
46
+ this._innerDiv.className="timeline-band-inner";
47
+ this._div.appendChild(this._innerDiv);
48
+ this._ether=G.ether;
49
+ G.ether.initialize(this,B);
50
+ this._etherPainter=G.etherPainter;
51
+ G.etherPainter.initialize(this,B);
52
+ this._eventSource=G.eventSource;
53
+ if(this._eventSource){this._eventListener={onAddMany:function(){A._onAddMany();
54
+ },onClear:function(){A._onClear();
55
+ }};
56
+ this._eventSource.addListener(this._eventListener);
57
+ }this._eventPainter=G.eventPainter;
58
+ this._eventTracksNeeded=0;
59
+ this._eventTrackIncrement=0;
60
+ G.eventPainter.initialize(this,B);
61
+ this._decorators=("decorators" in G)?G.decorators:[];
62
+ for(var D=0;
63
+ D<this._decorators.length;
64
+ D++){this._decorators[D].initialize(this,B);
65
+ }};
66
+ Timeline._Band.SCROLL_MULTIPLES=5;
67
+ Timeline._Band.prototype.dispose=function(){this.closeBubble();
68
+ if(this._eventSource){this._eventSource.removeListener(this._eventListener);
69
+ this._eventListener=null;
70
+ this._eventSource=null;
71
+ }this._timeline=null;
72
+ this._bandInfo=null;
73
+ this._labeller=null;
74
+ this._ether=null;
75
+ this._etherPainter=null;
76
+ this._eventPainter=null;
77
+ this._decorators=null;
78
+ this._onScrollListeners=null;
79
+ this._syncWithBandHandler=null;
80
+ this._selectorListener=null;
81
+ this._div=null;
82
+ this._innerDiv=null;
83
+ this._keyboardInput=null;
84
+ };
85
+ Timeline._Band.prototype.addOnScrollListener=function(A){this._onScrollListeners.push(A);
86
+ };
87
+ Timeline._Band.prototype.removeOnScrollListener=function(B){for(var A=0;
88
+ A<this._onScrollListeners.length;
89
+ A++){if(this._onScrollListeners[A]==B){this._onScrollListeners.splice(A,1);
90
+ break;
91
+ }}};
92
+ Timeline._Band.prototype.setSyncWithBand=function(B,A){if(this._syncWithBand){this._syncWithBand.removeOnScrollListener(this._syncWithBandHandler);
93
+ }this._syncWithBand=B;
94
+ this._syncWithBand.addOnScrollListener(this._syncWithBandHandler);
95
+ this._highlight=A;
96
+ this._positionHighlight();
97
+ };
98
+ Timeline._Band.prototype.getLocale=function(){return this._locale;
99
+ };
100
+ Timeline._Band.prototype.getTimeZone=function(){return this._timeZone;
101
+ };
102
+ Timeline._Band.prototype.getLabeller=function(){return this._labeller;
103
+ };
104
+ Timeline._Band.prototype.getIndex=function(){return this._index;
105
+ };
106
+ Timeline._Band.prototype.getEther=function(){return this._ether;
107
+ };
108
+ Timeline._Band.prototype.getEtherPainter=function(){return this._etherPainter;
109
+ };
110
+ Timeline._Band.prototype.getEventSource=function(){return this._eventSource;
111
+ };
112
+ Timeline._Band.prototype.getEventPainter=function(){return this._eventPainter;
113
+ };
114
+ Timeline._Band.prototype.getTimeline=function(){return this._timeline;
115
+ };
116
+ Timeline._Band.prototype.updateEventTrackInfo=function(A,B){this._eventTrackIncrement=B;
117
+ if(A>this._eventTracksNeeded){this._eventTracksNeeded=A;
118
+ }};
119
+ Timeline._Band.prototype.checkAutoWidth=function(){if(!this._timeline.autoWidth){return ;
120
+ }var C=this._eventPainter.getType()=="overview";
121
+ var A=C?this._theme.event.overviewTrack.autoWidthMargin:this._theme.event.track.autoWidthMargin;
122
+ var B=Math.ceil((this._eventTracksNeeded+A)*this._eventTrackIncrement);
123
+ B+=C?this._theme.event.overviewTrack.offset:this._theme.event.track.offset;
124
+ var D=this._bandInfo;
125
+ if(B!=D.width){D.width=B;
126
+ }};
127
+ Timeline._Band.prototype.layout=function(){this.paint();
128
+ };
129
+ Timeline._Band.prototype.paint=function(){this._etherPainter.paint();
130
+ this._paintDecorators();
131
+ this._paintEvents();
132
+ };
133
+ Timeline._Band.prototype.softLayout=function(){this.softPaint();
134
+ };
135
+ Timeline._Band.prototype.softPaint=function(){this._etherPainter.softPaint();
136
+ this._softPaintDecorators();
137
+ this._softPaintEvents();
138
+ };
139
+ Timeline._Band.prototype.setBandShiftAndWidth=function(A,D){var C=this._keyboardInput.parentNode;
140
+ var B=A+Math.floor(D/2);
141
+ if(this._timeline.isHorizontal()){this._div.style.top=A+"px";
142
+ this._div.style.height=D+"px";
143
+ C.style.top=B+"px";
144
+ C.style.left="-1em";
145
+ }else{this._div.style.left=A+"px";
146
+ this._div.style.width=D+"px";
147
+ C.style.left=B+"px";
148
+ C.style.top="-1em";
149
+ }};
150
+ Timeline._Band.prototype.getViewWidth=function(){if(this._timeline.isHorizontal()){return this._div.offsetHeight;
151
+ }else{return this._div.offsetWidth;
152
+ }};
153
+ Timeline._Band.prototype.setViewLength=function(A){this._viewLength=A;
154
+ this._recenterDiv();
155
+ this._onChanging();
156
+ };
157
+ Timeline._Band.prototype.getViewLength=function(){return this._viewLength;
158
+ };
159
+ Timeline._Band.prototype.getTotalViewLength=function(){return Timeline._Band.SCROLL_MULTIPLES*this._viewLength;
160
+ };
161
+ Timeline._Band.prototype.getViewOffset=function(){return this._viewOffset;
162
+ };
163
+ Timeline._Band.prototype.getMinDate=function(){return this._ether.pixelOffsetToDate(this._viewOffset);
164
+ };
165
+ Timeline._Band.prototype.getMaxDate=function(){return this._ether.pixelOffsetToDate(this._viewOffset+Timeline._Band.SCROLL_MULTIPLES*this._viewLength);
166
+ };
167
+ Timeline._Band.prototype.getMinVisibleDate=function(){return this._ether.pixelOffsetToDate(0);
168
+ };
169
+ Timeline._Band.prototype.getMinVisibleDateAfterDelta=function(A){return this._ether.pixelOffsetToDate(A);
170
+ };
171
+ Timeline._Band.prototype.getMaxVisibleDate=function(){return this._ether.pixelOffsetToDate(this._viewLength);
172
+ };
173
+ Timeline._Band.prototype.getMaxVisibleDateAfterDelta=function(A){return this._ether.pixelOffsetToDate(this._viewLength+A);
174
+ };
175
+ Timeline._Band.prototype.getCenterVisibleDate=function(){return this._ether.pixelOffsetToDate(this._viewLength/2);
176
+ };
177
+ Timeline._Band.prototype.setMinVisibleDate=function(A){if(!this._changing){this._moveEther(Math.round(-this._ether.dateToPixelOffset(A)));
178
+ }};
179
+ Timeline._Band.prototype.setMaxVisibleDate=function(A){if(!this._changing){this._moveEther(Math.round(this._viewLength-this._ether.dateToPixelOffset(A)));
180
+ }};
181
+ Timeline._Band.prototype.setCenterVisibleDate=function(A){if(!this._changing){this._moveEther(Math.round(this._viewLength/2-this._ether.dateToPixelOffset(A)));
182
+ }};
183
+ Timeline._Band.prototype.dateToPixelOffset=function(A){return this._ether.dateToPixelOffset(A)-this._viewOffset;
184
+ };
185
+ Timeline._Band.prototype.pixelOffsetToDate=function(A){return this._ether.pixelOffsetToDate(A+this._viewOffset);
186
+ };
187
+ Timeline._Band.prototype.createLayerDiv=function(C,A){var D=this._timeline.getDocument().createElement("div");
188
+ D.className="timeline-band-layer"+(typeof A=="string"?(" "+A):"");
189
+ D.style.zIndex=C;
190
+ this._innerDiv.appendChild(D);
191
+ var B=this._timeline.getDocument().createElement("div");
192
+ B.className="timeline-band-layer-inner";
193
+ if(SimileAjax.Platform.browser.isIE){B.style.cursor="move";
194
+ }else{B.style.cursor="-moz-grab";
195
+ }D.appendChild(B);
196
+ return B;
197
+ };
198
+ Timeline._Band.prototype.removeLayerDiv=function(A){this._innerDiv.removeChild(A.parentNode);
199
+ };
200
+ Timeline._Band.prototype.scrollToCenter=function(A,C){var B=this._ether.dateToPixelOffset(A);
201
+ if(B<-this._viewLength/2){this.setCenterVisibleDate(this.pixelOffsetToDate(B+this._viewLength));
202
+ }else{if(B>3*this._viewLength/2){this.setCenterVisibleDate(this.pixelOffsetToDate(B-this._viewLength));
203
+ }}this._autoScroll(Math.round(this._viewLength/2-this._ether.dateToPixelOffset(A)),C);
204
+ };
205
+ Timeline._Band.prototype.showBubbleForEvent=function(C){var A=this.getEventSource().getEvent(C);
206
+ if(A){var B=this;
207
+ this.scrollToCenter(A.getStart(),function(){B._eventPainter.showBubble(A);
208
+ });
209
+ }};
210
+ Timeline._Band.prototype.zoom=function(C,A,F,E){if(!this._zoomSteps){return ;
211
+ }A+=this._viewOffset;
212
+ var D=this._ether.pixelOffsetToDate(A);
213
+ var B=this._ether.zoom(C);
214
+ this._etherPainter.zoom(B);
215
+ this._moveEther(Math.round(-this._ether.dateToPixelOffset(D)));
216
+ this._moveEther(A);
217
+ };
218
+ Timeline._Band.prototype._onMouseDown=function(B,A,C){this.closeBubble();
219
+ this._dragging=true;
220
+ this._dragX=A.clientX;
221
+ this._dragY=A.clientY;
222
+ };
223
+ Timeline._Band.prototype._onMouseMove=function(D,A,E){if(this._dragging){var C=A.clientX-this._dragX;
224
+ var B=A.clientY-this._dragY;
225
+ this._dragX=A.clientX;
226
+ this._dragY=A.clientY;
227
+ this._moveEther(this._timeline.isHorizontal()?C:B);
228
+ this._positionHighlight();
229
+ }};
230
+ Timeline._Band.prototype._onMouseUp=function(B,A,C){this._dragging=false;
231
+ this._keyboardInput.focus();
232
+ };
233
+ Timeline._Band.prototype._onMouseOut=function(C,B,D){var A=SimileAjax.DOM.getEventRelativeCoordinates(B,C);
234
+ A.x+=this._viewOffset;
235
+ if(A.x<0||A.x>C.offsetWidth||A.y<0||A.y>C.offsetHeight){this._dragging=false;
236
+ }};
237
+ Timeline._Band.prototype._onMouseScroll=function(G,H,B){var A=new Date();
238
+ A=A.getTime();
239
+ if(!this._lastScrollTime||((A-this._lastScrollTime)>50)){this._lastScrollTime=A;
240
+ var I=0;
241
+ if(H.wheelDelta){I=H.wheelDelta/120;
242
+ }else{if(H.detail){I=-H.detail/3;
243
+ }}var F=this._theme.mouseWheel;
244
+ if(this._zoomSteps||F==="zoom"){var E=SimileAjax.DOM.getEventRelativeCoordinates(H,G);
245
+ if(I!=0){var D;
246
+ if(I>0){D=true;
247
+ }if(I<0){D=false;
248
+ }this._timeline.zoom(D,E.x,E.y,G);
249
+ }}else{if(F==="scroll"){var C=50*(I<0?-1:1);
250
+ this._moveEther(C);
251
+ }}}if(H.stopPropagation){H.stopPropagation();
252
+ }H.cancelBubble=true;
253
+ if(H.preventDefault){H.preventDefault();
254
+ }H.returnValue=false;
255
+ };
256
+ Timeline._Band.prototype._onDblClick=function(C,B,E){var A=SimileAjax.DOM.getEventRelativeCoordinates(B,C);
257
+ var D=A.x-(this._viewLength/2-this._viewOffset);
258
+ this._autoScroll(-D);
259
+ };
260
+ Timeline._Band.prototype._onKeyDown=function(B,A,C){if(!this._dragging){switch(A.keyCode){case 27:break;
261
+ case 37:case 38:this._scrollSpeed=Math.min(50,Math.abs(this._scrollSpeed*1.05));
262
+ this._moveEther(this._scrollSpeed);
263
+ break;
264
+ case 39:case 40:this._scrollSpeed=-Math.min(50,Math.abs(this._scrollSpeed*1.05));
265
+ this._moveEther(this._scrollSpeed);
266
+ break;
267
+ default:return true;
268
+ }this.closeBubble();
269
+ SimileAjax.DOM.cancelEvent(A);
270
+ return false;
271
+ }return true;
272
+ };
273
+ Timeline._Band.prototype._onKeyUp=function(B,A,C){if(!this._dragging){this._scrollSpeed=this._originalScrollSpeed;
274
+ switch(A.keyCode){case 35:this.setCenterVisibleDate(this._eventSource.getLatestDate());
275
+ break;
276
+ case 36:this.setCenterVisibleDate(this._eventSource.getEarliestDate());
277
+ break;
278
+ case 33:this._autoScroll(this._timeline.getPixelLength());
279
+ break;
280
+ case 34:this._autoScroll(-this._timeline.getPixelLength());
281
+ break;
282
+ default:return true;
283
+ }this.closeBubble();
284
+ SimileAjax.DOM.cancelEvent(A);
285
+ return false;
286
+ }return true;
287
+ };
288
+ Timeline._Band.prototype._autoScroll=function(D,C){var A=this;
289
+ var B=SimileAjax.Graphics.createAnimation(function(E,F){A._moveEther(F);
290
+ },0,D,1000,C);
291
+ B.run();
292
+ };
293
+ Timeline._Band.prototype._moveEther=function(A){this.closeBubble();
294
+ if(!this._timeline.shiftOK(this._index,A)){return ;
295
+ }this._viewOffset+=A;
296
+ this._ether.shiftPixels(-A);
297
+ if(this._timeline.isHorizontal()){this._div.style.left=this._viewOffset+"px";
298
+ }else{this._div.style.top=this._viewOffset+"px";
299
+ }if(this._viewOffset>-this._viewLength*0.5||this._viewOffset<-this._viewLength*(Timeline._Band.SCROLL_MULTIPLES-1.5)){this._recenterDiv();
300
+ }else{this.softLayout();
301
+ }this._onChanging();
302
+ };
303
+ Timeline._Band.prototype._onChanging=function(){this._changing=true;
304
+ this._fireOnScroll();
305
+ this._setSyncWithBandDate();
306
+ this._changing=false;
307
+ };
308
+ Timeline._Band.prototype.busy=function(){return(this._changing);
309
+ };
310
+ Timeline._Band.prototype._fireOnScroll=function(){for(var A=0;
311
+ A<this._onScrollListeners.length;
312
+ A++){this._onScrollListeners[A](this);
313
+ }};
314
+ Timeline._Band.prototype._setSyncWithBandDate=function(){if(this._syncWithBand){var A=this._ether.pixelOffsetToDate(this.getViewLength()/2);
315
+ this._syncWithBand.setCenterVisibleDate(A);
316
+ }};
317
+ Timeline._Band.prototype._onHighlightBandScroll=function(){if(this._syncWithBand){var A=this._syncWithBand.getCenterVisibleDate();
318
+ var B=this._ether.dateToPixelOffset(A);
319
+ this._moveEther(Math.round(this._viewLength/2-B));
320
+ if(this._highlight){this._etherPainter.setHighlight(this._syncWithBand.getMinVisibleDate(),this._syncWithBand.getMaxVisibleDate());
321
+ }}};
322
+ Timeline._Band.prototype._onAddMany=function(){this._paintEvents();
323
+ };
324
+ Timeline._Band.prototype._onClear=function(){this._paintEvents();
325
+ };
326
+ Timeline._Band.prototype._positionHighlight=function(){if(this._syncWithBand){var A=this._syncWithBand.getMinVisibleDate();
327
+ var B=this._syncWithBand.getMaxVisibleDate();
328
+ if(this._highlight){this._etherPainter.setHighlight(A,B);
329
+ }}};
330
+ Timeline._Band.prototype._recenterDiv=function(){this._viewOffset=-this._viewLength*(Timeline._Band.SCROLL_MULTIPLES-1)/2;
331
+ if(this._timeline.isHorizontal()){this._div.style.left=this._viewOffset+"px";
332
+ this._div.style.width=(Timeline._Band.SCROLL_MULTIPLES*this._viewLength)+"px";
333
+ }else{this._div.style.top=this._viewOffset+"px";
334
+ this._div.style.height=(Timeline._Band.SCROLL_MULTIPLES*this._viewLength)+"px";
335
+ }this.layout();
336
+ };
337
+ Timeline._Band.prototype._paintEvents=function(){this._eventPainter.paint();
338
+ };
339
+ Timeline._Band.prototype._softPaintEvents=function(){this._eventPainter.softPaint();
340
+ };
341
+ Timeline._Band.prototype._paintDecorators=function(){for(var A=0;
342
+ A<this._decorators.length;
343
+ A++){this._decorators[A].paint();
344
+ }};
345
+ Timeline._Band.prototype._softPaintDecorators=function(){for(var A=0;
346
+ A<this._decorators.length;
347
+ A++){this._decorators[A].softPaint();
348
+ }};
349
+ Timeline._Band.prototype.closeBubble=function(){SimileAjax.WindowManager.cancelPopups();
350
+ };
351
+
352
+
353
+ /* compact-painter.js */
354
+ Timeline.CompactEventPainter=function(A){this._params=A;
355
+ this._onSelectListeners=[];
356
+ this._filterMatcher=null;
357
+ this._highlightMatcher=null;
358
+ this._frc=null;
359
+ this._eventIdToElmt={};
360
+ };
361
+ Timeline.CompactEventPainter.prototype.initialize=function(B,A){this._band=B;
362
+ this._timeline=A;
363
+ this._backLayer=null;
364
+ this._eventLayer=null;
365
+ this._lineLayer=null;
366
+ this._highlightLayer=null;
367
+ this._eventIdToElmt=null;
368
+ };
369
+ Timeline.CompactEventPainter.prototype.addOnSelectListener=function(A){this._onSelectListeners.push(A);
370
+ };
371
+ Timeline.CompactEventPainter.prototype.removeOnSelectListener=function(B){for(var A=0;
372
+ A<this._onSelectListeners.length;
373
+ A++){if(this._onSelectListeners[A]==B){this._onSelectListeners.splice(A,1);
374
+ break;
375
+ }}};
376
+ Timeline.CompactEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher;
377
+ };
378
+ Timeline.CompactEventPainter.prototype.setFilterMatcher=function(A){this._filterMatcher=A;
379
+ };
380
+ Timeline.CompactEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher;
381
+ };
382
+ Timeline.CompactEventPainter.prototype.setHighlightMatcher=function(A){this._highlightMatcher=A;
383
+ };
384
+ Timeline.CompactEventPainter.prototype.paint=function(){var N=this._band.getEventSource();
385
+ if(N==null){return ;
386
+ }this._eventIdToElmt={};
387
+ this._prepareForPainting();
388
+ var O=this._params.theme;
389
+ var L=O.event;
390
+ var G={trackOffset:"trackOffset" in this._params?this._params.trackOffset:10,trackHeight:"trackHeight" in this._params?this._params.trackHeight:10,tapeHeight:O.event.tape.height,tapeBottomMargin:"tapeBottomMargin" in this._params?this._params.tapeBottomMargin:2,labelBottomMargin:"labelBottomMargin" in this._params?this._params.labelBottomMargin:5,labelRightMargin:"labelRightMargin" in this._params?this._params.labelRightMargin:5,defaultIcon:L.instant.icon,defaultIconWidth:L.instant.iconWidth,defaultIconHeight:L.instant.iconHeight,customIconWidth:"iconWidth" in this._params?this._params.iconWidth:L.instant.iconWidth,customIconHeight:"iconHeight" in this._params?this._params.iconHeight:L.instant.iconHeight,iconLabelGap:"iconLabelGap" in this._params?this._params.iconLabelGap:2,iconBottomMargin:"iconBottomMargin" in this._params?this._params.iconBottomMargin:2};
391
+ if("compositeIcon" in this._params){G.compositeIcon=this._params.compositeIcon;
392
+ G.compositeIconWidth=this._params.compositeIconWidth||G.customIconWidth;
393
+ G.compositeIconHeight=this._params.compositeIconHeight||G.customIconHeight;
394
+ }else{G.compositeIcon=G.defaultIcon;
395
+ G.compositeIconWidth=G.defaultIconWidth;
396
+ G.compositeIconHeight=G.defaultIconHeight;
397
+ }G.defaultStackIcon="icon" in this._params.stackConcurrentPreciseInstantEvents?this._params.stackConcurrentPreciseInstantEvents.icon:G.defaultIcon;
398
+ G.defaultStackIconWidth="iconWidth" in this._params.stackConcurrentPreciseInstantEvents?this._params.stackConcurrentPreciseInstantEvents.iconWidth:G.defaultIconWidth;
399
+ G.defaultStackIconHeight="iconHeight" in this._params.stackConcurrentPreciseInstantEvents?this._params.stackConcurrentPreciseInstantEvents.iconHeight:G.defaultIconHeight;
400
+ var B=this._band.getMinDate();
401
+ var D=this._band.getMaxDate();
402
+ var R=(this._filterMatcher!=null)?this._filterMatcher:function(S){return true;
403
+ };
404
+ var Q=(this._highlightMatcher!=null)?this._highlightMatcher:function(S){return -1;
405
+ };
406
+ var F=N.getEventIterator(B,D);
407
+ var H="stackConcurrentPreciseInstantEvents" in this._params&&typeof this._params.stackConcurrentPreciseInstantEvents=="object";
408
+ var P="collapseConcurrentPreciseInstantEvents" in this._params&&this._params.collapseConcurrentPreciseInstantEvents;
409
+ if(P||H){var M=[];
410
+ var A=null;
411
+ while(F.hasNext()){var E=F.next();
412
+ if(R(E)){if(!E.isInstant()||E.isImprecise()){this.paintEvent(E,G,this._params.theme,Q(E));
413
+ }else{if(A!=null&&A.getStart().getTime()==E.getStart().getTime()){M[M.length-1].push(E);
414
+ }else{M.push([E]);
415
+ A=E;
416
+ }}}}for(var J=0;
417
+ J<M.length;
418
+ J++){var K=M[J];
419
+ if(K.length==1){this.paintEvent(K[0],G,this._params.theme,Q(E));
420
+ }else{var C=-1;
421
+ for(var I=0;
422
+ C<0&&I<K.length;
423
+ I++){C=Q(K[I]);
424
+ }if(H){this.paintStackedPreciseInstantEvents(K,G,this._params.theme,C);
425
+ }else{this.paintCompositePreciseInstantEvents(K,G,this._params.theme,C);
426
+ }}}}else{while(F.hasNext()){var E=F.next();
427
+ if(R(E)){this.paintEvent(E,G,this._params.theme,Q(E));
428
+ }}}this._highlightLayer.style.display="block";
429
+ this._lineLayer.style.display="block";
430
+ this._eventLayer.style.display="block";
431
+ };
432
+ Timeline.CompactEventPainter.prototype.softPaint=function(){};
433
+ Timeline.CompactEventPainter.prototype._prepareForPainting=function(){var B=this._band;
434
+ if(this._backLayer==null){this._backLayer=this._band.createLayerDiv(0,"timeline-band-events");
435
+ this._backLayer.style.visibility="hidden";
436
+ var A=document.createElement("span");
437
+ A.className="timeline-event-label";
438
+ this._backLayer.appendChild(A);
439
+ this._frc=SimileAjax.Graphics.getFontRenderingContext(A);
440
+ }this._frc.update();
441
+ this._tracks=[];
442
+ if(this._highlightLayer!=null){B.removeLayerDiv(this._highlightLayer);
443
+ }this._highlightLayer=B.createLayerDiv(105,"timeline-band-highlights");
444
+ this._highlightLayer.style.display="none";
445
+ if(this._lineLayer!=null){B.removeLayerDiv(this._lineLayer);
446
+ }this._lineLayer=B.createLayerDiv(110,"timeline-band-lines");
447
+ this._lineLayer.style.display="none";
448
+ if(this._eventLayer!=null){B.removeLayerDiv(this._eventLayer);
449
+ }this._eventLayer=B.createLayerDiv(115,"timeline-band-events");
450
+ this._eventLayer.style.display="none";
451
+ };
452
+ Timeline.CompactEventPainter.prototype.paintEvent=function(B,C,D,A){if(B.isInstant()){this.paintInstantEvent(B,C,D,A);
453
+ }else{this.paintDurationEvent(B,C,D,A);
454
+ }};
455
+ Timeline.CompactEventPainter.prototype.paintInstantEvent=function(B,C,D,A){if(B.isImprecise()){this.paintImpreciseInstantEvent(B,C,D,A);
456
+ }else{this.paintPreciseInstantEvent(B,C,D,A);
457
+ }};
458
+ Timeline.CompactEventPainter.prototype.paintDurationEvent=function(B,C,D,A){if(B.isImprecise()){this.paintImpreciseDurationEvent(B,C,D,A);
459
+ }else{this.paintPreciseDurationEvent(B,C,D,A);
460
+ }};
461
+ Timeline.CompactEventPainter.prototype.paintPreciseInstantEvent=function(H,F,B,A){var C={tooltip:H.getProperty("tooltip")||H.getText()};
462
+ var E={url:H.getIcon()};
463
+ if(E.url==null){E.url=F.defaultIcon;
464
+ E.width=F.defaultIconWidth;
465
+ E.height=F.defaultIconHeight;
466
+ E.className="timeline-event-icon-default";
467
+ }else{E.width=H.getProperty("iconWidth")||F.customIconWidth;
468
+ E.height=H.getProperty("iconHeight")||F.customIconHeight;
469
+ }var J={text:H.getText(),color:H.getTextColor()||H.getColor(),className:H.getClassName()};
470
+ var G=this.paintTapeIconLabel(H.getStart(),C,null,E,J,F,B,A);
471
+ var I=this;
472
+ var D=function(L,K,M){return I._onClickInstantEvent(G.iconElmtData.elmt,K,H);
473
+ };
474
+ SimileAjax.DOM.registerEvent(G.iconElmtData.elmt,"mousedown",D);
475
+ SimileAjax.DOM.registerEvent(G.labelElmtData.elmt,"mousedown",D);
476
+ this._eventIdToElmt[H.getID()]=G.iconElmtData.elmt;
477
+ };
478
+ Timeline.CompactEventPainter.prototype.paintCompositePreciseInstantEvents=function(J,H,D,B){var K=J[0];
479
+ var A=[];
480
+ for(var C=0;
481
+ C<J.length;
482
+ C++){A.push(J[C].getProperty("tooltip")||J[C].getText());
483
+ }var E={tooltip:A.join("; ")};
484
+ var G={url:H.compositeIcon,width:H.compositeIconWidth,height:H.compositeIconHeight,className:"timeline-event-icon-composite"};
485
+ var M={text:String.substitute(this._params.compositeEventLabelTemplate,[J.length])};
486
+ var I=this.paintTapeIconLabel(K.getStart(),E,null,G,M,H,D,B);
487
+ var L=this;
488
+ var F=function(O,N,P){return L._onClickMultiplePreciseInstantEvent(I.iconElmtData.elmt,N,J);
489
+ };
490
+ SimileAjax.DOM.registerEvent(I.iconElmtData.elmt,"mousedown",F);
491
+ SimileAjax.DOM.registerEvent(I.labelElmtData.elmt,"mousedown",F);
492
+ for(var C=0;
493
+ C<J.length;
494
+ C++){this._eventIdToElmt[J[C].getID()]=I.iconElmtData.elmt;
495
+ }};
496
+ Timeline.CompactEventPainter.prototype.paintStackedPreciseInstantEvents=function(T,j,c,E){var S="limit" in this._params.stackConcurrentPreciseInstantEvents?this._params.stackConcurrentPreciseInstantEvents.limit:10;
497
+ var G="moreMessageTemplate" in this._params.stackConcurrentPreciseInstantEvents?this._params.stackConcurrentPreciseInstantEvents.moreMessageTemplate:"%0 More Events";
498
+ var Q=S<=T.length-2;
499
+ var B=this._band;
500
+ var L=function(i){return Math.round(B.dateToPixelOffset(i));
501
+ };
502
+ var O=function(i){var r={url:i.getIcon()};
503
+ if(r.url==null){r.url=j.defaultStackIcon;
504
+ r.width=j.defaultStackIconWidth;
505
+ r.height=j.defaultStackIconHeight;
506
+ r.className="timeline-event-icon-stack timeline-event-icon-default";
507
+ }else{r.width=i.getProperty("iconWidth")||j.customIconWidth;
508
+ r.height=i.getProperty("iconHeight")||j.customIconHeight;
509
+ r.className="timeline-event-icon-stack";
510
+ }return r;
511
+ };
512
+ var C=O(T[0]);
513
+ var V=5;
514
+ var D=0;
515
+ var g=0;
516
+ var p=0;
517
+ var U=0;
518
+ var l=[];
519
+ for(var n=0;
520
+ n<T.length&&(!Q||n<S);
521
+ n++){var b=T[n];
522
+ var a=b.getText();
523
+ var X=O(b);
524
+ var W=this._frc.computeSize(a);
525
+ var K={text:a,iconData:X,labelSize:W,iconLeft:C.width+n*V-X.width};
526
+ K.labelLeft=C.width+n*V+j.iconLabelGap;
527
+ K.top=p;
528
+ l.push(K);
529
+ D=Math.min(D,K.iconLeft);
530
+ p+=W.height;
531
+ g=Math.max(g,K.labelLeft+W.width);
532
+ U=Math.max(U,K.top+X.height);
533
+ }if(Q){var e=String.substitute(G,[T.length-S]);
534
+ var H=this._frc.computeSize(e);
535
+ var J=C.width+(S-1)*V+j.iconLabelGap;
536
+ var m=p;
537
+ p+=H.height;
538
+ g=Math.max(g,J+H.width);
539
+ }g+=j.labelRightMargin;
540
+ p+=j.labelBottomMargin;
541
+ U+=j.iconBottomMargin;
542
+ var F=L(T[0].getStart());
543
+ var Y=[];
544
+ var N=Math.ceil(Math.max(U,p)/j.trackHeight);
545
+ var M=C.width+(T.length-1)*V;
546
+ for(var n=0;
547
+ n<N;
548
+ n++){Y.push({start:D,end:M});
549
+ }var f=Math.ceil(p/j.trackHeight);
550
+ for(var n=0;
551
+ n<f;
552
+ n++){var P=Y[n];
553
+ P.end=Math.max(P.end,g);
554
+ }var k=this._fitTracks(F,Y);
555
+ var Z=k*j.trackHeight+j.trackOffset;
556
+ var q=this._timeline.getDocument().createElement("div");
557
+ q.className="timeline-event-icon-stack";
558
+ q.style.position="absolute";
559
+ q.style.overflow="visible";
560
+ q.style.left=F+"px";
561
+ q.style.top=Z+"px";
562
+ q.style.width=M+"px";
563
+ q.style.height=U+"px";
564
+ q.innerHTML="<div style='position: relative'></div>";
565
+ this._eventLayer.appendChild(q);
566
+ var I=this;
567
+ var R=function(r){try{var w=parseInt(this.getAttribute("index"));
568
+ var u=q.firstChild.childNodes;
569
+ for(var s=0;
570
+ s<u.length;
571
+ s++){var v=u[s];
572
+ if(s==w){v.style.zIndex=u.length;
573
+ }else{v.style.zIndex=u.length-s;
574
+ }}}catch(t){}};
575
+ var d=function(u){var w=l[u];
576
+ var r=T[u];
577
+ var i=r.getProperty("tooltip")||r.getText();
578
+ var v=I._paintEventLabel({tooltip:i},{text:w.text},F+w.labelLeft,Z+w.top,w.labelSize.width,w.labelSize.height,c);
579
+ v.elmt.setAttribute("index",u);
580
+ v.elmt.onmouseover=R;
581
+ var t=SimileAjax.Graphics.createTranslucentImage(w.iconData.url);
582
+ var s=I._timeline.getDocument().createElement("div");
583
+ s.className="timeline-event-icon"+("className" in w.iconData?(" "+w.iconData.className):"");
584
+ s.style.left=w.iconLeft+"px";
585
+ s.style.top=w.top+"px";
586
+ s.style.zIndex=(l.length-u);
587
+ s.appendChild(t);
588
+ s.setAttribute("index",u);
589
+ s.onmouseover=R;
590
+ q.firstChild.appendChild(s);
591
+ var x=function(z,y,AA){return I._onClickInstantEvent(v.elmt,y,r);
592
+ };
593
+ SimileAjax.DOM.registerEvent(s,"mousedown",x);
594
+ SimileAjax.DOM.registerEvent(v.elmt,"mousedown",x);
595
+ I._eventIdToElmt[r.getID()]=s;
596
+ };
597
+ for(var n=0;
598
+ n<l.length;
599
+ n++){d(n);
600
+ }if(Q){var o=T.slice(S);
601
+ var A=this._paintEventLabel({tooltip:e},{text:e},F+J,Z+m,H.width,H.height,c);
602
+ var h=function(r,i,s){return I._onClickMultiplePreciseInstantEvent(A.elmt,i,o);
603
+ };
604
+ SimileAjax.DOM.registerEvent(A.elmt,"mousedown",h);
605
+ for(var n=0;
606
+ n<o.length;
607
+ n++){this._eventIdToElmt[o[n].getID()]=A.elmt;
608
+ }}};
609
+ Timeline.CompactEventPainter.prototype.paintImpreciseInstantEvent=function(I,G,B,A){var C={tooltip:I.getProperty("tooltip")||I.getText()};
610
+ var E={start:I.getStart(),end:I.getEnd(),latestStart:I.getLatestStart(),earliestEnd:I.getEarliestEnd(),isInstant:true};
611
+ var F={url:I.getIcon()};
612
+ if(F.url==null){F=null;
613
+ }else{F.width=I.getProperty("iconWidth")||G.customIconWidth;
614
+ F.height=I.getProperty("iconHeight")||G.customIconHeight;
615
+ }var K={text:I.getText(),color:I.getTextColor()||I.getColor(),className:I.getClassName()};
616
+ var H=this.paintTapeIconLabel(I.getStart(),C,E,F,K,G,B,A);
617
+ var J=this;
618
+ var D=F!=null?function(M,L,N){return J._onClickInstantEvent(H.iconElmtData.elmt,L,I);
619
+ }:function(M,L,N){return J._onClickInstantEvent(H.labelElmtData.elmt,L,I);
620
+ };
621
+ SimileAjax.DOM.registerEvent(H.labelElmtData.elmt,"mousedown",D);
622
+ SimileAjax.DOM.registerEvent(H.impreciseTapeElmtData.elmt,"mousedown",D);
623
+ if(F!=null){SimileAjax.DOM.registerEvent(H.iconElmtData.elmt,"mousedown",D);
624
+ this._eventIdToElmt[I.getID()]=H.iconElmtData.elmt;
625
+ }else{this._eventIdToElmt[I.getID()]=H.labelElmtData.elmt;
626
+ }};
627
+ Timeline.CompactEventPainter.prototype.paintPreciseDurationEvent=function(I,G,B,A){var C={tooltip:I.getProperty("tooltip")||I.getText()};
628
+ var E={start:I.getStart(),end:I.getEnd(),isInstant:false};
629
+ var F={url:I.getIcon()};
630
+ if(F.url==null){F=null;
631
+ }else{F.width=I.getProperty("iconWidth")||G.customIconWidth;
632
+ F.height=I.getProperty("iconHeight")||G.customIconHeight;
633
+ }var K={text:I.getText(),color:I.getTextColor()||I.getColor(),className:I.getClassName()};
634
+ var H=this.paintTapeIconLabel(I.getLatestStart(),C,E,F,K,G,B,A);
635
+ var J=this;
636
+ var D=F!=null?function(M,L,N){return J._onClickInstantEvent(H.iconElmtData.elmt,L,I);
637
+ }:function(M,L,N){return J._onClickInstantEvent(H.labelElmtData.elmt,L,I);
638
+ };
639
+ SimileAjax.DOM.registerEvent(H.labelElmtData.elmt,"mousedown",D);
640
+ SimileAjax.DOM.registerEvent(H.tapeElmtData.elmt,"mousedown",D);
641
+ if(F!=null){SimileAjax.DOM.registerEvent(H.iconElmtData.elmt,"mousedown",D);
642
+ this._eventIdToElmt[I.getID()]=H.iconElmtData.elmt;
643
+ }else{this._eventIdToElmt[I.getID()]=H.labelElmtData.elmt;
644
+ }};
645
+ Timeline.CompactEventPainter.prototype.paintImpreciseDurationEvent=function(I,G,B,A){var C={tooltip:I.getProperty("tooltip")||I.getText()};
646
+ var E={start:I.getStart(),end:I.getEnd(),latestStart:I.getLatestStart(),earliestEnd:I.getEarliestEnd(),isInstant:false};
647
+ var F={url:I.getIcon()};
648
+ if(F.url==null){F=null;
649
+ }else{F.width=I.getProperty("iconWidth")||G.customIconWidth;
650
+ F.height=I.getProperty("iconHeight")||G.customIconHeight;
651
+ }var K={text:I.getText(),color:I.getTextColor()||I.getColor(),className:I.getClassName()};
652
+ var H=this.paintTapeIconLabel(I.getLatestStart(),C,E,F,K,G,B,A);
653
+ var J=this;
654
+ var D=F!=null?function(M,L,N){return J._onClickInstantEvent(H.iconElmtData.elmt,L,I);
655
+ }:function(M,L,N){return J._onClickInstantEvent(H.labelElmtData.elmt,L,I);
656
+ };
657
+ SimileAjax.DOM.registerEvent(H.labelElmtData.elmt,"mousedown",D);
658
+ SimileAjax.DOM.registerEvent(H.tapeElmtData.elmt,"mousedown",D);
659
+ if(F!=null){SimileAjax.DOM.registerEvent(H.iconElmtData.elmt,"mousedown",D);
660
+ this._eventIdToElmt[I.getID()]=H.iconElmtData.elmt;
661
+ }else{this._eventIdToElmt[I.getID()]=H.labelElmtData.elmt;
662
+ }};
663
+ Timeline.CompactEventPainter.prototype.paintTapeIconLabel=function(V,O,S,I,a,X,c,Z){var R=this._band;
664
+ var F=function(e){return Math.round(R.dateToPixelOffset(e));
665
+ };
666
+ var d=F(V);
667
+ var W=[];
668
+ var b=0;
669
+ var B=0;
670
+ var C=0;
671
+ if(S!=null){b=X.tapeHeight+X.tapeBottomMargin;
672
+ B=Math.ceil(X.tapeHeight/X.trackHeight);
673
+ var A=F(S.end)-d;
674
+ var L=F(S.start)-d;
675
+ for(var Q=0;
676
+ Q<B;
677
+ Q++){W.push({start:L,end:A});
678
+ }C=X.trackHeight-(b%X.tapeHeight);
679
+ }var N=0;
680
+ var U=0;
681
+ if(I!=null){if("iconAlign" in I&&I.iconAlign=="center"){N=-Math.floor(I.width/2);
682
+ }U=N+I.width+X.iconLabelGap;
683
+ if(B>0){W[B-1].end=Math.max(W[B-1].end,U);
684
+ }var E=I.height+X.iconBottomMargin+C;
685
+ while(E>0){W.push({start:N,end:U});
686
+ E-=X.trackHeight;
687
+ }}var P=a.text;
688
+ var H=this._frc.computeSize(P);
689
+ var M=H.height+X.labelBottomMargin+C;
690
+ var J=U+H.width+X.labelRightMargin;
691
+ if(B>0){W[B-1].end=Math.max(W[B-1].end,J);
692
+ }for(var Y=0;
693
+ M>0;
694
+ Y++){if(B+Y<W.length){var T=W[B+Y];
695
+ T.end=J;
696
+ }else{W.push({start:0,end:J});
697
+ }M-=X.trackHeight;
698
+ }var G=this._fitTracks(d,W);
699
+ var K=G*X.trackHeight+X.trackOffset;
700
+ var D={};
701
+ D.labelElmtData=this._paintEventLabel(O,a,d+U,K+b,H.width,H.height,c);
702
+ if(S!=null){if("latestStart" in S||"earliestEnd" in S){D.impreciseTapeElmtData=this._paintEventTape(O,S,X.tapeHeight,K,F(S.start),F(S.end),c.event.duration.impreciseColor,c.event.duration.impreciseOpacity,X,c);
703
+ }if(!S.isInstant&&"start" in S&&"end" in S){D.tapeElmtData=this._paintEventTape(O,S,X.tapeHeight,K,d,F("earliestEnd" in S?S.earliestEnd:S.end),S.color,100,X,c);
704
+ }}if(I!=null){D.iconElmtData=this._paintEventIcon(O,I,K+b,d+N,X,c);
705
+ }return D;
706
+ };
707
+ Timeline.CompactEventPainter.prototype._fitTracks=function(F,C){var H;
708
+ for(H=0;
709
+ H<this._tracks.length;
710
+ H++){var E=true;
711
+ for(var B=0;
712
+ B<C.length&&(H+B)<this._tracks.length;
713
+ B++){var G=this._tracks[H+B];
714
+ var A=C[B];
715
+ if(F+A.start<G){E=false;
716
+ break;
717
+ }}if(E){break;
718
+ }}for(var D=0;
719
+ D<C.length;
720
+ D++){this._tracks[H+D]=F+C[D].end;
721
+ }return H;
722
+ };
723
+ Timeline.CompactEventPainter.prototype._paintEventIcon=function(C,D,H,G,E,F){var B=SimileAjax.Graphics.createTranslucentImage(D.url);
724
+ var A=this._timeline.getDocument().createElement("div");
725
+ A.className="timeline-event-icon"+("className" in D?(" "+D.className):"");
726
+ A.style.left=G+"px";
727
+ A.style.top=H+"px";
728
+ A.appendChild(B);
729
+ if("tooltip" in C&&typeof C.tooltip=="string"){A.title=C.tooltip;
730
+ }this._eventLayer.appendChild(A);
731
+ return{left:G,top:H,width:E.iconWidth,height:E.iconHeight,elmt:A};
732
+ };
733
+ Timeline.CompactEventPainter.prototype._paintEventLabel=function(E,I,C,F,A,G,D){var H=this._timeline.getDocument();
734
+ var B=H.createElement("div");
735
+ B.className="timeline-event-label";
736
+ B.style.left=C+"px";
737
+ B.style.width=(A+1)+"px";
738
+ B.style.top=F+"px";
739
+ B.innerHTML=I.text;
740
+ if("tooltip" in E&&typeof E.tooltip=="string"){B.title=E.tooltip;
741
+ }if("color" in I&&typeof I.color=="string"){B.style.color=I.color;
742
+ }if("className" in I&&typeof I.className=="string"){B.className+=" "+I.className;
743
+ }this._eventLayer.appendChild(B);
744
+ return{left:C,top:F,width:A,height:G,elmt:B};
745
+ };
746
+ Timeline.CompactEventPainter.prototype._paintEventTape=function(G,H,K,J,D,A,E,C,I,F){var B=A-D;
747
+ var L=this._timeline.getDocument().createElement("div");
748
+ L.className="timeline-event-tape";
749
+ L.style.left=D+"px";
750
+ L.style.top=J+"px";
751
+ L.style.width=B+"px";
752
+ L.style.height=K+"px";
753
+ if("tooltip" in G&&typeof G.tooltip=="string"){L.title=G.tooltip;
754
+ }if(E!=null&&typeof H.color=="string"){L.style.backgroundColor=E;
755
+ }if("backgroundImage" in H&&typeof H.backgroundImage=="string"){L.style.backgroundImage="url("+backgroundImage+")";
756
+ L.style.backgroundRepeat=("backgroundRepeat" in H&&typeof H.backgroundRepeat=="string")?H.backgroundRepeat:"repeat";
757
+ }SimileAjax.Graphics.setOpacity(L,C);
758
+ if("className" in H&&typeof H.className=="string"){L.className+=" "+H.className;
759
+ }this._eventLayer.appendChild(L);
760
+ return{left:D,top:J,width:B,height:K,elmt:L};
761
+ };
762
+ Timeline.CompactEventPainter.prototype._createHighlightDiv=function(A,C,E){if(A>=0){var D=this._timeline.getDocument();
763
+ var G=E.event;
764
+ var B=G.highlightColors[Math.min(A,G.highlightColors.length-1)];
765
+ var F=D.createElement("div");
766
+ F.style.position="absolute";
767
+ F.style.overflow="hidden";
768
+ F.style.left=(C.left-2)+"px";
769
+ F.style.width=(C.width+4)+"px";
770
+ F.style.top=(C.top-2)+"px";
771
+ F.style.height=(C.height+4)+"px";
772
+ this._highlightLayer.appendChild(F);
773
+ }};
774
+ Timeline.CompactEventPainter.prototype._onClickMultiplePreciseInstantEvent=function(E,A,B){var F=SimileAjax.DOM.getPageCoordinates(E);
775
+ this._showBubble(F.left+Math.ceil(E.offsetWidth/2),F.top+Math.ceil(E.offsetHeight/2),B);
776
+ var D=[];
777
+ for(var C=0;
778
+ C<B.length;
779
+ C++){D.push(B[C].getID());
780
+ }this._fireOnSelect(D);
781
+ A.cancelBubble=true;
782
+ SimileAjax.DOM.cancelEvent(A);
783
+ return false;
784
+ };
785
+ Timeline.CompactEventPainter.prototype._onClickInstantEvent=function(C,A,B){var D=SimileAjax.DOM.getPageCoordinates(C);
786
+ this._showBubble(D.left+Math.ceil(C.offsetWidth/2),D.top+Math.ceil(C.offsetHeight/2),[B]);
787
+ this._fireOnSelect([B.getID()]);
788
+ A.cancelBubble=true;
789
+ SimileAjax.DOM.cancelEvent(A);
790
+ return false;
791
+ };
792
+ Timeline.CompactEventPainter.prototype._onClickDurationEvent=function(F,B,C){if("pageX" in B){var A=B.pageX;
793
+ var E=B.pageY;
794
+ }else{var D=SimileAjax.DOM.getPageCoordinates(F);
795
+ var A=B.offsetX+D.left;
796
+ var E=B.offsetY+D.top;
797
+ }this._showBubble(A,E,[C]);
798
+ this._fireOnSelect([C.getID()]);
799
+ B.cancelBubble=true;
800
+ SimileAjax.DOM.cancelEvent(B);
801
+ return false;
802
+ };
803
+ Timeline.CompactEventPainter.prototype.showBubble=function(A){var B=this._eventIdToElmt[A.getID()];
804
+ if(B){var C=SimileAjax.DOM.getPageCoordinates(B);
805
+ this._showBubble(C.left+B.offsetWidth/2,C.top+B.offsetHeight/2,[A]);
806
+ }};
807
+ Timeline.CompactEventPainter.prototype._showBubble=function(A,F,B){var E=document.createElement("div");
808
+ B=("fillInfoBubble" in B)?[B]:B;
809
+ for(var D=0;
810
+ D<B.length;
811
+ D++){var C=document.createElement("div");
812
+ E.appendChild(C);
813
+ B[D].fillInfoBubble(C,this._params.theme,this._band.getLabeller());
814
+ }SimileAjax.WindowManager.cancelPopups();
815
+ SimileAjax.Graphics.createBubbleForContentAndPoint(E,A,F,this._params.theme.event.bubble.width);
816
+ };
817
+ Timeline.CompactEventPainter.prototype._fireOnSelect=function(B){for(var A=0;
818
+ A<this._onSelectListeners.length;
819
+ A++){this._onSelectListeners[A](B);
820
+ }};
821
+
822
+
823
+ /* decorators.js */
824
+ Timeline.SpanHighlightDecorator=function(A){this._unit=A.unit!=null?A.unit:SimileAjax.NativeDateUnit;
825
+ this._startDate=(typeof A.startDate=="string")?this._unit.parseFromObject(A.startDate):A.startDate;
826
+ this._endDate=(typeof A.endDate=="string")?this._unit.parseFromObject(A.endDate):A.endDate;
827
+ this._startLabel=A.startLabel!=null?A.startLabel:"";
828
+ this._endLabel=A.endLabel!=null?A.endLabel:"";
829
+ this._color=A.color;
830
+ this._cssClass=A.cssClass!=null?A.cssClass:null;
831
+ this._opacity=A.opacity!=null?A.opacity:100;
832
+ this._zIndex=(A.inFront!=null&&A.inFront)?113:10;
833
+ };
834
+ Timeline.SpanHighlightDecorator.prototype.initialize=function(B,A){this._band=B;
835
+ this._timeline=A;
836
+ this._layerDiv=null;
837
+ };
838
+ Timeline.SpanHighlightDecorator.prototype.paint=function(){if(this._layerDiv!=null){this._band.removeLayerDiv(this._layerDiv);
839
+ }this._layerDiv=this._band.createLayerDiv(this._zIndex);
840
+ this._layerDiv.setAttribute("name","span-highlight-decorator");
841
+ this._layerDiv.style.display="none";
842
+ var E=this._band.getMinDate();
843
+ var A=this._band.getMaxDate();
844
+ if(this._unit.compare(this._startDate,A)<0&&this._unit.compare(this._endDate,E)>0){E=this._unit.later(E,this._startDate);
845
+ A=this._unit.earlier(A,this._endDate);
846
+ var F=this._band.dateToPixelOffset(E);
847
+ var I=this._band.dateToPixelOffset(A);
848
+ var H=this._timeline.getDocument();
849
+ var K=function(){var L=H.createElement("table");
850
+ L.insertRow(0).insertCell(0);
851
+ return L;
852
+ };
853
+ var B=H.createElement("div");
854
+ B.className="timeline-highlight-decorator";
855
+ if(this._cssClass){B.className+=" "+this._cssClass;
856
+ }if(this._color!=null){B.style.backgroundColor=this._color;
857
+ }if(this._opacity<100){SimileAjax.Graphics.setOpacity(B,this._opacity);
858
+ }this._layerDiv.appendChild(B);
859
+ var J=K();
860
+ J.className="timeline-highlight-label timeline-highlight-label-start";
861
+ var C=J.rows[0].cells[0];
862
+ C.innerHTML=this._startLabel;
863
+ if(this._cssClass){C.className="label_"+this._cssClass;
864
+ }this._layerDiv.appendChild(J);
865
+ var G=K();
866
+ G.className="timeline-highlight-label timeline-highlight-label-end";
867
+ var D=G.rows[0].cells[0];
868
+ D.innerHTML=this._endLabel;
869
+ if(this._cssClass){D.className="label_"+this._cssClass;
870
+ }this._layerDiv.appendChild(G);
871
+ if(this._timeline.isHorizontal()){B.style.left=F+"px";
872
+ B.style.width=(I-F)+"px";
873
+ J.style.right=(this._band.getTotalViewLength()-F)+"px";
874
+ J.style.width=(this._startLabel.length)+"em";
875
+ G.style.left=I+"px";
876
+ G.style.width=(this._endLabel.length)+"em";
877
+ }else{B.style.top=F+"px";
878
+ B.style.height=(I-F)+"px";
879
+ J.style.bottom=F+"px";
880
+ J.style.height="1.5px";
881
+ G.style.top=I+"px";
882
+ G.style.height="1.5px";
883
+ }}this._layerDiv.style.display="block";
884
+ };
885
+ Timeline.SpanHighlightDecorator.prototype.softPaint=function(){};
886
+ Timeline.PointHighlightDecorator=function(A){this._unit=A.unit!=null?A.unit:SimileAjax.NativeDateUnit;
887
+ this._date=(typeof A.date=="string")?this._unit.parseFromObject(A.date):A.date;
888
+ this._width=A.width!=null?A.width:10;
889
+ this._color=A.color;
890
+ this._cssClass=A.cssClass!=null?A.cssClass:"";
891
+ this._opacity=A.opacity!=null?A.opacity:100;
892
+ };
893
+ Timeline.PointHighlightDecorator.prototype.initialize=function(B,A){this._band=B;
894
+ this._timeline=A;
895
+ this._layerDiv=null;
896
+ };
897
+ Timeline.PointHighlightDecorator.prototype.paint=function(){if(this._layerDiv!=null){this._band.removeLayerDiv(this._layerDiv);
898
+ }this._layerDiv=this._band.createLayerDiv(10);
899
+ this._layerDiv.setAttribute("name","span-highlight-decorator");
900
+ this._layerDiv.style.display="none";
901
+ var C=this._band.getMinDate();
902
+ var E=this._band.getMaxDate();
903
+ if(this._unit.compare(this._date,E)<0&&this._unit.compare(this._date,C)>0){var A=this._band.dateToPixelOffset(this._date);
904
+ var B=A-Math.round(this._width/2);
905
+ var D=this._timeline.getDocument();
906
+ var F=D.createElement("div");
907
+ F.className="timeline-highlight-point-decorator";
908
+ F.className+=" "+this._cssClass;
909
+ if(this._color!=null){F.style.backgroundColor=this._color;
910
+ }if(this._opacity<100){SimileAjax.Graphics.setOpacity(F,this._opacity);
911
+ }this._layerDiv.appendChild(F);
912
+ if(this._timeline.isHorizontal()){F.style.left=B+"px";
913
+ F.style.width=this._width;
914
+ }else{F.style.top=B+"px";
915
+ F.style.height=this._width;
916
+ }}this._layerDiv.style.display="block";
917
+ };
918
+ Timeline.PointHighlightDecorator.prototype.softPaint=function(){};
919
+
920
+
921
+ /* detailed-painter.js */
922
+ Timeline.DetailedEventPainter=function(A){this._params=A;
923
+ this._onSelectListeners=[];
924
+ this._filterMatcher=null;
925
+ this._highlightMatcher=null;
926
+ this._frc=null;
927
+ this._eventIdToElmt={};
928
+ };
929
+ Timeline.DetailedEventPainter.prototype.initialize=function(B,A){this._band=B;
930
+ this._timeline=A;
931
+ this._backLayer=null;
932
+ this._eventLayer=null;
933
+ this._lineLayer=null;
934
+ this._highlightLayer=null;
935
+ this._eventIdToElmt=null;
936
+ };
937
+ Timeline.DetailedEventPainter.prototype.getType=function(){return"detailed";
938
+ };
939
+ Timeline.DetailedEventPainter.prototype.addOnSelectListener=function(A){this._onSelectListeners.push(A);
940
+ };
941
+ Timeline.DetailedEventPainter.prototype.removeOnSelectListener=function(B){for(var A=0;
942
+ A<this._onSelectListeners.length;
943
+ A++){if(this._onSelectListeners[A]==B){this._onSelectListeners.splice(A,1);
944
+ break;
945
+ }}};
946
+ Timeline.DetailedEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher;
947
+ };
948
+ Timeline.DetailedEventPainter.prototype.setFilterMatcher=function(A){this._filterMatcher=A;
949
+ };
950
+ Timeline.DetailedEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher;
951
+ };
952
+ Timeline.DetailedEventPainter.prototype.setHighlightMatcher=function(A){this._highlightMatcher=A;
953
+ };
954
+ Timeline.DetailedEventPainter.prototype.paint=function(){var C=this._band.getEventSource();
955
+ if(C==null){return ;
956
+ }this._eventIdToElmt={};
957
+ this._prepareForPainting();
958
+ var I=this._params.theme.event;
959
+ var G=Math.max(I.track.height,this._frc.getLineHeight());
960
+ var F={trackOffset:Math.round(this._band.getViewWidth()/2-G/2),trackHeight:G,trackGap:I.track.gap,trackIncrement:G+I.track.gap,icon:I.instant.icon,iconWidth:I.instant.iconWidth,iconHeight:I.instant.iconHeight,labelWidth:I.label.width};
961
+ var D=this._band.getMinDate();
962
+ var B=this._band.getMaxDate();
963
+ var J=(this._filterMatcher!=null)?this._filterMatcher:function(K){return true;
964
+ };
965
+ var A=(this._highlightMatcher!=null)?this._highlightMatcher:function(K){return -1;
966
+ };
967
+ var E=C.getEventReverseIterator(D,B);
968
+ while(E.hasNext()){var H=E.next();
969
+ if(J(H)){this.paintEvent(H,F,this._params.theme,A(H));
970
+ }}this._highlightLayer.style.display="block";
971
+ this._lineLayer.style.display="block";
972
+ this._eventLayer.style.display="block";
973
+ this._band.updateEventTrackInfo(this._lowerTracks.length+this._upperTracks.length,F.trackIncrement);
974
+ };
975
+ Timeline.DetailedEventPainter.prototype.softPaint=function(){};
976
+ Timeline.DetailedEventPainter.prototype._prepareForPainting=function(){var B=this._band;
977
+ if(this._backLayer==null){this._backLayer=this._band.createLayerDiv(0,"timeline-band-events");
978
+ this._backLayer.style.visibility="hidden";
979
+ var A=document.createElement("span");
980
+ A.className="timeline-event-label";
981
+ this._backLayer.appendChild(A);
982
+ this._frc=SimileAjax.Graphics.getFontRenderingContext(A);
983
+ }this._frc.update();
984
+ this._lowerTracks=[];
985
+ this._upperTracks=[];
986
+ if(this._highlightLayer!=null){B.removeLayerDiv(this._highlightLayer);
987
+ }this._highlightLayer=B.createLayerDiv(105,"timeline-band-highlights");
988
+ this._highlightLayer.style.display="none";
989
+ if(this._lineLayer!=null){B.removeLayerDiv(this._lineLayer);
990
+ }this._lineLayer=B.createLayerDiv(110,"timeline-band-lines");
991
+ this._lineLayer.style.display="none";
992
+ if(this._eventLayer!=null){B.removeLayerDiv(this._eventLayer);
993
+ }this._eventLayer=B.createLayerDiv(110,"timeline-band-events");
994
+ this._eventLayer.style.display="none";
995
+ };
996
+ Timeline.DetailedEventPainter.prototype.paintEvent=function(B,C,D,A){if(B.isInstant()){this.paintInstantEvent(B,C,D,A);
997
+ }else{this.paintDurationEvent(B,C,D,A);
998
+ }};
999
+ Timeline.DetailedEventPainter.prototype.paintInstantEvent=function(B,C,D,A){if(B.isImprecise()){this.paintImpreciseInstantEvent(B,C,D,A);
1000
+ }else{this.paintPreciseInstantEvent(B,C,D,A);
1001
+ }};
1002
+ Timeline.DetailedEventPainter.prototype.paintDurationEvent=function(B,C,D,A){if(B.isImprecise()){this.paintImpreciseDurationEvent(B,C,D,A);
1003
+ }else{this.paintPreciseDurationEvent(B,C,D,A);
1004
+ }};
1005
+ Timeline.DetailedEventPainter.prototype.paintPreciseInstantEvent=function(L,P,S,Q){var T=this._timeline.getDocument();
1006
+ var J=L.getText();
1007
+ var G=L.getStart();
1008
+ var H=Math.round(this._band.dateToPixelOffset(G));
1009
+ var A=Math.round(H+P.iconWidth/2);
1010
+ var C=Math.round(H-P.iconWidth/2);
1011
+ var E=this._frc.computeSize(J);
1012
+ var F=this._findFreeTrackForSolid(A,H);
1013
+ var B=this._paintEventIcon(L,F,C,P,S);
1014
+ var K=A+S.event.label.offsetFromLine;
1015
+ var O=F;
1016
+ var D=this._getTrackData(F);
1017
+ if(Math.min(D.solid,D.text)>=K+E.width){D.solid=C;
1018
+ D.text=K;
1019
+ }else{D.solid=C;
1020
+ K=H+S.event.label.offsetFromLine;
1021
+ O=this._findFreeTrackForText(F,K+E.width,function(U){U.line=H-2;
1022
+ });
1023
+ this._getTrackData(O).text=C;
1024
+ this._paintEventLine(L,H,F,O,P,S);
1025
+ }var N=Math.round(P.trackOffset+O*P.trackIncrement+P.trackHeight/2-E.height/2);
1026
+ var R=this._paintEventLabel(L,J,K,N,E.width,E.height,S);
1027
+ var M=this;
1028
+ var I=function(V,U,W){return M._onClickInstantEvent(B.elmt,U,L);
1029
+ };
1030
+ SimileAjax.DOM.registerEvent(B.elmt,"mousedown",I);
1031
+ SimileAjax.DOM.registerEvent(R.elmt,"mousedown",I);
1032
+ this._createHighlightDiv(Q,B,S);
1033
+ this._eventIdToElmt[L.getID()]=B.elmt;
1034
+ };
1035
+ Timeline.DetailedEventPainter.prototype.paintImpreciseInstantEvent=function(O,S,W,T){var X=this._timeline.getDocument();
1036
+ var M=O.getText();
1037
+ var I=O.getStart();
1038
+ var U=O.getEnd();
1039
+ var K=Math.round(this._band.dateToPixelOffset(I));
1040
+ var B=Math.round(this._band.dateToPixelOffset(U));
1041
+ var A=Math.round(K+S.iconWidth/2);
1042
+ var D=Math.round(K-S.iconWidth/2);
1043
+ var G=this._frc.computeSize(M);
1044
+ var H=this._findFreeTrackForSolid(B,K);
1045
+ var E=this._paintEventTape(O,H,K,B,W.event.instant.impreciseColor,W.event.instant.impreciseOpacity,S,W);
1046
+ var C=this._paintEventIcon(O,H,D,S,W);
1047
+ var F=this._getTrackData(H);
1048
+ F.solid=D;
1049
+ var N=A+W.event.label.offsetFromLine;
1050
+ var J=N+G.width;
1051
+ var R;
1052
+ if(J<B){R=H;
1053
+ }else{N=K+W.event.label.offsetFromLine;
1054
+ J=N+G.width;
1055
+ R=this._findFreeTrackForText(H,J,function(Y){Y.line=K-2;
1056
+ });
1057
+ this._getTrackData(R).text=D;
1058
+ this._paintEventLine(O,K,H,R,S,W);
1059
+ }var Q=Math.round(S.trackOffset+R*S.trackIncrement+S.trackHeight/2-G.height/2);
1060
+ var V=this._paintEventLabel(O,M,N,Q,G.width,G.height,W);
1061
+ var P=this;
1062
+ var L=function(Z,Y,a){return P._onClickInstantEvent(C.elmt,Y,O);
1063
+ };
1064
+ SimileAjax.DOM.registerEvent(C.elmt,"mousedown",L);
1065
+ SimileAjax.DOM.registerEvent(E.elmt,"mousedown",L);
1066
+ SimileAjax.DOM.registerEvent(V.elmt,"mousedown",L);
1067
+ this._createHighlightDiv(T,C,W);
1068
+ this._eventIdToElmt[O.getID()]=C.elmt;
1069
+ };
1070
+ Timeline.DetailedEventPainter.prototype.paintPreciseDurationEvent=function(K,O,T,Q){var U=this._timeline.getDocument();
1071
+ var I=K.getText();
1072
+ var E=K.getStart();
1073
+ var R=K.getEnd();
1074
+ var F=Math.round(this._band.dateToPixelOffset(E));
1075
+ var A=Math.round(this._band.dateToPixelOffset(R));
1076
+ var C=this._frc.computeSize(I);
1077
+ var D=this._findFreeTrackForSolid(A);
1078
+ var P=K.getColor();
1079
+ P=P!=null?P:T.event.duration.color;
1080
+ var B=this._paintEventTape(K,D,F,A,P,100,O,T);
1081
+ var H=this._getTrackData(D);
1082
+ H.solid=F;
1083
+ var J=F+T.event.label.offsetFromLine;
1084
+ var N=this._findFreeTrackForText(D,J+C.width,function(V){V.line=F-2;
1085
+ });
1086
+ this._getTrackData(N).text=F-2;
1087
+ this._paintEventLine(K,F,D,N,O,T);
1088
+ var M=Math.round(O.trackOffset+N*O.trackIncrement+O.trackHeight/2-C.height/2);
1089
+ var S=this._paintEventLabel(K,I,J,M,C.width,C.height,T);
1090
+ var L=this;
1091
+ var G=function(W,V,X){return L._onClickDurationEvent(B.elmt,V,K);
1092
+ };
1093
+ SimileAjax.DOM.registerEvent(B.elmt,"mousedown",G);
1094
+ SimileAjax.DOM.registerEvent(S.elmt,"mousedown",G);
1095
+ this._createHighlightDiv(Q,B,T);
1096
+ this._eventIdToElmt[K.getID()]=B.elmt;
1097
+ };
1098
+ Timeline.DetailedEventPainter.prototype.paintImpreciseDurationEvent=function(M,T,Y,V){var Z=this._timeline.getDocument();
1099
+ var K=M.getText();
1100
+ var G=M.getStart();
1101
+ var S=M.getLatestStart();
1102
+ var W=M.getEnd();
1103
+ var O=M.getEarliestEnd();
1104
+ var H=Math.round(this._band.dateToPixelOffset(G));
1105
+ var E=Math.round(this._band.dateToPixelOffset(S));
1106
+ var A=Math.round(this._band.dateToPixelOffset(W));
1107
+ var F=Math.round(this._band.dateToPixelOffset(O));
1108
+ var C=this._frc.computeSize(K);
1109
+ var D=this._findFreeTrackForSolid(A);
1110
+ var U=M.getColor();
1111
+ U=U!=null?U:Y.event.duration.color;
1112
+ var R=this._paintEventTape(M,D,H,A,Y.event.duration.impreciseColor,Y.event.duration.impreciseOpacity,T,Y);
1113
+ var B=this._paintEventTape(M,D,E,F,U,100,T,Y);
1114
+ var J=this._getTrackData(D);
1115
+ J.solid=H;
1116
+ var L=E+Y.event.label.offsetFromLine;
1117
+ var Q=this._findFreeTrackForText(D,L+C.width,function(a){a.line=E-2;
1118
+ });
1119
+ this._getTrackData(Q).text=E-2;
1120
+ this._paintEventLine(M,E,D,Q,T,Y);
1121
+ var P=Math.round(T.trackOffset+Q*T.trackIncrement+T.trackHeight/2-C.height/2);
1122
+ var X=this._paintEventLabel(M,K,L,P,C.width,C.height,Y);
1123
+ var N=this;
1124
+ var I=function(b,a,c){return N._onClickDurationEvent(B.elmt,a,M);
1125
+ };
1126
+ SimileAjax.DOM.registerEvent(B.elmt,"mousedown",I);
1127
+ SimileAjax.DOM.registerEvent(X.elmt,"mousedown",I);
1128
+ this._createHighlightDiv(V,B,Y);
1129
+ this._eventIdToElmt[M.getID()]=B.elmt;
1130
+ };
1131
+ Timeline.DetailedEventPainter.prototype._findFreeTrackForSolid=function(D,A){for(var C=0;
1132
+ true;
1133
+ C++){if(C<this._lowerTracks.length){var B=this._lowerTracks[C];
1134
+ if(Math.min(B.solid,B.text)>D&&(!(A)||B.line>A)){return C;
1135
+ }}else{this._lowerTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});
1136
+ return C;
1137
+ }if(C<this._upperTracks.length){var B=this._upperTracks[C];
1138
+ if(Math.min(B.solid,B.text)>D&&(!(A)||B.line>A)){return -1-C;
1139
+ }}else{this._upperTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});
1140
+ return -1-C;
1141
+ }}};
1142
+ Timeline.DetailedEventPainter.prototype._findFreeTrackForText=function(C,A,I){var B;
1143
+ var E;
1144
+ var F;
1145
+ var H;
1146
+ if(C<0){B=true;
1147
+ F=-C;
1148
+ E=this._findFreeUpperTrackForText(F,A);
1149
+ H=-1-E;
1150
+ }else{if(C>0){B=false;
1151
+ F=C+1;
1152
+ E=this._findFreeLowerTrackForText(F,A);
1153
+ H=E;
1154
+ }else{var G=this._findFreeUpperTrackForText(0,A);
1155
+ var J=this._findFreeLowerTrackForText(1,A);
1156
+ if(J-1<=G){B=false;
1157
+ F=1;
1158
+ E=J;
1159
+ H=E;
1160
+ }else{B=true;
1161
+ F=0;
1162
+ E=G;
1163
+ H=-1-E;
1164
+ }}}if(B){if(E==this._upperTracks.length){this._upperTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});
1165
+ }for(var D=F;
1166
+ D<E;
1167
+ D++){I(this._upperTracks[D]);
1168
+ }}else{if(E==this._lowerTracks.length){this._lowerTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});
1169
+ }for(var D=F;
1170
+ D<E;
1171
+ D++){I(this._lowerTracks[D]);
1172
+ }}return H;
1173
+ };
1174
+ Timeline.DetailedEventPainter.prototype._findFreeLowerTrackForText=function(A,C){for(;
1175
+ A<this._lowerTracks.length;
1176
+ A++){var B=this._lowerTracks[A];
1177
+ if(Math.min(B.solid,B.text)>=C){break;
1178
+ }}return A;
1179
+ };
1180
+ Timeline.DetailedEventPainter.prototype._findFreeUpperTrackForText=function(A,C){for(;
1181
+ A<this._upperTracks.length;
1182
+ A++){var B=this._upperTracks[A];
1183
+ if(Math.min(B.solid,B.text)>=C){break;
1184
+ }}return A;
1185
+ };
1186
+ Timeline.DetailedEventPainter.prototype._getTrackData=function(A){return(A<0)?this._upperTracks[-A-1]:this._lowerTracks[A];
1187
+ };
1188
+ Timeline.DetailedEventPainter.prototype._paintEventLine=function(J,E,D,A,G,F){var H=Math.round(G.trackOffset+D*G.trackIncrement+G.trackHeight/2);
1189
+ var I=Math.round(Math.abs(A-D)*G.trackIncrement);
1190
+ var C="1px solid "+F.event.label.lineColor;
1191
+ var B=this._timeline.getDocument().createElement("div");
1192
+ B.style.position="absolute";
1193
+ B.style.left=E+"px";
1194
+ B.style.width=F.event.label.offsetFromLine+"px";
1195
+ B.style.height=I+"px";
1196
+ if(D>A){B.style.top=(H-I)+"px";
1197
+ B.style.borderTop=C;
1198
+ }else{B.style.top=H+"px";
1199
+ B.style.borderBottom=C;
1200
+ }B.style.borderLeft=C;
1201
+ this._lineLayer.appendChild(B);
1202
+ };
1203
+ Timeline.DetailedEventPainter.prototype._paintEventIcon=function(J,B,C,F,E){var H=J.getIcon();
1204
+ H=H!=null?H:F.icon;
1205
+ var G=F.trackOffset+B*F.trackIncrement+F.trackHeight/2;
1206
+ var I=Math.round(G-F.iconHeight/2);
1207
+ var D=SimileAjax.Graphics.createTranslucentImage(H);
1208
+ var A=this._timeline.getDocument().createElement("div");
1209
+ A.style.position="absolute";
1210
+ A.style.left=C+"px";
1211
+ A.style.top=I+"px";
1212
+ A.appendChild(D);
1213
+ A.style.cursor="pointer";
1214
+ if(J._title!=null){A.title=J._title;
1215
+ }this._eventLayer.appendChild(A);
1216
+ return{left:C,top:I,width:F.iconWidth,height:F.iconHeight,elmt:A};
1217
+ };
1218
+ Timeline.DetailedEventPainter.prototype._paintEventLabel=function(I,J,C,F,A,G,E){var H=this._timeline.getDocument();
1219
+ var K=H.createElement("div");
1220
+ K.style.position="absolute";
1221
+ K.style.left=C+"px";
1222
+ K.style.width=A+"px";
1223
+ K.style.top=F+"px";
1224
+ K.style.height=G+"px";
1225
+ K.style.backgroundColor=E.event.label.backgroundColor;
1226
+ SimileAjax.Graphics.setOpacity(K,E.event.label.backgroundOpacity);
1227
+ this._eventLayer.appendChild(K);
1228
+ var B=H.createElement("div");
1229
+ B.style.position="absolute";
1230
+ B.style.left=C+"px";
1231
+ B.style.width=A+"px";
1232
+ B.style.top=F+"px";
1233
+ B.innerHTML=J;
1234
+ B.style.cursor="pointer";
1235
+ if(I._title!=null){B.title=I._title;
1236
+ }var D=I.getTextColor();
1237
+ if(D==null){D=I.getColor();
1238
+ }if(D!=null){B.style.color=D;
1239
+ }this._eventLayer.appendChild(B);
1240
+ return{left:C,top:F,width:A,height:G,elmt:B};
1241
+ };
1242
+ Timeline.DetailedEventPainter.prototype._paintEventTape=function(L,B,D,A,G,C,I,H){var F=A-D;
1243
+ var E=H.event.tape.height;
1244
+ var K=I.trackOffset+B*I.trackIncrement+I.trackHeight/2;
1245
+ var J=Math.round(K-E/2);
1246
+ var M=this._timeline.getDocument().createElement("div");
1247
+ M.style.position="absolute";
1248
+ M.style.left=D+"px";
1249
+ M.style.width=F+"px";
1250
+ M.style.top=J+"px";
1251
+ M.style.height=E+"px";
1252
+ M.style.backgroundColor=G;
1253
+ M.style.overflow="hidden";
1254
+ M.style.cursor="pointer";
1255
+ if(L._title!=null){M.title=L._title;
1256
+ }SimileAjax.Graphics.setOpacity(M,C);
1257
+ this._eventLayer.appendChild(M);
1258
+ return{left:D,top:J,width:F,height:E,elmt:M};
1259
+ };
1260
+ Timeline.DetailedEventPainter.prototype._createHighlightDiv=function(A,C,E){if(A>=0){var D=this._timeline.getDocument();
1261
+ var G=E.event;
1262
+ var B=G.highlightColors[Math.min(A,G.highlightColors.length-1)];
1263
+ var F=D.createElement("div");
1264
+ F.style.position="absolute";
1265
+ F.style.overflow="hidden";
1266
+ F.style.left=(C.left-2)+"px";
1267
+ F.style.width=(C.width+4)+"px";
1268
+ F.style.top=(C.top-2)+"px";
1269
+ F.style.height=(C.height+4)+"px";
1270
+ F.style.background=B;
1271
+ this._highlightLayer.appendChild(F);
1272
+ }};
1273
+ Timeline.DetailedEventPainter.prototype._onClickInstantEvent=function(C,A,B){var D=SimileAjax.DOM.getPageCoordinates(C);
1274
+ this._showBubble(D.left+Math.ceil(C.offsetWidth/2),D.top+Math.ceil(C.offsetHeight/2),B);
1275
+ this._fireOnSelect(B.getID());
1276
+ A.cancelBubble=true;
1277
+ SimileAjax.DOM.cancelEvent(A);
1278
+ return false;
1279
+ };
1280
+ Timeline.DetailedEventPainter.prototype._onClickDurationEvent=function(F,B,C){if("pageX" in B){var A=B.pageX;
1281
+ var E=B.pageY;
1282
+ }else{var D=SimileAjax.DOM.getPageCoordinates(F);
1283
+ var A=B.offsetX+D.left;
1284
+ var E=B.offsetY+D.top;
1285
+ }this._showBubble(A,E,C);
1286
+ this._fireOnSelect(C.getID());
1287
+ B.cancelBubble=true;
1288
+ SimileAjax.DOM.cancelEvent(B);
1289
+ return false;
1290
+ };
1291
+ Timeline.DetailedEventPainter.prototype.showBubble=function(A){var B=this._eventIdToElmt[A.getID()];
1292
+ if(B){var C=SimileAjax.DOM.getPageCoordinates(B);
1293
+ this._showBubble(C.left+B.offsetWidth/2,C.top+B.offsetHeight/2,A);
1294
+ }};
1295
+ Timeline.DetailedEventPainter.prototype._showBubble=function(B,E,C){var D=document.createElement("div");
1296
+ var A=this._params.theme.event.bubble;
1297
+ C.fillInfoBubble(D,this._params.theme,this._band.getLabeller());
1298
+ SimileAjax.WindowManager.cancelPopups();
1299
+ SimileAjax.Graphics.createBubbleForContentAndPoint(D,B,E,A.width,null,A.maxHeight);
1300
+ };
1301
+ Timeline.DetailedEventPainter.prototype._fireOnSelect=function(A){for(var B=0;
1302
+ B<this._onSelectListeners.length;
1303
+ B++){this._onSelectListeners[B](A);
1304
+ }};
1305
+
1306
+
1307
+ /* ether-painters.js */
1308
+ Timeline.GregorianEtherPainter=function(A){this._params=A;
1309
+ this._theme=A.theme;
1310
+ this._unit=A.unit;
1311
+ this._multiple=("multiple" in A)?A.multiple:1;
1312
+ };
1313
+ Timeline.GregorianEtherPainter.prototype.initialize=function(C,B){this._band=C;
1314
+ this._timeline=B;
1315
+ this._backgroundLayer=C.createLayerDiv(0);
1316
+ this._backgroundLayer.setAttribute("name","ether-background");
1317
+ this._backgroundLayer.className="timeline-ether-bg";
1318
+ this._markerLayer=null;
1319
+ this._lineLayer=null;
1320
+ var D=("align" in this._params&&this._params.align!=undefined)?this._params.align:this._theme.ether.interval.marker[B.isHorizontal()?"hAlign":"vAlign"];
1321
+ var A=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;
1322
+ this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,D,A);
1323
+ this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer);
1324
+ };
1325
+ Timeline.GregorianEtherPainter.prototype.setHighlight=function(A,B){this._highlight.position(A,B);
1326
+ };
1327
+ Timeline.GregorianEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer);
1328
+ }this._markerLayer=this._band.createLayerDiv(100);
1329
+ this._markerLayer.setAttribute("name","ether-markers");
1330
+ this._markerLayer.style.display="none";
1331
+ if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer);
1332
+ }this._lineLayer=this._band.createLayerDiv(1);
1333
+ this._lineLayer.setAttribute("name","ether-lines");
1334
+ this._lineLayer.style.display="none";
1335
+ var C=this._band.getMinDate();
1336
+ var F=this._band.getMaxDate();
1337
+ var A=this._band.getTimeZone();
1338
+ var E=this._band.getLabeller();
1339
+ SimileAjax.DateTime.roundDownToInterval(C,this._unit,A,this._multiple,this._theme.firstDayOfWeek);
1340
+ var D=this;
1341
+ var B=function(G){for(var H=0;
1342
+ H<D._multiple;
1343
+ H++){SimileAjax.DateTime.incrementByInterval(G,D._unit);
1344
+ }};
1345
+ while(C.getTime()<F.getTime()){this._intervalMarkerLayout.createIntervalMarker(C,E,this._unit,this._markerLayer,this._lineLayer);
1346
+ B(C);
1347
+ }this._markerLayer.style.display="block";
1348
+ this._lineLayer.style.display="block";
1349
+ };
1350
+ Timeline.GregorianEtherPainter.prototype.softPaint=function(){};
1351
+ Timeline.GregorianEtherPainter.prototype.zoom=function(A){if(A!=0){this._unit+=A;
1352
+ }};
1353
+ Timeline.HotZoneGregorianEtherPainter=function(G){this._params=G;
1354
+ this._theme=G.theme;
1355
+ this._zones=[{startTime:Number.NEGATIVE_INFINITY,endTime:Number.POSITIVE_INFINITY,unit:G.unit,multiple:1}];
1356
+ for(var F=0;
1357
+ F<G.zones.length;
1358
+ F++){var C=G.zones[F];
1359
+ var E=SimileAjax.DateTime.parseGregorianDateTime(C.start).getTime();
1360
+ var B=SimileAjax.DateTime.parseGregorianDateTime(C.end).getTime();
1361
+ for(var D=0;
1362
+ D<this._zones.length&&B>E;
1363
+ D++){var A=this._zones[D];
1364
+ if(E<A.endTime){if(E>A.startTime){this._zones.splice(D,0,{startTime:A.startTime,endTime:E,unit:A.unit,multiple:A.multiple});
1365
+ D++;
1366
+ A.startTime=E;
1367
+ }if(B<A.endTime){this._zones.splice(D,0,{startTime:E,endTime:B,unit:C.unit,multiple:(C.multiple)?C.multiple:1});
1368
+ D++;
1369
+ A.startTime=B;
1370
+ E=B;
1371
+ }else{A.multiple=C.multiple;
1372
+ A.unit=C.unit;
1373
+ E=A.endTime;
1374
+ }}}}};
1375
+ Timeline.HotZoneGregorianEtherPainter.prototype.initialize=function(C,B){this._band=C;
1376
+ this._timeline=B;
1377
+ this._backgroundLayer=C.createLayerDiv(0);
1378
+ this._backgroundLayer.setAttribute("name","ether-background");
1379
+ this._backgroundLayer.className="timeline-ether-bg";
1380
+ this._markerLayer=null;
1381
+ this._lineLayer=null;
1382
+ var D=("align" in this._params&&this._params.align!=undefined)?this._params.align:this._theme.ether.interval.marker[B.isHorizontal()?"hAlign":"vAlign"];
1383
+ var A=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;
1384
+ this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,D,A);
1385
+ this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer);
1386
+ };
1387
+ Timeline.HotZoneGregorianEtherPainter.prototype.setHighlight=function(A,B){this._highlight.position(A,B);
1388
+ };
1389
+ Timeline.HotZoneGregorianEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer);
1390
+ }this._markerLayer=this._band.createLayerDiv(100);
1391
+ this._markerLayer.setAttribute("name","ether-markers");
1392
+ this._markerLayer.style.display="none";
1393
+ if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer);
1394
+ }this._lineLayer=this._band.createLayerDiv(1);
1395
+ this._lineLayer.setAttribute("name","ether-lines");
1396
+ this._lineLayer.style.display="none";
1397
+ var C=this._band.getMinDate();
1398
+ var A=this._band.getMaxDate();
1399
+ var I=this._band.getTimeZone();
1400
+ var L=this._band.getLabeller();
1401
+ var B=this;
1402
+ var J=function(N,M){for(var O=0;
1403
+ O<M.multiple;
1404
+ O++){SimileAjax.DateTime.incrementByInterval(N,M.unit);
1405
+ }};
1406
+ var D=0;
1407
+ while(D<this._zones.length){if(C.getTime()<this._zones[D].endTime){break;
1408
+ }D++;
1409
+ }var E=this._zones.length-1;
1410
+ while(E>=0){if(A.getTime()>this._zones[E].startTime){break;
1411
+ }E--;
1412
+ }for(var H=D;
1413
+ H<=E;
1414
+ H++){var G=this._zones[H];
1415
+ var K=new Date(Math.max(C.getTime(),G.startTime));
1416
+ var F=new Date(Math.min(A.getTime(),G.endTime));
1417
+ SimileAjax.DateTime.roundDownToInterval(K,G.unit,I,G.multiple,this._theme.firstDayOfWeek);
1418
+ SimileAjax.DateTime.roundUpToInterval(F,G.unit,I,G.multiple,this._theme.firstDayOfWeek);
1419
+ while(K.getTime()<F.getTime()){this._intervalMarkerLayout.createIntervalMarker(K,L,G.unit,this._markerLayer,this._lineLayer);
1420
+ J(K,G);
1421
+ }}this._markerLayer.style.display="block";
1422
+ this._lineLayer.style.display="block";
1423
+ };
1424
+ Timeline.HotZoneGregorianEtherPainter.prototype.softPaint=function(){};
1425
+ Timeline.HotZoneGregorianEtherPainter.prototype.zoom=function(A){if(A!=0){for(var B=0;
1426
+ B<this._zones.length;
1427
+ ++B){if(this._zones[B]){this._zones[B].unit+=A;
1428
+ }}}};
1429
+ Timeline.YearCountEtherPainter=function(A){this._params=A;
1430
+ this._theme=A.theme;
1431
+ this._startDate=SimileAjax.DateTime.parseGregorianDateTime(A.startDate);
1432
+ this._multiple=("multiple" in A)?A.multiple:1;
1433
+ };
1434
+ Timeline.YearCountEtherPainter.prototype.initialize=function(C,B){this._band=C;
1435
+ this._timeline=B;
1436
+ this._backgroundLayer=C.createLayerDiv(0);
1437
+ this._backgroundLayer.setAttribute("name","ether-background");
1438
+ this._backgroundLayer.className="timeline-ether-bg";
1439
+ this._markerLayer=null;
1440
+ this._lineLayer=null;
1441
+ var D=("align" in this._params)?this._params.align:this._theme.ether.interval.marker[B.isHorizontal()?"hAlign":"vAlign"];
1442
+ var A=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;
1443
+ this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,D,A);
1444
+ this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer);
1445
+ };
1446
+ Timeline.YearCountEtherPainter.prototype.setHighlight=function(A,B){this._highlight.position(A,B);
1447
+ };
1448
+ Timeline.YearCountEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer);
1449
+ }this._markerLayer=this._band.createLayerDiv(100);
1450
+ this._markerLayer.setAttribute("name","ether-markers");
1451
+ this._markerLayer.style.display="none";
1452
+ if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer);
1453
+ }this._lineLayer=this._band.createLayerDiv(1);
1454
+ this._lineLayer.setAttribute("name","ether-lines");
1455
+ this._lineLayer.style.display="none";
1456
+ var B=new Date(this._startDate.getTime());
1457
+ var F=this._band.getMaxDate();
1458
+ var E=this._band.getMinDate().getUTCFullYear()-this._startDate.getUTCFullYear();
1459
+ B.setUTCFullYear(this._band.getMinDate().getUTCFullYear()-E%this._multiple);
1460
+ var C=this;
1461
+ var A=function(G){for(var H=0;
1462
+ H<C._multiple;
1463
+ H++){SimileAjax.DateTime.incrementByInterval(G,SimileAjax.DateTime.YEAR);
1464
+ }};
1465
+ var D={labelInterval:function(G,I){var H=G.getUTCFullYear()-C._startDate.getUTCFullYear();
1466
+ return{text:H,emphasized:H==0};
1467
+ }};
1468
+ while(B.getTime()<F.getTime()){this._intervalMarkerLayout.createIntervalMarker(B,D,SimileAjax.DateTime.YEAR,this._markerLayer,this._lineLayer);
1469
+ A(B);
1470
+ }this._markerLayer.style.display="block";
1471
+ this._lineLayer.style.display="block";
1472
+ };
1473
+ Timeline.YearCountEtherPainter.prototype.softPaint=function(){};
1474
+ Timeline.QuarterlyEtherPainter=function(A){this._params=A;
1475
+ this._theme=A.theme;
1476
+ this._startDate=SimileAjax.DateTime.parseGregorianDateTime(A.startDate);
1477
+ };
1478
+ Timeline.QuarterlyEtherPainter.prototype.initialize=function(C,B){this._band=C;
1479
+ this._timeline=B;
1480
+ this._backgroundLayer=C.createLayerDiv(0);
1481
+ this._backgroundLayer.setAttribute("name","ether-background");
1482
+ this._backgroundLayer.className="timeline-ether-bg";
1483
+ this._markerLayer=null;
1484
+ this._lineLayer=null;
1485
+ var D=("align" in this._params)?this._params.align:this._theme.ether.interval.marker[B.isHorizontal()?"hAlign":"vAlign"];
1486
+ var A=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;
1487
+ this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,D,A);
1488
+ this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer);
1489
+ };
1490
+ Timeline.QuarterlyEtherPainter.prototype.setHighlight=function(A,B){this._highlight.position(A,B);
1491
+ };
1492
+ Timeline.QuarterlyEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer);
1493
+ }this._markerLayer=this._band.createLayerDiv(100);
1494
+ this._markerLayer.setAttribute("name","ether-markers");
1495
+ this._markerLayer.style.display="none";
1496
+ if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer);
1497
+ }this._lineLayer=this._band.createLayerDiv(1);
1498
+ this._lineLayer.setAttribute("name","ether-lines");
1499
+ this._lineLayer.style.display="none";
1500
+ var B=new Date(0);
1501
+ var E=this._band.getMaxDate();
1502
+ B.setUTCFullYear(Math.max(this._startDate.getUTCFullYear(),this._band.getMinDate().getUTCFullYear()));
1503
+ B.setUTCMonth(this._startDate.getUTCMonth());
1504
+ var C=this;
1505
+ var A=function(F){F.setUTCMonth(F.getUTCMonth()+3);
1506
+ };
1507
+ var D={labelInterval:function(G,H){var F=(4+(G.getUTCMonth()-C._startDate.getUTCMonth())/3)%4;
1508
+ if(F!=0){return{text:"Q"+(F+1),emphasized:false};
1509
+ }else{return{text:"Y"+(G.getUTCFullYear()-C._startDate.getUTCFullYear()+1),emphasized:true};
1510
+ }}};
1511
+ while(B.getTime()<E.getTime()){this._intervalMarkerLayout.createIntervalMarker(B,D,SimileAjax.DateTime.YEAR,this._markerLayer,this._lineLayer);
1512
+ A(B);
1513
+ }this._markerLayer.style.display="block";
1514
+ this._lineLayer.style.display="block";
1515
+ };
1516
+ Timeline.QuarterlyEtherPainter.prototype.softPaint=function(){};
1517
+ Timeline.EtherIntervalMarkerLayout=function(I,L,C,E,M){var A=I.isHorizontal();
1518
+ if(A){if(E=="Top"){this.positionDiv=function(O,N){O.style.left=N+"px";
1519
+ O.style.top="0px";
1520
+ };
1521
+ }else{this.positionDiv=function(O,N){O.style.left=N+"px";
1522
+ O.style.bottom="0px";
1523
+ };
1524
+ }}else{if(E=="Left"){this.positionDiv=function(O,N){O.style.top=N+"px";
1525
+ O.style.left="0px";
1526
+ };
1527
+ }else{this.positionDiv=function(O,N){O.style.top=N+"px";
1528
+ O.style.right="0px";
1529
+ };
1530
+ }}var D=C.ether.interval.marker;
1531
+ var K=C.ether.interval.line;
1532
+ var B=C.ether.interval.weekend;
1533
+ var H=(A?"h":"v")+E;
1534
+ var G=D[H+"Styler"];
1535
+ var J=D[H+"EmphasizedStyler"];
1536
+ var F=SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.DAY];
1537
+ this.createIntervalMarker=function(T,c,a,Y,P){var U=Math.round(L.dateToPixelOffset(T));
1538
+ if(M&&a!=SimileAjax.DateTime.WEEK){var V=I.getDocument().createElement("div");
1539
+ V.className="timeline-ether-lines";
1540
+ if(K.opacity<100){SimileAjax.Graphics.setOpacity(V,K.opacity);
1541
+ }if(A){V.style.left=U+"px";
1542
+ }else{V.style.top=U+"px";
1543
+ }P.appendChild(V);
1544
+ }if(a==SimileAjax.DateTime.WEEK){var N=C.firstDayOfWeek;
1545
+ var R=new Date(T.getTime()+(6-N-7)*F);
1546
+ var b=new Date(R.getTime()+2*F);
1547
+ var Q=Math.round(L.dateToPixelOffset(R));
1548
+ var S=Math.round(L.dateToPixelOffset(b));
1549
+ var W=Math.max(1,S-Q);
1550
+ var X=I.getDocument().createElement("div");
1551
+ X.className="timeline-ether-weekends";
1552
+ if(B.opacity<100){SimileAjax.Graphics.setOpacity(X,B.opacity);
1553
+ }if(A){X.style.left=Q+"px";
1554
+ X.style.width=W+"px";
1555
+ }else{X.style.top=Q+"px";
1556
+ X.style.height=W+"px";
1557
+ }P.appendChild(X);
1558
+ }var Z=c.labelInterval(T,a);
1559
+ var O=I.getDocument().createElement("div");
1560
+ O.innerHTML=Z.text;
1561
+ O.className="timeline-date-label";
1562
+ if(Z.emphasized){O.className+=" timeline-date-label-em";
1563
+ }this.positionDiv(O,U);
1564
+ Y.appendChild(O);
1565
+ return O;
1566
+ };
1567
+ };
1568
+ Timeline.EtherHighlight=function(B,E,D,C){var A=B.isHorizontal();
1569
+ this._highlightDiv=null;
1570
+ this._createHighlightDiv=function(){if(this._highlightDiv==null){this._highlightDiv=B.getDocument().createElement("div");
1571
+ this._highlightDiv.setAttribute("name","ether-highlight");
1572
+ this._highlightDiv.className="timeline-ether-highlight";
1573
+ var F=D.ether.highlightOpacity;
1574
+ if(F<100){SimileAjax.Graphics.setOpacity(this._highlightDiv,F);
1575
+ }C.appendChild(this._highlightDiv);
1576
+ }};
1577
+ this.position=function(H,J){this._createHighlightDiv();
1578
+ var I=Math.round(E.dateToPixelOffset(H));
1579
+ var G=Math.round(E.dateToPixelOffset(J));
1580
+ var F=Math.max(G-I,3);
1581
+ if(A){this._highlightDiv.style.left=I+"px";
1582
+ this._highlightDiv.style.width=F+"px";
1583
+ this._highlightDiv.style.height=(E.getViewWidth()-4)+"px";
1584
+ }else{this._highlightDiv.style.top=I+"px";
1585
+ this._highlightDiv.style.height=F+"px";
1586
+ this._highlightDiv.style.width=(E.getViewWidth()-4)+"px";
1587
+ }};
1588
+ };
1589
+
1590
+
1591
+ /* ethers.js */
1592
+ Timeline.LinearEther=function(A){this._params=A;
1593
+ this._interval=A.interval;
1594
+ this._pixelsPerInterval=A.pixelsPerInterval;
1595
+ };
1596
+ Timeline.LinearEther.prototype.initialize=function(B,A){this._band=B;
1597
+ this._timeline=A;
1598
+ this._unit=A.getUnit();
1599
+ if("startsOn" in this._params){this._start=this._unit.parseFromObject(this._params.startsOn);
1600
+ }else{if("endsOn" in this._params){this._start=this._unit.parseFromObject(this._params.endsOn);
1601
+ this.shiftPixels(-this._timeline.getPixelLength());
1602
+ }else{if("centersOn" in this._params){this._start=this._unit.parseFromObject(this._params.centersOn);
1603
+ this.shiftPixels(-this._timeline.getPixelLength()/2);
1604
+ }else{this._start=this._unit.makeDefaultValue();
1605
+ this.shiftPixels(-this._timeline.getPixelLength()/2);
1606
+ }}}};
1607
+ Timeline.LinearEther.prototype.setDate=function(A){this._start=this._unit.cloneValue(A);
1608
+ };
1609
+ Timeline.LinearEther.prototype.shiftPixels=function(B){var A=this._interval*B/this._pixelsPerInterval;
1610
+ this._start=this._unit.change(this._start,A);
1611
+ };
1612
+ Timeline.LinearEther.prototype.dateToPixelOffset=function(B){var A=this._unit.compare(B,this._start);
1613
+ return this._pixelsPerInterval*A/this._interval;
1614
+ };
1615
+ Timeline.LinearEther.prototype.pixelOffsetToDate=function(B){var A=B*this._interval/this._pixelsPerInterval;
1616
+ return this._unit.change(this._start,A);
1617
+ };
1618
+ Timeline.LinearEther.prototype.zoom=function(D){var A=0;
1619
+ var B=this._band._zoomIndex;
1620
+ var C=B;
1621
+ if(D&&(B>0)){C=B-1;
1622
+ }if(!D&&(B<(this._band._zoomSteps.length-1))){C=B+1;
1623
+ }this._band._zoomIndex=C;
1624
+ this._interval=SimileAjax.DateTime.gregorianUnitLengths[this._band._zoomSteps[C].unit];
1625
+ this._pixelsPerInterval=this._band._zoomSteps[C].pixelsPerInterval;
1626
+ A=this._band._zoomSteps[C].unit-this._band._zoomSteps[B].unit;
1627
+ return A;
1628
+ };
1629
+ Timeline.HotZoneEther=function(A){this._params=A;
1630
+ this._interval=A.interval;
1631
+ this._pixelsPerInterval=A.pixelsPerInterval;
1632
+ this._theme=A.theme;
1633
+ };
1634
+ Timeline.HotZoneEther.prototype.initialize=function(I,H){this._band=I;
1635
+ this._timeline=H;
1636
+ this._unit=H.getUnit();
1637
+ this._zones=[{startTime:Number.NEGATIVE_INFINITY,endTime:Number.POSITIVE_INFINITY,magnify:1}];
1638
+ var D=this._params;
1639
+ for(var E=0;
1640
+ E<D.zones.length;
1641
+ E++){var G=D.zones[E];
1642
+ var F=this._unit.parseFromObject(G.start);
1643
+ var B=this._unit.parseFromObject(G.end);
1644
+ for(var C=0;
1645
+ C<this._zones.length&&this._unit.compare(B,F)>0;
1646
+ C++){var A=this._zones[C];
1647
+ if(this._unit.compare(F,A.endTime)<0){if(this._unit.compare(F,A.startTime)>0){this._zones.splice(C,0,{startTime:A.startTime,endTime:F,magnify:A.magnify});
1648
+ C++;
1649
+ A.startTime=F;
1650
+ }if(this._unit.compare(B,A.endTime)<0){this._zones.splice(C,0,{startTime:F,endTime:B,magnify:G.magnify*A.magnify});
1651
+ C++;
1652
+ A.startTime=B;
1653
+ F=B;
1654
+ }else{A.magnify*=G.magnify;
1655
+ F=A.endTime;
1656
+ }}}}if("startsOn" in this._params){this._start=this._unit.parseFromObject(this._params.startsOn);
1657
+ }else{if("endsOn" in this._params){this._start=this._unit.parseFromObject(this._params.endsOn);
1658
+ this.shiftPixels(-this._timeline.getPixelLength());
1659
+ }else{if("centersOn" in this._params){this._start=this._unit.parseFromObject(this._params.centersOn);
1660
+ this.shiftPixels(-this._timeline.getPixelLength()/2);
1661
+ }else{this._start=this._unit.makeDefaultValue();
1662
+ this.shiftPixels(-this._timeline.getPixelLength()/2);
1663
+ }}}};
1664
+ Timeline.HotZoneEther.prototype.setDate=function(A){this._start=this._unit.cloneValue(A);
1665
+ };
1666
+ Timeline.HotZoneEther.prototype.shiftPixels=function(A){this._start=this.pixelOffsetToDate(A);
1667
+ };
1668
+ Timeline.HotZoneEther.prototype.dateToPixelOffset=function(A){return this._dateDiffToPixelOffset(this._start,A);
1669
+ };
1670
+ Timeline.HotZoneEther.prototype.pixelOffsetToDate=function(A){return this._pixelOffsetToDate(A,this._start);
1671
+ };
1672
+ Timeline.HotZoneEther.prototype.zoom=function(D){var A=0;
1673
+ var B=this._band._zoomIndex;
1674
+ var C=B;
1675
+ if(D&&(B>0)){C=B-1;
1676
+ }if(!D&&(B<(this._band._zoomSteps.length-1))){C=B+1;
1677
+ }this._band._zoomIndex=C;
1678
+ this._interval=SimileAjax.DateTime.gregorianUnitLengths[this._band._zoomSteps[C].unit];
1679
+ this._pixelsPerInterval=this._band._zoomSteps[C].pixelsPerInterval;
1680
+ A=this._band._zoomSteps[C].unit-this._band._zoomSteps[B].unit;
1681
+ return A;
1682
+ };
1683
+ Timeline.HotZoneEther.prototype._dateDiffToPixelOffset=function(H,C){var D=this._getScale();
1684
+ var I=H;
1685
+ var B=C;
1686
+ var E=0;
1687
+ if(this._unit.compare(I,B)<0){var G=0;
1688
+ while(G<this._zones.length){if(this._unit.compare(I,this._zones[G].endTime)<0){break;
1689
+ }G++;
1690
+ }while(this._unit.compare(I,B)<0){var F=this._zones[G];
1691
+ var A=this._unit.earlier(B,F.endTime);
1692
+ E+=(this._unit.compare(A,I)/(D/F.magnify));
1693
+ I=A;
1694
+ G++;
1695
+ }}else{var G=this._zones.length-1;
1696
+ while(G>=0){if(this._unit.compare(I,this._zones[G].startTime)>0){break;
1697
+ }G--;
1698
+ }while(this._unit.compare(I,B)>0){var F=this._zones[G];
1699
+ var A=this._unit.later(B,F.startTime);
1700
+ E+=(this._unit.compare(A,I)/(D/F.magnify));
1701
+ I=A;
1702
+ G--;
1703
+ }}return E;
1704
+ };
1705
+ Timeline.HotZoneEther.prototype._pixelOffsetToDate=function(E,B){var G=this._getScale();
1706
+ var D=B;
1707
+ if(E>0){var F=0;
1708
+ while(F<this._zones.length){if(this._unit.compare(D,this._zones[F].endTime)<0){break;
1709
+ }F++;
1710
+ }while(E>0){var A=this._zones[F];
1711
+ var H=G/A.magnify;
1712
+ if(A.endTime==Number.POSITIVE_INFINITY){D=this._unit.change(D,E*H);
1713
+ E=0;
1714
+ }else{var C=this._unit.compare(A.endTime,D)/H;
1715
+ if(C>E){D=this._unit.change(D,E*H);
1716
+ E=0;
1717
+ }else{D=A.endTime;
1718
+ E-=C;
1719
+ }}F++;
1720
+ }}else{var F=this._zones.length-1;
1721
+ while(F>=0){if(this._unit.compare(D,this._zones[F].startTime)>0){break;
1722
+ }F--;
1723
+ }E=-E;
1724
+ while(E>0){var A=this._zones[F];
1725
+ var H=G/A.magnify;
1726
+ if(A.startTime==Number.NEGATIVE_INFINITY){D=this._unit.change(D,-E*H);
1727
+ E=0;
1728
+ }else{var C=this._unit.compare(D,A.startTime)/H;
1729
+ if(C>E){D=this._unit.change(D,-E*H);
1730
+ E=0;
1731
+ }else{D=A.startTime;
1732
+ E-=C;
1733
+ }}F--;
1734
+ }}return D;
1735
+ };
1736
+ Timeline.HotZoneEther.prototype._getScale=function(){return this._interval/this._pixelsPerInterval;
1737
+ };
1738
+
1739
+
1740
+ /* event-utils.js */
1741
+ Timeline.EventUtils={};
1742
+ Timeline.EventUtils.getNewEventID=function(){if(this._lastEventID==null){this._lastEventID=0;
1743
+ }this._lastEventID+=1;
1744
+ return"e"+this._lastEventID;
1745
+ };
1746
+ Timeline.EventUtils.decodeEventElID=function(C){var D=C.split("-");
1747
+ if(D[1]!="tl"){alert("Internal Timeline problem 101, please consult support");
1748
+ return{band:null,evt:null};
1749
+ }var B=Timeline.getTimelineFromID(D[2]);
1750
+ var E=B.getBand(D[3]);
1751
+ var A=E.getEventSource.getEvent(D[4]);
1752
+ return{band:E,evt:A};
1753
+ };
1754
+ Timeline.EventUtils.encodeEventElID=function(B,D,C,A){return C+"-tl-"+B.timelineID+"-"+D.getIndex()+"-"+A.getID();
1755
+ };
1756
+
1757
+
1758
+ /* labellers.js */
1759
+ Timeline.GregorianDateLabeller=function(B,A){this._locale=B;
1760
+ this._timeZone=A;
1761
+ };
1762
+ Timeline.GregorianDateLabeller.monthNames=[];
1763
+ Timeline.GregorianDateLabeller.dayNames=[];
1764
+ Timeline.GregorianDateLabeller.labelIntervalFunctions=[];
1765
+ Timeline.GregorianDateLabeller.getMonthName=function(B,A){return Timeline.GregorianDateLabeller.monthNames[A][B];
1766
+ };
1767
+ Timeline.GregorianDateLabeller.prototype.labelInterval=function(A,C){var B=Timeline.GregorianDateLabeller.labelIntervalFunctions[this._locale];
1768
+ if(B==null){B=Timeline.GregorianDateLabeller.prototype.defaultLabelInterval;
1769
+ }return B.call(this,A,C);
1770
+ };
1771
+ Timeline.GregorianDateLabeller.prototype.labelPrecise=function(A){return SimileAjax.DateTime.removeTimeZoneOffset(A,this._timeZone).toUTCString();
1772
+ };
1773
+ Timeline.GregorianDateLabeller.prototype.defaultLabelInterval=function(B,C){var D;
1774
+ var F=false;
1775
+ B=SimileAjax.DateTime.removeTimeZoneOffset(B,this._timeZone);
1776
+ switch(C){case SimileAjax.DateTime.MILLISECOND:D=B.getUTCMilliseconds();
1777
+ break;
1778
+ case SimileAjax.DateTime.SECOND:D=B.getUTCSeconds();
1779
+ break;
1780
+ case SimileAjax.DateTime.MINUTE:var A=B.getUTCMinutes();
1781
+ if(A==0){D=B.getUTCHours()+":00";
1782
+ F=true;
1783
+ }else{D=A;
1784
+ }break;
1785
+ case SimileAjax.DateTime.HOUR:D=B.getUTCHours()+"hr";
1786
+ break;
1787
+ case SimileAjax.DateTime.DAY:D=Timeline.GregorianDateLabeller.getMonthName(B.getUTCMonth(),this._locale)+" "+B.getUTCDate();
1788
+ break;
1789
+ case SimileAjax.DateTime.WEEK:D=Timeline.GregorianDateLabeller.getMonthName(B.getUTCMonth(),this._locale)+" "+B.getUTCDate();
1790
+ break;
1791
+ case SimileAjax.DateTime.MONTH:var A=B.getUTCMonth();
1792
+ if(A!=0){D=Timeline.GregorianDateLabeller.getMonthName(A,this._locale);
1793
+ break;
1794
+ }case SimileAjax.DateTime.YEAR:case SimileAjax.DateTime.DECADE:case SimileAjax.DateTime.CENTURY:case SimileAjax.DateTime.MILLENNIUM:var E=B.getUTCFullYear();
1795
+ if(E>0){D=B.getUTCFullYear();
1796
+ }else{D=(1-E)+"BC";
1797
+ }F=(C==SimileAjax.DateTime.MONTH)||(C==SimileAjax.DateTime.DECADE&&E%100==0)||(C==SimileAjax.DateTime.CENTURY&&E%1000==0);
1798
+ break;
1799
+ default:D=B.toUTCString();
1800
+ }return{text:D,emphasized:F};
1801
+ };
1802
+
1803
+
1804
+ /* original-painter.js */
1805
+ Timeline.OriginalEventPainter=function(A){this._params=A;
1806
+ this._onSelectListeners=[];
1807
+ this._eventPaintListeners=[];
1808
+ this._filterMatcher=null;
1809
+ this._highlightMatcher=null;
1810
+ this._frc=null;
1811
+ this._eventIdToElmt={};
1812
+ };
1813
+ Timeline.OriginalEventPainter.prototype.initialize=function(B,A){this._band=B;
1814
+ this._timeline=A;
1815
+ this._backLayer=null;
1816
+ this._eventLayer=null;
1817
+ this._lineLayer=null;
1818
+ this._highlightLayer=null;
1819
+ this._eventIdToElmt=null;
1820
+ };
1821
+ Timeline.OriginalEventPainter.prototype.getType=function(){return"original";
1822
+ };
1823
+ Timeline.OriginalEventPainter.prototype.addOnSelectListener=function(A){this._onSelectListeners.push(A);
1824
+ };
1825
+ Timeline.OriginalEventPainter.prototype.removeOnSelectListener=function(B){for(var A=0;
1826
+ A<this._onSelectListeners.length;
1827
+ A++){if(this._onSelectListeners[A]==B){this._onSelectListeners.splice(A,1);
1828
+ break;
1829
+ }}};
1830
+ Timeline.OriginalEventPainter.prototype.addEventPaintListener=function(A){this._eventPaintListeners.push(A);
1831
+ };
1832
+ Timeline.OriginalEventPainter.prototype.removeEventPaintListener=function(B){for(var A=0;
1833
+ A<this._eventPaintListeners.length;
1834
+ A++){if(this._eventPaintListeners[A]==B){this._eventPaintListeners.splice(A,1);
1835
+ break;
1836
+ }}};
1837
+ Timeline.OriginalEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher;
1838
+ };
1839
+ Timeline.OriginalEventPainter.prototype.setFilterMatcher=function(A){this._filterMatcher=A;
1840
+ };
1841
+ Timeline.OriginalEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher;
1842
+ };
1843
+ Timeline.OriginalEventPainter.prototype.setHighlightMatcher=function(A){this._highlightMatcher=A;
1844
+ };
1845
+ Timeline.OriginalEventPainter.prototype.paint=function(){var C=this._band.getEventSource();
1846
+ if(C==null){return ;
1847
+ }this._eventIdToElmt={};
1848
+ this._fireEventPaintListeners("paintStarting",null,null);
1849
+ this._prepareForPainting();
1850
+ var I=this._params.theme.event;
1851
+ var G=Math.max(I.track.height,I.tape.height+this._frc.getLineHeight());
1852
+ var F={trackOffset:I.track.offset,trackHeight:G,trackGap:I.track.gap,trackIncrement:G+I.track.gap,icon:I.instant.icon,iconWidth:I.instant.iconWidth,iconHeight:I.instant.iconHeight,labelWidth:I.label.width,maxLabelChar:I.label.maxLabelChar,impreciseIconMargin:I.instant.impreciseIconMargin};
1853
+ var D=this._band.getMinDate();
1854
+ var B=this._band.getMaxDate();
1855
+ var J=(this._filterMatcher!=null)?this._filterMatcher:function(K){return true;
1856
+ };
1857
+ var A=(this._highlightMatcher!=null)?this._highlightMatcher:function(K){return -1;
1858
+ };
1859
+ var E=C.getEventReverseIterator(D,B);
1860
+ while(E.hasNext()){var H=E.next();
1861
+ if(J(H)){this.paintEvent(H,F,this._params.theme,A(H));
1862
+ }}this._highlightLayer.style.display="block";
1863
+ this._lineLayer.style.display="block";
1864
+ this._eventLayer.style.display="block";
1865
+ this._band.updateEventTrackInfo(this._tracks.length,F.trackIncrement);
1866
+ this._fireEventPaintListeners("paintEnded",null,null);
1867
+ };
1868
+ Timeline.OriginalEventPainter.prototype.softPaint=function(){};
1869
+ Timeline.OriginalEventPainter.prototype._prepareForPainting=function(){var B=this._band;
1870
+ if(this._backLayer==null){this._backLayer=this._band.createLayerDiv(0,"timeline-band-events");
1871
+ this._backLayer.style.visibility="hidden";
1872
+ var A=document.createElement("span");
1873
+ A.className="timeline-event-label";
1874
+ this._backLayer.appendChild(A);
1875
+ this._frc=SimileAjax.Graphics.getFontRenderingContext(A);
1876
+ }this._frc.update();
1877
+ this._tracks=[];
1878
+ if(this._highlightLayer!=null){B.removeLayerDiv(this._highlightLayer);
1879
+ }this._highlightLayer=B.createLayerDiv(105,"timeline-band-highlights");
1880
+ this._highlightLayer.style.display="none";
1881
+ if(this._lineLayer!=null){B.removeLayerDiv(this._lineLayer);
1882
+ }this._lineLayer=B.createLayerDiv(110,"timeline-band-lines");
1883
+ this._lineLayer.style.display="none";
1884
+ if(this._eventLayer!=null){B.removeLayerDiv(this._eventLayer);
1885
+ }this._eventLayer=B.createLayerDiv(115,"timeline-band-events");
1886
+ this._eventLayer.style.display="none";
1887
+ };
1888
+ Timeline.OriginalEventPainter.prototype.paintEvent=function(B,C,D,A){if(B.isInstant()){this.paintInstantEvent(B,C,D,A);
1889
+ }else{this.paintDurationEvent(B,C,D,A);
1890
+ }};
1891
+ Timeline.OriginalEventPainter.prototype.paintInstantEvent=function(B,C,D,A){if(B.isImprecise()){this.paintImpreciseInstantEvent(B,C,D,A);
1892
+ }else{this.paintPreciseInstantEvent(B,C,D,A);
1893
+ }};
1894
+ Timeline.OriginalEventPainter.prototype.paintDurationEvent=function(B,C,D,A){if(B.isImprecise()){this.paintImpreciseDurationEvent(B,C,D,A);
1895
+ }else{this.paintPreciseDurationEvent(B,C,D,A);
1896
+ }};
1897
+ Timeline.OriginalEventPainter.prototype.paintPreciseInstantEvent=function(N,S,V,T){var W=this._timeline.getDocument();
1898
+ var L=N.getText();
1899
+ var H=N.getStart();
1900
+ var I=Math.round(this._band.dateToPixelOffset(H));
1901
+ var A=Math.round(I+S.iconWidth/2);
1902
+ var C=Math.round(I-S.iconWidth/2);
1903
+ var F=this._getLabelDivClassName(N);
1904
+ var D=this._frc.computeSize(L,F);
1905
+ var M=A+V.event.label.offsetFromLine;
1906
+ var J=M+D.width;
1907
+ var Q=J;
1908
+ var P=this._findFreeTrack(N,Q);
1909
+ var R=Math.round(S.trackOffset+P*S.trackIncrement+S.trackHeight/2-D.height/2);
1910
+ var B=this._paintEventIcon(N,P,C,S,V,0);
1911
+ var U=this._paintEventLabel(N,L,M,R,D.width,D.height,V,F,T);
1912
+ var E=[B.elmt,U.elmt];
1913
+ var O=this;
1914
+ var K=function(Y,X,Z){return O._onClickInstantEvent(B.elmt,X,N);
1915
+ };
1916
+ SimileAjax.DOM.registerEvent(B.elmt,"mousedown",K);
1917
+ SimileAjax.DOM.registerEvent(U.elmt,"mousedown",K);
1918
+ var G=this._createHighlightDiv(T,B,V,N);
1919
+ if(G!=null){E.push(G);
1920
+ }this._fireEventPaintListeners("paintedEvent",N,E);
1921
+ this._eventIdToElmt[N.getID()]=B.elmt;
1922
+ this._tracks[P]=C;
1923
+ };
1924
+ Timeline.OriginalEventPainter.prototype.paintImpreciseInstantEvent=function(P,U,Z,W){var b=this._timeline.getDocument();
1925
+ var N=P.getText();
1926
+ var J=P.getStart();
1927
+ var X=P.getEnd();
1928
+ var K=Math.round(this._band.dateToPixelOffset(J));
1929
+ var B=Math.round(this._band.dateToPixelOffset(X));
1930
+ var A=Math.round(K+U.iconWidth/2);
1931
+ var D=Math.round(K-U.iconWidth/2);
1932
+ var H=this._getLabelDivClassName(P);
1933
+ var F=this._frc.computeSize(N,H);
1934
+ var O=A+Z.event.label.offsetFromLine;
1935
+ var L=O+F.width;
1936
+ var S=Math.max(L,B);
1937
+ var R=this._findFreeTrack(P,S);
1938
+ var a=Z.event.tape.height;
1939
+ var T=Math.round(U.trackOffset+R*U.trackIncrement+a);
1940
+ var C=this._paintEventIcon(P,R,D,U,Z,a);
1941
+ var Y=this._paintEventLabel(P,N,O,T,F.width,F.height,Z,H,W);
1942
+ var V=P.getColor();
1943
+ V=V!=null?V:Z.event.instant.impreciseColor;
1944
+ var E=this._paintEventTape(P,R,K,B,V,Z.event.instant.impreciseOpacity,U,Z,0);
1945
+ var G=[C.elmt,Y.elmt,E.elmt];
1946
+ var Q=this;
1947
+ var M=function(d,c,e){return Q._onClickInstantEvent(C.elmt,c,P);
1948
+ };
1949
+ SimileAjax.DOM.registerEvent(C.elmt,"mousedown",M);
1950
+ SimileAjax.DOM.registerEvent(E.elmt,"mousedown",M);
1951
+ SimileAjax.DOM.registerEvent(Y.elmt,"mousedown",M);
1952
+ var I=this._createHighlightDiv(W,C,Z,P);
1953
+ if(I!=null){G.push(I);
1954
+ }this._fireEventPaintListeners("paintedEvent",P,G);
1955
+ this._eventIdToElmt[P.getID()]=C.elmt;
1956
+ this._tracks[R]=D;
1957
+ };
1958
+ Timeline.OriginalEventPainter.prototype.paintPreciseDurationEvent=function(M,R,W,T){var X=this._timeline.getDocument();
1959
+ var K=M.getText();
1960
+ var G=M.getStart();
1961
+ var U=M.getEnd();
1962
+ var H=Math.round(this._band.dateToPixelOffset(G));
1963
+ var A=Math.round(this._band.dateToPixelOffset(U));
1964
+ var E=this._getLabelDivClassName(M);
1965
+ var C=this._frc.computeSize(K,E);
1966
+ var L=H;
1967
+ var I=L+C.width;
1968
+ var P=Math.max(I,A);
1969
+ var O=this._findFreeTrack(M,P);
1970
+ var Q=Math.round(R.trackOffset+O*R.trackIncrement+W.event.tape.height);
1971
+ var S=M.getColor();
1972
+ S=S!=null?S:W.event.duration.color;
1973
+ var B=this._paintEventTape(M,O,H,A,S,100,R,W,0);
1974
+ var V=this._paintEventLabel(M,K,L,Q,C.width,C.height,W,E,T);
1975
+ var D=[B.elmt,V.elmt];
1976
+ var N=this;
1977
+ var J=function(Z,Y,a){return N._onClickDurationEvent(B.elmt,Y,M);
1978
+ };
1979
+ SimileAjax.DOM.registerEvent(B.elmt,"mousedown",J);
1980
+ SimileAjax.DOM.registerEvent(V.elmt,"mousedown",J);
1981
+ var F=this._createHighlightDiv(T,B,W,M);
1982
+ if(F!=null){D.push(F);
1983
+ }this._fireEventPaintListeners("paintedEvent",M,D);
1984
+ this._eventIdToElmt[M.getID()]=B.elmt;
1985
+ this._tracks[O]=H;
1986
+ };
1987
+ Timeline.OriginalEventPainter.prototype.paintImpreciseDurationEvent=function(O,W,b,Y){var c=this._timeline.getDocument();
1988
+ var M=O.getText();
1989
+ var I=O.getStart();
1990
+ var V=O.getLatestStart();
1991
+ var Z=O.getEnd();
1992
+ var Q=O.getEarliestEnd();
1993
+ var K=Math.round(this._band.dateToPixelOffset(I));
1994
+ var F=Math.round(this._band.dateToPixelOffset(V));
1995
+ var A=Math.round(this._band.dateToPixelOffset(Z));
1996
+ var G=Math.round(this._band.dateToPixelOffset(Q));
1997
+ var E=this._getLabelDivClassName(O);
1998
+ var C=this._frc.computeSize(M,E);
1999
+ var N=F;
2000
+ var J=N+C.width;
2001
+ var S=Math.max(J,A);
2002
+ var R=this._findFreeTrack(O,S);
2003
+ var T=Math.round(W.trackOffset+R*W.trackIncrement+b.event.tape.height);
2004
+ var X=O.getColor();
2005
+ X=X!=null?X:b.event.duration.color;
2006
+ var U=this._paintEventTape(O,R,K,A,b.event.duration.impreciseColor,b.event.duration.impreciseOpacity,W,b,0);
2007
+ var B=this._paintEventTape(O,R,F,G,X,100,W,b,1);
2008
+ var a=this._paintEventLabel(O,M,N,T,C.width,C.height,b,E,Y);
2009
+ var D=[U.elmt,B.elmt,a.elmt];
2010
+ var P=this;
2011
+ var L=function(e,d,f){return P._onClickDurationEvent(B.elmt,d,O);
2012
+ };
2013
+ SimileAjax.DOM.registerEvent(B.elmt,"mousedown",L);
2014
+ SimileAjax.DOM.registerEvent(a.elmt,"mousedown",L);
2015
+ var H=this._createHighlightDiv(Y,B,b,O);
2016
+ if(H!=null){D.push(H);
2017
+ }this._fireEventPaintListeners("paintedEvent",O,D);
2018
+ this._eventIdToElmt[O.getID()]=B.elmt;
2019
+ this._tracks[R]=K;
2020
+ };
2021
+ Timeline.OriginalEventPainter.prototype._encodeEventElID=function(B,A){return Timeline.EventUtils.encodeEventElID(this._timeline,this._band,B,A);
2022
+ };
2023
+ Timeline.OriginalEventPainter.prototype._findFreeTrack=function(E,D){var A=E.getTrackNum();
2024
+ if(A!=null){return A;
2025
+ }for(var C=0;
2026
+ C<this._tracks.length;
2027
+ C++){var B=this._tracks[C];
2028
+ if(B>D){break;
2029
+ }}return C;
2030
+ };
2031
+ Timeline.OriginalEventPainter.prototype._paintEventIcon=function(K,B,C,G,F,D){var I=K.getIcon();
2032
+ I=I!=null?I:G.icon;
2033
+ var J;
2034
+ if(D>0){J=G.trackOffset+B*G.trackIncrement+D+G.impreciseIconMargin;
2035
+ }else{var H=G.trackOffset+B*G.trackIncrement+G.trackHeight/2;
2036
+ J=Math.round(H-G.iconHeight/2);
2037
+ }var E=SimileAjax.Graphics.createTranslucentImage(I);
2038
+ var A=this._timeline.getDocument().createElement("div");
2039
+ A.className=this._getElClassName("timeline-event-icon",K,"icon");
2040
+ A.id=this._encodeEventElID("icon",K);
2041
+ A.style.left=C+"px";
2042
+ A.style.top=J+"px";
2043
+ A.appendChild(E);
2044
+ if(K._title!=null){A.title=K._title;
2045
+ }this._eventLayer.appendChild(A);
2046
+ return{left:C,top:J,width:G.iconWidth,height:G.iconHeight,elmt:A};
2047
+ };
2048
+ Timeline.OriginalEventPainter.prototype._paintEventLabel=function(K,L,D,H,A,J,G,E,C){var I=this._timeline.getDocument();
2049
+ var B=I.createElement("div");
2050
+ B.className=E;
2051
+ B.id=this._encodeEventElID("label",K);
2052
+ B.style.left=D+"px";
2053
+ B.style.width=A+"px";
2054
+ B.style.top=H+"px";
2055
+ B.innerHTML=L;
2056
+ if(K._title!=null){B.title=K._title;
2057
+ }var F=K.getTextColor();
2058
+ if(F==null){F=K.getColor();
2059
+ }if(F!=null){B.style.color=F;
2060
+ }if(G.event.highlightLabelBackground&&C>=0){B.style.background=this._getHighlightColor(C,G);
2061
+ }this._eventLayer.appendChild(B);
2062
+ return{left:D,top:H,width:A,height:J,elmt:B};
2063
+ };
2064
+ Timeline.OriginalEventPainter.prototype._paintEventTape=function(N,B,D,A,G,C,J,I,M){var F=A-D;
2065
+ var E=I.event.tape.height;
2066
+ var K=J.trackOffset+B*J.trackIncrement;
2067
+ var O=this._timeline.getDocument().createElement("div");
2068
+ O.className=this._getElClassName("timeline-event-tape",N,"tape");
2069
+ O.id=this._encodeEventElID("tape"+M,N);
2070
+ O.style.left=D+"px";
2071
+ O.style.width=F+"px";
2072
+ O.style.height=E+"px";
2073
+ O.style.top=K+"px";
2074
+ if(N._title!=null){O.title=N._title;
2075
+ }if(G!=null){O.style.backgroundColor=G;
2076
+ }var L=N.getTapeImage();
2077
+ var H=N.getTapeRepeat();
2078
+ H=H!=null?H:"repeat";
2079
+ if(L!=null){O.style.backgroundImage="url("+L+")";
2080
+ O.style.backgroundRepeat=H;
2081
+ }SimileAjax.Graphics.setOpacity(O,C);
2082
+ this._eventLayer.appendChild(O);
2083
+ return{left:D,top:K,width:F,height:E,elmt:O};
2084
+ };
2085
+ Timeline.OriginalEventPainter.prototype._getLabelDivClassName=function(A){return this._getElClassName("timeline-event-label",A,"label");
2086
+ };
2087
+ Timeline.OriginalEventPainter.prototype._getElClassName=function(D,C,A){var E=C.getClassName(),B=[];
2088
+ if(E){if(A){B.push(A+"-"+E+" ");
2089
+ }B.push(E+" ");
2090
+ }B.push(D);
2091
+ return(B.join(""));
2092
+ };
2093
+ Timeline.OriginalEventPainter.prototype._getHighlightColor=function(A,B){var C=B.event.highlightColors;
2094
+ return C[Math.min(A,C.length-1)];
2095
+ };
2096
+ Timeline.OriginalEventPainter.prototype._createHighlightDiv=function(A,D,F,B){var G=null;
2097
+ if(A>=0){var E=this._timeline.getDocument();
2098
+ var C=this._getHighlightColor(A,F);
2099
+ G=E.createElement("div");
2100
+ G.className=this._getElClassName("timeline-event-highlight",B,"highlight");
2101
+ G.id=this._encodeEventElID("highlight0",B);
2102
+ G.style.position="absolute";
2103
+ G.style.overflow="hidden";
2104
+ G.style.left=(D.left-2)+"px";
2105
+ G.style.width=(D.width+4)+"px";
2106
+ G.style.top=(D.top-2)+"px";
2107
+ G.style.height=(D.height+4)+"px";
2108
+ G.style.background=C;
2109
+ this._highlightLayer.appendChild(G);
2110
+ }return G;
2111
+ };
2112
+ Timeline.OriginalEventPainter.prototype._onClickInstantEvent=function(C,A,B){var D=SimileAjax.DOM.getPageCoordinates(C);
2113
+ this._showBubble(D.left+Math.ceil(C.offsetWidth/2),D.top+Math.ceil(C.offsetHeight/2),B);
2114
+ this._fireOnSelect(B.getID());
2115
+ A.cancelBubble=true;
2116
+ SimileAjax.DOM.cancelEvent(A);
2117
+ return false;
2118
+ };
2119
+ Timeline.OriginalEventPainter.prototype._onClickDurationEvent=function(F,B,C){if("pageX" in B){var A=B.pageX;
2120
+ var E=B.pageY;
2121
+ }else{var D=SimileAjax.DOM.getPageCoordinates(F);
2122
+ var A=B.offsetX+D.left;
2123
+ var E=B.offsetY+D.top;
2124
+ }this._showBubble(A,E,C);
2125
+ this._fireOnSelect(C.getID());
2126
+ B.cancelBubble=true;
2127
+ SimileAjax.DOM.cancelEvent(B);
2128
+ return false;
2129
+ };
2130
+ Timeline.OriginalEventPainter.prototype.showBubble=function(A){var B=this._eventIdToElmt[A.getID()];
2131
+ if(B){var C=SimileAjax.DOM.getPageCoordinates(B);
2132
+ this._showBubble(C.left+B.offsetWidth/2,C.top+B.offsetHeight/2,A);
2133
+ }};
2134
+ Timeline.OriginalEventPainter.prototype._showBubble=function(B,E,C){var D=document.createElement("div");
2135
+ var A=this._params.theme.event.bubble;
2136
+ C.fillInfoBubble(D,this._params.theme,this._band.getLabeller());
2137
+ SimileAjax.WindowManager.cancelPopups();
2138
+ SimileAjax.Graphics.createBubbleForContentAndPoint(D,B,E,A.width,null,A.maxHeight);
2139
+ };
2140
+ Timeline.OriginalEventPainter.prototype._fireOnSelect=function(A){for(var B=0;
2141
+ B<this._onSelectListeners.length;
2142
+ B++){this._onSelectListeners[B](A);
2143
+ }};
2144
+ Timeline.OriginalEventPainter.prototype._fireEventPaintListeners=function(D,A,C){for(var B=0;
2145
+ B<this._eventPaintListeners.length;
2146
+ B++){this._eventPaintListeners[B](this._band,D,A,C);
2147
+ }};
2148
+
2149
+
2150
+ /* overview-painter.js */
2151
+ Timeline.OverviewEventPainter=function(A){this._params=A;
2152
+ this._onSelectListeners=[];
2153
+ this._filterMatcher=null;
2154
+ this._highlightMatcher=null;
2155
+ };
2156
+ Timeline.OverviewEventPainter.prototype.initialize=function(B,A){this._band=B;
2157
+ this._timeline=A;
2158
+ this._eventLayer=null;
2159
+ this._highlightLayer=null;
2160
+ };
2161
+ Timeline.OverviewEventPainter.prototype.getType=function(){return"overview";
2162
+ };
2163
+ Timeline.OverviewEventPainter.prototype.addOnSelectListener=function(A){this._onSelectListeners.push(A);
2164
+ };
2165
+ Timeline.OverviewEventPainter.prototype.removeOnSelectListener=function(B){for(var A=0;
2166
+ A<this._onSelectListeners.length;
2167
+ A++){if(this._onSelectListeners[A]==B){this._onSelectListeners.splice(A,1);
2168
+ break;
2169
+ }}};
2170
+ Timeline.OverviewEventPainter.prototype.getFilterMatcher=function(){return this._filterMatcher;
2171
+ };
2172
+ Timeline.OverviewEventPainter.prototype.setFilterMatcher=function(A){this._filterMatcher=A;
2173
+ };
2174
+ Timeline.OverviewEventPainter.prototype.getHighlightMatcher=function(){return this._highlightMatcher;
2175
+ };
2176
+ Timeline.OverviewEventPainter.prototype.setHighlightMatcher=function(A){this._highlightMatcher=A;
2177
+ };
2178
+ Timeline.OverviewEventPainter.prototype.paint=function(){var C=this._band.getEventSource();
2179
+ if(C==null){return ;
2180
+ }this._prepareForPainting();
2181
+ var H=this._params.theme.event;
2182
+ var F={trackOffset:H.overviewTrack.offset,trackHeight:H.overviewTrack.height,trackGap:H.overviewTrack.gap,trackIncrement:H.overviewTrack.height+H.overviewTrack.gap};
2183
+ var D=this._band.getMinDate();
2184
+ var B=this._band.getMaxDate();
2185
+ var I=(this._filterMatcher!=null)?this._filterMatcher:function(J){return true;
2186
+ };
2187
+ var A=(this._highlightMatcher!=null)?this._highlightMatcher:function(J){return -1;
2188
+ };
2189
+ var E=C.getEventReverseIterator(D,B);
2190
+ while(E.hasNext()){var G=E.next();
2191
+ if(I(G)){this.paintEvent(G,F,this._params.theme,A(G));
2192
+ }}this._highlightLayer.style.display="block";
2193
+ this._eventLayer.style.display="block";
2194
+ this._band.updateEventTrackInfo(this._tracks.length,F.trackIncrement);
2195
+ };
2196
+ Timeline.OverviewEventPainter.prototype.softPaint=function(){};
2197
+ Timeline.OverviewEventPainter.prototype._prepareForPainting=function(){var A=this._band;
2198
+ this._tracks=[];
2199
+ if(this._highlightLayer!=null){A.removeLayerDiv(this._highlightLayer);
2200
+ }this._highlightLayer=A.createLayerDiv(105,"timeline-band-highlights");
2201
+ this._highlightLayer.style.display="none";
2202
+ if(this._eventLayer!=null){A.removeLayerDiv(this._eventLayer);
2203
+ }this._eventLayer=A.createLayerDiv(110,"timeline-band-events");
2204
+ this._eventLayer.style.display="none";
2205
+ };
2206
+ Timeline.OverviewEventPainter.prototype.paintEvent=function(B,C,D,A){if(B.isInstant()){this.paintInstantEvent(B,C,D,A);
2207
+ }else{this.paintDurationEvent(B,C,D,A);
2208
+ }};
2209
+ Timeline.OverviewEventPainter.prototype.paintInstantEvent=function(I,H,E,A){var F=I.getStart();
2210
+ var B=Math.round(this._band.dateToPixelOffset(F));
2211
+ var C=I.getColor(),D=I.getClassName();
2212
+ if(D){C=null;
2213
+ }else{C=C!=null?C:E.event.duration.color;
2214
+ }var G=this._paintEventTick(I,B,C,100,H,E);
2215
+ this._createHighlightDiv(A,G,E);
2216
+ };
2217
+ Timeline.OverviewEventPainter.prototype.paintDurationEvent=function(L,K,H,B){var A=L.getLatestStart();
2218
+ var I=L.getEarliestEnd();
2219
+ var J=Math.round(this._band.dateToPixelOffset(A));
2220
+ var C=Math.round(this._band.dateToPixelOffset(I));
2221
+ var F=0;
2222
+ for(;
2223
+ F<this._tracks.length;
2224
+ F++){if(C<this._tracks[F]){break;
2225
+ }}this._tracks[F]=C;
2226
+ var E=L.getColor(),G=L.getClassName();
2227
+ if(G){E=null;
2228
+ }else{E=E!=null?E:H.event.duration.color;
2229
+ }var D=this._paintEventTape(L,F,J,C,E,100,K,H,G);
2230
+ this._createHighlightDiv(B,D,H);
2231
+ };
2232
+ Timeline.OverviewEventPainter.prototype._paintEventTape=function(K,B,D,L,E,C,H,G,F){var I=H.trackOffset+B*H.trackIncrement;
2233
+ var A=L-D;
2234
+ var J=H.trackHeight;
2235
+ var M=this._timeline.getDocument().createElement("div");
2236
+ M.className="timeline-small-event-tape";
2237
+ if(F){M.className+=" small-"+F;
2238
+ }M.style.left=D+"px";
2239
+ M.style.width=A+"px";
2240
+ M.style.top=I+"px";
2241
+ M.style.height=J+"px";
2242
+ if(E){M.style.backgroundColor=E;
2243
+ }if(C<100){SimileAjax.Graphics.setOpacity(M,C);
2244
+ }this._eventLayer.appendChild(M);
2245
+ return{left:D,top:I,width:A,height:J,elmt:M};
2246
+ };
2247
+ Timeline.OverviewEventPainter.prototype._paintEventTick=function(J,C,D,B,G,F){var I=F.event.overviewTrack.tickHeight;
2248
+ var H=G.trackOffset-I;
2249
+ var A=1;
2250
+ var K=this._timeline.getDocument().createElement("div");
2251
+ K.className="timeline-small-event-icon";
2252
+ K.style.left=C+"px";
2253
+ K.style.top=H+"px";
2254
+ var E=J.getClassName();
2255
+ if(E){K.className+=" small-"+E;
2256
+ }if(B<100){SimileAjax.Graphics.setOpacity(K,B);
2257
+ }this._eventLayer.appendChild(K);
2258
+ return{left:C,top:H,width:A,height:I,elmt:K};
2259
+ };
2260
+ Timeline.OverviewEventPainter.prototype._createHighlightDiv=function(A,C,E){if(A>=0){var D=this._timeline.getDocument();
2261
+ var G=E.event;
2262
+ var B=G.highlightColors[Math.min(A,G.highlightColors.length-1)];
2263
+ var F=D.createElement("div");
2264
+ F.style.position="absolute";
2265
+ F.style.overflow="hidden";
2266
+ F.style.left=(C.left-1)+"px";
2267
+ F.style.width=(C.width+2)+"px";
2268
+ F.style.top=(C.top-1)+"px";
2269
+ F.style.height=(C.height+2)+"px";
2270
+ F.style.background=B;
2271
+ this._highlightLayer.appendChild(F);
2272
+ }};
2273
+ Timeline.OverviewEventPainter.prototype.showBubble=function(A){};
2274
+
2275
+
2276
+ /* sources.js */
2277
+ Timeline.DefaultEventSource=function(A){this._events=(A instanceof Object)?A:new SimileAjax.EventIndex();
2278
+ this._listeners=[];
2279
+ };
2280
+ Timeline.DefaultEventSource.prototype.addListener=function(A){this._listeners.push(A);
2281
+ };
2282
+ Timeline.DefaultEventSource.prototype.removeListener=function(B){for(var A=0;
2283
+ A<this._listeners.length;
2284
+ A++){if(this._listeners[A]==B){this._listeners.splice(A,1);
2285
+ break;
2286
+ }}};
2287
+ Timeline.DefaultEventSource.prototype.loadXML=function(G,A){var C=this._getBaseURL(A);
2288
+ var H=G.documentElement.getAttribute("wiki-url");
2289
+ var J=G.documentElement.getAttribute("wiki-section");
2290
+ var F=G.documentElement.getAttribute("date-time-format");
2291
+ var E=this._events.getUnit().getParser(F);
2292
+ var D=G.documentElement.firstChild;
2293
+ var I=false;
2294
+ while(D!=null){if(D.nodeType==1){var L="";
2295
+ if(D.firstChild!=null&&D.firstChild.nodeType==3){L=D.firstChild.nodeValue;
2296
+ }var B=(D.getAttribute("isDuration")===null&&D.getAttribute("durationEvent")===null)||D.getAttribute("isDuration")=="false"||D.getAttribute("durationEvent")=="false";
2297
+ var K=new Timeline.DefaultEventSource.Event({id:D.getAttribute("id"),start:E(D.getAttribute("start")),end:E(D.getAttribute("end")),latestStart:E(D.getAttribute("latestStart")),earliestEnd:E(D.getAttribute("earliestEnd")),instant:B,text:D.getAttribute("title"),description:L,image:this._resolveRelativeURL(D.getAttribute("image"),C),link:this._resolveRelativeURL(D.getAttribute("link"),C),icon:this._resolveRelativeURL(D.getAttribute("icon"),C),color:D.getAttribute("color"),textColor:D.getAttribute("textColor"),hoverText:D.getAttribute("hoverText"),classname:D.getAttribute("classname"),tapeImage:D.getAttribute("tapeImage"),tapeRepeat:D.getAttribute("tapeRepeat"),caption:D.getAttribute("caption"),eventID:D.getAttribute("eventID"),trackNum:D.getAttribute("trackNum")});
2298
+ K._node=D;
2299
+ K.getProperty=function(M){return this._node.getAttribute(M);
2300
+ };
2301
+ K.setWikiInfo(H,J);
2302
+ this._events.add(K);
2303
+ I=true;
2304
+ }D=D.nextSibling;
2305
+ }if(I){this._fire("onAddMany",[]);
2306
+ }};
2307
+ Timeline.DefaultEventSource.prototype.loadJSON=function(H,B){var D=this._getBaseURL(B);
2308
+ var J=false;
2309
+ if(H&&H.events){var I=("wikiURL" in H)?H.wikiURL:null;
2310
+ var K=("wikiSection" in H)?H.wikiSection:null;
2311
+ var F=("dateTimeFormat" in H)?H.dateTimeFormat:null;
2312
+ var E=this._events.getUnit().getParser(F);
2313
+ for(var G=0;
2314
+ G<H.events.length;
2315
+ G++){var A=H.events[G];
2316
+ var C=A.isDuration||(A.durationEvent!=null&&!A.durationEvent);
2317
+ var L=new Timeline.DefaultEventSource.Event({id:("id" in A)?A.id:undefined,start:E(A.start),end:E(A.end),latestStart:E(A.latestStart),earliestEnd:E(A.earliestEnd),instant:C,text:A.title,description:A.description,image:this._resolveRelativeURL(A.image,D),link:this._resolveRelativeURL(A.link,D),icon:this._resolveRelativeURL(A.icon,D),color:A.color,textColor:A.textColor,hoverText:A.hoverText,classname:A.classname,tapeImage:A.tapeImage,tapeRepeat:A.tapeRepeat,caption:A.caption,eventID:A.eventID,trackNum:A.trackNum});
2318
+ L._obj=A;
2319
+ L.getProperty=function(M){return this._obj[M];
2320
+ };
2321
+ L.setWikiInfo(I,K);
2322
+ this._events.add(L);
2323
+ J=true;
2324
+ }}if(J){this._fire("onAddMany",[]);
2325
+ }};
2326
+ Timeline.DefaultEventSource.prototype.loadSPARQL=function(I,B){var E=this._getBaseURL(B);
2327
+ var H="iso8601";
2328
+ var G=this._events.getUnit().getParser(H);
2329
+ if(I==null){return ;
2330
+ }var F=I.documentElement.firstChild;
2331
+ while(F!=null&&(F.nodeType!=1||F.nodeName!="results")){F=F.nextSibling;
2332
+ }var J=null;
2333
+ var L=null;
2334
+ if(F!=null){J=F.getAttribute("wiki-url");
2335
+ L=F.getAttribute("wiki-section");
2336
+ F=F.firstChild;
2337
+ }var K=false;
2338
+ while(F!=null){if(F.nodeType==1){var D={};
2339
+ var A=F.firstChild;
2340
+ while(A!=null){if(A.nodeType==1&&A.firstChild!=null&&A.firstChild.nodeType==1&&A.firstChild.firstChild!=null&&A.firstChild.firstChild.nodeType==3){D[A.getAttribute("name")]=A.firstChild.firstChild.nodeValue;
2341
+ }A=A.nextSibling;
2342
+ }if(D["start"]==null&&D["date"]!=null){D["start"]=D["date"];
2343
+ }var C=(D["isDuration"]===null&&D["durationEvent"]===null)||D["isDuration"]=="false"||D["durationEvent"]=="false";
2344
+ var M=new Timeline.DefaultEventSource.Event({id:D["id"],start:G(D["start"]),end:G(D["end"]),latestStart:G(D["latestStart"]),earliestEnd:G(D["earliestEnd"]),instant:C,text:D["title"],description:D["description"],image:this._resolveRelativeURL(D["image"],E),link:this._resolveRelativeURL(D["link"],E),icon:this._resolveRelativeURL(D["icon"],E),color:D["color"],textColor:D["textColor"],hoverText:D["hoverText"],caption:D["caption"],classname:D["classname"],tapeImage:D["tapeImage"],tapeRepeat:D["tapeRepeat"],eventID:D["eventID"],trackNum:D["trackNum"]});
2345
+ M._bindings=D;
2346
+ M.getProperty=function(N){return this._bindings[N];
2347
+ };
2348
+ M.setWikiInfo(J,L);
2349
+ this._events.add(M);
2350
+ K=true;
2351
+ }F=F.nextSibling;
2352
+ }if(K){this._fire("onAddMany",[]);
2353
+ }};
2354
+ Timeline.DefaultEventSource.prototype.add=function(A){this._events.add(A);
2355
+ this._fire("onAddOne",[A]);
2356
+ };
2357
+ Timeline.DefaultEventSource.prototype.addMany=function(A){for(var B=0;
2358
+ B<A.length;
2359
+ B++){this._events.add(A[B]);
2360
+ }this._fire("onAddMany",[]);
2361
+ };
2362
+ Timeline.DefaultEventSource.prototype.clear=function(){this._events.removeAll();
2363
+ this._fire("onClear",[]);
2364
+ };
2365
+ Timeline.DefaultEventSource.prototype.getEvent=function(A){return this._events.getEvent(A);
2366
+ };
2367
+ Timeline.DefaultEventSource.prototype.getEventIterator=function(A,B){return this._events.getIterator(A,B);
2368
+ };
2369
+ Timeline.DefaultEventSource.prototype.getEventReverseIterator=function(A,B){return this._events.getReverseIterator(A,B);
2370
+ };
2371
+ Timeline.DefaultEventSource.prototype.getAllEventIterator=function(){return this._events.getAllIterator();
2372
+ };
2373
+ Timeline.DefaultEventSource.prototype.getCount=function(){return this._events.getCount();
2374
+ };
2375
+ Timeline.DefaultEventSource.prototype.getEarliestDate=function(){return this._events.getEarliestDate();
2376
+ };
2377
+ Timeline.DefaultEventSource.prototype.getLatestDate=function(){return this._events.getLatestDate();
2378
+ };
2379
+ Timeline.DefaultEventSource.prototype._fire=function(B,A){for(var C=0;
2380
+ C<this._listeners.length;
2381
+ C++){var D=this._listeners[C];
2382
+ if(B in D){try{D[B].apply(D,A);
2383
+ }catch(E){SimileAjax.Debug.exception(E);
2384
+ }}}};
2385
+ Timeline.DefaultEventSource.prototype._getBaseURL=function(A){if(A.indexOf("://")<0){var C=this._getBaseURL(document.location.href);
2386
+ if(A.substr(0,1)=="/"){A=C.substr(0,C.indexOf("/",C.indexOf("://")+3))+A;
2387
+ }else{A=C+A;
2388
+ }}var B=A.lastIndexOf("/");
2389
+ if(B<0){return"";
2390
+ }else{return A.substr(0,B+1);
2391
+ }};
2392
+ Timeline.DefaultEventSource.prototype._resolveRelativeURL=function(A,B){if(A==null||A==""){return A;
2393
+ }else{if(A.indexOf("://")>0){return A;
2394
+ }else{if(A.substr(0,1)=="/"){return B.substr(0,B.indexOf("/",B.indexOf("://")+3))+A;
2395
+ }else{return B+A;
2396
+ }}}};
2397
+ Timeline.DefaultEventSource.Event=function(A){function D(E){return(A[E]!=null&&A[E]!="")?A[E]:null;
2398
+ }var C=A.id?A.id.trim():"";
2399
+ this._id=C.length>0?C:Timeline.EventUtils.getNewEventID();
2400
+ this._instant=A.instant||(A.end==null);
2401
+ this._start=A.start;
2402
+ this._end=(A.end!=null)?A.end:A.start;
2403
+ this._latestStart=(A.latestStart!=null)?A.latestStart:(A.instant?this._end:this._start);
2404
+ this._earliestEnd=(A.earliestEnd!=null)?A.earliestEnd:this._end;
2405
+ var B=[];
2406
+ if(this._start>this._latestStart){this._latestStart=this._start;
2407
+ B.push("start is > latestStart");
2408
+ }if(this._start>this._earliestEnd){this._earliestEnd=this._latestStart;
2409
+ B.push("start is > earliestEnd");
2410
+ }if(this._start>this._end){this._end=this._earliestEnd;
2411
+ B.push("start is > end");
2412
+ }if(this._latestStart>this._earliestEnd){this._earliestEnd=this._latestStart;
2413
+ B.push("latestStart is > earliestEnd");
2414
+ }if(this._latestStart>this._end){this._end=this._earliestEnd;
2415
+ B.push("latestStart is > end");
2416
+ }if(this._earliestEnd>this._end){this._end=this._earliestEnd;
2417
+ B.push("earliestEnd is > end");
2418
+ }this._eventID=D("eventID");
2419
+ this._text=(A.text!=null)?SimileAjax.HTML.deEntify(A.text):"";
2420
+ if(B.length>0){this._text+=" PROBLEM: "+B.join(", ");
2421
+ }this._description=SimileAjax.HTML.deEntify(A.description);
2422
+ this._image=D("image");
2423
+ this._link=D("link");
2424
+ this._title=D("hoverText");
2425
+ this._title=D("caption");
2426
+ this._icon=D("icon");
2427
+ this._color=D("color");
2428
+ this._textColor=D("textColor");
2429
+ this._classname=D("classname");
2430
+ this._tapeImage=D("tapeImage");
2431
+ this._tapeRepeat=D("tapeRepeat");
2432
+ this._trackNum=D("trackNum");
2433
+ if(this._trackNum!=null){this._trackNum=parseInt(this._trackNum);
2434
+ }this._wikiURL=null;
2435
+ this._wikiSection=null;
2436
+ };
2437
+ Timeline.DefaultEventSource.Event.prototype={getID:function(){return this._id;
2438
+ },isInstant:function(){return this._instant;
2439
+ },isImprecise:function(){return this._start!=this._latestStart||this._end!=this._earliestEnd;
2440
+ },getStart:function(){return this._start;
2441
+ },getEnd:function(){return this._end;
2442
+ },getLatestStart:function(){return this._latestStart;
2443
+ },getEarliestEnd:function(){return this._earliestEnd;
2444
+ },getEventID:function(){return this._eventID;
2445
+ },getText:function(){return this._text;
2446
+ },getDescription:function(){return this._description;
2447
+ },getImage:function(){return this._image;
2448
+ },getLink:function(){return this._link;
2449
+ },getIcon:function(){return this._icon;
2450
+ },getColor:function(){return this._color;
2451
+ },getTextColor:function(){return this._textColor;
2452
+ },getClassName:function(){return this._classname;
2453
+ },getTapeImage:function(){return this._tapeImage;
2454
+ },getTapeRepeat:function(){return this._tapeRepeat;
2455
+ },getTrackNum:function(){return this._trackNum;
2456
+ },getProperty:function(A){return null;
2457
+ },getWikiURL:function(){return this._wikiURL;
2458
+ },getWikiSection:function(){return this._wikiSection;
2459
+ },setWikiInfo:function(B,A){this._wikiURL=B;
2460
+ this._wikiSection=A;
2461
+ },fillDescription:function(A){A.innerHTML=this._description;
2462
+ },fillWikiInfo:function(D){D.style.display="none";
2463
+ if(this._wikiURL==null||this._wikiSection==null){return ;
2464
+ }var C=this.getProperty("wikiID");
2465
+ if(C==null||C.length==0){C=this.getText();
2466
+ }if(C==null||C.length==0){return ;
2467
+ }D.style.display="inline";
2468
+ C=C.replace(/\s/g,"_");
2469
+ var B=this._wikiURL+this._wikiSection.replace(/\s/g,"_")+"/"+C;
2470
+ var A=document.createElement("a");
2471
+ A.href=B;
2472
+ A.target="new";
2473
+ A.innerHTML=Timeline.strings[Timeline.clientLocale].wikiLinkLabel;
2474
+ D.appendChild(document.createTextNode("["));
2475
+ D.appendChild(A);
2476
+ D.appendChild(document.createTextNode("]"));
2477
+ },fillTime:function(A,B){if(this._instant){if(this.isImprecise()){A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start)));
2478
+ A.appendChild(A.ownerDocument.createElement("br"));
2479
+ A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._end)));
2480
+ }else{A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start)));
2481
+ }}else{if(this.isImprecise()){A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start)+" ~ "+B.labelPrecise(this._latestStart)));
2482
+ A.appendChild(A.ownerDocument.createElement("br"));
2483
+ A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._earliestEnd)+" ~ "+B.labelPrecise(this._end)));
2484
+ }else{A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._start)));
2485
+ A.appendChild(A.ownerDocument.createElement("br"));
2486
+ A.appendChild(A.ownerDocument.createTextNode(B.labelPrecise(this._end)));
2487
+ }}},fillInfoBubble:function(A,E,M){var K=A.ownerDocument;
2488
+ var J=this.getText();
2489
+ var H=this.getLink();
2490
+ var B=this.getImage();
2491
+ if(B!=null){var D=K.createElement("img");
2492
+ D.src=B;
2493
+ E.event.bubble.imageStyler(D);
2494
+ A.appendChild(D);
2495
+ }var L=K.createElement("div");
2496
+ var C=K.createTextNode(J);
2497
+ if(H!=null){var I=K.createElement("a");
2498
+ I.href=H;
2499
+ I.appendChild(C);
2500
+ L.appendChild(I);
2501
+ }else{L.appendChild(C);
2502
+ }E.event.bubble.titleStyler(L);
2503
+ A.appendChild(L);
2504
+ var N=K.createElement("div");
2505
+ this.fillDescription(N);
2506
+ E.event.bubble.bodyStyler(N);
2507
+ A.appendChild(N);
2508
+ var G=K.createElement("div");
2509
+ this.fillTime(G,M);
2510
+ E.event.bubble.timeStyler(G);
2511
+ A.appendChild(G);
2512
+ var F=K.createElement("div");
2513
+ this.fillWikiInfo(F);
2514
+ E.event.bubble.wikiStyler(F);
2515
+ A.appendChild(F);
2516
+ }};
2517
+
2518
+
2519
+ /* themes.js */
2520
+ Timeline.ClassicTheme=new Object();
2521
+ Timeline.ClassicTheme.implementations=[];
2522
+ Timeline.ClassicTheme.create=function(B){if(B==null){B=Timeline.getDefaultLocale();
2523
+ }var A=Timeline.ClassicTheme.implementations[B];
2524
+ if(A==null){A=Timeline.ClassicTheme._Impl;
2525
+ }return new A();
2526
+ };
2527
+ Timeline.ClassicTheme._Impl=function(){this.firstDayOfWeek=0;
2528
+ this.autoWidth=false;
2529
+ this.autoWidthAnimationTime=500;
2530
+ this.timeline_start=null;
2531
+ this.timeline_stop=null;
2532
+ this.ether={backgroundColors:[],highlightOpacity:50,interval:{line:{show:true,opacity:25},weekend:{opacity:30},marker:{hAlign:"Bottom",vAlign:"Right"}}};
2533
+ 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";
2534
+ },bodyStyler:function(A){A.className="timeline-event-bubble-body";
2535
+ },imageStyler:function(A){A.className="timeline-event-bubble-image";
2536
+ },wikiStyler:function(A){A.className="timeline-event-bubble-wiki";
2537
+ },timeStyler:function(A){A.className="timeline-event-bubble-time";
2538
+ }}};
2539
+ this.mouseWheel="scroll";
2540
+ };
2541
+
2542
+
2543
+ /* timeline.js */
2544
+ Timeline.version="2.3.0";
2545
+ Timeline.ajax_lib_version=SimileAjax.version;
2546
+ Timeline.display_version=Timeline.version+" (with Ajax lib "+Timeline.ajax_lib_version+")";
2547
+ Timeline.strings={};
2548
+ Timeline.HORIZONTAL=0;
2549
+ Timeline.VERTICAL=1;
2550
+ Timeline._defaultTheme=null;
2551
+ Timeline.getDefaultLocale=function(){return Timeline.clientLocale;
2552
+ };
2553
+ Timeline.create=function(D,C,E,F){if(Timeline.timelines==null){Timeline.timelines=[];
2554
+ }var B=Timeline.timelines.length;
2555
+ Timeline.timelines[B]=null;
2556
+ var A=new Timeline._Impl(D,C,E,F,B);
2557
+ Timeline.timelines[B]=A;
2558
+ return A;
2559
+ };
2560
+ Timeline.createBandInfo=function(F){var G=("theme" in F)?F.theme:Timeline.getDefaultTheme();
2561
+ var D=("eventSource" in F)?F.eventSource:null;
2562
+ var H=new Timeline.LinearEther({centersOn:("date" in F)?F.date:new Date(),interval:SimileAjax.DateTime.gregorianUnitLengths[F.intervalUnit],pixelsPerInterval:F.intervalPixels,theme:G});
2563
+ var C=new Timeline.GregorianEtherPainter({unit:F.intervalUnit,multiple:("multiple" in F)?F.multiple:1,theme:G,align:("align" in F)?F.align:undefined});
2564
+ var I={showText:("showEventText" in F)?F.showEventText:true,theme:G};
2565
+ if("eventPainterParams" in F){for(var A in F.eventPainterParams){I[A]=F.eventPainterParams[A];
2566
+ }}if("trackHeight" in F){I.trackHeight=F.trackHeight;
2567
+ }if("trackGap" in F){I.trackGap=F.trackGap;
2568
+ }var B=("overview" in F&&F.overview)?"overview":("layout" in F?F.layout:"original");
2569
+ var E;
2570
+ if("eventPainter" in F){E=new F.eventPainter(I);
2571
+ }else{switch(B){case"overview":E=new Timeline.OverviewEventPainter(I);
2572
+ break;
2573
+ case"detailed":E=new Timeline.DetailedEventPainter(I);
2574
+ break;
2575
+ default:E=new Timeline.OriginalEventPainter(I);
2576
+ }}return{width:F.width,eventSource:D,timeZone:("timeZone" in F)?F.timeZone:0,ether:H,etherPainter:C,eventPainter:E,theme:G,zoomIndex:("zoomIndex" in F)?F.zoomIndex:0,zoomSteps:("zoomSteps" in F)?F.zoomSteps:null};
2577
+ };
2578
+ Timeline.createHotZoneBandInfo=function(F){var G=("theme" in F)?F.theme:Timeline.getDefaultTheme();
2579
+ var D=("eventSource" in F)?F.eventSource:null;
2580
+ var H=new Timeline.HotZoneEther({centersOn:("date" in F)?F.date:new Date(),interval:SimileAjax.DateTime.gregorianUnitLengths[F.intervalUnit],pixelsPerInterval:F.intervalPixels,zones:F.zones,theme:G});
2581
+ var C=new Timeline.HotZoneGregorianEtherPainter({unit:F.intervalUnit,zones:F.zones,theme:G,align:("align" in F)?F.align:undefined});
2582
+ var I={showText:("showEventText" in F)?F.showEventText:true,theme:G};
2583
+ if("eventPainterParams" in F){for(var A in F.eventPainterParams){I[A]=F.eventPainterParams[A];
2584
+ }}if("trackHeight" in F){I.trackHeight=F.trackHeight;
2585
+ }if("trackGap" in F){I.trackGap=F.trackGap;
2586
+ }var B=("overview" in F&&F.overview)?"overview":("layout" in F?F.layout:"original");
2587
+ var E;
2588
+ if("eventPainter" in F){E=new F.eventPainter(I);
2589
+ }else{switch(B){case"overview":E=new Timeline.OverviewEventPainter(I);
2590
+ break;
2591
+ case"detailed":E=new Timeline.DetailedEventPainter(I);
2592
+ break;
2593
+ default:E=new Timeline.OriginalEventPainter(I);
2594
+ }}return{width:F.width,eventSource:D,timeZone:("timeZone" in F)?F.timeZone:0,ether:H,etherPainter:C,eventPainter:E,theme:G,zoomIndex:("zoomIndex" in F)?F.zoomIndex:0,zoomSteps:("zoomSteps" in F)?F.zoomSteps:null};
2595
+ };
2596
+ Timeline.getDefaultTheme=function(){if(Timeline._defaultTheme==null){Timeline._defaultTheme=Timeline.ClassicTheme.create(Timeline.getDefaultLocale());
2597
+ }return Timeline._defaultTheme;
2598
+ };
2599
+ Timeline.setDefaultTheme=function(A){Timeline._defaultTheme=A;
2600
+ };
2601
+ Timeline.loadXML=function(A,C){var D=function(G,F,E){alert("Failed to load data xml from "+A+"\n"+G);
2602
+ };
2603
+ var B=function(F){var E=F.responseXML;
2604
+ if(!E.documentElement&&F.responseStream){E.load(F.responseStream);
2605
+ }C(E,A);
2606
+ };
2607
+ SimileAjax.XmlHttp.get(A,D,B);
2608
+ };
2609
+ Timeline.loadJSON=function(url,f){var fError=function(statusText,status,xmlhttp){alert("Failed to load json data from "+url+"\n"+statusText);
2610
+ };
2611
+ var fDone=function(xmlhttp){f(eval("("+xmlhttp.responseText+")"),url);
2612
+ };
2613
+ SimileAjax.XmlHttp.get(url,fError,fDone);
2614
+ };
2615
+ Timeline.getTimelineFromID=function(A){return Timeline.timelines[A];
2616
+ };
2617
+ Timeline.writeVersion=function(A){document.getElementById(A).innerHTML=this.display_version;
2618
+ };
2619
+ Timeline._Impl=function(C,B,D,E,A){SimileAjax.WindowManager.initialize();
2620
+ this._containerDiv=C;
2621
+ this._bandInfos=B;
2622
+ this._orientation=D==null?Timeline.HORIZONTAL:D;
2623
+ this._unit=(E!=null)?E:SimileAjax.NativeDateUnit;
2624
+ this._starting=true;
2625
+ this._autoResizing=false;
2626
+ this.autoWidth=B&&B[0]&&B[0].theme&&B[0].theme.autoWidth;
2627
+ this.autoWidthAnimationTime=B&&B[0]&&B[0].theme&&B[0].theme.autoWidthAnimationTime;
2628
+ this.timelineID=A;
2629
+ this.timeline_start=B&&B[0]&&B[0].theme&&B[0].theme.timeline_start;
2630
+ this.timeline_stop=B&&B[0]&&B[0].theme&&B[0].theme.timeline_stop;
2631
+ this.timeline_at_start=false;
2632
+ this.timeline_at_stop=false;
2633
+ this._initialize();
2634
+ };
2635
+ Timeline._Impl.prototype.dispose=function(){for(var A=0;
2636
+ A<this._bands.length;
2637
+ A++){this._bands[A].dispose();
2638
+ }this._bands=null;
2639
+ this._bandInfos=null;
2640
+ this._containerDiv.innerHTML="";
2641
+ Timeline.timelines[this.timelineID]=null;
2642
+ };
2643
+ Timeline._Impl.prototype.getBandCount=function(){return this._bands.length;
2644
+ };
2645
+ Timeline._Impl.prototype.getBand=function(A){return this._bands[A];
2646
+ };
2647
+ Timeline._Impl.prototype.finishedEventLoading=function(){this._autoWidthCheck(true);
2648
+ this._starting=false;
2649
+ };
2650
+ Timeline._Impl.prototype.layout=function(){this._autoWidthCheck(true);
2651
+ this._distributeWidths();
2652
+ };
2653
+ Timeline._Impl.prototype.paint=function(){for(var A=0;
2654
+ A<this._bands.length;
2655
+ A++){this._bands[A].paint();
2656
+ }};
2657
+ Timeline._Impl.prototype.getDocument=function(){return this._containerDiv.ownerDocument;
2658
+ };
2659
+ Timeline._Impl.prototype.addDiv=function(A){this._containerDiv.appendChild(A);
2660
+ };
2661
+ Timeline._Impl.prototype.removeDiv=function(A){this._containerDiv.removeChild(A);
2662
+ };
2663
+ Timeline._Impl.prototype.isHorizontal=function(){return this._orientation==Timeline.HORIZONTAL;
2664
+ };
2665
+ Timeline._Impl.prototype.isVertical=function(){return this._orientation==Timeline.VERTICAL;
2666
+ };
2667
+ Timeline._Impl.prototype.getPixelLength=function(){return this._orientation==Timeline.HORIZONTAL?this._containerDiv.offsetWidth:this._containerDiv.offsetHeight;
2668
+ };
2669
+ Timeline._Impl.prototype.getPixelWidth=function(){return this._orientation==Timeline.VERTICAL?this._containerDiv.offsetWidth:this._containerDiv.offsetHeight;
2670
+ };
2671
+ Timeline._Impl.prototype.getUnit=function(){return this._unit;
2672
+ };
2673
+ Timeline._Impl.prototype.getWidthStyle=function(){return this._orientation==Timeline.HORIZONTAL?"height":"width";
2674
+ };
2675
+ Timeline._Impl.prototype.loadXML=function(B,D){var A=this;
2676
+ var E=function(H,G,F){alert("Failed to load data xml from "+B+"\n"+H);
2677
+ A.hideLoadingMessage();
2678
+ };
2679
+ var C=function(G){try{var F=G.responseXML;
2680
+ if(!F.documentElement&&G.responseStream){F.load(G.responseStream);
2681
+ }D(F,B);
2682
+ }finally{A.hideLoadingMessage();
2683
+ }};
2684
+ this.showLoadingMessage();
2685
+ window.setTimeout(function(){SimileAjax.XmlHttp.get(B,E,C);
2686
+ },0);
2687
+ };
2688
+ Timeline._Impl.prototype.loadJSON=function(url,f){var tl=this;
2689
+ var fError=function(statusText,status,xmlhttp){alert("Failed to load json data from "+url+"\n"+statusText);
2690
+ tl.hideLoadingMessage();
2691
+ };
2692
+ var fDone=function(xmlhttp){try{f(eval("("+xmlhttp.responseText+")"),url);
2693
+ }finally{tl.hideLoadingMessage();
2694
+ }};
2695
+ this.showLoadingMessage();
2696
+ window.setTimeout(function(){SimileAjax.XmlHttp.get(url,fError,fDone);
2697
+ },0);
2698
+ };
2699
+ Timeline._Impl.prototype._autoWidthScrollListener=function(A){A.getTimeline()._autoWidthCheck(false);
2700
+ };
2701
+ Timeline._Impl.prototype._autoWidthCheck=function(C){var A=this;
2702
+ var B=A._starting;
2703
+ var D=0;
2704
+ function E(){var G=A.getWidthStyle();
2705
+ if(B){A._containerDiv.style[G]=D+"px";
2706
+ }else{A._autoResizing=true;
2707
+ var H={};
2708
+ H[G]=D+"px";
2709
+ SimileAjax.jQuery(A._containerDiv).animate(H,A.autoWidthAnimationTime,"linear",function(){A._autoResizing=false;
2710
+ });
2711
+ }}function F(){var H=0;
2712
+ var G=A.getPixelWidth();
2713
+ if(A._autoResizing){return ;
2714
+ }for(var I=0;
2715
+ I<A._bands.length;
2716
+ I++){A._bands[I].checkAutoWidth();
2717
+ H+=A._bandInfos[I].width;
2718
+ }if(H>G||C){D=H;
2719
+ E();
2720
+ A._distributeWidths();
2721
+ }}if(!A.autoWidth){return ;
2722
+ }F();
2723
+ };
2724
+ Timeline._Impl.prototype._initialize=function(){var H=this._containerDiv;
2725
+ var E=H.ownerDocument;
2726
+ H.className=H.className.split(" ").concat("timeline-container").join(" ");
2727
+ var C=(this.isHorizontal())?"horizontal":"vertical";
2728
+ H.className+=" timeline-"+C;
2729
+ while(H.firstChild){H.removeChild(H.firstChild);
2730
+ }var A=SimileAjax.Graphics.createTranslucentImage(Timeline.urlPrefix+(this.isHorizontal()?"images/copyright-vertical.png":"images/copyright.png"));
2731
+ A.className="timeline-copyright";
2732
+ A.title="Timeline copyright SIMILE - www.code.google.com/p/simile-widgets/";
2733
+ SimileAjax.DOM.registerEvent(A,"click",function(){window.location="http://code.google.com/p/simile-widgets/";
2734
+ });
2735
+ H.appendChild(A);
2736
+ this._bands=[];
2737
+ for(var B=0;
2738
+ B<this._bandInfos.length;
2739
+ B++){var G=new Timeline._Band(this,this._bandInfos[B],B);
2740
+ this._bands.push(G);
2741
+ }this._distributeWidths();
2742
+ for(var B=0;
2743
+ B<this._bandInfos.length;
2744
+ B++){var F=this._bandInfos[B];
2745
+ if("syncWith" in F){this._bands[B].setSyncWithBand(this._bands[F.syncWith],("highlight" in F)?F.highlight:false);
2746
+ }}if(this.autoWidth){for(var B=0;
2747
+ B<this._bands.length;
2748
+ B++){this._bands[B].addOnScrollListener(this._autoWidthScrollListener);
2749
+ }}var D=SimileAjax.Graphics.createMessageBubble(E);
2750
+ D.containerDiv.className="timeline-message-container";
2751
+ H.appendChild(D.containerDiv);
2752
+ D.contentDiv.className="timeline-message";
2753
+ D.contentDiv.innerHTML="<img src='"+Timeline.urlPrefix+"images/progress-running.gif' /> Loading...";
2754
+ this.showLoadingMessage=function(){D.containerDiv.style.display="block";
2755
+ };
2756
+ this.hideLoadingMessage=function(){D.containerDiv.style.display="none";
2757
+ };
2758
+ };
2759
+ Timeline._Impl.prototype._distributeWidths=function(){var G=this.getPixelLength();
2760
+ var B=this.getPixelWidth();
2761
+ var C=0;
2762
+ for(var F=0;
2763
+ F<this._bands.length;
2764
+ F++){var J=this._bands[F];
2765
+ var I=this._bandInfos[F];
2766
+ var E=I.width;
2767
+ var D;
2768
+ if(typeof E=="string"){var H=E.indexOf("%");
2769
+ if(H>0){var A=parseInt(E.substr(0,H));
2770
+ D=Math.round(A*B/100);
2771
+ }else{D=parseInt(E);
2772
+ }}else{D=E;
2773
+ }J.setBandShiftAndWidth(C,D);
2774
+ J.setViewLength(G);
2775
+ C+=D;
2776
+ }};
2777
+ Timeline._Impl.prototype.shiftOK=function(C,B){var F=B>0,A=B<0;
2778
+ if((F&&this.timeline_start==null)||(A&&this.timeline_stop==null)||(B==0)){return(true);
2779
+ }var H=false;
2780
+ for(var E=0;
2781
+ E<this._bands.length&&!H;
2782
+ E++){H=this._bands[E].busy();
2783
+ }if(H){return(true);
2784
+ }if((F&&this.timeline_at_start)||(A&&this.timeline_at_stop)){return(false);
2785
+ }var D=false;
2786
+ for(var E=0;
2787
+ E<this._bands.length&&!D;
2788
+ E++){var G=this._bands[E];
2789
+ if(F){D=(E==C?G.getMinVisibleDateAfterDelta(B):G.getMinVisibleDate())>=this.timeline_start;
2790
+ }else{D=(E==C?G.getMaxVisibleDateAfterDelta(B):G.getMaxVisibleDate())<=this.timeline_stop;
2791
+ }}if(F){this.timeline_at_start=!D;
2792
+ this.timeline_at_stop=false;
2793
+ }else{this.timeline_at_stop=!D;
2794
+ this.timeline_at_start=false;
2795
+ }return(D);
2796
+ };
2797
+ Timeline._Impl.prototype.zoom=function(D,A,G,F){var C=new RegExp("^timeline-band-([0-9]+)$");
2798
+ var E=null;
2799
+ var B=C.exec(F.id);
2800
+ if(B){E=parseInt(B[1]);
2801
+ }if(E!=null){this._bands[E].zoom(D,A,G,F);
2802
+ }this.paint();
2803
+ };
2804
+
2805
+
2806
+ /* units.js */
2807
+ Timeline.NativeDateUnit=new Object();
2808
+ Timeline.NativeDateUnit.createLabeller=function(B,A){return new Timeline.GregorianDateLabeller(B,A);
2809
+ };
2810
+ Timeline.NativeDateUnit.makeDefaultValue=function(){return new Date();
2811
+ };
2812
+ Timeline.NativeDateUnit.cloneValue=function(A){return new Date(A.getTime());
2813
+ };
2814
+ Timeline.NativeDateUnit.getParser=function(A){if(typeof A=="string"){A=A.toLowerCase();
2815
+ }return(A=="iso8601"||A=="iso 8601")?Timeline.DateTime.parseIso8601DateTime:Timeline.DateTime.parseGregorianDateTime;
2816
+ };
2817
+ Timeline.NativeDateUnit.parseFromObject=function(A){return Timeline.DateTime.parseGregorianDateTime(A);
2818
+ };
2819
+ Timeline.NativeDateUnit.toNumber=function(A){return A.getTime();
2820
+ };
2821
+ Timeline.NativeDateUnit.fromNumber=function(A){return new Date(A);
2822
+ };
2823
+ Timeline.NativeDateUnit.compare=function(D,C){var B,A;
2824
+ if(typeof D=="object"){B=D.getTime();
2825
+ }else{B=Number(D);
2826
+ }if(typeof C=="object"){A=C.getTime();
2827
+ }else{A=Number(C);
2828
+ }return B-A;
2829
+ };
2830
+ Timeline.NativeDateUnit.earlier=function(B,A){return Timeline.NativeDateUnit.compare(B,A)<0?B:A;
2831
+ };
2832
+ Timeline.NativeDateUnit.later=function(B,A){return Timeline.NativeDateUnit.compare(B,A)>0?B:A;
2833
+ };
2834
+ Timeline.NativeDateUnit.change=function(A,B){return new Date(A.getTime()+B);
2835
+ };