diff --git a/COPYING.LESSER b/COPYING.LESSER new file mode 100644 index 0000000..65c5ca8 --- /dev/null +++ b/COPYING.LESSER @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..9182453 --- /dev/null +++ b/Rakefile @@ -0,0 +1,137 @@ +# Rakefile - create single combined nd compressed javascript file + +COMPRESS="java -jar lib/yuicompressor-2.4.2.jar" +COMPRESSED_OUTPUT_FILE='geotemco-min.js' +OUTPUT_FILE='geotemco.js' +CSS_FILE='css/geotemco.css' + +task :default => :all + +task :all => [COMPRESSED_OUTPUT_FILE, OUTPUT_FILE, CSS_FILE] + +# javascript sources +Files = %w(lib/jquery/jquery.min.js +js/Build/Minifier/basic.js +lib/excanvas/excanvas.js +js/Build/Minifier/simile-ajax-basic.js +lib/simile/ajax/scripts/platform.js +lib/simile/ajax/scripts/debug.js +lib/simile/ajax/scripts/xmlhttp.js +lib/simile/ajax/scripts/json.js +lib/simile/ajax/scripts/dom.js +lib/simile/ajax/scripts/graphics.js +lib/simile/ajax/scripts/date-time.js +lib/simile/ajax/scripts/string.js +lib/simile/ajax/scripts/html.js +lib/simile/ajax/scripts/data-structure.js +lib/simile/ajax/scripts/units.js +lib/simile/ajax/scripts/ajax.js +lib/simile/ajax/scripts/history.js +lib/simile/ajax/scripts/window-manager.js +js/Build/Minifier/timeline-basic.js +lib/simile/timeline/timeline-api.js +lib/simile/timeline/scripts/timeline.js +lib/simile/timeline/scripts/band.js +lib/simile/timeline/scripts/themes.js +lib/simile/timeline/scripts/ethers.js +lib/simile/timeline/scripts/ether-painters.js +lib/simile/timeline/scripts/event-utils.js +lib/simile/timeline/scripts/labellers.js +lib/simile/timeline/scripts/sources.js +lib/simile/timeline/scripts/original-painter.js +lib/simile/timeline/scripts/detailed-painter.js +lib/simile/timeline/scripts/overview-painter.js +lib/simile/timeline/scripts/compact-painter.js +lib/simile/timeline/scripts/decorators.js +lib/simile/timeline/scripts/units.js +lib/simile/timeline/scripts/l10n/en/timeline.js +lib/simile/timeline/scripts/l10n/en/labellers.js +js/Build/Minifier/timeplot-basic.js +lib/simile/timeplot/timeplot-api.js +lib/simile/timeplot/scripts/timeplot.js +lib/simile/timeplot/scripts/plot.js +lib/simile/timeplot/scripts/sources.js +lib/simile/timeplot/scripts/geometry.js +lib/simile/timeplot/scripts/color.js +lib/simile/timeplot/scripts/math.js +lib/simile/timeplot/scripts/processor.js +lib/slider/js/range.js +lib/slider/js/slider.js +lib/slider/js/timer.js +js/Time/SimileTimeplotModify.js +lib/openlayers/OpenLayers.js +js/Util/Tooltips.js +js/GeoTemConfig.js +js/Map/MapControl.js +js/Map/CircleObject.js +js/Util/FilterBar.js +js/Util/Selection.js +js/Map/PlacenameTags.js +js/Map/MapConfig.js +js/Map/MapGui.js +js/Map/MapWidget.js +js/Time/TimeConfig.js +js/Time/TimeGui.js +js/Time/TimeWidget.js +js/Table/TableConfig.js +js/Table/TableGui.js +js/Table/TableWidget.js +js/Table/Table.js +js/Util/DataObject.js +js/Util/Dataset.js +js/Time/TimeDataSource.js +js/Map/Binning.js +js/Map/MapDataSource.js +js/Map/Clustering.js +js/Util/Dropdown.js +js/Map/MapZoomSlider.js +js/Map/MapPopup.js +js/Map/PlacenamePopup.js +js/Util/Publisher.js +js/Util/WidgetWrapper.js +js/Build/Minifier/final.js) + +# css sources +Cssfiles = %w(lib/simile/ajax/styles/graphics.css +lib/simile/timeline/styles/timeline.css +lib/simile/timeline/styles/ethers.css +lib/simile/timeline/styles/events.css +lib/simile/timeplot/styles/timeplot.css +css/style.css +lib/openlayers/theme/default/style.css) + +def cat_files(outputfile, basename) + File.open(outputfile, 'w') do |x| + Files.each do |f| + x.puts(File.open(f).read.gsub('REPLACEME-REPLACEME', basename)) + end + end +end + +file CSS_FILE => Cssfiles do + File.open(CSS_FILE, 'w') do |x| + Cssfiles.each do |f| + x.puts(File.open(f).read) + end + end +end + +# Just one big JS file, no compression. +file OUTPUT_FILE => Files do + basename = File.basename(OUTPUT_FILE, ".js") + cat_files(OUTPUT_FILE, basename) +end + +# Compress it. +file COMPRESSED_OUTPUT_FILE => Files do + basename = File.basename(COMPRESSED_OUTPUT_FILE, ".js") + cat_files(OUTPUT_FILE, basename) + system "#{COMPRESS} #{OUTPUT_FILE} >> #{COMPRESSED_OUTPUT_FILE}" +end + +# Clean up the whole thing. +task :clean do + rm OUTPUT_FILE + rm COMPRESSED_OUTPUT_FILE + rm CSS_FILE +end diff --git a/css/geotemco.css b/css/geotemco.css new file mode 100644 index 0000000..6ddc687 --- /dev/null +++ b/css/geotemco.css @@ -0,0 +1,2355 @@ +div.simileAjax-bubble-container { + margin: 0px; + padding: 0px; + border: none; + position: absolute; + z-index: 1000; +} + +div.simileAjax-bubble-innerContainer { + margin: 0px; + padding: 0px; + border: none; + position: relative; + width: 100%; + height: 100%; + overflow: visible; +} + +div.simileAjax-bubble-contentContainer { + margin: 0px; + padding: 0px; + border: none; + position: absolute; + left: 0px; + top: 0px; + width: 100%; + height: 100%; + overflow: auto; + background: white; +} + +div.simileAjax-bubble-border-left { + position: absolute; + left: -50px; + top: 0px; + width: 50px; + height: 100%; +} +div.simileAjax-bubble-border-left-pngTranslucent { + background: url(../images/bubble-left.png) top right repeat-y; +} + +div.simileAjax-bubble-border-right { + position: absolute; + right: -50px; + top: 0px; + width: 50px; + height: 100%; +} +.simileAjax-bubble-border-right-pngTranslucent { + background: url(../images/bubble-right.png) top left repeat-y; +} + +div.simileAjax-bubble-border-top { + position: absolute; + top: -50px; + left: 0px; + width: 100%; + height: 50px; +} +.simileAjax-bubble-border-top-pngTranslucent { + background: url(../images/bubble-top.png) bottom left repeat-x; +} + +div.simileAjax-bubble-border-bottom { + position: absolute; + bottom: -50px; + left: 0px; + width: 100%; + height: 50px; +} +.simileAjax-bubble-border-bottom-pngTranslucent { + background: url(../images/bubble-bottom.png) top left repeat-x; +} + +div.simileAjax-bubble-border-top-left { + position: absolute; + top: -50px; + left: -50px; + width: 50px; + height: 50px; +} +.simileAjax-bubble-border-top-left-pngTranslucent { + background: url(../images/bubble-top-left.png) bottom right no-repeat; +} + +div.simileAjax-bubble-border-top-right { + position: absolute; + top: -50px; + right: -50px; + width: 50px; + height: 50px; +} +.simileAjax-bubble-border-top-right-pngTranslucent { + background: url(../images/bubble-top-right.png) bottom left no-repeat; +} + +div.simileAjax-bubble-border-bottom-left { + position: absolute; + bottom: -50px; + left: -50px; + width: 50px; + height: 50px; +} +.simileAjax-bubble-border-bottom-left-pngTranslucent { + background: url(../images/bubble-bottom-left.png) top right no-repeat; +} + +div.simileAjax-bubble-border-bottom-right { + position: absolute; + bottom: -50px; + right: -50px; + width: 50px; + height: 50px; +} +.simileAjax-bubble-border-bottom-right-pngTranslucent { + background: url(../images/bubble-bottom-right.png) top left no-repeat; +} + +div.simileAjax-bubble-arrow-point-left { + position: absolute; + left: -100px; + width: 100px; + height: 49px; +} +.simileAjax-bubble-arrow-point-left-pngTranslucent { + background: url(../images/bubble-arrow-point-left.png) center right no-repeat; +} + +div.simileAjax-bubble-arrow-point-right { + position: absolute; + right: -100px; + width: 100px; + height: 49px; +} +.simileAjax-bubble-arrow-point-right-pngTranslucent { + background: url(../images/bubble-arrow-point-right.png) center left no-repeat; +} + +div.simileAjax-bubble-arrow-point-up { + position: absolute; + top: -100px; + width: 49px; + height: 100px; +} +.simileAjax-bubble-arrow-point-up-pngTranslucent { + background: url(../images/bubble-arrow-point-up.png) bottom center no-repeat; +} + +div.simileAjax-bubble-arrow-point-down { + position: absolute; + bottom: -100px; + width: 49px; + height: 100px; +} +.simileAjax-bubble-arrow-point-down-pngTranslucent { + background: url(../images/bubble-arrow-point-down.png) bottom center no-repeat; +} + + +div.simileAjax-bubble-close { + position: absolute; + right: -10px; + top: -12px; + width: 16px; + height: 16px; + cursor: pointer; +} +.simileAjax-bubble-close-pngTranslucent { + background: url(../images/close-button.png) no-repeat; +} +.timeline-container { + position: relative; + overflow: hidden; +} + +.timeline-copyright { + position: absolute; + bottom: 0px; + left: 0px; + z-index: 1000; + cursor: pointer; +} + +.timeline-message-container { + position: absolute; + top: 30%; + left: 35%; + right: 35%; + z-index: 1000; + display: none; +} +.timeline-message { + font-size: 120%; + font-weight: bold; + text-align: center; +} +.timeline-message img { + vertical-align: middle; +} + +.timeline-band { + position: absolute; + background: #eee; + z-index: 10; +} + +.timeline-band-inner { + position: relative; + width: 100%; + height: 100%; +} + +.timeline-band-input { + position: absolute; + width: 1em; + height: 1em; + overflow: hidden; + z-index: 0; +} +.timeline-band-input input{ + width: 0; +} + +.timeline-band-layer { + position: absolute; + width: 100%; + height: 100%; +} + +.timeline-band-layer-inner { + position: relative; + width: 100%; + height: 100%; +} + + + +/*------------------- Horizontal / Vertical lines ----------------*/ + +/* style for ethers */ +.timeline-ether-lines{border-color:#666; border-style:dotted; position:absolute;} +.timeline-horizontal .timeline-ether-lines{border-width:0 0 0 1px; height:100%; top: 0; width: 1px;} +.timeline-vertical .timeline-ether-lines{border-width:1px 0 0; height:1px; left: 0; width: 100%;} + + + +/*---------------- Weekends ---------------------------*/ +.timeline-ether-weekends{ + position:absolute; + background-color:#FFFFE0; +} + +.timeline-vertical .timeline-ether-weekends{left:0;width:100%;} +.timeline-horizontal .timeline-ether-weekends{top:0; height:100%;} + + +/*-------------------------- HIGHLIGHT DECORATORS -------------------*/ +/* Used for decorators, not used for Timeline Highlight */ +.timeline-highlight-decorator, +.timeline-highlight-point-decorator{ + position:absolute; + overflow:hidden; +} + +/* Width of horizontal decorators and Height of vertical decorators is + set in the decorator function params */ +.timeline-horizontal .timeline-highlight-point-decorator, +.timeline-horizontal .timeline-highlight-decorator{ + top:0; + height:100%; +} + +.timeline-vertical .timeline-highlight-point-decorator, +.timeline-vertical .timeline-highlight-decorator{ + width:100%; + left:0; +} + +.timeline-highlight-decorator{background-color:#FFC080;} +.timeline-highlight-point-decorator{background-color:#ff5;} + + +/*---------------------------- LABELS -------------------------*/ +.timeline-highlight-label { + position:absolute; overflow:hidden; font-size:200%; + font-weight:bold; color:#999; } + + +/*---------------- VERTICAL LABEL -------------------*/ +.timeline-horizontal .timeline-highlight-label {top:0; height:100%;} +.timeline-horizontal .timeline-highlight-label td {vertical-align:middle;} +.timeline-horizontal .timeline-highlight-label-start {text-align:right;} +.timeline-horizontal .timeline-highlight-label-end {text-align:left;} + + +/*---------------- HORIZONTAL LABEL -------------------*/ +.timeline-vertical .timeline-highlight-label {left:0;width:100%;} +.timeline-vertical .timeline-highlight-label td {vertical-align:top;} +.timeline-vertical .timeline-highlight-label-start {text-align:center;} +.timeline-vertical .timeline-highlight-label-end {text-align:center;} + + +/*-------------------------------- DATE LABELS --------------------------------*/ +.timeline-date-label { + position: absolute; + border: solid #aaa; + color: #aaa; + width: 5em; + height: 1.5em;} +.timeline-date-label-em {color: #000;} + +/* horizontal */ +.timeline-horizontal .timeline-date-label{padding-left:2px;} +.timeline-horizontal .timeline-date-label{border-width:0 0 0 1px;} +.timeline-horizontal .timeline-date-label-em{height:2em} + +/* vertical */ +.timeline-vertical .timeline-date-label{padding-top:2px;} +.timeline-vertical .timeline-date-label{border-width:1px 0 0;} +.timeline-vertical .timeline-date-label-em{width:7em} + + +/*------------------------------- Ether.highlight -------------------------*/ +.timeline-ether-highlight{position:absolute; background-color:#fff;} +.timeline-horizontal .timeline-ether-highlight{top:2px;} +.timeline-vertical .timeline-ether-highlight{left:2px;} + + +/*------------------------------ EVENTS ------------------------------------*/ +.timeline-event-icon, .timeline-event-label,.timeline-event-tape{ + position:absolute; + cursor:pointer; +} + +.timeline-event-tape, +.timeline-small-event-tape, +.timeline-small-event-icon{ + background-color:#58A0DC; + overflow:hidden; +} + +.timeline-small-event-tape, +.timeline-small-event-icon{ + position:absolute; +} + +.timeline-small-event-icon{width:1px; height:6px;} + + +/*--------------------------------- TIMELINE-------------------------*/ +.timeline-ether-bg{width:100%; height:100%;} +.timeline-band-0 .timeline-ether-bg{background-color:#eee} +.timeline-band-1 .timeline-ether-bg{background-color:#ddd} +.timeline-band-2 .timeline-ether-bg{background-color:#ccc} +.timeline-band-3 .timeline-ether-bg{background-color:#aaa} +.timeline-duration-event { + position: absolute; + overflow: hidden; + border: 1px solid blue; +} + +.timeline-instant-event2 { + position: absolute; + overflow: hidden; + border-left: 1px solid blue; + padding-left: 2px; +} + +.timeline-instant-event { + position: absolute; + overflow: hidden; +} + +.timeline-event-bubble-title { + font-weight: bold; + border-bottom: 1px solid #888; + margin-bottom: 0.5em; +} + +.timeline-event-bubble-body { +} + +.timeline-event-bubble-wiki { + margin: 0.5em; + text-align: right; + color: #A0A040; +} +.timeline-event-bubble-wiki a { + color: #A0A040; +} + +.timeline-event-bubble-time { + color: #aaa; +} + +.timeline-event-bubble-image { + float: right; + padding-left: 5px; + padding-bottom: 5px; +} +.timeplot-container { + overflow: hidden; + position: relative; + height: 200px; + border: 1px solid #ccc; + padding: 12px 14px; +} + +.timeplot-copyright { + position: absolute; + top: 0px; + left: 0px; + z-index: 1000; + cursor: pointer; +} + +.timeplot-message-container { + position: absolute; + top: 30%; + left: 35%; + right: 35%; + max-width: 400px; + z-index: 1000; + display: none; +} +.timeplot-message { + font-size: 120%; + font-weight: bold; + text-align: center; +} +.timeplot-message img { + vertical-align: middle; +} + +.timeplot-div { + position: absolute; +} + +.timeplot-grid-label { + font-size: 9px; +} + +.timeplot-event-box { + cursor: pointer; +} + +.timeplot-event-box-highlight { + border: 1px solid #FFB03B; +} + +.timeplot-valueflag { + display: none; + border: 1px solid #FFB02D; + padding: 2px 4px; + text-align: center; + background-color: #FFE57F; + font-weight: bold; + z-index: 1000; +} + +.timeplot-valueflag-line { + display: none; + width: 14px; + height: 14px; + z-index: 1000; +} + +.timeplot-timeflag { + display: none; + border: 1px solid #FFB02D; + padding: 2px 4px; + text-align: center; + background-color: #FFE57F; + font-weight: bold; + z-index: 1000; +} + +.timeplot-timeflag-triangle { + display: none; + width: 11px; + height: 6px; + z-index: 1001; +} + +.timeplot-valueflag-pole { + display: none; + border-left: 1px solid #FFB02D; + z-index: 999; +} + +.timeplot-lens { + display: none; + border: 1px solid #FFB02D; + z-index: 998; +} +body { + font-family: Calibri,Arial,sans-serif; +} + +/* + settings for slider object +*/ +.dynamic-slider-control { + width: 20px; + position: relative; + margin: auto; +} + +.vertical { + height: 80px; +} + +.horizontal { + width: 60px; +} + +.dynamic-slider-control input { + display: none; +} + +.dynamic-slider-control .handle { + position: absolute; + font-size: 1px; + overflow: hidden; +} + +.dynamic-slider-control.vertical .handle { + width: 20px; + height: 30px; + background-image: url("../images/sliderDot.png"); +} + +.dynamic-slider-control.horizontal .handle { + width: 30px; + height: 20px; + background-image: url("../images/sliderDot-horizontal.png"); +} + +.dynamic-slider-control .line { + position: absolute; + font-size: 0.01mm; + overflow: hidden; + border: 1px solid rgb(90,97,90); + background: rgb(189,190,189); +} + +.dynamic-slider-control.vertical .line { + width: 3px; +} + +.dynamic-slider-control .line div { + width: 1px; + height: 1px; + + border: 1px solid; + border-color: rgb(230,230,230) rgb(189,190,189) + rgb(189,190,189) rgb(230,230,230); +} + +/* + settings for timeplot widget (some are overwritten timeplot css classes) +*/ +#plotWindow { + position: relative; + border-bottom: 1px solid #ADADAD; + z-index: 1; + width: 100%; +} + +#plotContainer { + position: absolute; + padding: 0px; + border: none; + top: 12px; + left: 0px; + z-index: 1; + overflow: hidden; + width: 100%; +} + +#timeplotToolbar dt, dl{ + padding: 2px 0px; + display: block; + cursor: pointer; +} + +.plotCanvas { + position: absolute; + top: 0px; + left: 0px; + z-index: -2; +} + +.timeplot-background { + display: none; + z-index: -2; +} + +.timeplot-container { + position: absolute; + left: 16px; + padding: 0px; + border: none; + z-index: 1; + top: 0px; + overflow: visible; +} + +.timeplot-copyright { + visibility: hidden; +} + +.timeplot-timeflag { + font-size: 0.8em; + font-weight: normal; +} + +.timeplot-valueflag { + font-size: 0.8em; +} + +.timeplot-dayflag-pole { + display: none; + z-index: 999; +} + +.timeplot-dayflag { + display: none; + border: 1px solid #FF0000; + padding: 1px; + text-align: center; + background-color: #FFCCCC; + z-index: 1000; +} + +.range-box { + display: none; + background-repeat: repeat; + opacity: 0.6; +filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; +-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; + z-index: -1; +} + +.popup-click-div { + display: none; + z-index: 1010; + cursor: pointer; +} + +.left-feather { + display: none; + z-index: -1; +} + +.right-feather { + display: none; + z-index: -1; +} + +.plotHandle { + position: absolute; + visibility: hidden; + cursor: pointer; + z-index: 1002; +} + +.plotHandleLabel { + padding: 2px 5px; + font-size: 0.8em; +} + +.plotHandleIcon { + height: 43px; + width: 14px; +} + +.plotToolbar { + position: absolute; + visibility: hidden; + z-index: 1; +} + +.featherSlider { + position: absolute; + top: 9px; + right: 64px; +} + +.timeOverview { + position: absolute; + top: 0px; + height: 12px; + z-index: 0; + visibility: hidden; + opacity: 0.5; +filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; +-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; + overflow: hidden; + border-bottom: 1px solid rgb(100,100,100); +} + +.plotLabels { + position: absolute; + overflow: hidden; + top: 0px; + left: 0px; + height: 12px; + z-index: 0; +} + +.plotLabel { + position: absolute; + font-size: 9px; + height: 10px; + padding: 1px 2px; + border-left: solid 1px rgb(214,214,214); +} + +.overviewRange { + position: absolute; + top: 0px; + height: 12px; + background: white; +} + +.overviewLabel { + position: absolute; + font-size: 9px; + height: 10px; + padding: 1px 2px; + border-left: solid 1px black; +} + +.shiftLeft { + position: absolute; + left: 4px; + top: 0px; + height: 12px; + width: 12px; +filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; +-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; + opacity: 0.8; + background-image: url(../images/shiftLeft.png); + visibility: hidden; +} + +.shiftLeft:hover { + cursor: pointer; + background-image: url(../images/shiftLeftOver.png); +} + +.shiftRight { + position: absolute; + right: 4px; + top: 0px; + height: 12px; + width: 12px; + opacity: 0.8; +filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; +-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; + background-image: url(../images/shiftRight.png); + visibility: hidden; +} + +.shiftRight:hover { + cursor: pointer; + background-image: url(../images/shiftRightOver.png); +} + +/* + settings for map widget +*/ +#mapWindow { + position: absolute; + overflow: hidden; + z-index: 2; + width: 100%; +} + +#mapContainer { + width: 100%; +} + +.mapCanvas { + position: absolute; + top: 0px; + left: 0px; + z-index: -2; +} + +.mapsMenu { + position: absolute; + z-index: 1000; +} + +.mapsMenu dl { + margin: 0px; + display: block; +} + +.mapsMenu dt { + padding: 2px; + display: block; + cursor: pointer; +} + +#mapToolbar dt, dl{ + padding: 2px 0px; + display: block; + cursor: pointer; +} + +.mapsMenu dt:hover { + background: #C9C9CB; +} + +.selectedMapEntry { + color: white; + background: #C9C9CB; +} + +.pointClickDiv { + position: absolute; + visibility: hidden; + z-index: 4; +} + +.pointClickDivBackground { + width: 100%; + height: 100%; + z-index: 4; + filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; +} + +.mapInfo { + position: absolute; + bottom: 5px; + right: 5px; + padding: 3px; +} + +.tagCloudDiv { + position: absolute; +} + +.mapToolbar { + position: absolute; + visibility: hidden; + z-index: 1009; + opacity: 0.8; +filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; +-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; +} + +.tagCloudItem { + z-index: 1009; + cursor: pointer; +} + +.controlLock { + position: absolute; + width: 100%; + height: 100%; + z-index: 1008; + visibility: hidden; +} + +/* + sti toolbar settings +*/ +.toolbarTop { + top: 0px; +} + +.toolbarBottom { + bottom: 0px; +} + +.toolbarLeft { + left: 0px; +} + +.toolbarRight { + right: 0px; +} + +.toolbarLeftLight { + background-image: url(../images/bg-left.png); + background-repeat: repeat-y; + border-right: 1px solid white; +} + +.toolbarRightLight { + background-image: url(../images/bg-right.png); + background-repeat: repeat-y; + border-left: 1px solid white; +} + +/* + settings for zoom slider +*/ +.sliderStyle { + position: relative; + width: 20px; + height: 100px; + border: 1px solid rgb(68,68,68); + margin: 3px; +} + +.zoomSliderContainer { + position: absolute; + top: 10px; + left: 0px; +} + +.zoomSliderIn { + position: absolute; + top: 0px; + left: 2px; +} + +.zoomSliderOut { + position: absolute; + top: 84px; + left: 2px; +} + +/* + settings for widgets integrated toolbars +*/ +.dragTimeRangeAlt { + position: relative; + height: 12px; + width: 43px; + cursor: pointer; +} + +.cancelRangeAlt { + position: absolute; + height: 16px; + width: 16px; + background-image: url(../images/cancel.png); + cursor: pointer; + visibility: hidden; +} + +.widgetHeadline { + position: absolute; + top: 3px; + font-size: 18px; + padding: 3px; +} + +/* + settings for widgets popup window +*/ +.popupDiv { + position: absolute; + background-color: white; + border: 2px solid #666666; + padding: 25px; + visibility: hidden; +} + +.back { + position: absolute; + height: 16px; + width: 16px; + top: 2px; + left: 5px; + background-image: url(../images/back.png); + background-repeat: no-repeat; + cursor: pointer; + display: none; +} + +.next { + position: absolute; + height: 16px; + width: 16px; + bottom: 5px; + right: 5px; + background-image: url(../images/next.png); + background-repeat: no-repeat; + cursor: pointer; +} + +.previous { + position: absolute; + height: 16px; + width: 16px; + bottom: 5px; + left: 5px; + background-image: url(../images/prev.png); + background-repeat: no-repeat; + cursor: pointer; +} + +.popupTriangleDown { + position: absolute; + height: 18px; + width: 31px; + background-image: url(../images/popupTriangleDown.png); + background-repeat: no-repeat; + z-index: 1000; +} + +.popupTriangleUp { + position: absolute; + height: 18px; + width: 31px; + background-image: url(../images/popupTriangleUp.png); + background-repeat: no-repeat; + z-index: 1000; +} + +.popupTriangleLeft { + position: absolute; + height: 31px; + width: 18px; + background-image: url(../images/popupTriangleLeft.png); + background-repeat: no-repeat; + z-index: 1000; +} + +.popupTriangleRight { + position: absolute; + height: 31px; + width: 18px; + background-image: url(../images/popupTriangleRight.png); + background-repeat: no-repeat; + z-index: 1000; +} + +.popupResultsLabel { + position: absolute; + bottom: 5px; + font-size: 60%; + color:#999999; +} + +.popupDescription { + font-size: 60%; +} + +.popupDiv ul { + list-style-type: none; + margin:0; + padding:0; +} + +.popupDiv ol li:hover { + text-decoration:underline; +} + +.popupDiv li { + padding: 5px; + cursor: pointer; +} + +.popupContent { + font-size: 60%; + font-weight: bold; +} + +.animation { + position: absolute; + width: 18px; + height: 18px; + cursor: pointer; + visibility: hidden; +} + +.osmLink { + position: absolute; + right: 5px; + bottom: 5px; + font-size: 11px; + color: blue; + visibility: hidden; + z-index: 1100; +} + +.osmLink a { + color: blue; +} + +.osmLink a:visited { + color: blue; +} + +.absoluteToolbar { + position: absolute; + top: 0px; + left: 0px; + z-index: 1002; +} + +.ddbToolbar { + width: 100%; + background-color: #878380; + position: relative; + opacity: 0.85; + filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; + border-spacing: 0px; + z-index: 10000; +} + +.ddbToolbar table { + border-spacing: 0px; +} + +.ddbToolbar td { + color: white; + font-size: 13px; + font-weight: bold; + border: none; + text-align: center; +} + +.ddbTooltip { + position: absolute; + width: 20px; + height: 20px; + background-image: url(../images/tooltip.png); + top: 5px; + right: 5px; + cursor: help; +} + +.dropdown { + display: inline-block; + height: 25px; + max-height: 25px; +} + +.dropdownLeft { + display: table-cell; + width: 5px; + height: 25px; + background-image: url(../images/dropdownLeft.png); +} + +.dropdownSelection { + text-align: center; + height: 25px; + color: #6f6b68; + font-style: italic; + font-weight: normal; + font-size: 13px; + display: table-cell; + vertical-align: middle; + background-image: url(../images/dropdownMiddle.png); +} + +.dropdownButtonEnabled { + display: table-cell; + width: 25px; + height: 25px; + background-image: url(../images/dropdownEnabled1.png); + cursor: pointer; +} + +.dropdownButtonDisabled { + display: table-cell; + width: 25px; + height: 25px; + background-image: url(../images/dropdownDisabled1.png); + cursor: pointer; +} + +.dropdownMenu { + display: inline-block; + font-size: 13px; + background-color: white; + opacity: 0.85; + filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; + max-height: 200px; + overflow: auto; + position: absolute; + z-index: 3; +} + +.dropdownMenu dl { + margin: 0px; + display: block; +} + +.dropdownMenu dt { + padding: 2px 10px; + display: block; + cursor: pointer; + text-align: center; + color: #6f6b68; + font-weight: normal; +} + +.dropdownMenu dt:hover { + background: #DFDFDD; +} + +.dropdownSelectedEntry { + color: #6f6b68; + font-style: italic; + font-weight: normal; + display: table-cell; + vertical-align: middle; +} + +.dropdownUnselectedEntry { + color: #6f6b68; + font-style: normal; + font-weight: normal; + display: table-cell; + vertical-align: middle; +} + +.ddbElementsCount { + font-family: Calibri,Arial,sans-serif; + color: white; + font-style: italic; + font-weight: normal; + font-size: 13px; +} + +/* + settings for slider object +*/ +.dynamic-slider-control { + width: 20px; + height: 18px; + position: relative; +} + +.vertical { + height: 123px; +} + +.horizontal { + width: 123px; +} + +.dynamic-slider-control input { + display: none; +} + +.dynamic-slider-control .handle { + position: absolute; + font-size: 1px; + overflow: hidden; +} + +.dynamic-slider-control.vertical .handle { + width: 20px; + height: 12px; + cursor: pointer; + background-image: url("../images/zoom_slider-vertical.png"); +} + +.dynamic-slider-control.horizontal .handle { + width: 12px; + height: 20px; + cursor: pointer; + background-image: url("../images/zoom_slider-horizontal.png"); +} + +.dynamic-slider-control .line { + position: absolute; + font-size: 0.01mm; + overflow: hidden; + border: none; + background: rgb(189,190,189); +} + +.dynamic-slider-control.vertical .line { + width: 0px; +} + +.dynamic-slider-control .line div { + width: 0px; + height: 0px; + border: none; +} + +/* + settings for zoom slider +*/ +.sliderStyle-horizontal { + position: relative; + width: 167px; + height: 21px; + border: 1px solid #bebdbc; + margin: 3px; + background: white; +} + +.sliderStyle-vertical { + position: absolute; + width: 27px; + height: 173px; +/* border: 1px solid #bebdbc;*/ +/* margin: 3px;*/ +/* background: white;*/ + background-image: url("../images/ZoomBgWithIncrements.png"); + z-index: 1001; +} + +.zoomSliderContainer-horizontal { + position: absolute; + top: 2px; + left: 22px; + height: 16px; + background-image: url("../images/zoom_grid-horizontal.png"); +} + +.zoomSliderContainer-vertical { + position: absolute; + top: 24px; + width: 27px; +/* background-image: url("../images/zoom_grid-vertical.png");*/ +} + +.zoomSliderIn-horizontal { + position: absolute; + top: 1px; + left: 149px; + cursor: pointer; +} + +.zoomSliderOut-horizontal { + position: absolute; + top: 1px; + left: 2px; + cursor: pointer; +} + +.zoomSliderIn-vertical { + position: absolute; + top: 4px; + left: 4px; + cursor: pointer; +} + +.zoomSliderOut-vertical { + position: absolute; + bottom: 5px; + left: 4px; + cursor: pointer; +} + +.ddbPopupDiv { + position: absolute; + background-color: white; + padding: 15px; + visibility: visible; + z-index: 1000; + cursor: default; +} + +.ddbPopupInput { + overflow-x: auto; + overflow-y: auto; +} + +.ddbPopupInput tr, th, td { + font-size: 13px; +} + +.viewResults { + width: 121px; + height: 18px; + background-image: url("../images/Viewresultsbutton.png"); + cursor: pointer; + margin-top: 10px; +} + +.popupRight { + position: absolute; + width: 10px; + right: -4px; + top: 8px; + background-image: url("../images/right.png"); + background-repeat: repeat-y; + z-index: 3; +} + +.popupBottom { + position: absolute; + height: 10px; + bottom: -4px; + left: 16px; + background-image: url("../images/bottom.png"); + background-repeat: repeat-x; + z-index: 3; +} + +.popupBottomRight { + position: absolute; + width: 10px; + height: 10px; + bottom: -4px; + right: -4px; + background-image: url("../images/bottom_right.png"); + z-index: 4; +} + +.popupTopRight { + position: absolute; + width: 10px; + height: 8px; + top: 0px; + right: -4px; + background-image: url("../images/top_right.png"); + z-index: 4; +} + +.popupPeak { + position: absolute; + width: 26px; + height: 29px; + bottom: -14px; + left: -10px; + background-image: url("../images/peak.png"); + z-index: 4; +} + +.popupDDBResults { + font-weight: bold; + font-size: 12px; + color: #3e3a37; + cursor: default; + padding-bottom: 10px; +} + +.ddbPopupCancel { + position: absolute; + height: 16px; + width: 16px; + top: 2px; + right: 2px; + background-image: url(../images/cancel.png); + cursor: pointer; + z-index: 5; +} + +.ddbPopupLabel { + display: inline-block; + font-size: 12px; + color: #56524f; + cursor: pointer; +} + +.zoomPopup { + height: 20px; + width: 20px; + margin-left: 5px; + background-image: url(../images/zoom.png); + display: inline-block; + cursor: pointer; +} + +.descriptions { + display: inline-block; + height: 20px; + width: 20px; + background-image: url(../images/descriptions.png); + background-repeat: no-repeat; + cursor: pointer; +} + +.mapHome { + position: absolute; + cursor: pointer; + z-index: 1001; + background-image: url("../images/ResetMap.png"); + height: 27px; + width: 27px; +} + +.geoLocationOn { + position: absolute; + cursor: pointer; + z-index: 1001; + background-image: url("../images/GeoLocation.png"); + height: 27px; + width: 27px; +} + +.geoLocationOff { + position: absolute; + cursor: pointer; + z-index: 1001; + background-image: url("../images/GeoLocation2.png"); + height: 27px; + width: 27px; +} + +.aggregation { + display: inline-block; + cursor: pointer; + background-image: url("../images/aggregation.png"); + height: 30px; + width: 31px; +} + +.noAggregation { + display: inline-block; + cursor: pointer; + background-image: url("../images/no_aggregation.png"); + height: 30px; + width: 31px; +} + +.showBbox { + display: inline-block; + cursor: pointer; + background-image: url("../images/bbox_icon.png"); + height: 30px; + width: 31px; +} + +.hideBbox { + display: inline-block; + cursor: pointer; + background-image: url("../images/hidebbox_icon.png"); + height: 30px; + width: 31px; +} + +.nextItem { + display: none; + cursor: pointer; + background-image: url("../images/next.png"); + height: 7px; + width: 9px; + margin-left: 3px; +} + +.prevItem { + display: none; + cursor: pointer; + background-image: url("../images/prev.png"); + height: 7px; + width: 9px; + margin-right: 3px; +} + +.singleTable { + width: 100%; +} + +.smallButton { + display: inline-block; + cursor: pointer; + height: 27px; + width: 27px; +} + +.paginationButton { + display: table-cell; + cursor: pointer; + height: 26px; + width: 27px; +} + +.firstPageEnabled { + background-image: url("../images/firstPageEnabled.png"); +} + +.firstPageDisabled { + background-image: url("../images/firstPageDisabled.png"); +} + +.nextPageEnabled { + background-image: url("../images/nextPageEnabled.png"); +} + +.nextPageDisabled { + background-image: url("../images/nextPageDisabled.png"); +} + +.previousPageEnabled { + background-image: url("../images/previousPageEnabled.png"); +} + +.previousPageDisabled { + background-image: url("../images/previousPageDisabled.png"); +} + +.lastPageEnabled { + background-image: url("../images/lastPageEnabled.png"); +} + +.lastPageDisabled { + background-image: url("../images/lastPageDisabled.png"); +} + +.pageInfo { + display: table-cell; + vertical-align: middle; + padding: 0px 10px; + font-style: italic; + font-weight: normal; + font-size: 13px; +} + +.resultsInfo { + display: table-cell; + vertical-align: middle; + font-style: italic; + font-weight: normal; + font-size: 13px; +} + +.resultsDropdown { + display: table-cell; + padding-left: 10px; +} + +.tableEntry { + padding-top: 10px; + padding-bottom: 10px; + padding-right: 10px; + padding-left: 100px; + border-bottom: 1px solid #878380; + text-align: left; +} + +.tableTabs { + text-align: left; + opacity: 0.85; + filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; + border-spacing: 0px; +} + +.tableTab { + display: inline-block; + padding: 5px 20px; + cursor: pointer; + font-weight: bold; + font-size: 13px; + margin-right: 10px; + border-top: 1px solid #878380; + border-left: 1px solid #878380; + border-right: 1px solid #878380; +} + +.mapControl { + display: inline-block; + width: 31px; + height: 30px; + cursor: pointer; +} + +.squareDisabled { + background-image: url("../images/square-disabled.png"); +} + +.squareActivated { + background-image: url("../images/square-activated.png"); +} + +.squareDeactivated { + background-image: url("../images/square-deactivated.png"); +} + +.circleDisabled { + background-image: url("../images/circle-disabled.png"); +} + +.circleActivated { + background-image: url("../images/circle-activated.png"); +} + +.circleDeactivated { + background-image: url("../images/circle-deactivated.png"); +} + +.polygonDisabled { + background-image: url("../images/polygon-disabled.png"); +} + +.polygonActivated { + background-image: url("../images/polygon-activated.png"); +} + +.polygonDeactivated { + background-image: url("../images/polygon-deactivated.png"); +} + +.countryDisabled { + background-image: url("../images/country-disabled.png"); +} + +.countryActivated { + background-image: url("../images/country-activated.png"); +} + +.countryDeactivated { + background-image: url("../images/country-deactivated.png"); +} + +.linearPlotActivated { + background-image: url("../images/lin-activated.png"); +} + +.linearPlotDeactivated { + background-image: url("../images/lin-deactivated.png"); +} + +.logarithmicPlotActivated { + background-image: url("../images/log-activated.png"); +} + +.logarithmicPlotDeactivated { + background-image: url("../images/log-deactivated.png"); +} + +.playEnabled { + background-image: url("../images/play-enabled.png"); +} + +.playDisabled { + background-image: url("../images/play-disabled.png"); +} + +.pauseEnabled { + background-image: url("../images/pause-enabled.png"); +} + +.pauseDisabled { + background-image: url("../images/pause-disabled.png"); +} + +.dragControl { + display: inline-block; + height: 19px; + width: 19px; + cursor: pointer; +} + +.dragDisabled { + background-image: url("../images/drag-disabled.png"); +} + +.dragActivated { + background-image: url("../images/drag-activated.png"); +} + +.dragDeactivated { + background-image: url("../images/drag-deactivated.png"); +} + +.selectAll { + background-image: url("../images/selectAll.png"); +} + +.deselectAll { + background-image: url("../images/deselectAll.png"); +} + +.showAll { + background-image: url("../images/showAll.png"); +} + +.showSelected { + background-image: url("../images/showSelected.png"); +} + +.selectPage { + background-image: url("../images/selectPage.png"); +} + +.deselectPage { + background-image: url("../images/deselectPage.png"); +} + +.resultList { + z-index: 2; + width: 100%; + background-color: #878380; + opacity: 0.85; + filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; + border-spacing: 0px; +} + +.resultList table { + border-spacing: 0px; +} + +.resultList th { + font-family: Calibri,Arial,sans-serif; + color: white; + font-size: 13px; + font-weight: bold; + border: none; +} + +.resultList td { + font-family: Calibri,Arial,sans-serif; + font-size: 13px; + padding: 10px; + border-bottom: 1px solid #878380; + text-align: left; +} + +.sortDescActive { + background-image: url("../images/descActive.png"); +} + +.sortDescDeactive { + background-image: url("../images/descDeactive.png"); +} + +.sortAscActive { + background-image: url("../images/ascActive.png"); +} + +.sortAscDeactive { + background-image: url("../images/ascDeactive.png"); +} + +.sort { + height: 11px; + background-position: center center; + background-repeat: no-repeat; + cursor: pointer; +} + +.headerLabel { + vertical-align: middle; + padding: 0px 10px; +} + +.smallButton { + display: inline-block; + height: 27px; + width: 27px; + cursor: pointer; +} + +.filter { + background-image: url("../images/filter.png"); +} + +.filterDisabled { + background-image: url("../images/filterDisabled.png"); +} + +.filterInverse { + background-image: url("../images/filterInverse.png"); +} + +.filterInverseDisabled { + background-image: url("../images/filterInverseDisabled.png"); +} + +.filterCancel { + background-image: url("../images/filterCancel.png"); +} + +.filterCancelDisabled { + background-image: url("../images/filterCancelDisabled.png"); +} +div.olMap { + z-index: 0; + padding: 0 !important; + margin: 0 !important; + cursor: default; +} + +div.olMapViewport { + text-align: left; +} + +div.olLayerDiv { + -moz-user-select: none; + -khtml-user-select: none; +} + +.olLayerGoogleCopyright { + left: 2px; + bottom: 2px; +} +.olLayerGoogleV3.olLayerGoogleCopyright { + right: auto !important; +} +.olLayerGooglePoweredBy { + left: 2px; + bottom: 15px; +} +.olLayerGoogleV3.olLayerGooglePoweredBy { + bottom: 15px !important; +} +.olControlAttribution { + font-size: smaller; + right: 3px; + bottom: 4.5em; + position: absolute; + display: block; +} +.olControlScale { + right: 3px; + bottom: 3em; + display: block; + position: absolute; + font-size: smaller; +} +.olControlScaleLine { + display: block; + position: absolute; + left: 10px; + bottom: 15px; + font-size: xx-small; +} +.olControlScaleLineBottom { + border: solid 2px black; + border-bottom: none; + margin-top:-2px; + text-align: center; +} +.olControlScaleLineTop { + border: solid 2px black; + border-top: none; + text-align: center; +} + +.olControlPermalink { + right: 3px; + bottom: 1.5em; + display: block; + position: absolute; + font-size: smaller; +} + +div.olControlMousePosition { + bottom: 0; + right: 3px; + display: block; + position: absolute; + font-family: Arial; + font-size: smaller; +} + +.olControlOverviewMapContainer { + position: absolute; + bottom: 0; + right: 0; +} + +.olControlOverviewMapElement { + padding: 10px 18px 10px 10px; + background-color: #00008B; + -moz-border-radius: 1em 0 0 0; +} + +.olControlOverviewMapMinimizeButton, +.olControlOverviewMapMaximizeButton { + height: 18px; + width: 18px; + right: 0; + bottom: 80px; + cursor: pointer; +} + +.olControlOverviewMapExtentRectangle { + overflow: hidden; + background-image: url("img/blank.gif"); + cursor: move; + border: 2px dotted red; +} +.olControlOverviewMapRectReplacement { + overflow: hidden; + cursor: move; + background-image: url("img/overview_replacement.gif"); + background-repeat: no-repeat; + background-position: center; +} + +.olLayerGeoRSSDescription { + float:left; + width:100%; + overflow:auto; + font-size:1.0em; +} +.olLayerGeoRSSClose { + float:right; + color:gray; + font-size:1.2em; + margin-right:6px; + font-family:sans-serif; +} +.olLayerGeoRSSTitle { + float:left;font-size:1.2em; +} + +.olPopupContent { + padding:5px; + overflow: auto; +} + +.olControlNavigationHistory { + background-image: url("img/navigation_history.png"); + background-repeat: no-repeat; + width: 24px; + height: 24px; + +} +.olControlNavigationHistoryPreviousItemActive { + background-position: 0 0; +} +.olControlNavigationHistoryPreviousItemInactive { + background-position: 0 -24px; +} +.olControlNavigationHistoryNextItemActive { + background-position: -24px 0; +} +.olControlNavigationHistoryNextItemInactive { + background-position: -24px -24px; +} + +div.olControlSaveFeaturesItemActive { + background-image: url(img/save_features_on.png); + background-repeat: no-repeat; + background-position: 0 1px; +} +div.olControlSaveFeaturesItemInactive { + background-image: url(img/save_features_off.png); + background-repeat: no-repeat; + background-position: 0 1px; +} + +.olHandlerBoxZoomBox { + border: 2px solid red; + position: absolute; + background-color: white; + opacity: 0.50; + font-size: 1px; + filter: alpha(opacity=50); +} +.olHandlerBoxSelectFeature { + border: 2px solid blue; + position: absolute; + background-color: white; + opacity: 0.50; + font-size: 1px; + filter: alpha(opacity=50); +} + +.olControlPanPanel { + top: 10px; + left: 5px; +} + +.olControlPanPanel div { + background-image: url(img/pan-panel.png); + height: 18px; + width: 18px; + cursor: pointer; + position: absolute; +} + +.olControlPanPanel .olControlPanNorthItemInactive { + top: 0; + left: 9px; + background-position: 0 0; +} +.olControlPanPanel .olControlPanSouthItemInactive { + top: 36px; + left: 9px; + background-position: 18px 0; +} +.olControlPanPanel .olControlPanWestItemInactive { + position: absolute; + top: 18px; + left: 0; + background-position: 0 18px; +} +.olControlPanPanel .olControlPanEastItemInactive { + top: 18px; + left: 18px; + background-position: 18px 18px; +} + +.olControlZoomPanel { + top: 71px; + left: 14px; +} + +.olControlZoomPanel div { + background-image: url(img/zoom-panel.png); + position: absolute; + height: 18px; + width: 18px; + cursor: pointer; +} + +.olControlZoomPanel .olControlZoomInItemInactive { + top: 0; + left: 0; + background-position: 0 0; +} + +.olControlZoomPanel .olControlZoomToMaxExtentItemInactive { + top: 18px; + left: 0; + background-position: 0 -18px; +} + +.olControlZoomPanel .olControlZoomOutItemInactive { + top: 36px; + left: 0; + background-position: 0 18px; +} + +/* + * When a potential text is bigger than the image it move the image + * with some headers (closes #3154) + */ +.olControlPanZoomBar div { + font-size: 1px; +} + +.olPopupCloseBox { + background: url("img/close.gif") no-repeat; + cursor: pointer; +} + +.olFramedCloudPopupContent { + padding: 5px; + overflow: auto; +} + +.olControlNoSelect { + -moz-user-select: none; + -khtml-user-select: none; +} + +.olImageLoadError { + background-color: pink; + opacity: 0.5; + filter: alpha(opacity=50); /* IE */ +} + +/** + * Cursor styles + */ + +.olCursorWait { + cursor: wait; +} +.olDragDown { + cursor: move; +} +.olDrawBox { + cursor: crosshair; +} +.olControlDragFeatureOver { + cursor: move; +} +.olControlDragFeatureActive.olControlDragFeatureOver.olDragDown { + cursor: -moz-grabbing; +} + +/** + * Layer switcher + */ +.olControlLayerSwitcher { + position: absolute; + top: 25px; + right: 0; + width: 20em; + font-family: sans-serif; + font-weight: bold; + margin-top: 3px; + margin-left: 3px; + margin-bottom: 3px; + font-size: smaller; + color: white; + background-color: transparent; +} + +.olControlLayerSwitcher .layersDiv { + padding-top: 5px; + padding-left: 10px; + padding-bottom: 5px; + padding-right: 10px; + background-color: darkblue; +} + +.olControlLayerSwitcher .layersDiv .baseLbl, +.olControlLayerSwitcher .layersDiv .dataLbl { + margin-top: 3px; + margin-left: 3px; + margin-bottom: 3px; +} + +.olControlLayerSwitcher .layersDiv .baseLayersDiv, +.olControlLayerSwitcher .layersDiv .dataLayersDiv { + padding-left: 10px; +} + +.olControlLayerSwitcher .maximizeDiv, +.olControlLayerSwitcher .minimizeDiv { + width: 18px; + height: 18px; + top: 5px; + right: 0; + cursor: pointer; +} + +.olBingAttribution { + color: #DDD; +} +.olBingAttribution.road { + color: #333; +} + +.olGoogleAttribution.hybrid, .olGoogleAttribution.satellite { + color: #EEE; +} +.olGoogleAttribution { + color: #333; +} +span.olGoogleAttribution a { + color: #77C; +} +span.olGoogleAttribution.hybrid a, span.olGoogleAttribution.satellite a { + color: #EEE; +} + +/** + * Editing and navigation icons. + * (using the editing_tool_bar.png sprint image) + */ +.olControlNavToolbar , +.olControlEditingToolbar { + margin: 5px 5px 0 0; +} +.olControlNavToolbar div, +.olControlEditingToolbar div { + background-image: url("img/editing_tool_bar.png"); + background-repeat: no-repeat; + margin: 0 0 5px 5px; + width: 24px; + height: 22px; + cursor: pointer +} +/* positions */ +.olControlEditingToolbar { + right: 0; + top: 0; +} +.olControlNavToolbar { + top: 295px; + left: 9px; +} +/* layouts */ +.olControlEditingToolbar div { + float: right; +} +/* individual controls */ +.olControlNavToolbar .olControlNavigationItemInactive, +.olControlEditingToolbar .olControlNavigationItemInactive { + background-position: -103px -1px; +} +.olControlNavToolbar .olControlNavigationItemActive , +.olControlEditingToolbar .olControlNavigationItemActive { + background-position: -103px -24px; +} +.olControlNavToolbar .olControlZoomBoxItemInactive { + background-position: -128px -1px; +} +.olControlNavToolbar .olControlZoomBoxItemActive { + background-position: -128px -24px; +} +.olControlEditingToolbar .olControlDrawFeaturePointItemInactive { + background-position: -77px -1px; +} +.olControlEditingToolbar .olControlDrawFeaturePointItemActive { + background-position: -77px -24px; +} +.olControlEditingToolbar .olControlDrawFeaturePathItemInactive { + background-position: -51px -1px; +} +.olControlEditingToolbar .olControlDrawFeaturePathItemActive { + background-position: -51px -24px; +} +.olControlEditingToolbar .olControlDrawFeaturePolygonItemInactive{ + background-position: -26px -1px; +} +.olControlEditingToolbar .olControlDrawFeaturePolygonItemActive { + background-position: -26px -24px; +} + +div.olControlZoom { + position: absolute; + top: 8px; + left: 8px; + background: rgba(255,255,255,0.4); + border-radius: 4px; + padding: 2px; +} +div.olControlZoom a { + display: block; + margin: 1px; + padding: 0; + color: white; + font-size: 18px; + font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif; + font-weight: bold; + text-decoration: none; + text-align: center; + height: 22px; + width:22px; + line-height: 19px; + background: #130085; /* fallback for IE - IE6 requires background shorthand*/ + background: rgba(0, 60, 136, 0.5); + filter: alpha(opacity=80); +} +div.olControlZoom a:hover { + background: #130085; /* fallback for IE */ + background: rgba(0, 60, 136, 0.7); + filter: alpha(opacity=100); +} +@media only screen and (max-width: 600px) { + div.olControlZoom a:hover { + background: rgba(0, 60, 136, 0.5); + } +} +a.olControlZoomIn { + border-radius: 4px 4px 0 0; +} +a.olControlZoomOut { + border-radius: 0 0 4px 4px; +} + + +/** + * Animations + */ + +.olLayerGrid .olTileImage { + -webkit-transition: opacity 0.2s linear; + -moz-transition: opacity 0.2s linear; + -o-transition: opacity 0.2s linear; + transition: opacity 0.2s linear; +} diff --git a/css/style.css b/css/style.css new file mode 100644 index 0000000..e7ea5f0 --- /dev/null +++ b/css/style.css @@ -0,0 +1,1375 @@ +body { + font-family: Calibri,Arial,sans-serif; +} + +/* + settings for slider object +*/ +.dynamic-slider-control { + width: 20px; + position: relative; + margin: auto; +} + +.vertical { + height: 80px; +} + +.horizontal { + width: 60px; +} + +.dynamic-slider-control input { + display: none; +} + +.dynamic-slider-control .handle { + position: absolute; + font-size: 1px; + overflow: hidden; +} + +.dynamic-slider-control.vertical .handle { + width: 20px; + height: 30px; + background-image: url("../images/sliderDot.png"); +} + +.dynamic-slider-control.horizontal .handle { + width: 30px; + height: 20px; + background-image: url("../images/sliderDot-horizontal.png"); +} + +.dynamic-slider-control .line { + position: absolute; + font-size: 0.01mm; + overflow: hidden; + border: 1px solid rgb(90,97,90); + background: rgb(189,190,189); +} + +.dynamic-slider-control.vertical .line { + width: 3px; +} + +.dynamic-slider-control .line div { + width: 1px; + height: 1px; + + border: 1px solid; + border-color: rgb(230,230,230) rgb(189,190,189) + rgb(189,190,189) rgb(230,230,230); +} + +/* + settings for timeplot widget (some are overwritten timeplot css classes) +*/ +#plotWindow { + position: relative; + border-bottom: 1px solid #ADADAD; + z-index: 1; + width: 100%; +} + +#plotContainer { + position: absolute; + padding: 0px; + border: none; + top: 12px; + left: 0px; + z-index: 1; + overflow: hidden; + width: 100%; +} + +#timeplotToolbar dt, dl{ + padding: 2px 0px; + display: block; + cursor: pointer; +} + +.plotCanvas { + position: absolute; + top: 0px; + left: 0px; + z-index: -2; +} + +.timeplot-background { + display: none; + z-index: -2; +} + +.timeplot-container { + position: absolute; + left: 16px; + padding: 0px; + border: none; + z-index: 1; + top: 0px; + overflow: visible; +} + +.timeplot-copyright { + visibility: hidden; +} + +.timeplot-timeflag { + font-size: 0.8em; + font-weight: normal; +} + +.timeplot-valueflag { + font-size: 0.8em; +} + +.timeplot-dayflag-pole { + display: none; + z-index: 999; +} + +.timeplot-dayflag { + display: none; + border: 1px solid #FF0000; + padding: 1px; + text-align: center; + background-color: #FFCCCC; + z-index: 1000; +} + +.range-box { + display: none; + background-repeat: repeat; + opacity: 0.6; +filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; +-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; + z-index: -1; +} + +.popup-click-div { + display: none; + z-index: 1010; + cursor: pointer; +} + +.left-feather { + display: none; + z-index: -1; +} + +.right-feather { + display: none; + z-index: -1; +} + +.plotHandle { + position: absolute; + visibility: hidden; + cursor: pointer; + z-index: 1002; +} + +.plotHandleLabel { + padding: 2px 5px; + font-size: 0.8em; +} + +.plotHandleIcon { + height: 43px; + width: 14px; +} + +.plotToolbar { + position: absolute; + visibility: hidden; + z-index: 1; +} + +.featherSlider { + position: absolute; + top: 9px; + right: 64px; +} + +.timeOverview { + position: absolute; + top: 0px; + height: 12px; + z-index: 0; + visibility: hidden; + opacity: 0.5; +filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; +-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; + overflow: hidden; + border-bottom: 1px solid rgb(100,100,100); +} + +.plotLabels { + position: absolute; + overflow: hidden; + top: 0px; + left: 0px; + height: 12px; + z-index: 0; +} + +.plotLabel { + position: absolute; + font-size: 9px; + height: 10px; + padding: 1px 2px; + border-left: solid 1px rgb(214,214,214); +} + +.overviewRange { + position: absolute; + top: 0px; + height: 12px; + background: white; +} + +.overviewLabel { + position: absolute; + font-size: 9px; + height: 10px; + padding: 1px 2px; + border-left: solid 1px black; +} + +.shiftLeft { + position: absolute; + left: 4px; + top: 0px; + height: 12px; + width: 12px; +filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; +-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; + opacity: 0.8; + background-image: url(../images/shiftLeft.png); + visibility: hidden; +} + +.shiftLeft:hover { + cursor: pointer; + background-image: url(../images/shiftLeftOver.png); +} + +.shiftRight { + position: absolute; + right: 4px; + top: 0px; + height: 12px; + width: 12px; + opacity: 0.8; +filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; +-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; + background-image: url(../images/shiftRight.png); + visibility: hidden; +} + +.shiftRight:hover { + cursor: pointer; + background-image: url(../images/shiftRightOver.png); +} + +/* + settings for map widget +*/ +#mapWindow { + position: absolute; + overflow: hidden; + z-index: 2; + width: 100%; +} + +#mapContainer { + width: 100%; +} + +.mapCanvas { + position: absolute; + top: 0px; + left: 0px; + z-index: -2; +} + +.mapsMenu { + position: absolute; + z-index: 1000; +} + +.mapsMenu dl { + margin: 0px; + display: block; +} + +.mapsMenu dt { + padding: 2px; + display: block; + cursor: pointer; +} + +#mapToolbar dt, dl{ + padding: 2px 0px; + display: block; + cursor: pointer; +} + +.mapsMenu dt:hover { + background: #C9C9CB; +} + +.selectedMapEntry { + color: white; + background: #C9C9CB; +} + +.pointClickDiv { + position: absolute; + visibility: hidden; + z-index: 4; +} + +.pointClickDivBackground { + width: 100%; + height: 100%; + z-index: 4; + filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; +} + +.mapInfo { + position: absolute; + bottom: 5px; + right: 5px; + padding: 3px; +} + +.tagCloudDiv { + position: absolute; +} + +.mapToolbar { + position: absolute; + visibility: hidden; + z-index: 1009; + opacity: 0.8; +filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; +-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; +} + +.tagCloudItem { + z-index: 1009; + cursor: pointer; +} + +.controlLock { + position: absolute; + width: 100%; + height: 100%; + z-index: 1008; + visibility: hidden; +} + +/* + sti toolbar settings +*/ +.toolbarTop { + top: 0px; +} + +.toolbarBottom { + bottom: 0px; +} + +.toolbarLeft { + left: 0px; +} + +.toolbarRight { + right: 0px; +} + +.toolbarLeftLight { + background-image: url(../images/bg-left.png); + background-repeat: repeat-y; + border-right: 1px solid white; +} + +.toolbarRightLight { + background-image: url(../images/bg-right.png); + background-repeat: repeat-y; + border-left: 1px solid white; +} + +/* + settings for zoom slider +*/ +.sliderStyle { + position: relative; + width: 20px; + height: 100px; + border: 1px solid rgb(68,68,68); + margin: 3px; +} + +.zoomSliderContainer { + position: absolute; + top: 10px; + left: 0px; +} + +.zoomSliderIn { + position: absolute; + top: 0px; + left: 2px; +} + +.zoomSliderOut { + position: absolute; + top: 84px; + left: 2px; +} + +/* + settings for widgets integrated toolbars +*/ +.dragTimeRangeAlt { + position: relative; + height: 12px; + width: 43px; + cursor: pointer; +} + +.cancelRangeAlt { + position: absolute; + height: 16px; + width: 16px; + background-image: url(../images/cancel.png); + cursor: pointer; + visibility: hidden; +} + +.widgetHeadline { + position: absolute; + top: 3px; + font-size: 18px; + padding: 3px; +} + +/* + settings for widgets popup window +*/ +.popupDiv { + position: absolute; + background-color: white; + border: 2px solid #666666; + padding: 25px; + visibility: hidden; +} + +.back { + position: absolute; + height: 16px; + width: 16px; + top: 2px; + left: 5px; + background-image: url(../images/back.png); + background-repeat: no-repeat; + cursor: pointer; + display: none; +} + +.next { + position: absolute; + height: 16px; + width: 16px; + bottom: 5px; + right: 5px; + background-image: url(../images/next.png); + background-repeat: no-repeat; + cursor: pointer; +} + +.previous { + position: absolute; + height: 16px; + width: 16px; + bottom: 5px; + left: 5px; + background-image: url(../images/prev.png); + background-repeat: no-repeat; + cursor: pointer; +} + +.popupTriangleDown { + position: absolute; + height: 18px; + width: 31px; + background-image: url(../images/popupTriangleDown.png); + background-repeat: no-repeat; + z-index: 1000; +} + +.popupTriangleUp { + position: absolute; + height: 18px; + width: 31px; + background-image: url(../images/popupTriangleUp.png); + background-repeat: no-repeat; + z-index: 1000; +} + +.popupTriangleLeft { + position: absolute; + height: 31px; + width: 18px; + background-image: url(../images/popupTriangleLeft.png); + background-repeat: no-repeat; + z-index: 1000; +} + +.popupTriangleRight { + position: absolute; + height: 31px; + width: 18px; + background-image: url(../images/popupTriangleRight.png); + background-repeat: no-repeat; + z-index: 1000; +} + +.popupResultsLabel { + position: absolute; + bottom: 5px; + font-size: 60%; + color:#999999; +} + +.popupDescription { + font-size: 60%; +} + +.popupDiv ul { + list-style-type: none; + margin:0; + padding:0; +} + +.popupDiv ol li:hover { + text-decoration:underline; +} + +.popupDiv li { + padding: 5px; + cursor: pointer; +} + +.popupContent { + font-size: 60%; + font-weight: bold; +} + +.animation { + position: absolute; + width: 18px; + height: 18px; + cursor: pointer; + visibility: hidden; +} + +.osmLink { + position: absolute; + right: 5px; + bottom: 5px; + font-size: 11px; + color: blue; + visibility: hidden; + z-index: 1100; +} + +.osmLink a { + color: blue; +} + +.osmLink a:visited { + color: blue; +} + +.absoluteToolbar { + position: absolute; + top: 0px; + left: 0px; + z-index: 1002; +} + +.ddbToolbar { + width: 100%; + background-color: #878380; + position: relative; + opacity: 0.85; + filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; + border-spacing: 0px; + z-index: 10000; +} + +.ddbToolbar table { + border-spacing: 0px; +} + +.ddbToolbar td { + color: white; + font-size: 13px; + font-weight: bold; + border: none; + text-align: center; +} + +.ddbTooltip { + position: absolute; + width: 20px; + height: 20px; + background-image: url(../images/tooltip.png); + top: 5px; + right: 5px; + cursor: help; +} + +.dropdown { + display: inline-block; + height: 25px; + max-height: 25px; +} + +.dropdownLeft { + display: table-cell; + width: 5px; + height: 25px; + background-image: url(../images/dropdownLeft.png); +} + +.dropdownSelection { + text-align: center; + height: 25px; + color: #6f6b68; + font-style: italic; + font-weight: normal; + font-size: 13px; + display: table-cell; + vertical-align: middle; + background-image: url(../images/dropdownMiddle.png); +} + +.dropdownButtonEnabled { + display: table-cell; + width: 25px; + height: 25px; + background-image: url(../images/dropdownEnabled1.png); + cursor: pointer; +} + +.dropdownButtonDisabled { + display: table-cell; + width: 25px; + height: 25px; + background-image: url(../images/dropdownDisabled1.png); + cursor: pointer; +} + +.dropdownMenu { + display: inline-block; + font-size: 13px; + background-color: white; + opacity: 0.85; + filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; + max-height: 200px; + overflow: auto; + position: absolute; + z-index: 3; +} + +.dropdownMenu dl { + margin: 0px; + display: block; +} + +.dropdownMenu dt { + padding: 2px 10px; + display: block; + cursor: pointer; + text-align: center; + color: #6f6b68; + font-weight: normal; +} + +.dropdownMenu dt:hover { + background: #DFDFDD; +} + +.dropdownSelectedEntry { + color: #6f6b68; + font-style: italic; + font-weight: normal; + display: table-cell; + vertical-align: middle; +} + +.dropdownUnselectedEntry { + color: #6f6b68; + font-style: normal; + font-weight: normal; + display: table-cell; + vertical-align: middle; +} + +.ddbElementsCount { + font-family: Calibri,Arial,sans-serif; + color: white; + font-style: italic; + font-weight: normal; + font-size: 13px; +} + +/* + settings for slider object +*/ +.dynamic-slider-control { + width: 20px; + height: 18px; + position: relative; +} + +.vertical { + height: 123px; +} + +.horizontal { + width: 123px; +} + +.dynamic-slider-control input { + display: none; +} + +.dynamic-slider-control .handle { + position: absolute; + font-size: 1px; + overflow: hidden; +} + +.dynamic-slider-control.vertical .handle { + width: 20px; + height: 12px; + cursor: pointer; + background-image: url("../images/zoom_slider-vertical.png"); +} + +.dynamic-slider-control.horizontal .handle { + width: 12px; + height: 20px; + cursor: pointer; + background-image: url("../images/zoom_slider-horizontal.png"); +} + +.dynamic-slider-control .line { + position: absolute; + font-size: 0.01mm; + overflow: hidden; + border: none; + background: rgb(189,190,189); +} + +.dynamic-slider-control.vertical .line { + width: 0px; +} + +.dynamic-slider-control .line div { + width: 0px; + height: 0px; + border: none; +} + +/* + settings for zoom slider +*/ +.sliderStyle-horizontal { + position: relative; + width: 167px; + height: 21px; + border: 1px solid #bebdbc; + margin: 3px; + background: white; +} + +.sliderStyle-vertical { + position: absolute; + width: 27px; + height: 173px; +/* border: 1px solid #bebdbc;*/ +/* margin: 3px;*/ +/* background: white;*/ + background-image: url("../images/ZoomBgWithIncrements.png"); + z-index: 1001; +} + +.zoomSliderContainer-horizontal { + position: absolute; + top: 2px; + left: 22px; + height: 16px; + background-image: url("../images/zoom_grid-horizontal.png"); +} + +.zoomSliderContainer-vertical { + position: absolute; + top: 24px; + width: 27px; +/* background-image: url("../images/zoom_grid-vertical.png");*/ +} + +.zoomSliderIn-horizontal { + position: absolute; + top: 1px; + left: 149px; + cursor: pointer; +} + +.zoomSliderOut-horizontal { + position: absolute; + top: 1px; + left: 2px; + cursor: pointer; +} + +.zoomSliderIn-vertical { + position: absolute; + top: 4px; + left: 4px; + cursor: pointer; +} + +.zoomSliderOut-vertical { + position: absolute; + bottom: 5px; + left: 4px; + cursor: pointer; +} + +.ddbPopupDiv { + position: absolute; + background-color: white; + padding: 15px; + visibility: visible; + z-index: 1000; + cursor: default; +} + +.ddbPopupInput { + overflow-x: auto; + overflow-y: auto; +} + +.ddbPopupInput tr, th, td { + font-size: 13px; +} + +.viewResults { + width: 121px; + height: 18px; + background-image: url("../images/Viewresultsbutton.png"); + cursor: pointer; + margin-top: 10px; +} + +.popupRight { + position: absolute; + width: 10px; + right: -4px; + top: 8px; + background-image: url("../images/right.png"); + background-repeat: repeat-y; + z-index: 3; +} + +.popupBottom { + position: absolute; + height: 10px; + bottom: -4px; + left: 16px; + background-image: url("../images/bottom.png"); + background-repeat: repeat-x; + z-index: 3; +} + +.popupBottomRight { + position: absolute; + width: 10px; + height: 10px; + bottom: -4px; + right: -4px; + background-image: url("../images/bottom_right.png"); + z-index: 4; +} + +.popupTopRight { + position: absolute; + width: 10px; + height: 8px; + top: 0px; + right: -4px; + background-image: url("../images/top_right.png"); + z-index: 4; +} + +.popupPeak { + position: absolute; + width: 26px; + height: 29px; + bottom: -14px; + left: -10px; + background-image: url("../images/peak.png"); + z-index: 4; +} + +.popupDDBResults { + font-weight: bold; + font-size: 12px; + color: #3e3a37; + cursor: default; + padding-bottom: 10px; +} + +.ddbPopupCancel { + position: absolute; + height: 16px; + width: 16px; + top: 2px; + right: 2px; + background-image: url(../images/cancel.png); + cursor: pointer; + z-index: 5; +} + +.ddbPopupLabel { + display: inline-block; + font-size: 12px; + color: #56524f; + cursor: pointer; +} + +.zoomPopup { + height: 20px; + width: 20px; + margin-left: 5px; + background-image: url(../images/zoom.png); + display: inline-block; + cursor: pointer; +} + +.descriptions { + display: inline-block; + height: 20px; + width: 20px; + background-image: url(../images/descriptions.png); + background-repeat: no-repeat; + cursor: pointer; +} + +.mapHome { + position: absolute; + cursor: pointer; + z-index: 1001; + background-image: url("../images/ResetMap.png"); + height: 27px; + width: 27px; +} + +.geoLocationOn { + position: absolute; + cursor: pointer; + z-index: 1001; + background-image: url("../images/GeoLocation.png"); + height: 27px; + width: 27px; +} + +.geoLocationOff { + position: absolute; + cursor: pointer; + z-index: 1001; + background-image: url("../images/GeoLocation2.png"); + height: 27px; + width: 27px; +} + +.aggregation { + display: inline-block; + cursor: pointer; + background-image: url("../images/aggregation.png"); + height: 30px; + width: 31px; +} + +.noAggregation { + display: inline-block; + cursor: pointer; + background-image: url("../images/no_aggregation.png"); + height: 30px; + width: 31px; +} + +.showBbox { + display: inline-block; + cursor: pointer; + background-image: url("../images/bbox_icon.png"); + height: 30px; + width: 31px; +} + +.hideBbox { + display: inline-block; + cursor: pointer; + background-image: url("../images/hidebbox_icon.png"); + height: 30px; + width: 31px; +} + +.nextItem { + display: none; + cursor: pointer; + background-image: url("../images/next.png"); + height: 7px; + width: 9px; + margin-left: 3px; +} + +.prevItem { + display: none; + cursor: pointer; + background-image: url("../images/prev.png"); + height: 7px; + width: 9px; + margin-right: 3px; +} + +.singleTable { + width: 100%; +} + +.smallButton { + display: inline-block; + cursor: pointer; + height: 27px; + width: 27px; +} + +.paginationButton { + display: table-cell; + cursor: pointer; + height: 26px; + width: 27px; +} + +.firstPageEnabled { + background-image: url("../images/firstPageEnabled.png"); +} + +.firstPageDisabled { + background-image: url("../images/firstPageDisabled.png"); +} + +.nextPageEnabled { + background-image: url("../images/nextPageEnabled.png"); +} + +.nextPageDisabled { + background-image: url("../images/nextPageDisabled.png"); +} + +.previousPageEnabled { + background-image: url("../images/previousPageEnabled.png"); +} + +.previousPageDisabled { + background-image: url("../images/previousPageDisabled.png"); +} + +.lastPageEnabled { + background-image: url("../images/lastPageEnabled.png"); +} + +.lastPageDisabled { + background-image: url("../images/lastPageDisabled.png"); +} + +.pageInfo { + display: table-cell; + vertical-align: middle; + padding: 0px 10px; + font-style: italic; + font-weight: normal; + font-size: 13px; +} + +.resultsInfo { + display: table-cell; + vertical-align: middle; + font-style: italic; + font-weight: normal; + font-size: 13px; +} + +.resultsDropdown { + display: table-cell; + padding-left: 10px; +} + +.tableEntry { + padding-top: 10px; + padding-bottom: 10px; + padding-right: 10px; + padding-left: 100px; + border-bottom: 1px solid #878380; + text-align: left; +} + +.tableTabs { + text-align: left; + opacity: 0.85; + filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; + border-spacing: 0px; +} + +.tableTab { + display: inline-block; + padding: 5px 20px; + cursor: pointer; + font-weight: bold; + font-size: 13px; + margin-right: 10px; + border-top: 1px solid #878380; + border-left: 1px solid #878380; + border-right: 1px solid #878380; +} + +.mapControl { + display: inline-block; + width: 31px; + height: 30px; + cursor: pointer; +} + +.squareDisabled { + background-image: url("../images/square-disabled.png"); +} + +.squareActivated { + background-image: url("../images/square-activated.png"); +} + +.squareDeactivated { + background-image: url("../images/square-deactivated.png"); +} + +.circleDisabled { + background-image: url("../images/circle-disabled.png"); +} + +.circleActivated { + background-image: url("../images/circle-activated.png"); +} + +.circleDeactivated { + background-image: url("../images/circle-deactivated.png"); +} + +.polygonDisabled { + background-image: url("../images/polygon-disabled.png"); +} + +.polygonActivated { + background-image: url("../images/polygon-activated.png"); +} + +.polygonDeactivated { + background-image: url("../images/polygon-deactivated.png"); +} + +.countryDisabled { + background-image: url("../images/country-disabled.png"); +} + +.countryActivated { + background-image: url("../images/country-activated.png"); +} + +.countryDeactivated { + background-image: url("../images/country-deactivated.png"); +} + +.linearPlotActivated { + background-image: url("../images/lin-activated.png"); +} + +.linearPlotDeactivated { + background-image: url("../images/lin-deactivated.png"); +} + +.logarithmicPlotActivated { + background-image: url("../images/log-activated.png"); +} + +.logarithmicPlotDeactivated { + background-image: url("../images/log-deactivated.png"); +} + +.playEnabled { + background-image: url("../images/play-enabled.png"); +} + +.playDisabled { + background-image: url("../images/play-disabled.png"); +} + +.pauseEnabled { + background-image: url("../images/pause-enabled.png"); +} + +.pauseDisabled { + background-image: url("../images/pause-disabled.png"); +} + +.dragControl { + display: inline-block; + height: 19px; + width: 19px; + cursor: pointer; +} + +.dragDisabled { + background-image: url("../images/drag-disabled.png"); +} + +.dragActivated { + background-image: url("../images/drag-activated.png"); +} + +.dragDeactivated { + background-image: url("../images/drag-deactivated.png"); +} + +.selectAll { + background-image: url("../images/selectAll.png"); +} + +.deselectAll { + background-image: url("../images/deselectAll.png"); +} + +.showAll { + background-image: url("../images/showAll.png"); +} + +.showSelected { + background-image: url("../images/showSelected.png"); +} + +.selectPage { + background-image: url("../images/selectPage.png"); +} + +.deselectPage { + background-image: url("../images/deselectPage.png"); +} + +.resultList { + z-index: 2; + width: 100%; + background-color: #878380; + opacity: 0.85; + filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; + border-spacing: 0px; +} + +.resultList table { + border-spacing: 0px; +} + +.resultList th { + font-family: Calibri,Arial,sans-serif; + color: white; + font-size: 13px; + font-weight: bold; + border: none; +} + +.resultList td { + font-family: Calibri,Arial,sans-serif; + font-size: 13px; + padding: 10px; + border-bottom: 1px solid #878380; + text-align: left; +} + +.sortDescActive { + background-image: url("../images/descActive.png"); +} + +.sortDescDeactive { + background-image: url("../images/descDeactive.png"); +} + +.sortAscActive { + background-image: url("../images/ascActive.png"); +} + +.sortAscDeactive { + background-image: url("../images/ascDeactive.png"); +} + +.sort { + height: 11px; + background-position: center center; + background-repeat: no-repeat; + cursor: pointer; +} + +.headerLabel { + vertical-align: middle; + padding: 0px 10px; +} + +.smallButton { + display: inline-block; + height: 27px; + width: 27px; + cursor: pointer; +} + +.filter { + background-image: url("../images/filter.png"); +} + +.filterDisabled { + background-image: url("../images/filterDisabled.png"); +} + +.filterInverse { + background-image: url("../images/filterInverse.png"); +} + +.filterInverseDisabled { + background-image: url("../images/filterInverseDisabled.png"); +} + +.filterCancel { + background-image: url("../images/filterCancel.png"); +} + +.filterCancelDisabled { + background-image: url("../images/filterCancelDisabled.png"); +} diff --git a/data/goethe.kml b/data/goethe.kml new file mode 100644 index 0000000..1eba45e --- /dev/null +++ b/data/goethe.kml @@ -0,0 +1,2 @@ + +
Stuttgart
Kommentar9.177017,48.782326,02009
Stuttgart
Text9.177017,48.782326,02009
Stuttgart
Der Briefwechsel9.177017,48.782326,02009
Frankfurt am Main
Faust. Eine Tragödie ; (Faust I)8.683333,50.116665,02009
Berlin
Kommentar13.4,52.516666,02009
Berlin
Texte13.4,52.516666,02009
Stuttgart
Text und Register9.177017,48.782326,02008
Berlin
Kommentar13.4,52.516666,02008
Berlin
Texte13.4,52.516666,02008
Berlin
Briefe. Historisch-kritische Ausgabe13.4,52.516666,02008
Weimar
Zeugnisse 1819 bis 1832. Überlieferungen, Erläuterungen, Anmerkungen,Register11.316667,50.983334,02007
Weimar
Materialien und Zeugnisse bis 181811.316667,50.983334,02007
Stuttgart
Text9.177017,48.782326,02007
São Paulo
/ il. de Max Beckmann-46.636112,-23.5475,02007
Weimar
Kommentar, Literatur- und Abkürzungsverzeichnis, Register11.316667,50.983334,02005
Weimar
Zur Meteorologie und Astronomie. Ergänzungen und Erläuterungen11.316667,50.983334,02005
Weimar
Text11.316667,50.983334,02005
Weimar
Goethes Briefwechsel mit seinem Sohn August. Mit Einleitung, Kommentar undRegister11.316667,50.983334,02005
São Paulo
/ il. de Eugène Delacroix-46.636112,-23.5475,02004
São Paulo
Fausto. Uma tragédia-46.636112,-23.5475,02004
Stuttgart
Text9.177017,48.782326,02004
Weimar
Überlieferung, Erläuterungen, Anmerkungen, Register11.316667,50.983334,02004
Weimar
Materialien und Zeugnisse11.316667,50.983334,02004
Göttingen
Edelsteine für die Seele. Ausgewählte Gedichte9.933333,51.533333,02004
Frankfurt am Main
Texte8.683333,50.116665,02003
Frankfurt am Main
Faust8.683333,50.116665,02003
Stuttgart
Briefwechsel mit Johann Wolfgang von Goethe. Nebst ergänzenden Schreiben9.177017,48.782326,02003
Weimar
Briefwechsel11.316667,50.983334,02002
Göttingen
"Zarten Seelen ist gar viel gegönnt". Naturwissenschaft und Kunst imBriefwechsel zwischen C. G. Carus und Goethe9.933333,51.533333,02001
Frankfurt am Main
Götz von Berlichingen mit der eisernen Hand. Ein Schauspiel 1773 ; [Textund Kommentar]8.683333,50.116665,02001
Stuttgart
Gedichte9.177017,48.782326,02001
Málaga
Ensayos sobre arte y literatura-4.420345,36.720158,02000
Stuttgart
Text9.177017,48.782326,02000
Milano
La forma delle nuvole e altri saggi di meteorologia9.189506,45.464268,02000
Leipzig
Träume und Legenden meiner Jugend. Texte über die Stillen im Lande12.371292,51.33962,02000
Buenos Aires
Fausto-58.408813,-34.576126,01999
Jakarta
Faust. Diterjemakhan dari bahasa Jerman oleh106.829445,-6.174444,01999
Weimar
Ergänzungen und Erläuterungen. Überlieferung, Erläuterungen, Anmerkungen,Register11.316667,50.983334,01999
Weimar
Ergänzungen und Erläuterungen . Materialien und Zeugnisse11.316667,50.983334,01999
Neumünster
Briefe an Augusta Louise zu Stolberg. Goethes Briefe ins holsteinischeKloster Uetersen9.983334,54.066666,01999
Stuttgart
Schriften zur Kunst und Literatur9.177017,48.782326,01999
Weimar
Leiden des jungen Werthers. Edition der Handschrift von 178611.316667,50.983334,01999
Frankfurt am Main
Bezüge nach aussen. Übersetzungen II, Bearbeitungen8.683333,50.116665,01999
Frankfurt am Main
1816 - 1820. über Kunst und Altertum I - II8.683333,50.116665,01999
Frankfurt am Main
Venezianische Epigramme. Eigenhändige Niederschriften, Transkription undKommentar8.683333,50.116665,01999
Würzburg
Goethes Biologie. Die wissenschaftlichen und die autobiographischen Texte9.936111,49.787777,01999
Frankfurt am Main
Kommentare8.683333,50.116665,01999
Frankfurt am Main
Texte8.683333,50.116665,01999
Frankfurt am Main
Faust8.683333,50.116665,01999
Berlin
1806 - 180813.4,52.516666,01999
Stuttgart
Texte9.177017,48.782326,01999
Stuttgart
Faust-Dichtungen9.177017,48.782326,01999
Stuttgart
Goethe gibt Auskunft. über sein Leben, sein Werk, seine Zeit9.177017,48.782326,01999
Frankfurt am Main
Gedichte in Handschriften. Fünfzig Gedichte Goethes8.683333,50.116665,01999
Frankfurt am Main
Vom 27. Oktober 1819 bis zum 26. Dezember 18228.683333,50.116665,01999
Frankfurt am Main
Vom 6. Juni 1816 bis zum 18. Oktober 18198.683333,50.116665,01999
Frankfurt am Main
Vom 1. Januar 1800 bis zum 9. Mai 18058.683333,50.116665,01999
Frankfurt am Main
Aufgabengebiete seit der Rückkehr aus Italien8.683333,50.116665,01999
Frankfurt am Main
1824 - 1832. über Kunst und Altertum V - VI8.683333,50.116665,01999
Frankfurt am Main
Die Leiden des jungen Werthers. Leipzig 1774 ; [Text und Kommentar]8.683333,50.116665,01998
Darmstadt
Versepen. Schriften, Maximen und Reflexionen8.649445,49.870556,01998
Darmstadt
Dichtung und Wahrheit8.649445,49.870556,01998
Darmstadt
Die Leiden des jungen Werthers. Wilhelm Meisters Lehrjahre8.649445,49.870556,01998
Darmstadt
Faust I und II. Die Wahlverwandtschaften8.649445,49.870556,01998
Darmstadt
Dramen. Novellen8.649445,49.870556,01998
Darmstadt
Gedichte. West-östlicher Divan8.649445,49.870556,01998
Darmstadt
Werke8.649445,49.870556,01998
München
West-östlicher Divan11.575491,48.137432,01998
Frankfurt am Main
Sämtliche Werke, Briefe, Tagebücher und Schriften bis 1775. Bilder,Handschriften, Zeugnisse und Werke der Zeitgenossen ; Bildungsmuster derEpoche ; Kommentare. Chronik. Register8.683333,50.116665,01998
Frankfurt am Main
Der junge Goethe. Sämtliche Werke, Briefe, Tagebücher und Schriften bis17758.683333,50.116665,01998
Frankfurt am Main
Der junge Goethe. Sämtliche Werke, Briefe, Tagebücher und Schriften bis17758.683333,50.116665,01998
Berlin
Johann Wolfgang Goethe - Briefe, Tagebücher, Gespräche13.4,52.516666,01998
Frankfurt am Main
Vom 24. Juni 1794 bis zum 31. Dezember 17998.683333,50.116665,01998
Frankfurt am Main
Geheimes Consilium und andere bis zur Italienreise übernommeneAufgabengebiete8.683333,50.116665,01998
Frankfurt am Main
1821 - 1824. über Kunst und Altertum III - IV8.683333,50.116665,01998
Frankfurt am Main
1806 - 18158.683333,50.116665,01998
Frankfurt am Main
1771 - 18058.683333,50.116665,01998
Berlin
Johann Wolfgang Goethe - Werke13.4,52.516666,01998
Frankfurt am Main
Leben des Benvenuto Cellini ; Ãœbersetzungen I8.683333,50.116665,01998
Rudolstadt
Goethe wandert11.333333,50.716667,01998
Frankfurt
Goethe, Handzeichnungen. Die zweiundzwanzig Handzeichnungen von 1810 ; einZyklus von Johann Wolfgang Goethe8.683333,50.116665,01998
Stuttgart
Text9.177017,48.782326,01998
Stuttgart
Tagebücher. Historisch-kritische Ausgabe9.177017,48.782326,01998
Moskva
Stichotvorenija37.615555,55.752224,01997
Sofija
Faust. Tragedija ; părva i vtora Äast23.324146,42.697514,01997
Halle
Johann Wolfgang von Goethe und Christian Gottfried Daniel Nees vonEsenbeck. Briefwechsel ; Vorabdruck der Texte11.933333,51.483334,01997
München
@11.575491,48.137432,01997
Weimar
Von 1806 bis 1820. Ergänzungen und Erläuterungen11.316667,50.983334,01997
Mainz
Reise-Tagebuch 1786. (italienische Reise) ; [eine Publikation desArbeitskreises Selbständiger Kultur-Institute e.V. - AsKI, Bonn und derStiftung Weimarer Klassik, Weimar aus Anlaß der Eröffnung der vom AsKIgetragenen Casa di Goethe, Via del Corso, Rom]8.2711115,50.0,01997
Rudolstadt
"Ich war heut glücklich im Zeichnen". Goethes Thüringer Ansichten11.333333,50.716667,01997
Frankfurt am Main
Das erste Weimarer Jahrzehnt. Briefe, Tagebücher und Gespräche vom 7.November 1775 - 2. September 17868.683333,50.116665,01997
Frankfurt am Main
Von Frankfurt nach Weimar. Briefe, Tagebücher und Gespräche vom 23. Mai1764 - 30. Oktober 17758.683333,50.116665,01997
München
Die Leiden des jungen Werthers. Leipzig 177411.575491,48.137432,01997
Paderborn
Die Leiden des jungen Werthers. Synoptischer Druck der beiden Fassungen1774 und 17878.754387,51.71905,01997
München
@11.575491,48.137432,01996
Frankfurt am Main
Einführung, Transkription und Kommentar8.683333,50.116665,01996
Frankfurt am Main
Handschriften8.683333,50.116665,01996
Frankfurt am Main
West-östlicher Divan. Eigenhändige Niederschriften8.683333,50.116665,01996
Montreuil
Histoire de Gottfried von Berlichingen à la main de fer, mise en drame2.4333334,48.866665,01996
Köln
Goethe-Zitate für Juristen. Aus Rechtsstudium, Advokatur, Staatsdienst,Rechts- und Lebensweisheit des Dichterjuristen6.95,50.933334,01996
Frankfurt am Main
Kommentare8.683333,50.116665,01995
Frankfurt am Main
Texte8.683333,50.116665,01995
Stuttgart
Tagebücher. 1. Januar bis 15. November 1777 ; Reise-Tagebuch 1786 ; erstesStück ; Text und Kommentar9.177017,48.782326,01995
Weimar
Von 1816 bis 182411.316667,50.983334,01995
München
Schriften zur Kunst, Schriften zur Literatur, Maximen und Reflexionen11.575491,48.137432,01994
Frankfurt am Main
Tag- und Jahreshefte8.683333,50.116665,01994
Frankfurt am Main
Kommentare8.683333,50.116665,01994
Frankfurt am Main
Texte8.683333,50.116665,01994
Stuttgart
Die Metamorphose des Granits. Substanz- und Gestaltbildung desErdorganismus9.177017,48.782326,01994
Frankfurt am Main
Campagne in Frankreich. Belagerung von Mainz. Reiseschriften8.683333,50.116665,01994
Frankfurt am Main
Die Leiden des jungen Werthers. Die Wahlverwandtschaften. Kleine Prosa.Epen8.683333,50.116665,01994
Frankfurt am Main
Von 1812 bis zu Christianes Tod8.683333,50.116665,01994
Stuttgart
Die Leiden des jungen Werther9.177017,48.782326,01993
Rudolstadt
"Untadeliche Schönheit". Kommentarbd. zum Rudolstädter Faks. von JohannWolfgang Goethe: "Das Römische Carneval"11.333333,50.716667,01993
Rudolstadt
Das römische Carneval11.333333,50.716667,01993
Frankfurt am Main
Goethes Briefe an Auguste Gräfin zu Stolberg aus der ehemaligen SammlungBrockhaus8.683333,50.116665,01993
Frankfurt am Main
Sprüche in Prosa. Sämtliche Maximen und Reflexionen8.683333,50.116665,01993
Frankfurt am Main
Von Schillers Tod bis 18118.683333,50.116665,01993
München
@11.575491,48.137432,01993
Frankfurt am Main
1791 - 18328.683333,50.116665,01993
Frankfurt am Main
Vom Dornburger Aufenthalt 1828 bis zum Tode8.683333,50.116665,01993
Frankfurt am Main
Von 1823 bis zum Tode Carl Augusts 18288.683333,50.116665,01993
Wrocław
Faust17.033333,51.1,01992
München
Italienische Reise11.575491,48.137432,01992
München
@11.575491,48.137432,01992
Weimar
Zur Farbenlehre. Polemischer Teil11.316667,50.983334,01992
Frankfurt am Main
Goethe's Briefwechsel mit einem Kinde8.683333,50.116665,01992
Frankfurt am Main
Verweile doch. 111 Gedichte mit Interpretationen8.683333,50.116665,01992
Oldenburg
Goethe und Buttel. Briefwechsel 1827 ; textkritische und kommentierteAusgabe8.2,53.166668,01992
Frankfurt am Main
Wilhelm Meisters theatralische Sendung. Wilhelm Meisters Lehrjahre.Unterhaltungen deutscher Ausgewanderten8.683333,50.116665,01992
Stuttgart
Kommentar, Nachwort, Register9.177017,48.782326,01991
Stuttgart
Text9.177017,48.782326,01991
München
Trost bei Goethe. "Nichts ist groß als das Natürliche"11.575491,48.137432,01991
Stuttgart
Aus meinem Leben. Dichtung und Wahrheit9.177017,48.782326,01991
Augsburg
Lexikon der Goethe-Zitate10.883333,48.366665,01991
Köln
Faust. Der Tragödie erster Teil6.95,50.933334,01991
Frankfurt am Main
Elegie von Marienbad. Urschrift, September 18238.683333,50.116665,01991
Frankfurt am Main
Goethe in Leipzig. 1765 - 1768 ; Bruchstücke einer Konfession ;dokumentiert in Briefen und Selbstzeugnissen8.683333,50.116665,01991
Frankfurt am Main
Italien - im Schatten der Revolution. Briefe, Tagebücher und Gespräche vom3. September 1786 bis 12. Juni 17948.683333,50.116665,01991
Frankfurt am Main
Schriften zur Farbenlehre 1790 - 18078.683333,50.116665,01991
Frankfurt am Main
Zur Farbenlehre8.683333,50.116665,01991
München
Wilhelm Meisters Wanderjahre. Maximen und Reflexionen11.575491,48.137432,01991
München
Leben des Benvenuto Cellini, Diderots Versuch über die Malerei, RameausNeffe11.575491,48.137432,01991
Weimar
Der Zeichner Goethe. 1788 - 183211.316667,50.983334,01990
Berlin
Das Tagebuch13.4,52.516666,01990
Tübingen
Goethe, Werke. Nach der Hamburger Ausgabe9.052219,48.52266,01990
München
Gesamtregister. [1764 - 1832]11.575491,48.137432,01990
München
Nachträge 1768 - 1832, Erläuterungen11.575491,48.137432,01990
München
Nachträge 1768-1832, Texte11.575491,48.137432,01990
Zollikon
Der Zauberlehrling8.574074,47.340195,01990
München
Gesamtregister11.575491,48.137432,01990
München
Nachträge 1768 - 1832 ; Erläuterungen11.575491,48.137432,01990
München
Nachträge 1768 - 1832 ; Texte11.575491,48.137432,01990
München
Goethes Werke. Weimarer Ausgabe ; Nachträge u. Register zu Abt. 4, Briefe11.575491,48.137432,01990
München
@11.575491,48.137432,01990
München
@11.575491,48.137432,01990
Frankfurt am Main
Goethe über das Mittelalter8.683333,50.116665,01990
Chicago
Faust. Parts 1 and 2-87.650055,41.850033,01989
Berlin
Venezianische Epigramme13.4,52.516666,01989
München
Alphabetisches Inhaltsverzeichnis zu den bis 1989 erschienenen Bänden11.575491,48.137432,01989
Frankfurt am Main
Mit Goethe durch den Garten. Ein ABC für Gartenfreunde8.683333,50.116665,01989
Weimar
Zur Geologie und Mineralogie. Von den Anfängen bis 1805 ; Ergänzungen undErläuterungen11.316667,50.983334,01989
Dresden
Der Tragödie zweiter Teil13.7383175,51.05089,01989
Dresden
Der Tragödie erster Teil13.7383175,51.05089,01989
Dresden
Faust13.7383175,51.05089,01989
Frankfurt am Main
Schriften zur allgemeinen Naturlehre, Geologie und Mineralogie8.683333,50.116665,01989
Frankfurt am Main
Wilhelm Meisters Wanderjahre8.683333,50.116665,01989
München
Zur Naturwissenschaft überhaupt, besonders zur Morphologie. Erfahrung,Betrachtung, Folgerung, durch Lebensereignisse verbunden11.575491,48.137432,01989
München
Zur Farbenlehre11.575491,48.137432,01989
Frankfurt am Main
Römische Elegien. Faksimile der Handschrift8.683333,50.116665,01988
München
Recension einer Anzahl französischer satyrischer Kupferstiche. Text, Bild,Kommentar11.575491,48.137432,01988
Weimar
Goethe als Zeichner in Italien11.316667,50.983334,01988
Frankfurt am Main
1776 - 17908.683333,50.116665,01988
Frankfurt am Main
1800 - 18328.683333,50.116665,01988
München
Wilhelm Meisters Lehrjahre. Ein Roman11.575491,48.137432,01988
München
@11.575491,48.137432,01988
Stuttgart
Briefwechsel 1784 - 18289.177017,48.782326,01988
Wien
Natur und Kunst. Graphik und Gedichte16.372076,48.20849,01987
Frankfurt am Main
Unterhaltungen deutscher Ausgewanderten8.683333,50.116665,01987
Weimar
Thüringer Zeichnungen. Aus den Beständen des Goethe-Nationalmuseums11.316667,50.983334,01987
München
Supplement zur Weimarer Ausgabe im Deutschen Taschenbuch Verl.11.575491,48.137432,01987
Frankfurt am Main
Schriften zur Morphologie8.683333,50.116665,01987
Frankfurt am Main
1756 - 17998.683333,50.116665,01987
Weimar
Register11.316667,50.983334,01987
München
Epoche der Wahlverwandtschaften. 1807 - 181411.575491,48.137432,01987
München
@11.575491,48.137432,01987
München
@11.575491,48.137432,01987
Hanau
Goethe-Zitate. Redensarten, Sprichwörter8.916667,50.133335,01986
Berlin
Die nachgelassenen Werke und die Quartausgabe13.4,52.516666,01986
New York
Essays on art and literature-74.005974,40.714268,01986
Frankfurt am Main
Die guten Frauen als Gegenbilder der bösen Weiber8.683333,50.116665,01986
Weimar
Von 1796 bis 1815. Ergänzungen und Erläuterungen11.316667,50.983334,01986
Frankfurt am Main
Aus meinem Leben, Dichtung und Wahrheit8.683333,50.116665,01986
München
Briefe der Jahre 1764 - 178611.575491,48.137432,01986
München
Autobiographische Schriften der frühen Zwanzigerjahre11.575491,48.137432,01986
München
@11.575491,48.137432,01986
Hamburg
Goethe an Cornelia. Die dreizehn Briefe an seine Schwester10.0,53.55,01986
Zürich
Goethe in Venedig. Reiseberichte und Gedichte8.55,47.366665,01986
Bonn
Wilhelm Meisters Wanderjahre oder die Entsagenden. Urfassung von 18217.1,50.733334,01986
Saarbrücken
Reisen zwischen Rhein und Saar7.0,49.233334,01986
Freiburg im Breisgau
Schönheit wächst im Herzen7.8522205,47.995895,01985
Frankfurt am Main
1765 - 17758.683333,50.116665,01985
Frankfurt am Main
Sämtliche Werke, Briefe, Tagebücher und Gespräche. Vierzig Bände8.683333,50.116665,01985
Berlin
1800 - 180513.4,52.516666,01985
München
Aus meinem Leben. Dichtung und Wahrheit11.575491,48.137432,01985
München
Sämtliche Werke nach Epochen seines Schaffens. Münchner Ausgabe11.575491,48.137432,01985
Weimar
Von Zürich nach Weimar. Goethes Tagebuch ; 177511.316667,50.983334,01985
Weimar
Erlkönig11.316667,50.983334,01985
Berlin
Die Einzeldrucke13.4,52.516666,01984
Zürich
Goethe erzählt. Geschichten, Märchen, Schilderungen, Abenteuer u.Geständnisse8.55,47.366665,01984
Cambridge
Faust I & II0.1166667,52.2,01984
Mainz
Goethes Faust8.2711115,50.0,01984
Stuttgart
Enthüllung der Theorie Newtons9.177017,48.782326,01984
Stuttgart
Vorarbeiten und Nachträge zur Farbenlehre9.177017,48.782326,01984
Stuttgart
Entwurf einer Farbenlehre9.177017,48.782326,01984
Darmstadt
Johann Wolfgang Goethe: Versuch einer Annäherung. Ringvorlesung an derTechnischen Hochschule Darmstadt im Sommersemester 1982 zum 150. Todestag vonJohann Wolfgang Goethe ; eine Dokumentation8.649445,49.870556,01984
Frankfurt am Main
Das römische Carneval. Mit den farbigen Figurinen von 1789 und denFragmenten "Über Italien"8.683333,50.116665,01984
Frankfurt am Main
Goethes Briefwechsel mit einem Kinde8.683333,50.116665,01984
Berlin
Willkomm und Abschied. Gedichte des jungen Goethe13.4,52.516666,01984
Frankfurt am Main
Goethe - warum?. Eine repräsentative Auslese aus Werken, Briefen undDokumenten8.683333,50.116665,01984
Tallinn
Faust24.753529,59.43696,01983
Frankfurt am Main
Briefe an Auguste Gräfin zu Stolberg8.683333,50.116665,01983
Stuttgart
1816 - 18329.177017,48.782326,01983
Stuttgart
1797 - 18159.177017,48.782326,01983
Leer
Dat Speel vun Dokter Faust. Eine niederdeutsche Nachgestaltung von GoethesUrfaust ; mit Ergänzungen aus der Tragödie erstem Teil7.4333334,53.233334,01983
Kehl
Goethe, Friederike und Sesenheim27.333334,44.2,01983
Berlin
Die Ausgabe letzter Hand13.4,52.516666,01982
Wiesbaden
Der Tragödie 2. Teil8.25,50.083332,01982
Wiesbaden
Der Tragödie 1. Teil8.25,50.083332,01982
Wiesbaden
Faust8.25,50.083332,01982
Frankfurt am Main
Goethes Gedichte in zeitlicher Folge8.683333,50.116665,01982
Berlin
Register zu Bd. 1 bis 613.4,52.516666,01982
Frankfurt am Main
Iphigenie auf Tauris. Prosa-Fassung8.683333,50.116665,01982
München
West-östlicher Divan11.575491,48.137432,01982
Weinheim
Goethe ist gut. Ein Goethe-Lesebuch für Kinder ausgestattet und bebildertmit Schattenrissen, Scherenschnitten, Stichen und anderen zeitgenössischenBildern ; im Anhang: Wie wertvoll ist eine Goethe-Locke?8.666111,49.548332,01982
Berlin
Register zu Band 1-613.4,52.516666,01982
Berlin
Die Leiden des jungen Werther. Ein unklassischer Klassiker13.4,52.516666,01982
Düsseldorf
Goethe und das Rheinland6.776161,51.22172,01982
München
Schriften zur Biologie11.575491,48.137432,01982
Frankfurt am Main
Johann Wolfgang Goethe zu Bildern8.683333,50.116665,01982
München
Schriften zur Kunst, Schriften zur Literatur, Maximen und Reflexionen11.575491,48.137432,01981
München
Schriften zur Kunst, Schriften zur Literatur, Maximen und Reflexionen11.575491,48.137432,01981
Berlin
Venezianische Epigramme13.4,52.516666,01981
Frankfurt am Main
Die Leiden des jungen Werther8.683333,50.116665,01981
München
Goethes Werke. Hamburger Ausgabe in 14 Bänden11.575491,48.137432,01981
Zürich
Der fünfte Akt von Goethes Faust II. Kommentierte kritische Ausg.8.55,47.366665,01981
Marktredwitz
Joseph Sebastian Grüners Briefwechsel mit Goethe12.081111,50.005,01981
Warszawa
Elegie rzymskie21.0,52.25,01980
Wrocław
Herman i Dorota17.033333,51.1,01980
Budapest
A műalkotások igazságáról és valószerűségéről. Válogatottképzőművészeti írások19.083334,47.5,01980
Beograd
Faust20.468056,44.81861,01980
Berlin
Ãœberlieferung, Varianten und Paralipomena zu Band 213.4,52.516666,01980
Frankfurt am Main
Goethes letzte Schweizer Reise8.683333,50.116665,01980
Tübingen
Novelle9.052219,48.52266,01980
Berlin
1793 - 179913.4,52.516666,01980
Berlin
Ãœberlieferung, Varianten und Paralipomena zu Band 213.4,52.516666,01980
Dortmund
Juristische Abhandlung über die Flöhe7.45,51.516666,01980
Stuttgart
Enthüllung der Theorie Newtons9.177017,48.782326,01979
Stuttgart
Vorarbeiten und Nachträge zur Farbenlehre9.177017,48.782326,01979
Stuttgart
Entwurf einer Farbenlehre9.177017,48.782326,01979
Stuttgart
Farbenlehre9.177017,48.782326,01979
Stuttgart
Briefe. 1816 - 18329.177017,48.782326,01979
Stuttgart
Briefe. 1797 - 18159.177017,48.782326,01979
Stuttgart
Goethe und Cotta. Briefwechsel, 1797 - 1832 ; textkritische undkommentierte Ausgabe in drei Bänden9.177017,48.782326,01979
München
Geliebte, Freundin. Goethes Briefe an Charlotte von Stein nachGroßkochberg ; nebst 17 unveröffentlichten Briefen der Amélie von Stein,geb. Seebach11.575491,48.137432,01979
Frankfurt am Main
Novellen8.683333,50.116665,01979
Marbach
Poetisches Werk und Handelszwang. Zur Ausgabe der Briefe zwischen Goetheund Cotta9.259951,48.93964,01979
Frankfurt am Main
Reise-, Zerstreuungs- und Trost-Büchlein. 1806 - 18078.683333,50.116665,01978
Berlin
Abbildungen zu den Schriften zur bildenden Kunst13.4,52.516666,01978
Berlin
Aufsätze13.4,52.516666,01978
Berlin
Ãœberlieferung, Varianten und Paralipomena zu Band 313.4,52.516666,01978
Berlin
Ãœberlieferung, Varianten und Paralipomena zu Band 313.4,52.516666,01978
Dortmund
Reineke Fuchs7.45,51.516666,01978
München
Leben und Welt in Briefen11.575491,48.137432,01978
München
Italienische Reise11.575491,48.137432,01978
München
Faust. [Goethes Faust-Dichtungen]11.575491,48.137432,01978
Stuttgart
Goethe. Faust ; Kommentare9.177017,48.782326,01977
Stuttgart
Goethe. Das bürgerliche Zeitalter9.177017,48.782326,01977
Stuttgart
Goethe. 1749 bis 1832 ; Texte und Bilder9.177017,48.782326,01977
Stuttgart
Faust. Der Tragödie zweiter Teil9.177017,48.782326,01977
Stuttgart
Faust. Der Tragödie erster Teil9.177017,48.782326,01977
Frankfurt am Main
West-östlicher Divan8.683333,50.116665,01977
Weimar
Von den Anfängen bis 179511.316667,50.983334,01977
Berlin
Benvenuto Cellini13.4,52.516666,01977
Berlin
1786 - 179213.4,52.516666,01977
Köln
Steuergutachten aus dem Jahre 17856.95,50.933334,01977
Berlin
Ãœberlieferung, Varianten und Paralipomena zu Band 113.4,52.516666,01976
New York
Goethe's Faust. Part I-74.005974,40.714268,01976
Berlin
Italienische Reise13.4,52.516666,01976
Berlin
Italienische Reise13.4,52.516666,01976
Berlin
Ãœberlieferung, Varianten und Paralipomena zu Bd. 113.4,52.516666,01976
Moskva
Ob isskustve37.615555,55.752224,01975
Hagen
Scene des Faust von Goethes eigener Hand 18007.4666667,51.35,01975
Hagen
Brocken-Scene des Faust von Goethe's eigener Hand 18007.4666667,51.35,01975
Hagen
Die Valentinszene und die Walpurgisnacht aus Faust I. Faksimile derHandschriften Ms. germ. qu. 475 und 527 der Staatsbibliothek PreußischerKulturbesitz in Berlin7.4666667,51.35,01975
Berlin
Ãœberlieferung, Varianten und Paralipomena13.4,52.516666,01975
Berlin
Wilhelm Meisters Lehrjahre13.4,52.516666,01974
Berlin
Die Laune des Verliebten13.4,52.516666,01974
Frankfurt am Main
West-östlicher Divan8.683333,50.116665,01974
Berlin
Schriften zu Kunst und Literatur13.4,52.516666,01974
Berlin
Philosophische und naturwissenschaftliche Schriften13.4,52.516666,01974
Berlin
Italienische Reise13.4,52.516666,01974
Berlin
Aus meinem Leben. dichtung und Wahrheit, 3. und 4. Teil13.4,52.516666,01974
Berlin
Aus meinem Leben. Dichtung und Wahrheit, 1. und 2. Teil13.4,52.516666,01974
Berlin
Die natürliche Tochter13.4,52.516666,01974
Berlin
Versepen13.4,52.516666,01974
Lawrence
Roman elegies and Venetian epigrams. A bilingual text-95.23525,38.97167,01974
Berlin
Die Leiden des jungen Werther13.4,52.516666,01974
Berlin
Wilhelm Meisters Wanderjahre13.4,52.516666,01974
Berlin
Goethes Werke. In zwölf Bänden13.4,52.516666,01974
Köln
Steuergutachten aus dem Jahre 1785. Faksimiledruck6.95,50.933334,01974
München
Gedichte11.575491,48.137432,01974
Berlin
Aufsätze zur bildenden Kunst. (1812 - 1832)13.4,52.516666,01974
Berlin
@13.4,52.516666,01974
Hamburg
Goethe und das Elsass10.0,53.55,01973
Weimar
Zur Farbenlehre. Didaktischer Teil und Tafeln11.316667,50.983334,01973
Wiesbaden
Reineke Fuchs8.25,50.083332,01973
Berlin
Aufsätze zur bildenden Kunst. (1772 - 1808)13.4,52.516666,01973
Berlin
Faust13.4,52.516666,01973
Berlin
Kleine Dramen. (1767 - 1788)13.4,52.516666,01973
Berlin
West-östlicher Divan13.4,52.516666,01973
Berlin
Gedichte. Nachlese und Nachlaß13.4,52.516666,01973
Berlin
Text13.4,52.516666,01973
Berlin
Januar - Oktober 177513.4,52.516666,01973
Leipzig
Die Zeugnisse12.371292,51.33962,01973
Berlin
Text13.4,52.516666,01973
Berlin
Italienische Reise13.4,52.516666,01972
Berlin
Wilhelm Meisters Wanderjahre. Oder die Entsagenden13.4,52.516666,01972
Berlin
Gedichte13.4,52.516666,01972
Stuttgart
Campagne in Frankreich. Belagerung von Mainz9.177017,48.782326,01972
Berlin
Aufsätze zur Weltliteratur13.4,52.516666,01972
Berlin
Briefe aus der Schweiz 177913.4,52.516666,01972
Berlin
Die Wahlverwandtschaften13.4,52.516666,01972
Berlin
Götz von Berlichingen13.4,52.516666,01972
Weimar
Erläuterungen zu den Schriften der Jahre 1788 - 181911.316667,50.983334,01972
Berlin
Wilhelm Meisters Lehrjahre13.4,52.516666,01971
Berlin
Aus meinem Leben. Dichtung und Wahrheit13.4,52.516666,01971
Berlin
Die Leiden des jungen Werther13.4,52.516666,01971
Zürich
Registerband. Personen und Orte, Goethe über seine Werke, Werkverzeichnis8.55,47.366665,01971
Bern
Briefwechsel des Herzogs-Grossherzogs Carl August mit Goethe-46.565,-23.69389,01971
Berlin
Text13.4,52.516666,01971
Berlin
Text13.4,52.516666,01971
Berlin
Erzählungen. Historisch-kritische Ausgabe13.4,52.516666,01971
Leipzig
Nr. 1 - 285. Zeichnungen außerhalb der Goethe-Institute der NationalenForschungs- und Gedenkstätten der Klassischen Deutschen Literatur in Weimar ;Nachträge ; Berichtigungen zu C. I - VI A ; Abschreibungen ; Gesamtkonkordanz12.371292,51.33962,01971
Berlin
Text13.4,52.516666,01971
Ravensburg
Goethes Farbenlehre9.616667,47.783333,01971
Berlin
Römische Elegien13.4,52.516666,01970
Berlin
Text13.4,52.516666,01970
Frankfurt am Main
Torquato Tasso. Regiebuch der Bremer Inszenierung8.683333,50.116665,01970
München
Wilhelm Tischbeins Idyllen11.575491,48.137432,01970
Weimar
Aufsätze, Fragmente, Studien zur Naturwissenschaft im allgemeinen11.316667,50.983334,01970
Berlin
Aus meinem Leben. Dichtung und Wahrheit13.4,52.516666,01970
Berlin
Aufsätze zu Schauspielkunst und Musik13.4,52.516666,01970
Berlin
Text13.4,52.516666,01970
Berlin
Schriften zur Literatur. Historisch-kritische Ausgabe13.4,52.516666,01970
Weimar
Die Schriften der Jahre 1788 - 181911.316667,50.983334,01970
Leipzig
Nr. 1 - 302. Zeichnungen aus dem Bestande des Goethe- und Schiller-Archivsder Nationalen Forschungs- und Gedenkstätten der Klassischen DeutschenLiteratur in Weimar12.371292,51.33962,01970
Bern
1828-1832-46.565,-23.69389,01970
Bern
1819-1827-46.565,-23.69389,01970
Bern
1799-1818-46.565,-23.69389,01970
Berlin
Text13.4,52.516666,01970
Berlin
Schriften zur Literatur. Historisch-kritische Ausgabe13.4,52.516666,01970
Berlin
Novelle13.4,52.516666,01969
Wien
Gutes Glück bei Goethe16.372076,48.20849,01969
Stuttgart
Schriften zur Morphologie ; 29.177017,48.782326,01969
Praha
The poet and the scientist14.424132,50.087837,01968
Berlin
Singspiele13.4,52.516666,01968
New York
Italian journey, 1786-1788-74.005974,40.714268,01968
Weimar
Die Schriften der Jahre 1788 - 181911.316667,50.983334,01968
Berlin
Januar - Dezember 177413.4,52.516666,01968
Leipzig
Nr. 1 - 271. Nachitalienische Zeichnungen 1788 bis 1829. Antike, Porträt,Figurales, Architektur, Theater12.371292,51.33962,01968
Zürich
Lexikon der Goethe-Zitate8.55,47.366665,01968
Tallinn
Faust24.753529,59.43696,01967
Hamburg
Briefe der Jahre 1821 - 183210.0,53.55,01967
Hamburg
Schriften zur Kunst. Schriften zur Literatur. Maximen und Reflexionen10.0,53.55,01967
Leipzig
Nr. 1 - 264. Die naturwissenschaftlichen Zeichnungen mit Ausnahme derFarbenlehre12.371292,51.33962,01967
Berlin
Gedichte. Nachlese und Nachlaß13.4,52.516666,01966
Leipzig
Nr. 1 - 348. Nachitalienische Landschaften12.371292,51.33962,01966
Moskva
Lirika37.615555,55.752224,01966
Hamburg
Materialien. Register10.0,53.55,01966
Berlin
1777 - 178513.4,52.516666,01966
Berlin
September 1772 - Dezember 177313.4,52.516666,01966
Zürich
Epen. West-östlicher Divan. Theatergedichte8.55,47.366665,01966
London
Ironhand-0.12553275,51.508415,01965
Berlin
West-östlicher Divan13.4,52.516666,01965
Berlin
Gedichte13.4,52.516666,01965
Zürich
Goethes Gespräche. Eine Sammlung zeitgenössischer Berichte aus seinemUmgang8.55,47.366665,01965
Berlin
Faust13.4,52.516666,01965
Leipzig
Nr. 1 - 271. Italienische Reise 1786 bis 1788 ; Antiken- undAnatomiestudien ; Architektur und Perspektive12.371292,51.33962,01965
Berlin
1749 - 177613.4,52.516666,01965
Berlin
Goethe. Begegnungen und Gespräche13.4,52.516666,01965
Tübingen
Kommentar9.052219,48.52266,01965
Tübingen
Text9.052219,48.52266,01965
Tübingen
West-östlicher Divan. Kritische Ausgabe der Gedichte9.052219,48.52266,01965
Hamburg
Briefe der Jahre 1805 - 182110.0,53.55,01965
Berlin
Tag- und Jahreshefte13.4,52.516666,01964
Berlin
Kleine Dramen. (1791 - 1815)13.4,52.516666,01964
Berlin
Kleine Dramen. (1767 - 1788)13.4,52.516666,01964
Zürich
Tagebücher8.55,47.366665,01964
Hamburg
Briefe der Jahre 1786 - 180510.0,53.55,01964
Weimar
Aufsätze, Fragmente, Studien zur Morphologie11.316667,50.983334,01964
Hamburg
Sachregister10.0,53.55,01964
Zürich
Briefwechsel mit Friedrich Schiller8.55,47.366665,01964
Stuttgart
Schriften zur Farbenlehre ; 29.177017,48.782326,01963
Berlin
Wilhelm Meisters Wanderjahre13.4,52.516666,01963
Berlin
Die Wahlverwandtschaften13.4,52.516666,01963
Berlin
Götz von Berlichingen13.4,52.516666,01963
Berlin
Ãœberlieferung, Varianten und Paralipomena13.4,52.516666,01963
Berlin
Ãœberlieferung, Varianten und Paralipomena13.4,52.516666,01963
Berlin
Text13.4,52.516666,01963
Stuttgart
Schriften. Ãœbertragungen9.177017,48.782326,01963
Hamburg
Goethes Faust. Der Tragödie erster und zweiter Teil ; Urfaust10.0,53.55,01963
München
Schriften zur Botanik und Wissenschaftslehre11.575491,48.137432,01963
Leipzig
Nr. 1 - 390. Die Zeichnungen zur Farbenlehre12.371292,51.33962,01963
München
Tagebücher 2. 1810 - 183211.575491,48.137432,01963
München
Tagebücher 1. 1775 - 180911.575491,48.137432,01963
Hamburg
Schriften zur Kunst. Schriften zur Literatur. Maximen und Reflexionen10.0,53.55,01963
Berlin
April 1770 - September 177213.4,52.516666,01963
Berlin
August 1749 - März 177013.4,52.516666,01963
Berlin
Der junge Goethe. In fünf Bänden13.4,52.516666,01963
Stuttgart
Ãœbertragungen9.177017,48.782326,01963
Lund
Faust. Tragöödia teine osa-0.12553275,51.508415,01962
Lund
Faust-0.12553275,51.508415,01962
Moskva
Faust. Tragedija37.615555,55.752224,01962
Berlin
Briefe aus der Schweiz 177913.4,52.516666,01962
Berlin
Wilhelm Meisters Lehrjahre13.4,52.516666,01962
Stuttgart
Schriften. Schriften zur Kunst 29.177017,48.782326,01962
Zürich
Schriften und Abhandlungen8.55,47.366665,01962
Zürich
Reisen8.55,47.366665,01962
Zürich
Dichtung und Wahrheit8.55,47.366665,01962
Zürich
Romane, Novellen, Epen8.55,47.366665,01962
Zürich
Wilhelm Meisters Lehrjahre8.55,47.366665,01962
Zürich
Dramen8.55,47.366665,01962
Zürich
Gedichte aus dem Nachlass8.55,47.366665,01962
München
Natur. Schriften, Gedanken, Briefe, Gespräche11.575491,48.137432,01962
Hamburg
Briefe der Jahre 1764 - 178610.0,53.55,01962
Hamburg
Goethes Briefe. [Hamburger Ausgabe in 4 Bänden]10.0,53.55,01962
München
Die Leiden des jungen Werthers. Frühe Prosa11.575491,48.137432,01962
München
Dtv-Gesammtausgabe11.575491,48.137432,01962
Weimar
Naturwissenschaftliche Hefte11.316667,50.983334,01962
Hamburg
Naturwissenschaftliche Schriften 2. Zeittafel. Register10.0,53.55,01962
Berlin
Kommentar13.4,52.516666,01962
Stuttgart
Schriften zur Kunst. Teil 29.177017,48.782326,01962
Zürich
Briefe der Jahre 1786 - 18148.55,47.366665,01962
Zürich
Aus meinem Leben. Dichtung und Wahrheit8.55,47.366665,01962
Zürich
Die Wahlverwandtschaften. Novellen. Maximen und Reflexionen8.55,47.366665,01962
Weimar
Prometheus11.316667,50.983334,01961
Berlin
Italienische Reise13.4,52.516666,01961
Berlin
Die Leiden des jungen Werther13.4,52.516666,01961
Stuttgart
Schriften. Schriften zur Kunst 19.177017,48.782326,01961
Zürich
Wilhelm Meisters Wanderjahre8.55,47.366665,01961
Zürich
Dramen8.55,47.366665,01961
Zürich
Gedichte8.55,47.366665,01961
Zürich
Goethes Werke. In 10 Bänden8.55,47.366665,01961
Stuttgart
Goethe und Sylvie. Briefe, Gedichte, Zeugnisse9.177017,48.782326,01961
München
dtv-Gesamtausgabe. [in 45 Bänden]11.575491,48.137432,01961
Weimar
Beiträge zur Optik und Anfänge der Farbenlehre11.316667,50.983334,01961
Stuttgart
Schriften zur Kunst. Teil 19.177017,48.782326,01961
Moskva
Faust37.615555,55.752224,01960
Stuttgart
Autobiographische Schriften. Teil 39.177017,48.782326,01960
Stuttgart
Autobiographische Schriften. Teil 29.177017,48.782326,01960
Berlin
Aus meinem Leben. Dichtung und Wahrheit13.4,52.516666,01960
Leipzig
Nr. 1 - 416. Italienische Reise 1786 bis 1788 ; die Landschaften12.371292,51.33962,01960
Berlin
Ãœberlieferung und Lesarten. Lieferung 1: Wilhelm Meisters theatralischeSendung13.4,52.516666,01960
Stuttgart
Schriften zur Geologie und Mineralogie. Schriften zur Meteorologie9.177017,48.782326,01960
München
Italienische Reise. 1786 - 1788 : [nach der von Erich Trunz textkritischdurchgesehenen Hamburger Goethe-Ausg.]11.575491,48.137432,01960
Hamburg
Schriften zur Kunst. Schriften zur Literatur. Maximen und Reflexionen10.0,53.55,01960
Berlin
Berliner Ausgabe13.4,52.516666,01960
Berlin
Goethes Briefe an Charlotte von Stein. Mit 11 Handzeichnungen von Goethe13.4,52.516666,01960
Stuttgart
Schriften zur Geologie und Mineralogie. Schriften zur Meteorologie9.177017,48.782326,01960
Stuttgart
Aus meinem Leben. Dichtung und Wahrheit9.177017,48.782326,01959
Gütersloh
Faust. Versepen8.383333,51.9,01959
Gütersloh
Dramen8.383333,51.9,01959
Stuttgart
Schriften zur Farbenlehre ; 19.177017,48.782326,01959
Gütersloh
Wanderjahre. Wahlverwandtschaften8.383333,51.9,01959
Zürich
Epen. West-östlicher Divan. Theatergedichte8.55,47.366665,01959
Weimar
Zur Farbenlehre. Historischer Teil11.316667,50.983334,01959
Stuttgart
Schriften zur Natur und Erfahrung. Schriften zur Morphologie ; 19.177017,48.782326,01959
Coimbra
Fausto-8.416667,40.2,01958
Gütersloh
Die Leiden des jungen Werthers. Wilhelm Meisters Lehrjahre8.383333,51.9,01958
Stuttgart
Erzählende Dichtungen ; Teil 29.177017,48.782326,01958
Stuttgart
Erzählende Dichtungen ; Teil 19.177017,48.782326,01958
Leipzig
Nr. 1 - 318. Von den Anfängen bis zur italienischen Reise 178612.371292,51.33962,01958
Berlin
Text13.4,52.516666,01958
Berlin
Die Geschichte Gottfriedens von Berlichingen - Götz von Berlichingen.(Paralleldruck)13.4,52.516666,01958
Berlin
Faust. Der Tragödie erster Theil13.4,52.516666,01958
Stuttgart
Schriften. Schriften zu Literatur und Theater9.177017,48.782326,01958
Berlin
Urfaust - Faust, ein Fragment - Faust, der Tragödie erster Theil.(Paralleldruck)13.4,52.516666,01958
Hamburg
Das römische Carneval10.0,53.55,01958
Hamburg
Ãœber allen Gipfeln ...10.0,53.55,01958
Hamburg
Jugendlyrik. Zueignung. Mit einem gemalten Band. Willkommen und Abschied.Mailied. Ganymed. Prometheus. An Schwager Kronos. Mahomets Gesang.Geistesgruss10.0,53.55,01958
Hamburg
Johann Wolfgang von Goethe. [Lyrik]10.0,53.55,01958
Göttingen
Goethe über den Faust9.933333,51.533333,01958
München
Briefe11.575491,48.137432,01958
Weimar
Zur Farbenlehre. Polemischer Teil11.316667,50.983334,01958
Stuttgart
Schriften zu Literatur und Theater9.177017,48.782326,01958
Stuttgart
Tagebücher. Bd. 3: 1824 - 18329.177017,48.782326,01958
Gütersloh
Dichtung und Wahrheit8.383333,51.9,01957
Berlin
Text13.4,52.516666,01957
Berlin
Wilhelm Meisters theatralische Sendung13.4,52.516666,01957
Stuttgart
Tagebücher. Bd. 2: 1811 - 18239.177017,48.782326,01957
Hamburg
Faust. Der Tragödie zweiter Teil10.0,53.55,01957
Wiesbaden
Briefwechsel in den Jahren 1807 - 18328.25,50.083332,01957
Weimar
Zur Farbenlehre. Anzeige und Übersicht, statt des supplementaren Teils undErklärung der Tafeln ; mit 24 Tafeln11.316667,50.983334,01957
Weimar
Zur Farbenlehre. Historischer Teil11.316667,50.983334,01957
Schaffhausen
Rede bey Eröffnung des neuen Bergbaues zu Ilmenau, den 24sten Februar 17848.633333,47.7,01956
Berlin
Prosaschriften (1757 - 1775)13.4,52.516666,01956
Stuttgart
Tagebücher. Bd. 1: 1770 - 18109.177017,48.782326,01956
Gütersloh
Gedichte8.383333,51.9,01959
Weimar
Zur Farbenlehre. Widmung, Vorwort und didaktischer Teil11.316667,50.983334,01955
Leipzig
Friedrich Schiller. Aus dem Briefwechsel mit Goethe ; Lichtdrucke derersten 9 Briefe aus dem Sommer 1794 ; Gedächtnisgabe zum 9. Mai 195512.371292,51.33962,01955
Chapel Hill
Goethe, the lyrist. 100 poems (dt. u. engl.)-79.05585,35.9132,01955
Bern
Das römische Karneval-46.565,-23.69389,01955
Hamburg
Autobiogrphische Schriften; 1.Band10.0,53.55,01955
Hamburg
Faust. Der Tragödie erster Teil ; in der Gründgens-Inszenierung desDüsseldorfer Schauspielhauses10.0,53.55,01954
Darmstadt
Farbenlehre. Tafeln zu den theoretischen Schriften8.649445,49.870556,01954
Berlin
Urfaust. Faust, ein Fragment13.4,52.516666,01954
Berlin
Text13.4,52.516666,01954
Berlin
Text. Erste und zweite Fassung13.4,52.516666,01954
Stuttgart
Novelle. [Hörspielbearb.]9.177017,48.782326,01954
Zürich
Schriften zur Kunst8.55,47.366665,01954
Zürich
Die Weimarer Dramen8.55,47.366665,01954
Weimar
Morphologische Hefte. Mit 32 Tafeln11.316667,50.983334,01954
Hamburg
Dramatische Dichtungen. 2. Band10.0,53.55,01953
Stuttgart
Frühe Dramen. Bruchstücke. Übersetzungen und Bearbeitungen9.177017,48.782326,01953
Stuttgart
Lustspiele. Singspiele. Satiren. Dramatische Zeit- undGelegenheitsdichtungen9.177017,48.782326,01953
Berlin
Dramen und dramatische Szenen (1774 - 1775)13.4,52.516666,01953
Berlin
Dramen und dramatische Szenen (1757 - 1773)13.4,52.516666,01953
Stuttgart
Poetische Werke9.177017,48.782326,01953
Stuttgart
Poetische Werke9.177017,48.782326,01953
Tübingen
Farbenlehre. Vollst. Ausg. d. theoretischen Schriften9.052219,48.52266,01953
Zürich
Ãœbertragungen8.55,47.366665,01953
Zürich
Der junge Goethe8.55,47.366665,01953
Hamburg
Schriften zur Kunst. Schriften zur Literatur. Maximen und Reflexionen10.0,53.55,01953
Hamburg
Schriften zur Kunst. Schriften zur Literatur. Maximen und Reflexionen10.0,53.55,01953
Zagreb
Faust. Tragoediae pars prima16.0,45.8,01952
Berlin
Paralipomena13.4,52.516666,01952
Berlin
Noten und Abhandlungen13.4,52.516666,01952
Berlin
Text13.4,52.516666,01952
Berlin
Werke Goethes13.4,52.516666,01952
London
Goethe's Faust. Parts I/II ; an abridged version-0.12553275,51.508415,01951
Erfurt
Goethe als Zeichner der deutschen Landschaft. 1776-178611.033333,50.983334,01951
Stuttgart
Poetische Werke. Die grossen Dramen9.177017,48.782326,01951
Zürich
Briefe der Jahre 1814 - 18328.55,47.366665,01951
Zürich
Briefe der Jahre 1764 - 17868.55,47.366665,01951
Weimar
Beiträge zur Optik und Anfänge der Farbenlehre. 1790 - 1808 ; mitAbbildungen im Text (darunter farbigen) und 26 Tafeln in einer Mappe(darunter farbigen)11.316667,50.983334,01951
Stuttgart
Gedichte9.177017,48.782326,01950
Leiden
Kommentar und Eräuterungen. Literatur. Bilderanhang. Faust-Wörterbuch4.493056,52.158333,01950
Stuttgart
Poetische Werke9.177017,48.782326,01950
Bielefeld
Hermann und Dorothea8.533333,52.033333,01950
Bielefeld
Gedichte. Auswahl8.533333,52.033333,01950
Braunschweig
Faust. Eine Tragödie ; [T. 1. 2.]10.533333,52.266666,01950
Bielefeld
Von Strassburg bis Weimar. (1770 - 1775)8.533333,52.033333,01950
Bielefeld
Der junge Goethe. (1749 - 1770)8.533333,52.033333,01950
Zürich
1817 - 18328.55,47.366665,01950
Zürich
Briefwechsel mit Friedrich Schiller8.55,47.366665,01950
Zürich
Schriften zur Literatur8.55,47.366665,01950
Zürich
Die Italienische Reise. Die Annalen8.55,47.366665,01950
Zürich
Die Faustdichtungen. Urfaust ; Faust, ein Fragment ; Faust, eine Tragödie; Paralipomena ; Goethe über Faust8.55,47.366665,01950
Hamburg
Autobiographische Schriften: 3.Band10.0,53.55,01950
Weimar
Die Schriften der Jahre 1776 - 178611.316667,50.983334,01950
Weimar
Goethes amtliche Schriften11.316667,50.983334,01950
Stuttgart
West-östlicher Divan. Epen. Maximen und Reflexionen9.177017,48.782326,01950
Berlin
Hermann und Dorothea13.4,52.516666,01949
Stendal
Winckelmann. 180511.85,52.6,01949
Berlin
@13.4,52.516666,01949
Stuttgart
Gedichte9.177017,48.782326,01949
Weimar
1749 - Goethe - 194911.316667,50.983334,01949
Stuttgart
Die Liebesgedichte des west-östlichen Divans. In zeitlicher Folge9.177017,48.782326,01949
Hamburg
Wilhelm Tischbeins Idyllen. [Festgabe zu Goethes 200. Geburtstag]10.0,53.55,01949
Köln
Urfaust6.95,50.933334,01949
Berlin
Goethes Briefe. Eine Auswahl13.4,52.516666,01949
Berlin
Goethe und die Antike. Eine Sammlung13.4,52.516666,01949
Erfurt
Goethe als Zeichner der deutschen Landschaft. 1776 - 178611.033333,50.983334,01949
Leipzig
Goethe. Von Mensch und Menschheit ; aus seinem Dichten und Denken12.371292,51.33962,01949
Leiden
Erster und zweiter Teil. Urfaust. Fragment. Helena. Nachlaß4.493056,52.158333,01949
Leiden
Goethes Faust4.493056,52.158333,01949
Köln
Faust. Eine Tragödie6.95,50.933334,01949
Hannover
Goethes Elpenor9.733222,52.370518,01949
München
Dichtung und Wahrheit. Aus meinem Leben11.575491,48.137432,01949
Bonn
Wilhelm Meisters theatralische Sendung7.1,50.733334,01949
Konstanz
Die Deutschen28.65,44.183334,01949
Leipzig
West-östlicher Divan. Gesamtausgabe12.371292,51.33962,01949
Zürich
Briefe der Jahre 1786 - 18148.55,47.366665,01949
Zürich
Biographische Einzelschriften8.55,47.366665,01949
Zürich
Die Wahlverwandtschaften. Die Novellen. Die Maximen und Reflexionen8.55,47.366665,01949
Zürich
Wilhelm Meisters Wanderjahre. Wilhelm Meisters theatralische Sendung8.55,47.366665,01949
Potsdam
Goethe und die Antike. Eine Sammlung13.065662,52.398857,01949
Zürich
1752 - 18178.55,47.366665,01949
Weimar
Schriften zur Geologie und Mineralogie. 1812 - 1832 ; mit 34 Tafeln11.316667,50.983334,01949
Weimar
Goethes Briefwechsel mit Christian Gottlob Voigt11.316667,50.983334,01949
Stuttgart
Gesamtausgabe der Werke und Schriften in zweiundzwanzig Bänden9.177017,48.782326,01949
Wiesbaden
West-östlicher Divan8.25,50.083332,01948
Zürich
Epen. West-östlicher Divan. Theatergedichte. [mit einem Bildnis Goethesaus dem Jahre 1816]8.55,47.366665,01948
Wiesbaden
West-östlicher Divan8.25,50.083332,01948
Hameln
Weite Welt und breites Leben. Gedichte9.35,52.1,01948
Zürich
Aus meinem Leben. Dichtung und Wahrheit8.55,47.366665,01948
Zürich
Wilhelm Meisters Lehrjahre. [mit einem Bildnis Goethes aus dem Jahre 1780]8.55,47.366665,01948
Hamburg
Goethes Werke. [Hamburger Ausgabe in 14 Bänden]10.0,53.55,01948
Zürich
Gespräche mit Goethe in den letzten Jahren seines Lebens8.55,47.366665,01948
Zürich
Gedenkausgabe der Werke, Briefe und Gespräche. 28. August 19498.55,47.366665,01948
Hannover
Die Leiden des jungen Werthers9.733222,52.370518,01947
Goslar
Hermann und Dorothea. Bürgerliches Epos in 9 Gesängen10.433333,51.9,01947
Weimar
Schriften zur Geologie und Mineralogie. 1770 - 1810 ; mit 20 Tafeln11.316667,50.983334,01947
Weimar
Die Schriften zur Naturwissenschaft11.316667,50.983334,01947
Stuttgart
Goethe reist durchs Schwabenland. Aus Goethes Tagebüchern und Briefen9.177017,48.782326,01945
Zürich
Goethe im Gespräch8.55,47.366665,01944
Leipzig
West-östlicher Divan12.371292,51.33962,01943
Stuttgart
Maximen und Reflexionen9.177017,48.782326,01943
Berlin
Lieder von Goethe. Komponiert von Franz Schubert ; Nachbildung derEigenschrift aus dem Besitz der Preuß. Staatsbibl.13.4,52.516666,01943
Berlin
Goethe an uns. Ewige Gedanken des großen Deutschen13.4,52.516666,01942
Potsdam
Friederike. Das Sesenheimer Idyll in Wortes Goethes13.065662,52.398857,01941
Leipzig
Goethes Faust. Gesamtausgabe12.371292,51.33962,01941
Leipzig
Handzeichnungen von Goethe12.371292,51.33962,01940
Leipzig
Gedichte12.371292,51.33962,01940
Weimar
Philipp Otto Runges Briefwechsel mit Goethe11.316667,50.983334,01940
Berlin
Faksimile13.4,52.516666,01939
Berlin
Geleitwort13.4,52.516666,01939
Berlin
Goethes Egmont-Handschrift13.4,52.516666,01939
Leipzig
Die Wahlverwandtschaften12.371292,51.33962,01939
Hameln
Das Wahre war schon längst gefunden, Hat edle Geisterschaft verbunden: Dasalte Wahre, faß' es an!. Kleines Goethe-Lesebuch9.35,52.1,01939
Leipzig
Faust und Urfaust12.371292,51.33962,01939
Mainz
Chorfantasie in drei Sätzen8.2711115,50.0,01939
Leipzig
Iphigenie auf Tauris. Ein Schauspiel ; [Faksimile der im Goethe- undSchiller-Archiv, Weimar, ruhenden Handschrift]12.371292,51.33962,01938
Leipzig
Die Leiden des jungen Werther 177412.371292,51.33962,01938
Leipzig
Geschichte Gottfriedens von Berlichingen mit der eisernen Hand.Dramatisiert12.371292,51.33962,01938
Weimar
Goethes Rede zum Schäkespears Tag. Wiedergabe der Handschrift11.316667,50.983334,01938
Leipzig
Faust. Der Tragödie zweiter Teil12.371292,51.33962,01937
Leipzig
Urfaust12.371292,51.33962,01937
Leipzig
West-östlicher Divan12.371292,51.33962,01937
Leiden
Kommentar und Erläuterungen. Literatur. Bilderanhang. Faust-Wörterbuch4.493056,52.158333,01936
Leiden
Erster und zweiter Teil. Urfaust. Fragment. Helena. Nachlaß4.493056,52.158333,01936
Mainz
Westöstlicher Divan8.2711115,50.0,01936
Leipzig
Epen und Kantaten12.371292,51.33962,01936
Leiden
Goethes Faust4.493056,52.158333,01936
London
The first part of Faust . Translated from the German-0.12553275,51.508415,01934
Weimar
Ur-Xenien11.316667,50.983334,01934
Gyoma
Az öreg Goethe 1801 - 1832. Antológia a költő öregkorának műveiből20.833334,46.933334,01932
Gyoma
A férfi Goethe 1777 - 1800. Antológia a költő férfikorának műveiből20.833334,46.933334,01932
Coimbra
O rei dos álamos-8.416667,40.2,01932
Wien
Pandora16.372076,48.20849,01932
Berlin
[Undatierbares. Verzeichnisse, Nachlaß, Register]13.4,52.516666,01932
Jena
Goethes morphologische Schriften11.583333,50.933334,01932
Leipzig
Goethes Werke. Die Welt-Goethe-Ausgabe der Gutenbergstadt Mainz und desGoethe- und Schiller-Archivs zu Weimar ; dargebracht zu Goethes hundertstemTodestage am 22. März 193212.371292,51.33962,01932
Weimar
Register zu Band 1 - 311.316667,50.983334,01932
Paris
Faust2.3488,48.85341,01932
Coimbra
Dedicatoria. (Fausto)-8.416667,40.2,01932
Coimbra
O rei de Thule-8.416667,40.2,01932
Leipzig
Der Rokoko-Goethe12.371292,51.33962,01932
Berlin
Gedichte. Aus den Briefen. Tagebuch. Faust. T. 2. Schriften zur Literatur.Schriften zur Naturwissenschaft. 1832. Anh.: Letzte Fassungen u. Paralipomena[1832]13.4,52.516666,01931
Weimar
Goethes Briefwechsel mit Georg und Caroline Sartorius. <von 1801 - 1825> :mit 15 neuen Goethe-Briefen und vielen anderen unbekannten Dokumenten aus derGoethezeit11.316667,50.983334,01931
Göttingen
Goethes Briefwechsel mit Georg und Caroline Sartorius. Mit 15 neuenGoethe-Briefen und vielen anderen unbekannten Dokumenten aus der Goethezeit9.933333,51.533333,01931
Barcelona
Traduccions de Goethe. II. Ifigénia a Taurida. Eridon i Amida2.1589851,41.388786,01931
Barcelona
Traduccions de Goethe. Vol.22.1589851,41.388786,01931
New York
Faust. A tragedy. Transl., in the Original Meter, by Bayard Taylor. Withan Introd. by Robert H[erndon] Fife-74.005974,40.714268,01930
Berlin
Das Louisenfest. Schriften zur Literatur 1830. Schriften zur bildendenKunst 1830. Schriften zur Naturwissenschaft 1830. Gedichte 1831. Aus d.Briefen 1831. Tagebuch 1831. Schriften zur Literatur 1831. Schriften zurbildenden Kunst 1831. Schriften zur Naturwissenschaft 1831. Anh. Letzte[1830-1831]13.4,52.516666,01930
Berlin
Von 1807 bis zum Ausgang13.4,52.516666,01930
Berlin
Von der Rückkehr aus Italien bis zur neuen Lebenswende 180713.4,52.516666,01930
Barcelona
Traduccions de Goethe. I. Fragments del Faust. Poesies. Pensaments2.1589851,41.388786,01930
Barcelona
Traduccions de Goethe. Vol.1. Fragments del Faust, poesies, pensaments2.1589851,41.388786,01930
Leipzig
Goethes Faust als Lösung des Faust-Rätsels. Der 31zeilige Faust I/II ;eine erotische Trilogie nach dem Strassburger Marien-Münster als Vorbild12.371292,51.33962,01929
Berlin
[1829-1830]13.4,52.516666,01929
Berlin
182913.4,52.516666,01929
Berlin
[1828-1829]13.4,52.516666,01929
Berlin
Bis zur Rückkehr aus Italien13.4,52.516666,01929
Berlin
Goethes Leben in seinen Briefen13.4,52.516666,01929
Weimar
Faust. Der Tragödie letzter Akt ; 25 Blätter aus Goethes eigenhändigenNiederschriften11.316667,50.983334,01929
Dresden
Goethes Leben im Spiegel seiner Werke13.7383175,51.05089,01928
Berlin
1826-182713.4,52.516666,01928
Berlin
[1826]13.4,52.516666,01928
Jena
Goethes Farbenlehre. Mit 1 Porträt, 23 farbigen und 8 schwarzen TafelnEinbandzeichnung von F. H. Ehmcke11.583333,50.933334,01928
Hannover
Aus meinem Leben .... Dichtung und Wahrheit9.733222,52.370518,01928
Berlin
Tagebuch 1824. Unterredung mit Napoleon. Maximen und Reflexionen 1824.Schriften zur Literatur 1824. Schriften zur bildenden Kunst 1824. Schriftenzur Naturwissenschaft 1824. Gedichte 1825. Aus d. Briefen 1825. Tagebuch1825. Bruchstücke e. Prologs zur Eröffnung e. Interimstheaters in Weimar.Maximen u. Reflexionen 1825. Schriften zur Literatur 1825. Schriften zurbildenden Kunst 1825. Schriften zur Naturwissenschaft 1825. Anh.: LetzteFassungen u. Paralipomena. 1824-2513.4,52.516666,01927
Berlin
[1823-1824]13.4,52.516666,01927
Berlin
Tagebuch 1821. Prolog zur Eröffnung des Berliner Theaters im Mai 1821.Totenfeier in der Loge Amalia zu Weimar 1821. Maximen und Reflexionen 1821.Schriften zur Literatur 1821. Schriften zur bildenden Kunst 1821. Schriftenzur Naturwissenschaft 1821. Gedichte 1822. Aus d. Briefen 1822. Tagebuch1822. Maximen u. Reflexionen 1822. Schriften zur Literatur 1822. Schriftenzur bildenden Kunst 1822 ... Schriften zur Naturwissenschaft 1822. Anh.:Letzte Fassungen u. Paralipomena. 1821-2213.4,52.516666,01927
Leipzig
@12.371292,51.33962,01927
Leipzig
Italienische Reise. Zweiter römischer Aufenthalt12.371292,51.33962,01927
Leipzig
Kleine Erzählungen12.371292,51.33962,01927
Leipzig
Bettinas Leben und Briefwechsel mit Goethe12.371292,51.33962,01927
Berlin
Die Weimarische Dramaturgie. Aus Goethes Schriften13.4,52.516666,01927
Berlin
Wilhelm Meisters Wanderjahre 1. Fassung. Kampagne in Frankreich.Belagerung von Mainz. Gedichte. 1821. Zahme Xenien. 2. Buch. Aus d. Briefen1821. Anh.: Letzte Fassungen u. Paralipomena. 1820-2113.4,52.516666,01926
Leipzig
August Wilhelm und Friedrich Schlegel im Briefwechsel mit Schiller undGoethe12.371292,51.33962,01926
Leipzig
Die Wahlverwandtschaften12.371292,51.33962,01926
Leipzig
Wilhelm Meisters Wanderjahre12.371292,51.33962,01926
Leipzig
Wilhelm Meisters Lehrjahre12.371292,51.33962,01926
Leipzig
Wilhelm Meisters theatralische Sendung12.371292,51.33962,01926
Leipzig
Die Leiden des jungen Werther12.371292,51.33962,01926
Leipzig
Dramen IV. Singspiele, Maskenzüge, Festspiele, Bruchstücke12.371292,51.33962,01926
Leipzig
Dramen III12.371292,51.33962,01926
Leipzig
Dramen II12.371292,51.33962,01926
Leipzig
Dramen I: Faust12.371292,51.33962,01926
Leipzig
Epen12.371292,51.33962,01926
Leipzig
West-östlicher Divan12.371292,51.33962,01926
Leipzig
Goethes Werke. Festausgabe zum 100jährigen Bestehen des Bibliogr. Inst.Gotha, Hildburghausen, Leipzig 1826-192612.371292,51.33962,01926
Jena
Goethes Morphologische Schriften11.583333,50.933334,01926
Bremen
Goethes Bremer Freund Dr. Nicolaus Meyer. Briefwechsel mit Goethe und demWeimarer Kreise8.807774,53.075157,01926
Jena
Morphologische Schriften11.583333,50.933334,01926
Bremen
Goethes Bremer Freund Dr. Nicolaus Meyer. Briefwechsel mit Goethe und demWeimarer Kreise8.807774,53.075157,01926
Leipzig
Gespräche mit Goethe in den letzten Jahren seines Lebens. [1823 - 1832]12.371292,51.33962,01925
Berlin
1823-183213.4,52.516666,01925
München
1749-179711.575491,48.137432,01925
Berlin
Gedichte. Aus den Briefen. Tagebuch. Maximen und Reflexionen. Schriftenzur Literatur. Schriften zur bildenden Kunst. Schriften zurNaturwissenschaft. Anh.: Letzte Fassungen u. Paralipomena. 182013.4,52.516666,01925
Berlin
Gedichte. West-östlicher Divan. Aus den Briefen. Tagebuch. Anh.: LetzteFassungen u. Paralipomena. 181913.4,52.516666,01925
Berlin
Gedichte. Aus den Briefen. Tagebuch. Maskenzug. Maximen u. Reflexionen.Schriften zur Literatur 1818. Schriften zur bildenden Kunst 1818. Schriftenzur Naturwissenschaft 1818. Schriften zur Literatur 1819. Schriften zurbildenden Kunst 1819. Schriften zur Naturwissenschaft 1819. Anh.: LetzteFassungen u. Paralipomena. 181813.4,52.516666,01925
Berlin
Goethe. Werke13.4,52.516666,01925
München
Faust. Eine Tragödie ; [T. 1, 2]11.575491,48.137432,01925
Berlin
Faust13.4,52.516666,01924
Leipzig
Frech und froh. Eine Auswahl Gedichte12.371292,51.33962,01924
Berlin
Gedichte. Aus den Briefen. Tagebuch. Italienische Reise. II. Schriften zurLiteratur. Schriften zur bildenden Kunst. Schriften zur Naturwissenschaft.Anh.: Letzte Fassungen u. Paralipomena. 181713.4,52.516666,01924
Berlin
Ausklang 1823 bis 183213.4,52.516666,01924
Berlin
Der alte Goethe 1815 bis 182213.4,52.516666,01924
Berlin
Dichtung und Wahrheit 1808 bis 181413.4,52.516666,01924
Berlin
Im neuen Jahrhundert 1801 bis 180713.4,52.516666,01924
Berlin
Weimar und Jena 1792 bis 180013.4,52.516666,01924
Berlin
Weimar und Italien 1784 bis 179213.4,52.516666,01924
Berlin
Weimar Sturm und Drang 1775 bis 178313.4,52.516666,01924
Berlin
Goethe-Briefe13.4,52.516666,01924
Berlin
Die Metamorphose der Pflanzen. Mit dem Originalbildwerk13.4,52.516666,01924
Berlin
Die Metamorphose der Pflanzen13.4,52.516666,01924
Tübingen
Goethe's Clavigo. Edited with the variants of all of the older editions9.052219,48.52266,01923
Leipzig
Die Leiden des jungen Werther12.371292,51.33962,01923
Berlin
1797 - 182313.4,52.516666,01923
Berlin
Theaterreden. Der Groß-Kophta. Der Bürgergeneral. Kleine Aufsätze undReden <1788-92>. Die Aufgeregten. Aus d. Briefen 1791-92. Reineke Fuchs.Reisetagebuch März-April 1790. Gedichte. Schriften zur Chromatik. 1791-9413.4,52.516666,01923
München
Gedichte. Künstlers Erdewallen. Des Künstlers Vergötterung. KünstlersApotheose. Römische Elegien. Erwin u. Elmire. <2. Fassung.> Claudine vonVilla Bella. <2. Fassung.> Faust. Ein Fragm. Aus d. Briefen ... VenezianischeEpigramme. Naturwissenschaftliche Schriften. Geognostisches Tagebuch derHarzreise. Reise d. Söhne Megaprazons. Fragm. 1788-9011.575491,48.137432,01923
Berlin
Neun Parkzeichnungen13.4,52.516666,01923
Wien
Natur16.372076,48.20849,01922
Leipzig
Gott, Gemüt und Welt. Goethes Selbstzeugnisse über seine Stellung zurReligion und zu religiös-kirchlichen Fragen12.371292,51.33962,01922
Weimar
Januar 1821 bis März 183211.316667,50.983334,01922
Wolfenbüttel
Goethes Briefe an E. Th. Langer10.55,52.166668,01922
Leipzig
Bettinas Briefwechsel mit Goethe. Auf Grund ihres handschriftlichenNachlasses nebst zeitgenössischen Dokumenten über ihr persönliches Verhältniszu Goethe12.371292,51.33962,01922
Leipzig
Goethes Briefwechsel mit Marianne von Willemer12.371292,51.33962,01922
Frankfurt am Main
Goethes Ehe in Briefen8.683333,50.116665,01921
Hannover
Goetheworte für unsere Zeit9.733222,52.370518,01921
Gotha
Goethes Schweizerreisen. Tagebücher, Briefe, Gedichte, Handzeichnungen10.716667,50.95,01921
Leipzig
Aus meinem Leben. Dichtung und Wahrheit12.371292,51.33962,01921
Berlin
Goethes Faust13.4,52.516666,01921
München
Das Tagebuch11.575491,48.137432,01921
Stuttgart
Ausgewählte Gedichte Goethes9.177017,48.782326,01921
Berlin
Gedichte. Nachträge 1814-16. Zahme Xenien. 1. Buch 1814-15. Kantate zumReformations-Jubiläum. Rede bei der Feierlichkeit der Stiftung des weißenFalkenordens. Sankt Rochus-Fest zu Bingen. Im Rheingau Herbsttage. Aus d.Briefen. Italiänische Reise. [1816]13.4,52.516666,01920
München
Goethe, die Novelle11.575491,48.137432,01920
Wernigerode
Goethe im Harz. Goethes Harzreisen in seinen Tagebüchern, Briefen,Dichtungen10.783333,51.833332,01920
Hamburg
Joseph. Goethes erste grosse Jugenddichtung10.0,53.55,01920
Hamburg
Joseph. Goethes erste große Jugenddichtung10.0,53.55,01920
Leipzig
Kommentar und Erläuterungen12.371292,51.33962,01919
Leipzig
Text12.371292,51.33962,01919
Jena
Die pädagogische Provinz11.583333,50.933334,01919
Weimar
Juni 1797 bis December 182011.316667,50.983334,01919
Leipzig
Adalbert von Weislingen. Schauspiel in 5 Aufzügen ; 1. Teil derzweiteiligen Weimarer Theaterbearbeitung des Götz von Berlichingen von 181912.371292,51.33962,01919
Madison
Lyric Poems in English translation prior to 1860-89.40123,43.07305,01919
Hannover
Die anderen unbekannten venezianischen Epigramme von Goethe9.733222,52.370518,01919
Weimar
Tagebücher Register T - Z. Goethes Schriften. Nachträge und Berichtigungen11.316667,50.983334,01919
Weimar
Tagebücher Register M - S11.316667,50.983334,01919
Leipzig
1828 - 183212.371292,51.33962,01918
Berlin
1821 - 1828. Mit einem Bildnis des Herzogs13.4,52.516666,01918
Weimar
M - Z. Register über Goethes Schriften. Inhaltsverzeichnis der erstenAbtheilung. Berichtigungen und Zusätze. Tafel der Herausgeber11.316667,50.983334,01918
Zürich
Goethe und Lavater. Zeugnisse ihrer Freundschaft ; [aus ihremBriefwechsel]8.55,47.366665,01918
Leipzig
Von Goethes dramatisches Schaffen. 70 Vorstufen, Fragmente, Pläne u.Zeugnisse12.371292,51.33962,01917
Weimar
Juli 1788 bis Juni 179711.316667,50.983334,01917
Weimar
Goethes Briefwechsel mit Heinrich Meyer11.316667,50.983334,01917
Prag
Goethes Briefwechsel mit Joseph Sebastian Grüner und Joseph StanislausZauper. (1820 - 1832)14.424132,50.087837,01917
Leipzig
Von Goethes dramatischem Schaffen. Siebzig Vorstufen, Fragmente, Pläne undZeugnisse12.371292,51.33962,01917
Weimar
Tagebücher Register ; A - L11.316667,50.983334,01917
Berlin
Anmerkungen und Register zu Eckermanns Gesprächen mit Goethe13.4,52.516666,01916
Berlin
Gespräche mit Goethe in den letzten Jahren seines Lebens. 1823 - 1832 ;mit 88 Abbildungen und zwei Handschriftproben13.4,52.516666,01916
Frankfurt am Main
1807 - 18168.683333,50.116665,01916
Frankfurt am Main
1792 - 18068.683333,50.116665,01916
Frankfurt am Main
Goethes Briefwechsel mit seiner Frau8.683333,50.116665,01916
Berlin
1807 - 1820. Mit einem Bildnis des Herzogs13.4,52.516666,01916
Weimar
A - L11.316667,50.983334,01916
Leipzig
Goethes Briefwechsel mit Marianne von Willemer12.371292,51.33962,01915
Leipzig
1819 - 182712.371292,51.33962,01915
Berlin
1775 - 180613.4,52.516666,01915
Leipzig
Briefwechsel mit Marianne von Willemer12.371292,51.33962,01915
Leipzig
Goethes Werke in sechs Bänden12.371292,51.33962,01914
München
Gedichte 1815. Epilog zu Schillers Glocke. Requiem des frohsten Manne desJahrhunderts. Finale zu Johann von Paris. Feradeddin u. Kolaila. Nachspiel zuIfflands Hagestolzen. Tagebuch 1815. Aus d. Briefen 1815. Aufsätze zurLiteratur. Aufsätze zur Kunst. Tagebuch 1816. Kunst u. Altertum am Rhein u.Main. Über Kunst u. Altertum in d. Rhein- u. Maingegenden. 1815-181611.575491,48.137432,01914
München
Gedichte. Gott, Gemüt und Welt. Sprichwörtlich. Epigrammatisch. Was wirbringen. Des Epimenides Erwachen. Der Löwenstuhl. Willkommen. Übersicht ...Tagebuch. Aus den Briefen. Naturwissenschaftliche Aufsätze. Vornotizen zuKunst u. Altertum am Rhein und Main 1814-1511.575491,48.137432,01914
München
Gedichte. Zu brüderlichem Andenken Wielands. Aufsätze zur Literatur.1813-16. Notizen und Entwürfe zu Dichtung und Wahrheit. Tagebuch. Aus denBriefen. Mineralogie und Geognosie. 181311.575491,48.137432,01914
München
Aus meinem Leben. Dichtung und Wahrheit. 8.-20. Buch. 1812-1411.575491,48.137432,01914
München
Goethe, Kestner und Lotte. [Briefwechsel und Äußerungen]11.575491,48.137432,01914
Weimar
Briefwechsel zwischen Goethe und Johann Wolfgang Döbereiner. (1810 - 1830)11.316667,50.983334,01914
München
Goethes Egmont in Schillers Bearbeitung. Nach dem Originalmanuskript imGoethe- und Schillerarchiv11.575491,48.137432,01914
London
West-Eastern Divan-0.12553275,51.508415,01914
Weimar
[Nachträge. Operndichtungen. Ansprachen. Zeugnisse amtlicher Tätigkeit.Testamente]11.316667,50.983334,01914
München
Aus den Briefen 1812. Aus meinem Leben: Dichtung und Wahrheit. 1.-7. Buch.1811-181211.575491,48.137432,01913
München
Zur Farbenlehre. Didaktischer Teil. Zur Farbenlehre: Polemischer Teil.181011.575491,48.137432,01913
München
Gedichte 1810. Tagebuch 1810. Aus den Briefen 1810. Philipp Hackert.1810-181111.575491,48.137432,01913
München
Gedichte 1808. Aus den Briefen 1808. Tagebuch 1808. Aufsätze zur Kunst undLiteratur. Gedichte 1809 ... Aus den Briefen 1809. Tagebuch 1809.Naturwissenschaftliche Aufsätze. 1807-180911.575491,48.137432,01913
Berlin
Gedichte 1795-96. Aus den Briefen 1793-94. Unterhaltungen deutscherAusgewanderten. Literarischer Sansculottismus. Versuch über Dichtungen.Xenien von Schiller u. Goethe. Votivtafeln von Schiller u. Goethe. Schriftenzur Chromatik. Benvenuto Cellini. 1793-179613.4,52.516666,01913
Dachau
Goethes Briefwechsel mit Thomas Carlyle11.433333,48.266666,01913
Helsinki
Torquato Tasso24.934166,60.175556,01913
Leipzig
1799 - 181812.371292,51.33962,01913
Leipzig
Der Briefwechsel zwischen Goethe und Zelter12.371292,51.33962,01913
München
Gedichte 1807. Vorspiel zu: Eröffnung der Weimarischen Theaters 1807. Zumfeierlichen Andenken der Durchlauchtigsten Fürstin und Frau Anna Amalia.Bruchstücke einer Tragödie. Aus den Briefen 1807. Tagebuch 1807. Pandora.Paralipomena zu Pandora. Notiz. Die Wahlverwandtschaften. 1807-180911.575491,48.137432,01912
München
Aus den Briefen 1805. Tagebuch 1805. Gedichte 1806. Aus den Briefen 1806.Tagebuch 1806. Aufsätze zu Literatur und Kunst. 1805-07. Elpenor. <2.Fassung>. Faust. Paralipomena zum Faust ... Zur Naturwissenschaft 1806.1805-180611.575491,48.137432,01912
München
Aus den Briefen 1804. Tagebuch 1804. Winckelmann. Rameaus Neffe. Beiträgezur Jenaischen Allgem. Literaturzeitung. Gedichte 1805. Schillers Totenfeier<EntwÓrfe>. Aus den Briefen 1805. Naturwissenschaftliche Studien. 1804-180511.575491,48.137432,01912
Berlin
1801 - 180213.4,52.516666,01912
Berlin
Gedichte 1799. Aus den Briefen 1799. Tagebuch 1799. Mahomet. Gedichte1800. Die guten Frauen. Tagebuch 1800. Paläophron und Neoterpe. Aufsätze zumTheater und zur Kunst. Aus den Briefen 1800. Tancred. Fragm. aus d. Faust.Entwürfe: Die natürliche Tochter. Zur Philosophie. 1799-180013.4,52.516666,01912
Leipzig
Anmerkungen12.371292,51.33962,01912
Leipzig
1798 - 180512.371292,51.33962,01912
Leipzig
1794 - 179712.371292,51.33962,01912
Stuttgart
Iphigenie auf Tauris9.177017,48.782326,01912
Bonn
Goethes römische Elegien7.1,50.733334,01912
Leipzig
Der Briefwechsel zwischen Schiller und Goethe12.371292,51.33962,01912
Leipzig
Kommentar und Erläuterungen12.371292,51.33962,01912
Leipzig
Urfaust12.371292,51.33962,01912
Leipzig
Goethes Faust12.371292,51.33962,01912
Weimar
Briefe Nachträge und Undatirtes. Register zu Bd. 31 - 5011.316667,50.983334,01912
Berlin
Gedichte. Aus den Briefen 1803. Tagebuch 1803. Die natürliche Tochter.Aufsätze zur Kunst 1802-04. Götz von Berlichingen mit der eisernen Hand. Fürdie Bühne bearb. 1803-180413.4,52.516666,01911
Berlin
Gedichte 1798. Aufsätze aus den Propyläen. Zu Theater- undSchauspielkunst. Tagebuch 1798. Der Zauberflöte zweiter Teil. Paralipomenazur Zauberflöte ... Aus d. Briefen 1798. 1798-9913.4,52.516666,01911
München
Gedichte 1797. Tagebuch 1797. Hermann und Dorothea. Achilleis. 1. Gesang.Paralipomena zur Achilleis. Aus den Briefen 1797. Aus den Sammlungen zurSchweizerreise. Kleine Aufsätze. Zur Naturwissenschaft. Fragmente 1797-9911.575491,48.137432,01911
Berlin
Benvenuto Cellini. T. 2. Anh. zur Lebensbeschreibung d. Benvenuto Cellini.Aus den Briefen 1795-96. Gesänge aus der Oper: Die vereitelten Ränke ... DasMädchen von Oberkirch. Die Befreiung des Prometheus. Versuch einerallgemeinen Knochenlehre. 1794-9613.4,52.516666,01911
München
Elpenor. Jery und Bätely. Die Fischerin. Die Vögel. Aus d. Tagebüchern1780-82. Aus d. Briefen 1780-83. Gedichte. Das Neueste von Plundersweilern.Maskenzüge. Der Geist d. Jugend. Scherz, List u. Rache. Die ungleichenHausgenossen. Der Hausball. Aus d. Briefen 1784-86. 1780-8611.575491,48.137432,01911
Weimar
[4. - 6. Buch]11.316667,50.983334,01911
Weimar
[1. - 3. Buch]11.316667,50.983334,01911
Weimar
Goethes eigenhändige Reinschrift des west-östlichen Divan. Eine Auswahlvon 28 Blättern in Facsimile-Nachbildung11.316667,50.983334,01911
Leipzig
Erläuterungen. Ergänzungen. Nachträge. Nachweisungen12.371292,51.33962,01911
Stuttgart
Wilhelm Meisters theatralische Sendung9.177017,48.782326,01911
Stuttgart
Wilhelm Meisters theatralische Sendung9.177017,48.782326,01911
Weimar
[Wilhelm Meisters theatralische Sendung]11.316667,50.983334,01911
München
Die Bildnisse Goethes11.575491,48.137432,01910
Leipzig
Annalen, Biographische Einzelnheiten12.371292,51.33962,01910
Zürich
Wilhelm Meisters theatralische Sendung. Mitteilungen über diewiedergefundene erste Fassung von Wilhelm Meisters Lehrjahren8.55,47.366665,01910
München
Gedichte 1811. Tagebuch 1811. Aus den Briefen 1811. Romeo und Julia.Gedichte 1812. Tagebuch 1812. Die Wette. Aufsätze zur Kunst und Literatur.Aufsätze zur Mineralogie und Geologie. 1811-181211.575491,48.137432,01910
München
Zur Farbenlehre. Historischer Teil. Materialien zur Geschichte derFarbenlehre. Statt des versprochenen suppl. Teils. Erklärung d. zu GoethesFarbenlehre gehörigen Tafeln ... Anzeige und Übersicht des Goethischen Werkeszur Farbenlehre. 181011.575491,48.137432,01910
Berlin
Wilhelm Meisters Lehrjahre 179513.4,52.516666,01910
München
Egmont. Tagebuch der italienischen Reise für Frau von Stein. Gedichte. DieMystifizierten. Iphigenie auf Tauris. Iphigenie in Delphi. Nausikaa. TorquatoTasso. Aus d. Briefen 1786-88. 1787-8811.575491,48.137432,01910
Leipzig
Schiller im Urteil Goethes. Die Zeugnisse Goethes in Wort und Schrift12.371292,51.33962,01910
Zürich
Goethe. Wilhelm Meisters theatralische Sendung ; Mitteilungen über diewiedergefundene erste Fassung von Wilhelm Meisters Lehrjahren8.55,47.366665,01910
Stuttgart
Goethe und Werther. Briefe Goethe's ; meistens aus seiner Jugendzeit, miterläuternden Dokumenten ; mit 2 Bildn. u. 3 Faks.9.177017,48.782326,01910
Leipzig
Vom Tode Karl Augusts bis zum Ende. 1828 Juni bis 22. März 183212.371292,51.33962,01910
Leipzig
Vom letzten böhmischen Aufenthalt bis zum Tode Karl Augusts. 1823September bis Juni 182812.371292,51.33962,01910
Leipzig
Ifflands Briefwechsel mit Schiller, Goethe, Kleist, Tieck und anderenDramatikern12.371292,51.33962,01910
Leipzig
Goethes sämtliche Werke12.371292,51.33962,01909
München
Stella. Claudine von Villa Bella. Faust. In ursprünglicher Gestalt.Hanswursts Hochzeit oder der Lauf der Welt. Reisetagebuch. Aus den Briefen1775-76. Diesseitige Antwort auf Bürgers Anfrage wegen Übersetzung d. Homers.Die Geschwister. Der Falke. Lila. Der Triumph d. Empfindsamkeit. Iphigenie inTauris. I. Fassung. Briefe aus d. Schweiz ... Gedichte. Aus d. Briefen1777-79. Aus d. Tagebüchern 1776-79. 1775-7911.575491,48.137432,01909
München
Gedichte. Prometheus. Götz von Berlichingen mit der eisernen Hand. 1773 -177411.575491,48.137432,01909
München
Gedichte 1757-1770. Aus den Briefen 1765-70. Die Laune des Verliebten. DieMitschuldigen. Gedichte 1770-72 ...11.575491,48.137432,01909
München
Propyläen-Ausgabe von Goethes sämtlichen Werken11.575491,48.137432,01909
Leipzig
Biographisches12.371292,51.33962,01909
Leipzig
Aus meinem Leben. Dichtung und Wahrheit ; Teil 112.371292,51.33962,01909
Leipzig
Wilhelm Meisters Lehrjahre12.371292,51.33962,01909
Leipzig
Die Leiden des jungen Werther12.371292,51.33962,01909
Leipzig
Götz von Berlichingen. Clavigo. Egmont. Iphigenie auf Tauris. TorquatoTasso12.371292,51.33962,01909
Leipzig
Goethes Werke. In sechs Bänden12.371292,51.33962,01909
Leipzig
Vom Erfurter Kongress bis zum letzten böhmischen Aufenthalt. 1808 Novemberbis September 182312.371292,51.33962,01909
Leipzig
Von der Kindheit bis zum Erfurter Kongress. 1754 bis Oktober 180812.371292,51.33962,01909
Leipzig
Goethes Gespräche. Gesamtausgabe12.371292,51.33962,01909
Leipzig
Der junge Goethe. Neue Ausgabe in 6 Bänden12.371292,51.33962,01909
Leipzig
Gespräche mit Goethe in den letzten Jahren seines Lebens12.371292,51.33962,01909
Leipzig
Goethe Venetianische Epigramme12.371292,51.33962,01909
Leipzig
Venetianische Epigramme12.371292,51.33962,01909
Weimar
Briefe Juli 1831 - März 183211.316667,50.983334,01909
Weimar
Briefe November 1830 - Juni 183111.316667,50.983334,01909
Weimar
Briefe April - October 183011.316667,50.983334,01909
Weimar
Briefe März 1828 - September 182811.316667,50.983334,01909
Leipzig
Der junge Goethe. Neue Ausgabe in sechs Bänden12.371292,51.33962,01909
Leipzig
Goethes Sprüche in Reimen. Zahme Xenien und Invektiven12.371292,51.33962,01908
Leipzig
Goethes Sprüche in Prosa. Maximen und Reflexionen12.371292,51.33962,01908
Leipzig
Aus Goethes Tagebüchern12.371292,51.33962,01908
Berlin
Goethes Faust in neuer Bearbeitung13.4,52.516666,01908
Weimar
Goethes Parodie auf Fritz Jacobis "Woldemar"11.316667,50.983334,01908
Weimar
Goethes Parodie auf Fritz Jacobis Woldemar11.316667,50.983334,01908
Weimar
Briefe Juli 1829 - März 183011.316667,50.983334,01908
Weimar
Briefe October 1828 - Juni 182911.316667,50.983334,01908
Weimar
Briefe August 1827 - Februar 182811.316667,50.983334,01908
Leipzig
Faust. Eine Tragödie12.371292,51.33962,01907
Helsinki
Iphigeneia Tauriissa. Viisinäytöksinen huvinäytelmä24.934166,60.175556,01907
Leipzig
@12.371292,51.33962,01907
Weimar
Maximen und Reflexionen11.316667,50.983334,01907
Wien
Goethes Faust. Der Tragödie zweiter Teil in fünf Akten ; Bühnentext desk.k.Hof-Burgtheaters16.372076,48.20849,01907
Leipzig
Goethes Gedichte. In der Auswahl12.371292,51.33962,01907
Berlin
Verheimlichte Epigramme Goethes13.4,52.516666,01907
Weimar
Briefe Januar - Juli 182711.316667,50.983334,01907
Weimar
Briefe April - December 182611.316667,50.983334,01907
Weimar
Briefe August 1825 - März 182611.316667,50.983334,01907
Weimar
Briefe November 1824 - Juli 182511.316667,50.983334,01907
Weimar
Briefe April 1822 - März 182311.316667,50.983334,01907
Weimar
[Aus dem Nachlaß. Maximen und Reflexionen über Literatur und Ethik.Maximen und Reflexionen über Kunst, Natur und Wissenschaft. Lesarten.Vorarbeiten und Bruchstücke]11.316667,50.983334,01907
Weimar
Goethes Schweizer Reise 1775. Zeichnungen und Niederschriften11.316667,50.983334,01907
Leipzig
Goethe im Gespräch12.371292,51.33962,01906
Leipzig
Goethes Faust12.371292,51.33962,01906
Stuttgart
Aus einer Reise in die Schweiz 17979.177017,48.782326,01906
Stuttgart
Die Leiden des jungen Werther9.177017,48.782326,01906
Stuttgart
Dramatische Fragmente und Ãœbersetzungen9.177017,48.782326,01906
Stuttgart
Götz von Berlichingen9.177017,48.782326,01906
Leipzig
@12.371292,51.33962,01906
Leipzig
Rezensionen in die Frankfurter gelehrten Anzeigen. KleinereJugendschriften. Dramen in ursprünglicher Gestalt12.371292,51.33962,01906
Leipzig
Dramatische Fragmente und Einzelheiten. Opern-Fragmente. Ãœbersetzungen12.371292,51.33962,01906
Leipzig
Singspiele. Festspiele. Die Wette12.371292,51.33962,01906
Leipzig
Fastnachtsspiele und Verwandtes. Der Triumph der Empfindsamkeit. DieVögel. Revolutionsdramen. Prologe, Nachspiele und Theaterreden. Maskenzüge12.371292,51.33962,01906
Hannover
Aus meinem Leben. Dichtung und Wahrheit9.733222,52.370518,01906
Leipzig
Kommentar und Erläuterungen12.371292,51.33962,01906
Leipzig
Entwürfe und Skizzen12.371292,51.33962,01906
Leipzig
Urfaust12.371292,51.33962,01906
Leipzig
Goethes Faust12.371292,51.33962,01906
Oldenburg
Der junge Goethe. Goethes Gedichte in ihrer geschichtlichen Entwicklung8.2,53.166668,01906
Weimar
Briefe Januar 1824 - October 182411.316667,50.983334,01906
Weimar
Briefe April 1823 - December 182311.316667,50.983334,01906
Weimar
Briefe Juli 1821 - März 182211.316667,50.983334,01906
Weimar
Briefe 30. August 1819 - 22. April 182011.316667,50.983334,01906
Weimar
Paralipomena zu Bd. 1 - 5. Register zu Bd. 1 - 5, 2. Abt.11.316667,50.983334,01906
Stuttgart
Dramen in Prosa9.177017,48.782326,01905
Stuttgart
Zeitdramen9.177017,48.782326,01905
Stuttgart
Jugenddramen9.177017,48.782326,01905
Stuttgart
West-östlicher Divan9.177017,48.782326,01905
Leipzig
@12.371292,51.33962,01905
Leipzig
@12.371292,51.33962,01905
Berlin
Ausklang. 1823 - 183213.4,52.516666,01905
Berlin
Der alte Goethe. 1815 - 182213.4,52.516666,01905
Berlin
Dichtung und Wahrheit. 1808 - 181413.4,52.516666,01905
Jena
Briefwechsel zwischen Schiller und Goethe11.583333,50.933334,01905
Weimar
Goethes Unterhaltungen mit Friedrich Soret. Nach dem französ. Texte, alseine bedeutend vermehrte und verbesserte Ausgabe des dritten Teils derEckermannschen Gespräche11.316667,50.983334,01905
Leipzig
Goethes Philosophie aus seinen Werken. Ein Buch für jeden gebildetenDeutschen12.371292,51.33962,01905
Weimar
Briefe November 1820 - Juni 182111.316667,50.983334,01905
Weimar
Briefe 25. April - 31. October 182011.316667,50.983334,01905
Weimar
Briefe 2. November 1818 - 25. August 181911.316667,50.983334,01905
Weimar
Briefe Undatirtes und Nachträge. Register zu Bd. 19 - 3011.316667,50.983334,01905
Weimar
[Lesarten, Paralipomena, Schemata]11.316667,50.983334,01905
Stuttgart
Goethes Unterhaltungen mit dem Kanzler Friedrich von Müller9.177017,48.782326,01904
Stuttgart
Die Wahlverwandtschaften9.177017,48.782326,01904
Leipzig
@12.371292,51.33962,01904
Leipzig
Gedichte12.371292,51.33962,01904
Berlin
Im neuen Jahrhundert. 1801 - 180713.4,52.516666,01904
Leipzig
1828-183212.371292,51.33962,01904
Leipzig
1819-182712.371292,51.33962,01904
Leipzig
1799-181812.371292,51.33962,01904
Leipzig
Briefwechsel zwischen Goethe und Zelter in den Jahren 1799-1832. M[it]Einl[eitung] u[nd] Erl[äuterungen]12.371292,51.33962,01904
Leipzig
Das Tagebuch (1810)12.371292,51.33962,01904
Weimar
Briefe Januar - October 181811.316667,50.983334,01904
Weimar
Nachträge zu Bd. 6 - 12. Mit 32 Abb. u. 1 Tafel11.316667,50.983334,01904
Weimar
[Beiträge zu verschiedenen Zeitschriften, 1820 - 1830. Ankündigungen,Geleitworte 1813 - 1830]11.316667,50.983334,01904
Weimar
[Lesarten. Vorbereitung zur zweiten Reise nach Italien11.316667,50.983334,01904
Stuttgart
Annalen9.177017,48.782326,01903
Stuttgart
Kampagne in Frankreich9.177017,48.782326,01903
Stuttgart
Singspiele9.177017,48.782326,01903
Stuttgart
Reineke Fuchs9.177017,48.782326,01903
Leipzig
@12.371292,51.33962,01903
Leipzig
@12.371292,51.33962,01903
Leipzig
Achilleis. Reineke Fuchs. Westöstlicher Diwan12.371292,51.33962,01903
Berlin
Weimar und Jena. 1792 - 180013.4,52.516666,01903
Weimar
Ein Goethisches Lied. Für den Bibliophilen-Tag in Weimar - 11. October190311.316667,50.983334,01903
Weimar
Briefe März 1817 - December 181711.316667,50.983334,01903
Weimar
Briefe Mai 1816 - Februar 181711.316667,50.983334,01903
Weimar
Tagebücher 1831 - 183211.316667,50.983334,01903
Weimar
[Ãœber Kunst und Altherthum. Mittheilungen im 4. - 6. Bd., 1823 - 1832]11.316667,50.983334,01903
Stuttgart
Goethes sämtliche Werke. Jubiläums-Ausgabe in 40 Bänden9.177017,48.782326,01902
Leipzig
@12.371292,51.33962,01902
Leipzig
Götz von Berlichingen mit der eisernen Hand. Egmont. Clavigo. Stella. DieGeschwister. Der Gross-Cophta. Der Bürgergeneral12.371292,51.33962,01902
Leipzig
Iphigenie auf Tauris. Torquato Tasso. Die natürliche Tochter. DieMitschuldigen. Die Laune des Verliebten 12.371292,51.33962,01902
Leipzig
Faust. Paralipomena zu Faust12.371292,51.33962,01902
Prag
Briefwechsel zwischen J. W. v. Goethe und Kaspar Graf v. Sternberg. (1820- 1832)14.424132,50.087837,01902
Berlin
Weimar und Italien. 1784 - 179213.4,52.516666,01902
Berlin
Weimarer Sturm und Drang. 1775 - 178313.4,52.516666,01902
Berlin
Der junge Goethe. 1764 - 177513.4,52.516666,01902
Berlin
Goethe-Briefe13.4,52.516666,01902
Weimar
Briefe 24. Mai 1815 - 30. April 181611.316667,50.983334,01902
Weimar
[Beiträge zum Morgenblatt für gebildete Stände, 1807 - 1816. Über Kunstund Alterthum. Mittheilungen im 1. - 3. Bd., 1816 - 1822]11.316667,50.983334,01902
Weimar
[11.316667,50.983334,01902
Leipzig
@12.371292,51.33962,01901
Weimar
Goethe und Lavater. Briefe und Tagebücher11.316667,50.983334,01901
Braunschweig
Goethes ausgewählte Gedichte. In chronologischer Folge mit Anmerkungenhrsg. von Otto Harnack10.533333,52.266666,01901
Leipzig
1797, 179812.371292,51.33962,01901
Leipzig
Briefwechsel zwischen Schiller und Goethe in den Jahren 1794 - 180512.371292,51.33962,01901
Weimar
Briefe 28. Juli 1814 - 21. Mai 181511.316667,50.983334,01901
Weimar
Briefe September 1813 - 24. Juli 181411.316667,50.983334,01901
Weimar
Briefe Januar 1811 - April 181211.316667,50.983334,01901
Weimar
Tagebücher 1829 - 183011.316667,50.983334,01901
Weimar
[Theater und Schauspielkunst. Literatur. Beiträge zur JenaischenAllgemeinen Literaturzeitung und Älteres, 1787 - 1807]11.316667,50.983334,01901
Weimar
[Buch 7 - 8]11.316667,50.983334,01901
Weimar
[Der Schutzgeist. Schauspiel von Kotzebue ; für die Weimarische Bühnebearb.]11.316667,50.983334,01901
Leipzig
Elpenor. Trauerspiel ; Fragment12.371292,51.33962,01900
Weimar
Ein unbekannter Aufsatz Goethes. Mitgetheilt von Carl Schüddekopf11.316667,50.983334,01900
Paris
Poésies lyriques de Goethe [et] Schiller. Texte allemand. Publié avecdes notices littéraires et des notes par Henri Lichtenberger2.3488,48.85341,01900
Weimar
Briefe Mai 1812 - August 181311.316667,50.983334,01900
Weimar
Tagebücher 1827 - 182811.316667,50.983334,01900
Weimar
[Reineke Fuchs. Hermann und Dorothea. Achilleis. Pandora]11.316667,50.983334,01900
Weimar
[Rameau's Neffe. Diderot's Versuch über die Mahlerei. Lesarten]11.316667,50.983334,01900
Weimar
Elegie. September 1823 ; Goethes Reinschrift mit Ulrikens von LevetzowBrief an Goethe und ihrem Jugendbildniß11.316667,50.983334,01900
Philadelphia
The fisher maiden. A vaudeville ; and, The lover's caprice-75.16379,39.952335,01899
Weimar
Tagebücher 1825 - 182611.316667,50.983334,01899
Weimar
[Buch 4 - 6]11.316667,50.983334,01899
Weimar
[Die Leiden des jungen Werther. Briefe aus der Schweiz]11.316667,50.983334,01899
Weimar
Goethe und die Romantik. Briefe mit Erläuterungen11.316667,50.983334,01898
Leipzig
Goethes Briefe an Frau Charlotte von Stein. Auswahl in 5 Büchern12.371292,51.33962,01898
Stuttgart
Goethes Unterhaltungen mit dem Kanzler Friedrich von Müller9.177017,48.782326,01898
Weimar
Zum 24. Juni 1898. Goethe und Maria Paulowna11.316667,50.983334,01898
Weimar
[Campagne in Frankreich 1792. Belagerung von Mainz]11.316667,50.983334,01898
Weimar
[Buch 1 - 3]11.316667,50.983334,01898
Hannover
Faust. Eine Tragödie ; erster Theil9.733222,52.370518,01897
Weimar
Tagebücher 1823 - 182411.316667,50.983334,01897
Weimar
Chromatik. Mit 16 Bilder-Taf. und 8 Holzschn.11.316667,50.983334,01897
Weimar
[Schriften zur Kunst 1800 - 1816. Paralipomena, Vorarbeiten undBruchstücke]11.316667,50.983334,01897
Weimar
[Geschichte Gottfriedens von Berlichingen. Mahomet. Prometheus. Faust(Jugendfragment). Iphigenie auf Tauris (Erste Prosa)]11.316667,50.983334,01897
Weimar
[Concerto dramatico. Götter, Helden und Wieland. Anekdote zu WerthersLeiden. Hanswursts Hochzeit. Der ewige Jude. Künstlers Vergötterung. Erwinund Elmire (1. Fassung). Claudine von Villa Bella (1. Fassung). Lesarten zuBd. 37]11.316667,50.983334,01897
Leipzig
Nachträge 1755 - 183212.371292,51.33962,01896
Weimar
Goethes Briefwechsel mit Antonie Brentano11.316667,50.983334,01896
Weimar
Briefe Juli 1809 - December 181011.316667,50.983334,01896
Weimar
Briefe. Januar 1808 - Juni 180911.316667,50.983334,01896
Weimar
Tagebücher 1821 - 182211.316667,50.983334,01896
Weimar
: mit e. lithographirten Tafel, e. Bilde in Lichtdruck u. Namens- u.Sachregister zu Bd. 6 - 1211.316667,50.983334,01896
Weimar
[Schriften zur Kunst 1788 - 1800. Paralipomena, Vorarbeiten undBruchstücke]11.316667,50.983334,01896
Weimar
[Knabengedichte. Höllenfahrt Jesu Christi. Annette. Belsazar. Der Lügner(Corneille). Der Tugendspiegel. An Händel. Judenpredigt. Romanbriefe. DieGesänge von Selma (Ossian). Ephemerides. Cäsar. Positiones juris. ZumShakespeares Tag. Von deutscher Baukunst. Brief des Pastors. Zwo biblischeFragen. Frankfurter gelehrte Anzeigen. Parabeln. Hohes Lied. Aus GoethesBrieftasche. Physiognomische Fragmente. Bürgers Homer]11.316667,50.983334,01896
Wien
Faust. Tragödie16.372076,48.20849,01895
Weimar
Briefe 9. Mai 1805 - Ende 180711.316667,50.983334,01895
Weimar
Briefe. Undatirtes und Nachträge. Register zu Bd. 9 - 1811.316667,50.983334,01895
Weimar
Briefe Anfang 1804 - 9. Mai 180511.316667,50.983334,01895
Weimar
Tagebücher 1819 - 182011.316667,50.983334,01895
Weimar
[Buch 2 - 3]11.316667,50.983334,01895
Weimar
[Die Aufgeregten. Das Mädchen von Oberkirch. Unterhaltungen deutscherAusgewanderten. Die guten Weiber. Novelle. Der Hausball. Reise der SöhneMegaprazons]11.316667,50.983334,01895
Weimar
Goethes Faust in ursprünglicher Gestalt. Nach der GöchhausenschenAbschrift11.316667,50.983334,01894
Weimar
Briefe 1802, 180311.316667,50.983334,01894
Weimar
Briefe 1800, 180111.316667,50.983334,01894
Weimar
Tagebücher. 1817 - 181811.316667,50.983334,01894
Weimar
Mineralogie und Geologie11.316667,50.983334,01894
Weimar
[Buch 1 - 2]11.316667,50.983334,01894
Weimar
[Der Triumph der Empfindsamkeit. Die Vögel. Der Groß-Cophta. DerBürgergeneral]11.316667,50.983334,01894
Weimar
[Neueröffnetes moralisch-politisches Puppenspiel. Ein Fastnachtsspiel vomPater Brey. Satyros oder der vergötterte Waldteufel. Prolog zu den neustenOffenbarungen Gottes. Parabeln. Legende. Hans Sachsens poetische Sendung. AufMiedings Tod. Künstlers Erdewallen. Künstlers Apotheose. Epilog zu SchillersGlocke.Die Geheimnisse. Maskenzüge. Im Namen der Bürgerschaft von Karlsbad.Des Epimenides Erwachen. Requiem dem frohsten Manne des Jahrhunderts. Anh.:Schillers Todtenfeyer. Cantate zum Reformations-Jubiläum]11.316667,50.983334,01894
Weimar
[Paläophron und Neoterpe. Vorspiel zur Eröffnung des Weimarischen Theatersam 19. September 1807. Was wir bringen. Prolog zur Eröffnung des BerlinerTheaters im Mai 1821. Finale zu Johann zu Paris. Zu Wallensteins Lager.Nachspiel zu Ifflands Hagestolzen. Theaterreden. Götz von Berlichingen(Bühnenbearb.)]11.316667,50.983334,01894
Stuttgart
Goethes sämtliche Werke. In 36 Bänden9.177017,48.782326,01893
Wien
Goethe's Briefe an Philipp Seidel. Italien 1786-178816.372076,48.20849,01893
Stuttgart
Faust ; Teil 1/29.177017,48.782326,01893
Stuttgart
Götz von Berlichingen. Clavigo. Egmont. Stella. Die Geschwister.9.177017,48.782326,01893
Stuttgart
Gedichte ; Teil 29.177017,48.782326,01893
Stuttgart
Gedichte ; Teil 19.177017,48.782326,01893
Paris
Le Faust2.3488,48.85341,01893
Berlin
Torquato Tasso. Ein Schauspiel13.4,52.516666,01893
Wien
Briefe an Seidel16.372076,48.20849,01893
Weimar
Briefe 179911.316667,50.983334,01893
Weimar
Briefe 179811.316667,50.983334,01893
Weimar
Briefe 179711.316667,50.983334,01893
Weimar
Tagebücher 1813 - 181611.316667,50.983334,01893
Weimar
[Tag- und Jahres-Hefte von 1807 bis 1822. Biographische Einzelnheiten. Zumfeierlichen Andenken der Durchlauchtigsten Fürstin und Frau Anna Amalia,1807. Zu brüderlichem Andenken Wielands, 1813. Kleine Biographien zurTrauerloge am 15. Juni 1821. Rede bei Eröffnung des neuen Bergbaues zuIlmenau, den 24. Febr. 1784. Rede bei der Feierlichkeit der Stiftung desWeißen Falkenordens, (am 30.1.1816)]11.316667,50.983334,01893
Weimar
Briefe 179611.316667,50.983334,01892
Weimar
Briefe 9. August 1792 - 31. December 179511.316667,50.983334,01892
Weimar
Mineralogie und Geologie11.316667,50.983334,01892
Weimar
[Tag- und Jahres-Hefte von 1749 bis 1806]11.316667,50.983334,01892
Weimar
[Die Wahlverwandtschaften. Ein Roman]11.316667,50.983334,01892
Weimar
[Singspiele und Opernfragmente. Jery und Bätely. Lila. Die Fischerin.Scherz, List und Rache. Der Zauberflöte 2. Theil. Die ungleichenHausgenossen. Gesänge aus der Oper: Die vereitelte Ränke]11.316667,50.983334,01892
Weimar
[Elpenor. Clavigo. Stella. Claudine von Villa Bella. Erwin und Elmire. DieBefreiung des Prometheus. Bruchstücke einer Tragödie. Aus fremden Sprachen]11.316667,50.983334,01892
Berlin
@13.4,52.516666,01891
Stuttgart
Zur Goetheforschung. Neue Beiträge9.177017,48.782326,01891
Weimar
Briefe 18. Juni 1788 - 8. August 1792. Weimar, Oberitalien, Schlesien,Weimar11.316667,50.983334,01891
Weimar
Briefe 1. Januar 1785 - 24. Juli 1786. Weimar11.316667,50.983334,01891
Weimar
Tagebücher 1809 - 181211.316667,50.983334,01891
Weimar
[Winckelmann. Philipp Hackert. Lesarten]11.316667,50.983334,01891
Weimar
[Buch 16 - 20]11.316667,50.983334,01891
Weimar
[Die Laune des Verliebten. Die Mitschuldigen. Die Geschwister. Die Wette.Romeo und Julia. Mahomet. Tancred]11.316667,50.983334,01891
Berlin
@13.4,52.516666,01890
Leipzig
1831 - 1832 und Nachträge12.371292,51.33962,01890
Leipzig
1829 - 183012.371292,51.33962,01890
Leipzig
1827 - 182812.371292,51.33962,01890
Leipzig
1824 - 182612.371292,51.33962,01890
Weimar
Zur Nachgeschichte der italienischen Reise. Goethes Briefwechsel mitFreunden und Kunstgenossen in Italien 1788 - 179011.316667,50.983334,01890
Leipzig
Goethes Briefwechsel mit einem Kinde. Seinem Denkmal12.371292,51.33962,01890
Weimar
Briefe 13. August 1786 - 5. Juni 1788. Italiänische Reise ; mit Register11.316667,50.983334,01890
Weimar
Briefe 1. Juli 1782 - 31. December 1784. Weimar11.316667,50.983334,01890
Weimar
Polemischer Theil11.316667,50.983334,01890
Weimar
Didaktischer Theil11.316667,50.983334,01890
Weimar
[Buch 11 - 15]11.316667,50.983334,01890
Heidelberg
Briefwechsel zwischen Goethe und K. Göttling in den Jahren 1824 - 18318.690786,49.407677,01889
Leipzig
Goethes Tagebücher der sechs ersten Weimarischen Jahre. (1776 - 1782) ; inlesbarer Gestalt12.371292,51.33962,01889
Leipzig
1819 - 182312.371292,51.33962,01889
Leipzig
1811 - 181812.371292,51.33962,01889
Leipzig
1805 - 181012.371292,51.33962,01889
Leipzig
1765 - 180412.371292,51.33962,01889
Leipzig
Goethe's Gespräche. Bd. 1 - 10 ; Anhang an Goethes Werke. Abth. fürGespräche12.371292,51.33962,01889
Leipzig
Goethes Gespräche12.371292,51.33962,01889
Weimar
Briefe 7. November 1780 - 30. Juni 1782. Weimar11.316667,50.983334,01889
Weimar
Briefe 1. Januar 1779 - 7. November 1780. Weimar, Schweiz, Weimar11.316667,50.983334,01889
Weimar
Tagebücher 1801 - 180811.316667,50.983334,01889
Weimar
[Buch 6 - 10]11.316667,50.983334,01889
Weimar
[Buch 1 - 5]11.316667,50.983334,01889
Weimar
[Iphigenie auf Tauris. Nausikaa. Torquato Tasso. Die natürliche Tochter]11.316667,50.983334,01889
Weimar
[Götz von Berlichingen. Egmont]11.316667,50.983334,01889
Weimar
[Faust ; Theil 2]11.316667,50.983334,01888
Weimar
Zweiundzwanzig Handzeichnungen von Goethe. 181011.316667,50.983334,01888
Weimar
22 Handzeichnungen von Goethe 1810 ... hrsg. von Carl Ruland11.316667,50.983334,01888
St. Petersburg
Goethe und Uwarow und ihr Briefwechsel30.264166,59.894444,01888
Weimar
Briefe 1775 - 1778. Weimar11.316667,50.983334,01888
Weimar
Tagebücher 1790 - 180011.316667,50.983334,01888
Weimar
[Lesarten]11.316667,50.983334,01888
Weimar
[Noten und Abhandlungen zu besserem Verständniß des West-östlichen Divans]11.316667,50.983334,01888
Weimar
[West-östlicher Divan]11.316667,50.983334,01888
Leipzig
Goethes Briefwechsel mit Friedrich Rochlitz12.371292,51.33962,01887
Berlin
Goethe's und Carlyle's Briefwechsel13.4,52.516666,01887
London
Goethe's letters to Zelter. with extracts from those of Zelter to Goethe ;selected, translated and annotated-0.12553275,51.508415,01887
Weimar
Goethes Faust in ursprünglicher Gestalt11.316667,50.983334,01887
Weimar
Werke (Sophien-Ausg.)11.316667,50.983334,01887
Berlin
Goethes und Carlyles Briefwechsel13.4,52.516666,01887
Weimar
Goethes Faust in ursprünglicher Gestalt11.316667,50.983334,01887
Berlin
Goethes Briefwechsel mit Friedrich Rochlitz13.4,52.516666,01887
Weimar
Briefe 1771 - 1775. Frankfurt, Wetzlar, Schweiz11.316667,50.983334,01887
Weimar
Briefe 1764 - 1771. Frankfurt, Leipzig, Straßburg11.316667,50.983334,01887
Weimar
Tagebücher 1775 - 178711.316667,50.983334,01887
Weimar
Goethes Werke11.316667,50.983334,01887
London
Correspondence between Goethe and Carlyle-0.12553275,51.508415,01887
Washington
Faust. A tragedy / by Johann Wolfgang von Goethe ; translated in theoriginal metres by Frank Claudy-77.03637,38.89511,01886
Berlin
@13.4,52.516666,01886
Berlin
@13.4,52.516666,01886
Berlin
@13.4,52.516666,01886
Weimar
Tagebücher und Briefe Goethes aus Italien an Frau von Stein und Herder11.316667,50.983334,01886
Leipzig
Goethes Liebesbriefe an Frau von Stein. 1776 bis 178912.371292,51.33962,01886
London
Faust-0.12553275,51.508415,01886
London
Goethe's Faust-0.12553275,51.508415,01886
Berlin
Goethe's Gedichte. Nach den vorzüglichsten Quellen revidirte Ausgabe.Hrsg. u. mit Anm. begleitet von Fr. Strehlke13.4,52.516666,01886
Paris
Goethe - Götz von Berlichingen mit der eisernen Hand. Ein Schauspiel ;texte Allemand conforme à l'édition de 17872.3488,48.85341,01885
Stuttgart
Die guten Frauen. Mit Nachbildungen der Originalkupfer9.177017,48.782326,01885
Berlin
Goethe's Gedichte. Theil 313.4,52.516666,01884
Berlin
Chronologisches Brief-Verzeichniß13.4,52.516666,01884
Berlin
N - Z. Briefe an Unbekannte. Nachträge, Berichtigungen und Ergänzungen ;Gruppirung der Briefe ; Gesammtresultate ; Nachwort13.4,52.516666,01884
Berlin
Goethe und Gräfin O'Donell. Ungedruckte Briefe nebst dichterischenBeilagen ; Mit zwei Portraits13.4,52.516666,01884
Berlin
Goethe und Gräfin O'Donnell13.4,52.516666,01884
Berlin
Goethes Werke13.4,52.516666,01883
Heilbronn
Ephemerides und Volkslieder9.22,49.140278,01883
Leipzig
Goethe's Faust. Erster und zweiter Theil ; Erläuterungen und Bemerkungendazu12.371292,51.33962,01882
Stuttgart
Faust. Ein Fragment9.177017,48.782326,01882
Stuttgart
Goethes sämtliche Werke. In sechsunddreißig Bänden9.177017,48.782326,01882
Berlin
Einleitung. Quellenverzeichniß. A - M13.4,52.516666,01882
Berlin
Goethe's Briefe. Verzeichniß unter Angabe von Quelle, Ort, Datum undAnfangsworten ; Übersichtlich Darstellung der Beziehungen zu den Empfängern ;Inhaltsangaben ; Mittheilung von vielen bisher ungedruckten Briefen13.4,52.516666,01882
Heilbronn
Faust. Ein Fragment9.22,49.140278,01882
Berlin
Goethes Reineke Fuchs nach dem ersten Druck vom Jahre 1794 mit Proben derälteren Tierepen13.4,52.516666,01882
Stuttgart
(1794 bis 1797)9.177017,48.782326,01881
Leipzig
Faust12.371292,51.33962,01881
Leipzig
Jeri und Bätely. Ein Singspiel12.371292,51.33962,01881
München
Briefwechsel zwischen Goethe und K. Göttling in den Jahren 1824 - 183111.575491,48.137432,01880
München
Briefwechsel zwischen Goethe und K. Göttling11.575491,48.137432,01880
Berlin
Geschichte der Farbenlehre13.4,52.516666,01879
Berlin
Briefe Goethe's an Sophie von La Roche und Bettina Brentano. Nebstdichterischen Beilagen13.4,52.516666,01879
Hamburg
Briefe von Benj. Constant, Görres, Goethe, Jac. Grimm, Guizot, F. H.Jacobi, Jean Paul, Klopstock, Schelling, Mad. de Staël, J. H. Voss undvielen Anderen. Auswahl aus dem handschriftlichen Nachlasse des Ch. deVillers10.0,53.55,01879
Karlsruhe
Götz von Berlichingen mit der eisernen Hand. Schauspiel in fünf Aufzügen ;erste vollständige Bühnenbearbeitung nach der Goethe-Handschrift derUniversitätsbibliothek in Heidelberg8.385834,49.004723,01879
Wien
Das Tagebuch16.372076,48.20849,01879
Berlin
Briefe Goethe's an Sophie von La Roche und Bettina Brentano13.4,52.516666,01879
Stuttgart
Briefwechsel zwischen Goethe und Marianne von Willemer (Suleika)9.177017,48.782326,01878
Berlin
Beiträge zur Optik13.4,52.516666,01878
Leipzig
Goethes Westöstlicher Divan12.371292,51.33962,01878
Stuttgart
Briefwechsel zwischen Goethe und Marianne von Willemer (Suleika)9.177017,48.782326,01878
Sanktpeterburg
SobranÄ«e soÄinenÄ«j Gete. V perevodach russkich pisatelej30.264166,59.894444,01878
Berlin
Ungedrucktes. Zum Druck befördert ... von Albert Cohn13.4,52.516666,01878
Stuttgart
Briefwechsel zwischen Goethe und Marianne von Willemer9.177017,48.782326,01878
Berlin
Zur Morphologie13.4,52.516666,01877
Stuttgart
Goethe's Briefe an Soret9.177017,48.782326,01877
Stuttgart
Goethe-Briefe aus Fritz Schlossers Nachlaß. Mit Goethe's Bild nachKügelgen (1810) und mit H. P. Schlosser's Portrait nach Goethe's Zeichnung,vor 17759.177017,48.782326,01877
Pisa
Elegie romane100.25,16.833334,01877
Stuttgart
Goethes Briefe an Soret9.177017,48.782326,01877
Stuttgart
Goethe-Briefe aus Fritz Schlossers Nachlass9.177017,48.782326,01877
München
Faust .Erster Teil. (Prachtausgabe)11.575491,48.137432,01877
Stuttgart
Briefwechsel zwischen Goethe und Marianne von Willemer9.177017,48.782326,01877
Berlin
Dichtung und Wahrheit ; Theil 413.4,52.516666,01876
Berlin
Dichtung und Wahrheit ; Theil 313.4,52.516666,01876
Berlin
Dichtung und Wahrheit ; Theil 213.4,52.516666,01876
Berlin
Dichtung und Wahrheit ; Theil 113.4,52.516666,01876
Leipzig
Goethe's Briefwechsel mit den Gebrüdern von Humboldt. (1795 - 1832)12.371292,51.33962,01876
Leipzig
Reineke Fuchs12.371292,51.33962,01876
Marburg
Zwei Goethe-reliquien15.646667,46.55472,01876
Leipzig
Der junge Goethe. Seine Briefe und Dichtungen von 1764 - 177612.371292,51.33962,01875
Stuttgart
Stahlstiche9.177017,48.782326,01875
Stuttgart
Goethes sämmtliche Werke. Vollständige Ausgabe in 10 Bänden9.177017,48.782326,01875
Leipzig
Briefe von Goethe an Johanna Fahlmer. Mit Porträt und Facsimile12.371292,51.33962,01875
Dorpat
Briefe von Goethe an Karl Morgenstern26.72509,58.380627,01875
Leipzig
Briefe von Goethe an Johanna Fahlmer12.371292,51.33962,01875
Leipzig
[N - Z]12.371292,51.33962,01874
Leipzig
Goethe's naturwissenschaftliche Correspondenz. 1812 - 183212.371292,51.33962,01874
Leipzig
[A - M]12.371292,51.33962,01874
Leipzig
Neue Mittheilungen aus Johann Wolfgang von Goethe's handschriftlichemNachlasse12.371292,51.33962,01874
Firenze
Ifigenia in Tauride. Dramma11.25,43.766666,01874
Leipzig
Neuestes Verzeichnis einer Goethe-Bibliothek12.371292,51.33962,01874
Leipzig
Neue Mittheilungen aus Goethes handschriftlichem Nachlasse12.371292,51.33962,01874
Berlin
Aufsätze zur Literatur13.4,52.516666,01873
Berlin
Nachlese zu Goethe's Gedichten13.4,52.516666,01873
Berlin
Zur stillen Feier des 28. August 187313.4,52.516666,01873
Berlin
Reineke Fuchs13.4,52.516666,01872
Berlin
West-östlicher Divan13.4,52.516666,01872
Berlin
Goethes Briefe an Eichstädt13.4,52.516666,01872
Leipzig
Faust. A tragedy12.371292,51.33962,01872
Málaga
Clavijo. Tragedia en cinco actos del célebre Goethe-4.420345,36.720158,01872
Boston
Faust. A tragedy-71.05978,42.35843,01871
Boston
Faust. A tragedy-71.05978,42.35843,01871
Berlin
Des Epimenides Erwachen. Ein Festspiel13.4,52.516666,01871
Pest
Egmont. Szomorújáték 5 felvonásban43.393612,56.642776,01871
Stuttgart
Goethes sämmtliche Werke. Vollständige Ausgabe in 15 Bänden9.177017,48.782326,01871
Berlin
Goethe's Hermann und Dorothea mit acht Bildern von Arthur Freiherr vonRamberg, nach den Original-Oelgemälden photographirt von Franz Hanfstängl undInitialen von Caspar Scheuren, geschnitten von Klitzsch & Rochlitzer13.4,52.516666,01871
Leipzig
Zur Hausandacht für die stille Gemeinde12.371292,51.33962,01871
Dresden
Goethe und Voigt der Jüngere13.7383175,51.05089,01871
Leipzig
Frau Rath12.371292,51.33962,01871
Berlin
Reinecke Fuchs. Von Johann Wolfgang von Goethe, mit Zeichnungen von PaulMeyerheim13.4,52.516666,01870
New York
Faust. A tragedy in three acts-74.005974,40.714268,01870
Berlin
Sprüche in Prosa13.4,52.516666,01870
Berlin
Wilhelm Meister's Wanderjahre13.4,52.516666,01870
Stuttgart
Vom Jahre 1798 bis 18059.177017,48.782326,01870
Stuttgart
Vom Jahre 1794 bis 17979.177017,48.782326,01870
Stuttgart
Briefwechsel zwischen Schiller und Goethe in den Jahren 1794 bis 18059.177017,48.782326,01870
Stuttgart
Goethes Unterhaltungen mit dem Kanzler Friedrich von Müller9.177017,48.782326,01870
Stuttgart
Goethes Unterhaltungen mit dem Kanzler Fr. v. Müller9.177017,48.782326,01870
Stuttgart
Goethes sämmtliche Werke. In vierzig Bänden9.177017,48.782326,01869
Leipzig
Aus F. H. Jacobi's Nachlaß. Ungedruckte Briefe von und an Jacobi undAndere ; nebst ungedruckten Gedichten von Goethe und Lenz12.371292,51.33962,01869
Berlin
Faust. Eine Tragödie13.4,52.516666,01869
Braunschweig
Hermann und Dorothea (Illustr. von Vautier)10.533333,52.266666,01869
Berlin
Faust (Illustr. von Liezen-Mayer13.4,52.516666,01869
Hildburghausen
Goethes Werke10.73184,50.425526,01868
Berlin
Goethe's Werke. Nach den vorzüglichsten Quellen revidirte Ausgabe13.4,52.516666,01868
Berlin
Goethes Briefe an Friedrich August Wolf13.4,52.516666,01868
Leipzig
Goethes Briefe an Christian Gottlob von Voigt. Mit Voigts Bildniß12.371292,51.33962,01868
Berlin
Faust. Eine Tragödie13.4,52.516666,01868
Berlin
Egmont. Ein Trauerspiel13.4,52.516666,01868
Berlin
Werke13.4,52.516666,01868
Berlin
Das Tagebuch13.4,52.516666,01868
Berlin
Goethes Briefe an Friedrich August Wolf13.4,52.516666,01868
Berlin
Ghasele auf den Eilfer von Goethe13.4,52.516666,01868
Leipzig
Goethe's Briefe an Leipziger Freunde. Mit drei lithogr. Bildn.12.371292,51.33962,01867
Lisboa
Fausto. Tragedia-9.133333,38.716667,01867
Leipzig
Goethes Briefe an Leipziger Freunde12.371292,51.33962,01867
Tübingen
Goethes Werke9.052219,48.52266,01866
Wien
Briefwechsel zwischen Goethe und Kaspar Graf von Sternberg (1820 - 1832)16.372076,48.20849,01866
Wien
Briefwechsel zwischen Goethe u. Kaspar Graf v. Sternberg16.372076,48.20849,01866
Milano
Arminio e Dorotea9.189506,45.464268,01864
Antwerpen
Goethe's Herman un Dorothea. Gedicht in negen zangen vertaald door FransWillems4.4166665,51.216667,01864
Weimar
Briefwechsel des Grossherzogs Carl August mit Goethe11.316667,50.983334,01863
Weimar
Briefwechsel des Großherzogs Carl August von Sachsen-Weimar-Eisenach mitGoethe. In den Jahren von 1775 bis 182811.316667,50.983334,01863
Milano
Fausto. Tragedia9.189506,45.464268,01862
Cassel
Faust9.5,51.316666,01862
Stuttgart
Sulpiz Boisserée9.177017,48.782326,01862
Leipzig
Anektode! zu den Freuden des jungen Werther von Goethe12.371292,51.33962,01862
Leipzig
Goethe an Christine v. Ligne12.371292,51.33962,01860
Philadelphia
The Minor Poetry of Goethe. A Selection from His Songs, Ballads, and OtherLesser Poems-75.16379,39.952335,01859
Warschau
Neweh Hazedek (Wohnung der Tugend) oder Hermann und Dorothea. In 9Gesängen21.0,52.25,01857
Dorpat
Briefe an Karl Morgenstern26.72509,58.380627,01857
Wetzlar
Acht Lieder8.5,50.55,01857
Wetzlar
Acht Lieder von Goethe8.5,50.55,01857
Boston
Faust. A tragedy-71.05978,42.35843,01856
Stuttgart
Briefwechsel zwischen Schiller und Goethe in den Jahren 1794 bis 18049.177017,48.782326,01856
Stuttgart
Hermann und Dorothea9.177017,48.782326,01856
Stuttgart
Vom Jahre 1798 bis 18059.177017,48.782326,01856
Stuttgart
Vom Jahre 1794 bis 17979.177017,48.782326,01856
Stuttgart
Briefwechsel zwischen Schiller und Goethe in den Jahren 1794 bis 18059.177017,48.782326,01856
Leipzig
Freundschaftliche Briefe von Goethe und seiner Frau an Nicolaus Meyer. Ausden Jahren 1800 - 183112.371292,51.33962,01856
Weimar
Briefe des Großherzogs Carl August und Göthes an Döbereiner11.316667,50.983334,01856
Berlin
Schiller's und Goethe's Xenien-Manuscript13.4,52.516666,01856
Berlin
Göthe's Briefe, worunter viele bisher ungedruckte13.4,52.516666,01856
Leipzig
Freundschaftliche Briefe von Goethe an Nicolaus Meyer12.371292,51.33962,01856
Weimar
Briefe Goethes an Döbereiner11.316667,50.983334,01856
Stuttgart
Sämmtliche Werke9.177017,48.782326,01855
Leipzig
Aus Weimars Glanzzeit12.371292,51.33962,01855
Stuttgart
Goethe und Werther. Briefe Goethe's, meistens aus seiner Jugendzeit, miterläuternden Documenten9.177017,48.782326,01854
Stuttgart
Die drei ältesten Bearbeitungen von Goethe's Iphigenie9.177017,48.782326,01854
Stuttgart
Goethe und Werther9.177017,48.782326,01854
Leipzig
Briefwechsel zwischen Goethe und Staatsrath Schultz. Mit einem Bildnissevon Schultz12.371292,51.33962,01853
Leipzig
Briefwechsel und mündlicher Verkehr zwischen Goethe und dem Rathe Grüner12.371292,51.33962,01853
Leipzig
Goethe's und Schiller's Balladen und Romanzen12.371292,51.33962,01853
Leipzig
Briefwechsel zwischen Goethe und Staatsrath Schultz12.371292,51.33962,01853
Leipzig
Briefwechsel zwischen Goethe und Grüner12.371292,51.33962,01853
Stuttgart
Gedichte9.177017,48.782326,01851
Wadowice
Pieśni i Ballady Goethego. Tłumaczenie A. G.19.483334,49.883335,01851
Leipzig
Briefwechsel zwischen Goethe und Knebel12.371292,51.33962,01851
New York
Iphigenia in Tauris. A drama in five acts-74.005974,40.714268,01850
Hildburghausen
Prosaische Fragmente10.73184,50.425526,01850
Hildburghausen
Rhytmische Fragmente. Mit Portrait10.73184,50.425526,01850
Hildburghausen
Schiller's und Göthe's Briefwechsel10.73184,50.425526,01850
Stuttgart
Briefwechsel zwischen Goethe und Reinhard in den Jahren 1807 bis 18329.177017,48.782326,01850
Stuttgart
Werke9.177017,48.782326,01850
Stuttgart
Briefwechsel zwischen Goethe und Graf von Reinhard9.177017,48.782326,01850
Leipzig
Goethes Briefe an Leipziger Freunde12.371292,51.33962,01849
Weimar
Zum 28. August 184911.316667,50.983334,01849
Leipzig
Goethes Briefe an Leipziger Freunde12.371292,51.33962,01849
Leipzig
Fragmente aus einer Goethe-Bibliothek12.371292,51.33962,01849
Weimar
Goethe's Briefe an Frau von Stein aus den Jahren 1776 bis 182611.316667,50.983334,01848
Leipzig
Verzeichniss einer Goethe-Bibliothek12.371292,51.33962,01848
Leipzig
Goethes Briefe aus dem Nachlass der Frau Caroline von Wolzogen12.371292,51.33962,01848
Weimar
Göthe's Briefe an Frau von Stein11.316667,50.983334,01848
Altenburg
Goethe's Selbstcharakteristik. Nach des Dichters Briefen seit seinemachtzehnten Lebensjahre bis zum letzten12.45,50.983334,01847
Stuttgart
Faust9.177017,48.782326,01847
Leipzig
Briefwechsel zwischen Goethe und F. H. Jacobi12.371292,51.33962,01846
Weimar
Briefe und Aufsätze von Goethe aus den Jahren 1766 bis 178611.316667,50.983334,01846
München
Reineke Fuchs11.575491,48.137432,01846
Leipzig
Nachträge zu Goethe's sämmtlichen Werken12.371292,51.33962,01846
Leipzig
Briefe Schillers und Goethes an A. W. Schlegel, aus den Jahren 1795 bis1801 und 1797 bis 1824. Nebst einem Briefe Schlegels an Schiller12.371292,51.33962,01846
Leipzig
Briefe von und an Goethe. Desgleichen Aphorismen und Brocardica12.371292,51.33962,01846
Leipzig
Briefe von Goethe und dessen Mutter an Friedrich Freiherrn von Stein..Nebst einigen Beilagen12.371292,51.33962,01846
München
Reineke Fuchs (Illustr. von W. von Kaulbach)11.575491,48.137432,01846
Leipzig
Briefwechsel zwischen Goethe u. Fr. Heinr. Jacobi12.371292,51.33962,01846
Leipzig
Briefe von und an Goethe12.371292,51.33962,01846
Leipzig
Briefe von Goethe an Freiherrn von Stein12.371292,51.33962,01846
Weimar
Briefe und Aufsätze aus den Jahren 1766 bis 178611.316667,50.983334,01846
Leipzig
Briefe Schillers und Goethes an A.W. Schlegel12.371292,51.33962,01846
Breslau
Ungedruckte Briefe von Schiller, Goethe und Wieland17.033333,51.1,01845
Breslau
Ungedruckte Briefe von Schiller, Goethe u. Wieland17.033333,51.1,01845
Stuttgart
Poetische und prosaische Werke9.177017,48.782326,01845
Berlin
Goethe's ältestes Liederbuch13.4,52.516666,01844
Stuttgart
Faust. Eine Tragödie ; Beide Theile in Einem Bande9.177017,48.782326,01843
Stuttgart
Faust (Erste Oktav-Ausg.)9.177017,48.782326,01843
Basel
Der Dichter Lenz und Friederike von Sesenheim. Aus Briefen undgleichzeitigen Quellen ; nebst Gedichten und Anderen7.6,47.566666,01842
Brussel
Faust, eene Tragedie4.3527746,50.846596,01842
Stuttgart
Sechzehn Tafeln zu Goethe's Farbenlehre und siebenudzwanzig Tafeln zudessen Beiträge zur Optik nebst Erklärung9.177017,48.782326,01842
Leipzig
Nachträge zu Goethe's sämmtlichen Wrken12.371292,51.33962,01841
Berlin
Mittheilungen über Goethe13.4,52.516666,01841
Leipzig
Bilder zu Goethes Faust von Anselmus Lachgern12.371292,51.33962,01841
Stuttgart
Goethe's sämmtliche Werke. In vierzig Bänden9.177017,48.782326,01840
Stuttgart
Werke9.177017,48.782326,01840
Paris
Sämtliche Werke2.3488,48.85341,01840
Leipzig
Goethe's Briefe an die Gräfin Auguste zu Stolberg. Verwitwete Gräfin vonBernstorf12.371292,51.33962,01839
Oldenburg
Goethe's Iphigenie auf Tauris in ihrer ersten Gestalt8.2,53.166668,01839
London
Faust. A Tragedy-0.12553275,51.508415,01839
Berlin
Goethe's juristische Abhandlung über die Flöhe13.4,52.516666,01839
Leipzig
Goethe's Briefe an die Gräfin Auguste zu Stolberg12.371292,51.33962,01839
Jena
Göthe in Frankfurt am Main11.583333,50.933334,01839
Braunschweig
Hermann und Dorothea10.533333,52.266666,01838
Stuttgart
Sieben Stahlstiche zu Goethe's poetischen und prosaischen Werken Ausgabein zwei Bänden gehörend9.177017,48.782326,01838
Stuttgart
Lief. II bis IV9.177017,48.782326,01837
Prag
Pflanzen und Gebirgsarten von Marienbad14.424132,50.087837,01837
Leipzig
Goethe's Briefe in den Jahren 1768 bis 1832. Ein Supplementband zu desDichters sämmtlichen Werken12.371292,51.33962,01837
Leipzig
Gespräche mit Goethe12.371292,51.33962,01837
Paris
Goethe's sämmtliche Werke2.3488,48.85341,01836
Stuttgart
Lief. I und II9.177017,48.782326,01836
Stuttgart
Goethes Poetische und prosaische Werke. Prachtausgabe in zwei Bänden9.177017,48.782326,01836
Paris
Sämmtliche Werke2.3488,48.85341,01836
Stuttgart
Poetische und prosaische Werke9.177017,48.782326,01836
Berlin
Goethe's Briefwechsel mit einem Kinde. Seinem Denkmal13.4,52.516666,01835
Darmstadt
Briefe an Johann Heinrich Merck von Göthe, Herder, Wieland und andernbedeutenden Zeitgenossen.. Mit Merck's biographischer Skizze8.649445,49.870556,01835
Berlin
Theater-Briefe von Goethe und freundschaftliche Briefe von Jean Paul.Nebst einer Schilderung Weimar's in seiner Blüthezeit13.4,52.516666,01835
London
Faustus, A Dramatic Mystery; The Bride of Corinth; The First WalpurgisNight-0.12553275,51.508415,01835
Berlin
Theater-Briefe von Goethe13.4,52.516666,01835
Herisau
Sämmtliche Werke9.279156,47.386147,01835
Berlin
Compositionen zu Göthe's Faust13.4,52.516666,01835
London
Faust. A Dramatic Poem-0.12553275,51.508415,01834
Heidelberg
Mittheilungen über Goethe und Schiller in Briefen8.690786,49.407677,01834
Jena
Goethe in amtlichen Verhältnissen11.583333,50.933334,01834
Stuttgart
Faust9.177017,48.782326,01834
Danzig
Die Xenien aus Schiller's Musenalmanach für das Jahr 1797. Geschichte,Abdruck und Erläuterung derselben ; Ein Supplement zu den Taschenausgaben derWerke Göthe's und Schiller's18.666666,54.35,01833
Leipzig
Briefe von Goethe an Lavater. Aus den Jahren 1774 bis 1783. ; Nebst einemAnhange und 2 Facsimile.12.371292,51.33962,01833
Berlin
Die letzte Krankheit Goethe's13.4,52.516666,01833
Leipzig
Kurzer Briefwechsel zwischen Klopstock12.371292,51.33962,01833
Stuttgart
Faust (Zweyter Theil)9.177017,48.782326,01833
Berlin
Briefwechsel zwischen Goethe und Zelter13.4,52.516666,01833
Leipzig
Briefe von Goethe an Lavater12.371292,51.33962,01833
Weimar
Goethe's letzter Brief an Zahn nach Neapel (Facsimile)11.316667,50.983334,01832
Verona
Ifigenia in Tauride. Dramma10.997788,45.434185,01832
Leipzig
Die Leiden des jungen Werther12.371292,51.33962,01832
Jena
Goethe's letzte literarische Thätigkeit11.583333,50.933334,01832
Berlin
Das Gastmahl13.4,52.516666,01832
Heidelberg
Faust8.690786,49.407677,01832
Leipzig
Neun Briefe über Landschaftsmalerei. Geschrieben in den Jahren 1815 - 1824; zuvor ein Brief von Goethe [an Carus] als Einleitung12.371292,51.33962,01831
Stuttgart
Essai sur la Métamorphose des plantes9.177017,48.782326,01831
Stuttgart
Versuch über die Metamorphose der Pflanzen9.177017,48.782326,01831
Giessen
Metrische griechische Übersetzung des zweiten Gesanges < v. 1-273> vonGöthes Hermann und Dorothea mit beigefügtem Original und lateinischerÜbersetzung von Fischer. Einladungsschrift ... von Heinrich Arnold WilhelmWinckler8.65,50.583332,01830
Stuttgart
Faust. Eine Tragödie9.177017,48.782326,01830
Weimar
Dem würdigen Bruderfeste Johanni 183011.316667,50.983334,01830
Stuttgart
Goethe's Gedichte9.177017,48.782326,01829
Stuttgart
Hermann und Dorothea9.177017,48.782326,01829
Weimar
Zu Goethe's Geburtstage11.316667,50.983334,01829
Coblenz
Das Römische Denkmal in Igel7.6,50.35,01829
Leipzig
Kupfersammlung zu Goethes Werken in 55 Kupfertafeln12.371292,51.33962,01829
Leipzig
Ueber Goethe12.371292,51.33962,01828
Berlin
Prolog vor Darstellung des Hans Sachs von Deinhardstein13.4,52.516666,01828
Jagsthausen
Hermann und Dorothea9.468333,49.310555,01828
Berlin
Der fünfte Mai13.4,52.516666,01828
Paris
Faust traduite par Stapfer2.3488,48.85341,01828
Stuttgart
Briefwechsel zwischen Schiller und Goethe9.177017,48.782326,01828
Stuttgart
Goethe's Werke. Vollständige Ausgabe letzter Hand9.177017,48.782326,01827
Stuttgart
Goethe's Werke9.177017,48.782326,01827
Lugano
Interesse di Goethe per Manzoni. Traduzione dal Tedesco8.960037,46.01008,01827
Leipzig
Memoiren Robert Guillemard's12.371292,51.33962,01827
Hamburg
Charakteristik Göthe's10.0,53.55,01826
Hamburg
Göthe's Ideen über die Kunst. Dritter - fünfter Abschnitt10.0,53.55,01826
Weimar
Goethe's goldener Jubeltag. Siebenter November 1825 ; Mit des GefeiertenBildniß, seinen Schriftzügen, und einer Abbildung des Festsaales11.316667,50.983334,01826
Weimar
Zum Beginnen, zum Vollenden11.316667,50.983334,01826
Weimar
Zu Göthe's Geburtstage11.316667,50.983334,01826
Leipzig
Der junge Feldjäger12.371292,51.33962,01826
Weimar
Dem glücklich bereichert Wiederkehrenden11.316667,50.983334,01826
Stuttgart
Faust. Eine Tragödie9.177017,48.782326,01825
Hamburg
Göthe's Ideen über die Kunst. Erster und zweiter Abschnitt10.0,53.55,01825
Hamburg
Göthe's Ideen über Literatur, Sprache und Kritik10.0,53.55,01825
Hamburg
Göthe's Ideen über Religion, Moral, Politik und Geschichte, Literatur,Sprache und Kritik10.0,53.55,01825
Hamburg
Göthe's Ideen über Lebensphilosophie und Klugheitslehre, Liebe, Ehe,Freundschaft und Erziehung10.0,53.55,01825
Hamburg
Göthe's Ideen über das menschliche Leben im Allgemeinen, über die Frauen,Männer, Gesellschaft und Stände, Jugend, Alter und Tod10.0,53.55,01825
Hamburg
Göthe's Philosophie. Eine vollständige, systematisch geordneteZusammenstellung seiner Ideen über Leben, Liebe, Ehe, Freundschaft,Erziehung, Religion, Moral, Politik, Literatur, Kunst und Natur; aus seinensämmtlichen poetischen und wissenschaftlichen Werken10.0,53.55,01825
Weimar
Iphigenie. Abdruck zur Feier des VII. Nov. 182511.316667,50.983334,01825
Weimar
Zur Logenfeyer des dritten Septembers 182511.316667,50.983334,01825
Leipzig
Die Leiden des jungen Werther12.371292,51.33962,01825
Stuttgart
Gedichte. Neue Ausgabe9.177017,48.782326,01825
London
Faust. A Drama-0.12553275,51.508415,01823
Stuttgart
Zur Morphologie9.177017,48.782326,01823
Giessen
Metrische griechische Übersetzung des ersten Gesanges von Göthes Hermannund Dorothea mit beigefügtem Original und lateinischer Übers.8.65,50.583332,01823
Braunschweig
Goethe als Mensch und Schriftsteller10.533333,52.266666,01823
Braunschweig
Herrmann und Dorothea10.533333,52.266666,01822
Stuttgart
Der deutsche Gilblas9.177017,48.782326,01822
Stuttgart
Faust. Eine Tragödie9.177017,48.782326,01821
Stuttgart
Wilhelm Meisters Wanderjahre oder die Entsagenden9.177017,48.782326,01821
Weimar
Weimarische Pinacothek11.316667,50.983334,01821
Straßburg
Goethe's Beurtheilung des Lustspiels in Straßburger Mundart derPfingstmontag in fünf Aufzügen und Versen7.75,48.583332,01820
Strassburg
Goethe's Beurtheilung des Lustspiels7.75,48.583332,01820
Stuttgart
Festgedichte9.177017,48.782326,01819
Leipzig
Torquato Tasso. Ein Schauspiel12.371292,51.33962,01819
Stuttgart
West-oestlicher Divan9.177017,48.782326,01819
Stuttgart
Bei Allerhöchster Anwesenheit9.177017,48.782326,01819
Stuttgart
Zur Morphologie9.177017,48.782326,01817
Stuttgart
Zur Naturwissenschaft überhaupt9.177017,48.782326,01817
Stuttgart
Auch ich in Arcadien!9.177017,48.782326,01817
Wien
Goethes Werke. Original-Ausgabe16.372076,48.20849,01816
Stuttgart
Auch ich in Arcadien!9.177017,48.782326,01816
Stuttgart
Faust. Eine Tragödie9.177017,48.782326,01816
Stuttgart
Ueber Kunst und Altherthum9.177017,48.782326,01816
Wien
Theater von Goethe16.372076,48.20849,01816
Wien
Gedichte16.372076,48.20849,01816
Stuttgart
Faust9.177017,48.782326,01816
Berlin
Des Epimenides Erwachen. Ein Festspiel13.4,52.516666,01815
Stuttgart
Goethes Werke9.177017,48.782326,01815
Stuttgart
Goethe's Gedichte9.177017,48.782326,01815
Stuttgart
Goethe's Werke9.177017,48.782326,01815
Stuttgart
Goethe's Gedichte9.177017,48.782326,01815
Berlin
Des Epimenides Erwachen13.4,52.516666,01815
Tübingen
Es ist dafür gesorgt, dass die Bäume nicht in den Himmel wachsen9.052219,48.52266,01814
Weimar
Willkommen!11.316667,50.983334,01814
Köln
Gedichte6.95,50.933334,01814
Köln
Faust6.95,50.933334,01814
Weimar
Höhen der alten und neuen Welt bildlich verglichen11.316667,50.983334,01813
Weimar
Höhen der alten und neuen Welt bildlich verglichen11.316667,50.983334,01813
Upsala
Goethe's kleinere Gedichte17.645428,59.8585,01813
Hamburg
Gedichte10.0,53.55,01813
Tübingen
Was man in der Jugend wünscht, hat man im Alter die Fülle9.052219,48.52266,01812
Tübingen
Goethe's Gedichte9.052219,48.52266,01812
Tübingen
Philipp Hackert. Biographische Skizze, meist nach dessen eigenen Aufsätzenentworfen9.052219,48.52266,01811
Tübingen
Ho mÄ“ dareis anthrÅpos u paideuetai9.052219,48.52266,01811
Tübingen
Aus meinem Leben. Dichtung und Wahrheit9.052219,48.52266,01811
Tübingen
Philipp Hackert9.052219,48.52266,01811
Tübingen
Aus meinem Leben9.052219,48.52266,01811
Tübingen
Die Wahlverwandtschaften. Ein Roman9.052219,48.52266,01810
Tübingen
Zur Farbenlehre9.052219,48.52266,01810
Weimar
Völkerwanderung11.316667,50.983334,01810
Weimar
Die Romantische Poesie11.316667,50.983334,01810
Wien
Pandora von Goethe16.372076,48.20849,01810
Weimar
Erneuerte Bedingungen unter welchen der Besuch der Bibliothek verstattetist11.316667,50.983334,01810
Tübingen
Die Wahlverwandtschaften. Ein Roman9.052219,48.52266,01809
Tübingen
Die Wahlverwandtschaften9.052219,48.52266,01809
Leipzig
Faust12.371292,51.33962,01809
Leipzig
Faust12.371292,51.33962,01809
Weimar
Saat von Göthe gesäet11.316667,50.983334,01808
Tübingen
Faust9.052219,48.52266,01808
Karlsbad
Sammlung zur Kenntniss der Gebirge von und um Karlsbad12.87117,50.23271,01807
Tübingen
Goethe's Werke9.052219,48.52266,01806
Tübingen
Goethe's Werke9.052219,48.52266,01806
Tübingen
Goethe's Werke9.052219,48.52266,01806
Tübingen
Winkelmann und sein Jahrhundert9.052219,48.52266,01805
Leipzig
Rameaus Neffe12.371292,51.33962,01805
Paris
Hermann et Dorothée2.3488,48.85341,01804
Berlin
Die natürliche Tochter. Trauerspiel13.4,52.516666,01804
Tübingen
Taschenbuch auf das Jahr 1804 (Die natürliche Tochter)9.052219,48.52266,01804
Mannheim
Mahomet. Trauerspiel in fünf Aufzügen8.464723,49.488335,01803
Tübingen
Leben des Benvenuto Cellini9.052219,48.52266,01803
Stuttgart
Hermann und Dorothea9.177017,48.782326,01803
Tübingen
Was wir bringen. Vorspiel9.052219,48.52266,01802
Tübingen
Was wir bringen. Vorspiel, bey Eröffnung des neuen Schauspielhauses zuLauchstädt9.052219,48.52266,01802
Tübingen
Mahomet. Trauerspiel in fünf Aufzügen nach Voltaire9.052219,48.52266,01802
Tübingen
Tancred. Trauerspiel in fünf Aufzügen nach Voltaire9.052219,48.52266,01802
Tübingen
Mahomet. Trauerspiel in fünf Aufzügen nach Voltaire9.052219,48.52266,01802
Tübingen
Tancred. Trauerspiel in fünf Aufzügen nach Voltaire9.052219,48.52266,01802
Paris
Alfred, ou les années d'apprentissage de Wilhelm Meister2.3488,48.85341,01802
Paris
Werther, von J. W. Göthe2.3488,48.85341,01802
Tübingen
Was wir bringen9.052219,48.52266,01802
Tübingen
Tancred9.052219,48.52266,01802
Tübingen
Mahomet9.052219,48.52266,01802
Paris
Alfred, ou les années d'apprentissage de Wilhelm Meister2.3488,48.85341,01802
London
Herman and Dorothea. A poem-0.12553275,51.508415,01801
Mannheim
Schriften8.464723,49.488335,01801
London
Herman and Dorothea-0.12553275,51.508415,01801
Wien
Iphigenie auf Tauris. Ein Schauspiel in fünf Aufzügen16.372076,48.20849,01800
Berlin
Mit Kupfern13.4,52.516666,01800
Berlin
Neueste Gedichte13.4,52.516666,01800
Ludlow
Letters of Werter. From the German of Goethe-72.47592,42.160095,01799
London
Goetz of Berlichingen, with the iron hand: a tragedy. Translated from theGerman of Goethé, ... By Walter Scott, ..-0.12553275,51.508415,01799
Liverpool
Gortz of Berlingen, with the iron hand. An historical drama, of thefifteenth century. Translated from the German of Goethe, ...-2.9779387,53.41058,01799
London
Goetz of Berlichingen, with the iron hand: a tragedy. Translated from theGerman of Goethé, ... By William Scott, ..-0.12553275,51.508415,01799
Berlin
Sechs Kupfer zu Wilhelm Meister's Lehrjahre13.4,52.516666,01799
Braunschweig
Herrmann und Dorothea10.533333,52.266666,01799
Grätz
Die Mitschuldigen. Ein Lustspiel in drey Aufzügen16.366667,52.233334,01798
London
Clavidgo, a tragedy, in five acts, translated from the German of Goethe,...-0.12553275,51.508415,01798
London
Stella. Translated from the German of M. Goethe, ..-0.12553275,51.508415,01798
Berlin
Taschenbuch für 179813.4,52.516666,01798
Tübingen
Propyläen9.052219,48.52266,01798
Berlin
Herrmann und Dorothea13.4,52.516666,01798
Grätz
Der Bürgeneral. Ein Lustspiel in einem Aufzuge16.366667,52.233334,01796
Grätz
Die Geschwister. Ein Schausp. in 1 Akt16.366667,52.233334,01796
Berlin
Claudine von Villa Bella. Ein Schauspiel mit Gesang13.4,52.516666,01796
New York
The sorrows of Werter. An affecting story-74.005974,40.714268,01795
London
The sorrows of Werter: a German story-0.12553275,51.508415,01795
Berlin
Wilhelm Meisters Lehrjahre. Ein Roman13.4,52.516666,01795
Berlin
Wilhelm Meisters Lehrjahre13.4,52.516666,01795
Frankfurt
Leiden des jungen Werthers8.683333,50.116665,01795
London
The sorrows of Werter: a German story-0.12553275,51.508415,01794
Berlin
Iphigenia in Tauris, a tragedy, written originally in German by J.W. vonGoethe13.4,52.516666,01794
Berlin
Goethe's neue Schriften13.4,52.516666,01794
Berlin
Reinecke Fuchs. In zwölf Gesängen13.4,52.516666,01794
Berlin
Iphigenia in Tauris. A Tragedy13.4,52.516666,01794
Dublin
The sorrows of Werter. A German story.. In two volumes. ..-6.248889,53.333057,01794
Norwich
Iphigenia in Tauris, a tragedy, written originally in German by J.W. vonGoethe1.2983394,52.627827,01793
Berlin
Der Bürgergeneral13.4,52.516666,01793
Berlin
Mit einem Kupfer13.4,52.516666,01792
Berlin
Goethe's neue Schriften13.4,52.516666,01792
Berlin
Der Gross-Cophta. Ein Lustspiel in fünf Aufzügen13.4,52.516666,01792
Berlin
Der Gross-Cophta13.4,52.516666,01792
Berlin
Goethe's neue Schriften13.4,52.516666,01792
Weimar
Beyträge zur Optik11.316667,50.983334,01791
Maestricht
Werther5.688889,50.84833,01791
Weimar
Beyträge zur Optik11.316667,50.983334,01791
Gotha
J. W. von Goethe Herzoglich Sachsen-Weimarischen Geheimenraths Versuch dieMetamorphose der Pflanzen zu erklären10.716667,50.95,01790
Dublin
The sorrows of Werter. A German story. ...-6.248889,53.333057,01790
Leipzig
Iphigenie auf Tauris. Ein Schauspiel12.371292,51.33962,01790
Gotha
J. W. von Goethe Herzoglich Sachsen-Weimarischen Geheimenraths Versuch dieMetamorphose der Pflanzen zu erklären10.716667,50.95,01790
Leipzig
Iphigenie auf Tauris. Ein Schauspiel12.371292,51.33962,01790
Leipzig
Iphigenie auf Tauris. Ein Schauspiel12.371292,51.33962,01790
Leipzig
Scherz, List und Rache. Ein Singspiel12.371292,51.33962,01790
Leipzig
Faust12.371292,51.33962,01790
Leipzig
Torquato Tasso. Ein Schauspiel12.371292,51.33962,01790
Leipzig
Torquato Tasso. Ein Schauspiel12.371292,51.33962,01790
Leipzig
Egmont. Ein Trauerspiel12.371292,51.33962,01790
Gotha
Versuch die Metamorphose der Pflanzen zu erklären10.716667,50.95,01790
Leipzig
Torquato Tasso12.371292,51.33962,01790
Leipzig
Schriften12.371292,51.33962,01790
Leipzig
Scherz, List und Rache12.371292,51.33962,01790
Leipzig
Jery und Bätely12.371292,51.33962,01790
Leipzig
Faust. Ein Fragment. (Ächte Ausgabe. Erster Druck, zweite Form)12.371292,51.33962,01790
London
The sorrows of Werter: a German story-0.12553275,51.508415,01789
London
The sorrows of Werter: a German story-0.12553275,51.508415,01788
Londra
Gli affanni del Giovane Verter: dall' originale Tedesco; tradotti inlingua Toscana, da Corrado Ludger. ...-0.12553275,51.508415,01788
Leipzig
Erwin und Elmire. Ein Singspiel12.371292,51.33962,01788
Leipzig
Claudine von Villa Bella. Ein Singspiel12.371292,51.33962,01788
Leipzig
Egmont. Trauerspiel12.371292,51.33962,01788
Leipzig
Erwin und Elmire12.371292,51.33962,01788
Leipzig
Egmont12.371292,51.33962,01788
Leipzig
Claudine von Villa Bella12.371292,51.33962,01788
Leipzig
Die Leiden des jungen Werthers12.371292,51.33962,01787
Leipzig
Der Triumph der Empfindsamkeit. Eine dramatische Grille12.371292,51.33962,01787
Leipzig
Leiden des jungen Werther12.371292,51.33962,01787
Leipzig
Clavigo. Ein Trauerspiel12.371292,51.33962,01787
Leipzig
Die Mitschuldigen. Ein Lustspiel ; [3. Fassung]12.371292,51.33962,01787
Leipzig
Die Vögel. Nach dem Aristophanus12.371292,51.33962,01787
Leipzig
Götz von Berlichingen mit der eisernen Hand. Ein Schauspiel12.371292,51.33962,01787
Leipzig
Die Geschwister. Ein Schauspiel12.371292,51.33962,01787
Leipzig
Die Vögel12.371292,51.33962,01787
Leipzig
Der Triumph der Empfindsamkeit12.371292,51.33962,01787
Leipzig
Die Mitschuldigen12.371292,51.33962,01787
Leipzig
Leiden des jungen Werthers12.371292,51.33962,01787
Leipzig
Iphigenie auf Tauris12.371292,51.33962,01787
Leipzig
Götz von Berlichingen mit der eisernen Hand12.371292,51.33962,01787
Leipzig
Goethe's Schriften12.371292,51.33962,01787
Leipzig
Die Geschwister12.371292,51.33962,01787
Leipzig
Clavigo12.371292,51.33962,01787
Dublin
Eleonora. By M. Goethe, author of the Sorrows of Werter. To which is addedA poetic epistle from Werter to Charlotte-6.248889,53.333057,01786
London
The sorrows of Werter: a German story-0.12553275,51.508415,01786
London
Werter and Charlotte. A German story. A new translation, from the lastLeipsic edition. Illustrated with notes-0.12553275,51.508415,01786
Jena
Ueber den Zwischenkiefer des Menschen und der Thiere11.583333,50.933334,01786
London
The sorrows of Werter: a German story-0.12553275,51.508415,01786
London
The sorrows of Werter: a German story-0.12553275,51.508415,01785
Weimar
Erste ... Siebente Nachricht von dem Fortgang des neuen Bergbaus zuIlmenau11.316667,50.983334,01785
Reutlingen
Göthens Schriften9.204268,48.49144,01784
London
The sorrows of Werter: a German story-0.12553275,51.508415,01783
Frankfurt
Works of Ossian8.683333,50.116665,01783
London
The sorrows of Werter: a German story-0.12553275,51.508415,01782
London
The sorrows of Werter: a German story-0.12553275,51.508415,01780
Dublin
The sorrows of Werter: a German story. ...-6.248889,53.333057,01780
London
The sorrows of Werter: a German story-0.12553275,51.508415,01779
Carlsruhe
J. W. Goethens Schriften8.385834,49.004723,01778
Carlsruhe
J.W. Goethens Schriften8.385834,49.004723,01778
Reutlingen
Goethens Schriften9.204268,48.49144,01778
Berlin
J. W. Goethens Schriften13.4,52.516666,01777
Berlin
J. W. Goethens Schriften13.4,52.516666,01777
Berlin
Claudine von Villa Bella. Ein Schauspiel mit Gesang13.4,52.516666,01776
Koenigsberg
Götz von Berlichingen mit der eisernen Hand. Ein Schauspiel20.5,54.71,01776
Berlin
Claudine von Villa Bella13.4,52.516666,01776
Berlin
Claudine von Villa Bella13.4,52.516666,01776
Hamburg
Stella. Ein Schauspiel für Liebende in fünf Akten10.0,53.55,01776
Münster
Stella. Ein Schauspiel für Liebende in fünf Akten7.6257133,51.962357,01776
Hanau
Stella8.916667,50.133335,01776
Münster
Stella7.6257133,51.962357,01776
Schaffhausen
Stella8.633333,47.7,01776
Berlin
Stella13.4,52.516666,01776
Frankfurt
Stella, Nummer Zwei. Oder Fortsetzung8.683333,50.116665,01776
Berlin
Claudine von Villa Bella13.4,52.516666,01776
Frankfurt
Erwin und Elmire. Ein Schauspiel mit Gesang8.683333,50.116665,01775
Frankfurt
Götz von Berlichingen mit der eisernen Hand. Ein Schauspiel8.683333,50.116665,01775
Strasburg
Die Leiden des jungen Werthers7.75,48.583332,01775
Freystadt
Die Leiden des jungen Werthers15.6,51.75,01775
Biel
Des Herrn Göthe sämtliche Werke36.58,50.61,01775
Bern
Die Leiden des jungen Werthers-46.565,-23.69389,01775
Strassburg
Die Leiden des jungen Werthers7.75,48.583332,01775
Biel
Des Herrn Göthe sämtliche Werke36.58,50.61,01775
Frankfurt
Götz von Berlichingen8.683333,50.116665,01775
Frankfurt
Erwin und Elmire ein Schauspiel mit Gesang8.683333,50.116665,01775
Frankfurt
Clavigo. Ein Trauerspiel8.683333,50.116665,01774
Leipzig
Götter, Helden und Wieland. Eine Farce12.371292,51.33962,01774
Giessen
Prolog zu den neuesten Offenbarungen Gottes verdeutscht durch Dr. CarlFriedrich Bahrdt8.65,50.583332,01774
Leipzig
Clavigo. Ein Trauerspiel12.371292,51.33962,01774
Leipzig
Neueröfnetes moralisch-politisches Puppenspiel12.371292,51.33962,01774
Leipzig
"Lotte". Lottes Schattenriss12.371292,51.33962,01774
Leipzig
Die Leiden des jungen Werthers12.371292,51.33962,01774
Giessen
Prolog zu den neuesten Offenbarungen Gottes8.65,50.583332,01774
Leipzig
Neueröffnetes moralisch-politisches Puppenspiel12.371292,51.33962,01774
Leipzig
Die Leiden des jungen Werthers (Zweiter Druck)12.371292,51.33962,01774
Leipzig
Die Leiden des jungen Werthers (Erster Druck)12.371292,51.33962,01774
Leipzig
Götter Helden und Wieland (Zweiter Druck)12.371292,51.33962,01774
Leipzig
Götter Helden und Wieland (Erster Druck)12.371292,51.33962,01774
Leipzig
Clavigo (Dritter Druck)12.371292,51.33962,01774
Leipzig
Clavigo (Zweiter Druck)12.371292,51.33962,01774
Leipzig
Clavigo (Erster Druck)12.371292,51.33962,01774
Lindau
Zwo wichtige bisher unerörterte Biblische Fragen9.683333,47.55,01773
Leipzig
Neue Lieder in Melodien gesetzt12.371292,51.33962,01770
Leipzig
Wöchentliche Nachrichten und Anmerkungen die Musik betreffend12.371292,51.33962,01766
\ No newline at end of file diff --git a/data/heine.kml b/data/heine.kml new file mode 100644 index 0000000..0a2f969 --- /dev/null +++ b/data/heine.kml @@ -0,0 +1,2 @@ + +
Stuttgart
Die romantische Schule. Kritische Ausgabe9.177017,48.782326,02006
Berlin
Deutschland. Ein Wintermährchen. Geschrieben im Januar 184413.4,52.516666,02006
München
Mit scharfer Zunge. 999 Aperçus und Bonmots11.575491,48.137432,02006
Marbach am Neckar
Zu welcher Parthey. Aus Heinrich Heines Arbeitsmanuskript zu "Deutschland.Ein Wintermärchen"9.259951,48.93964,02005
Zagreb
Sjeverno more16.0,45.8,02000
Berlin
Deutschland. Ein Wintermährchen13.4,52.516666,01998
Berlin
Atta Troll. Atta Troll. Ein Sommernachtstraum13.4,52.516666,01998
Berlin
Werke. Hörtext "Die Harzreise"13.4,52.516666,01998
Frankfurt am Main
Ich hab im Traum geweinet. 44 Gedichte mit Interpretationen8.683333,50.116665,01997
München
Buch der Lieder. Hamburg 182711.575491,48.137432,01997
Düsseldorf
Memoiren und Geständnisse. [nach Band 10 der Ausgabe Heines Werke in zehnBänden (Leipzig 1915) unter Hinzuziehung der Historisch-kritischenHeine-Werkausgabe]6.776161,51.22172,01997
Hamburg
Nachträge und Korrekturen, Register10.0,53.55,01997
Frankfurt am Main
Sämtliche Gedichte in zeitlicher Folge8.683333,50.116665,01996
Berlin
Unterwegs in Europa. Reisebilder ; [eine Auswahl in zwei Bänden ; mitzeitgenössischen Abbildungen]13.4,52.516666,01995
Stuttgart
Deutschland, ein Wintermärchen9.177017,48.782326,01995
Berlin
Gedichte 1827 - 184413.4,52.516666,01994
Darmstadt
Dichterische Prosa 8.649445,49.870556,01994
Stuttgart
Der Rabbi von Bacherach. Ein Fragment9.177017,48.782326,01994
Hamburg
Almansor10.0,53.55,01994
Darmstadt
Schriften zu Literatur und Politik ; 2. Vermischtes8.649445,49.870556,01993
Hamburg
Shakespeares Mädchen und Frauen und kleinere literaturkritische Schriften10.0,53.55,01993
Darmstadt
Schriften zu Literatur und Politik ; 18.649445,49.870556,01992
Darmstadt
Gedichte8.649445,49.870556,01992
Darmstadt
Sämtliche Werke. [in vier Bänden ; nach dem Text der Ausgaben letzterHand]8.649445,49.870556,01992
Göttingen
Bleibe auch Du mir gewogen. Briefe aus Göttingen ; eine Auswahl aus denJahren 1820/21 und 1824/259.933333,51.533333,01992
Hamburg
Apparat10.0,53.55,01992
Hamburg
Text10.0,53.55,01992
Berlin
Atta Troll. Deutschland-ein Wintermärchen. Der Rabbi von Bacherach. DieHarzreise. Aus den Memoiren des Herren von Schnabelewopski.13.4,52.516666,01991
Berlin
Gedichte13.4,52.516666,01991
Hamburg
Apparat 59. - 61. Artikel und Anhang10.0,53.55,01991
Hamburg
Text. Apparat 43. - 58. Artikel10.0,53.55,01990
Hamburg
Apparat 11. - 42. Artikel10.0,53.55,01989
Berlin
Späte Prosa 1847 - 185613.4,52.516666,01988
Hamburg
Text. Apparat 1. - 10. Artikel10.0,53.55,01988
Hildesheim
Romantische Harzreisen. Reiseaufzeichnungen9.966667,52.15,01987
Hamburg
Elementargeister10.0,53.55,01987
Köln
Heinrich Heine und die Musik. Publizistische Arbeiten und poetischeReflexionen6.95,50.933334,01987
Leipzig
Heinrich Heine und die Musik. Publizistische Arbeiten und poetischeReflexionen12.371292,51.33962,01987
Hamburg
Apparat10.0,53.55,01986
Hamburg
Text10.0,53.55,01986
Berlin
Heines Werke in fünf Bänden13.4,52.516666,01986
Nördlingen
Ludwig Börne und Heinrich Heine, ein deutsches Zerwürfnis10.488682,48.85122,01986
Hamburg
Atta Troll. Ein Sommernachtstraum10.0,53.55,01985
Berlin
Briefwechsel 1815 - 1856. Register13.4,52.516666,01984
Hamburg
Apparat10.0,53.55,01984
Hamburg
Neue Gedichte10.0,53.55,01983
Frankfurt am Main
Atta Troll. En Sommernachtstraum8.683333,50.116665,01983
Hamburg
Geständnisse, Memoiren und kleinere autobiographische Schriften10.0,53.55,01982
Paris
De l'Allemagne2.3488,48.85341,01981
München
Heinrich Heine als Theologe. Ein Textbuch11.575491,48.137432,01981
Hamburg
Apparat10.0,53.55,01981
Hamburg
Text10.0,53.55,01980
Berlin
Italie13.4,52.516666,01979
Hamburg
Text10.0,53.55,01979
Hamburg
Ludwig Börne. Eine Denkschrift und kleinere politische Schriften10.0,53.55,01978
Stuttgart
Atta Troll. Ein Sommernachtstraum9.177017,48.782326,01977
Stuttgart
Die romantische Schule. Kritische Ausgabe9.177017,48.782326,01976
München
[Gedichte11.575491,48.137432,01976
München
[Gedichte11.575491,48.137432,01975
München
@11.575491,48.137432,01975
Hamburg
Apparat10.0,53.55,01975
Hamburg
Text10.0,53.55,01975
Berlin
Zur Geschichte der Religion und Philosophie. Über den Denunzianten. LudwigBörne. Die Februarrevolution. Geständnisse. Memoiren. Vermächtnis.13.4,52.516666,01974
Berlin
Französische Zustände. Die romantische Schule.13.4,52.516666,01974
Berlin
Ideen. Das Buch von Le Grand. Englische Fragmente. Reise von München nachGenua. Die Bäder von Lucca. Einleitung zu "Kahldorf über den Adel".13.4,52.516666,01974
München
@11.575491,48.137432,01974
Berlin
Lutezia. Berichte über Politik, Kunst und Volksleben13.4,52.516666,01974
Dusanbe
Gejne v Rossii. (1830 - 1860-e gody)68.77389,38.56,01973
Hamburg
Briefe aus Berlin10.0,53.55,01973
Hamburg
Heinrich Heine. Historisch-kritische Gesamtausgabe der Werke10.0,53.55,01973
Detmold
Bruchstück einer eigenhändigen Niederschrift zu "Lutezia. Berichte überPolitik, Kunst und Volksleben"8.873177,51.93855,01972
Hildesheim
Romantische Harzreisen. Reiseaufzeichnungen9.966667,52.15,01971
München
@11.575491,48.137432,01971
München
@11.575491,48.137432,01971
München
Heinrich Heine11.575491,48.137432,01971
Berlin
Heines Werke. In fünf Bänden13.4,52.516666,01970
Berlin
Säkularausgabe. Werke, Briefwechsel, Lebenszeugnisse13.4,52.516666,01970
München
@11.575491,48.137432,01969
Beograd
NemaÄka20.468056,44.81861,01968
München
@11.575491,48.137432,01968
München
Sämtliche Schriften11.575491,48.137432,01968
Beograd
Pesme20.468056,44.81861,01964
Berlin
Zur Geschichte der Religion und Philosophie; über den Denunzianten; LudwigBörne; die Februarrevolution; Geständnisse; Memoiren; Vermächtnis13.4,52.516666,01964
Berlin
Französische Zustände; die Romantische Schule13.4,52.516666,01964
Berlin
Ideen - das Buch Le Grand. Englische Fragmente. Reise von München nachGenua. Die Bäder von Lucca. Einleitung zu "Kahldorf über den Adel"13.4,52.516666,01964
Berlin
Atta Troll. Deutschland - Ein Wintermärchen. Der Rabbi von Bacherach. DieHarzreise. Aus den Memoiren des Herren von Schnabelewopski13.4,52.516666,01964
Berlin
Gedichte13.4,52.516666,01964
München
Nachlese zu den Gedichten (1831-1848) ; Almansor ; William Ratcliff11.575491,48.137432,01964
München
Romanzero ; Gedichte (1853/54) ; Nachlese zu den Gedichten (1812-1831)11.575491,48.137432,01964
München
Neue Gedichte (2) ; Atta Troll ; Ein Sommernachtstraum ; Deutschland, einWintermärchen11.575491,48.137432,01964
München
Buch der Lieder ; Neue Gedichte (1)11.575491,48.137432,01964
München
Sämtliche Werke11.575491,48.137432,01964
Frankfurt am Main
Zeitungsberichte über Musik und Malerei8.683333,50.116665,01964
Wiesbaden
Serbokroatische Heine-Ãœbersetzungen8.25,50.083332,01963
Berlin
Briefe 1839 - 185613.4,52.516666,01962
Berlin
Der Doktor Faust. Die Götter im Exil. Die Göttin Diana. Geständnisse.Memoiren. Kleine Schriften. 1840 - 1856. Aphorismen und Fragmente. Testamente13.4,52.516666,01962
Berlin
Über die französische Bühne. Ludwig Börne. Lutetia13.4,52.516666,01962
Berlin
Briefe 1815 - 183813.4,52.516666,01961
Berlin
Die romantische Schule. Zur Geschichte der Religion und Philosophie inDeutschland. Elementargeister. Kleine Schriften. 1832 - 1839. ShakespearesMädchen und Frauen13.4,52.516666,01961
Berlin
Der Rabbi von Bacherach. Aus den Memoiren des Herren von Schnabelewopski.Florentinische Nächte. Kleine Schriften. 1820 - 1831 Französische Maler.Französische Zustände. Vorrede zum ersten Band des "Salon"13.4,52.516666,01961
Berlin
Reisebilder13.4,52.516666,01961
Berlin
Romanzero. Gedichte 1853 und 1854. Nachlese zu den Gedichten. Almansor.William Ratcliff13.4,52.516666,01961
Berlin
Buch der Lieder. Neue Gedichte. Atta Troll, ein Sommernachtstraum.Deutschland, ein Wintermärchen13.4,52.516666,01961
Berlin
Werke und Briefe. In zehn Bänden13.4,52.516666,01961
Frankfurt am Main
Buch der Lieder8.683333,50.116665,01961
Gütersloh
Versepen8.383333,51.9,01959
Gütersloh
Einleitung, Gedichte8.383333,51.9,01959
Berlin
Zur Geschichte der deutschen Philosophie13.4,52.516666,01956
Mainz
[Briefe 1845 - 1856]8.2711115,50.0,01953
Skopje
Lirski intermeco21.433332,42.0,01952
Mainz
[Briefe 1815 - 1831]8.2711115,50.0,01950
Mainz
[Briefe 1831 - 1844]8.2711115,50.0,01950
Hildesheim
Ideen "Das Buch Le Grand"9.966667,52.15,01949
Mainz
[Briefe 1815 - 1831]8.2711115,50.0,01948
Mainz
Briefe. Erste Gesamtausgabe nach den Handschriften8.2711115,50.0,01948
Freudenstadt
Reisebilder8.416667,48.433334,01947
Berlin
Eine Auswahl aus seinen Werken13.4,52.516666,01947
Leningrad
Germanija. Zimnjaja skazka30.264166,59.894444,01933
Zagreb
Heineove pjesme. (1932)16.0,45.8,01932
Emsdetten
Schuldversprechen und Schuldanerkenntnis als abstrakte Schuldverträge. (§§780 - 782 BGB)7.5333333,52.183334,01932
Leipzig
Registerband12.371292,51.33962,01929
Lüneburg
Über das Absinken der Milchleistung bei zureichender Ernährung10.4,53.25,01928
Hamburg
Der Prosa-Nachlass von H. Heine. Neu geordnet, gesichtet und eingeleitetvon Erich Loewenthal10.0,53.55,01926
Leipzig
Registerband12.371292,51.33962,01920
Leipzig
Die Harzreise. Mit Bildern der Zeit12.371292,51.33962,01920
Hannover
Florentinische Nächte9.733222,52.370518,01920
Leipzig
Die Februarrevolution 1848. Der Dr. Faust. Gedanken und Einfälle [u.a.]12.371292,51.33962,01915
Leipzig
Reisebilder Teil 4. Englische Fragmente 1828. Kleinere Schriften aus denJahren 1820 bis 183112.371292,51.33962,01914
München
Heinrich Heines Briefwechsel11.575491,48.137432,01914
Leipzig
An die hohe Bundesversammlung. Über den Denunzianten. Über dieFranzösische Bühne12.371292,51.33962,01913
Leipzig
Romanzero. Gedichte 1853 und 1854. Bimini12.371292,51.33962,01913
Leipzig
Französische Maler. Französische Zustände. Aus den Memoiren des Herrn vonSchnabelewopski. Florentische Nächte12.371292,51.33962,01912
Leipzig
Reisebilder Teil 1 und 312.371292,51.33962,01912
Leipzig
Neue Gedichte. Atta Troll. Deutschland12.371292,51.33962,01912
Leipzig
Buch der Lieder. Tragödien12.371292,51.33962,01911
Warschau
Heine-Buch für Schule und Haus21.0,52.25,01911
München
Ich klage Sie an!. Politische Kampfrufe ; 1831 - 3211.575491,48.137432,01911
Berlin
Heine-Reliquien. Neue Briefe und Aufsätze Heinrich Heines ; mit 5Bildnissen und 5 Faksimiles13.4,52.516666,01911
Berlin
Briefe13.4,52.516666,01911
Leipzig
Lutezia. Berichte über Politik, Kunst und Volksleben. Kleinere Schriften1840-184412.371292,51.33962,01910
Leipzig
Die romantische Schule. Zur Geschichte der Religion und Philosophie inDeutschland. Elementargeister12.371292,51.33962,01910
Leipzig
Heinrich Heines sämtliche Werke12.371292,51.33962,01910
Leipzig
Heines Werke in zehn Bänden12.371292,51.33962,01910
Warszawa
Pieśni współczesne. (1839-1846) : z nietłomaczonych poezyi21.0,52.25,01909
Berlin
Memoiren13.4,52.516666,01909
Berlin
Geständnisse13.4,52.516666,01908
Berlin
Ludwig Börne13.4,52.516666,01908
Berlin
Lutezia13.4,52.516666,01908
Berlin
Ãœber Polen13.4,52.516666,01908
Berlin
Französische Maler13.4,52.516666,01908
Berlin
Elementargeister13.4,52.516666,01908
Berlin
Die romantische Schule13.4,52.516666,01908
Berlin
Reisebilder 3 und 413.4,52.516666,01908
Berlin
Reisebilder 1 und 213.4,52.516666,01908
Berlin
Der Rabbi von Bacherach13.4,52.516666,01908
Berlin
Almansor13.4,52.516666,01908
Berlin
Atta Troll13.4,52.516666,01908
Berlin
Nachlese13.4,52.516666,01908
Berlin
Neue Gedichte13.4,52.516666,01908
Berlin
Buch der Lieder13.4,52.516666,01908
Berlin
Heine's Werke in fünfzehn Teilen13.4,52.516666,01908
Berlin
Heinrich Heine. Gesammelte Aufsätze13.4,52.516666,01906
Langensalza
Über thüringisch-sächsische Ortsnamen10.65,51.1,01906
Berlin
Höllenfahrt13.4,52.516666,01904
Berlin
Buch der Lieder13.4,52.516666,01902
Berlin
Lehr- und Lesebuch der Englischen Sprache für Handelsschulen13.4,52.516666,01900
Berlin
Heinrich Heine. Sein Leben in seinen Liedern <1797-1856> ; Ein Breviariumzum 100. Geburtstage <13. Dezember 1897>13.4,52.516666,01897
Hannover
Stammesgeschichtliche Ergänzungshefte für die Provinz Sachsen9.733222,52.370518,01896
Norden
Die Nordsee. Meerdichtungen von Heinrich Heine. Nebst einem Anhang:Heinrich Heine als Dichter des Meeres. Von Karl Kessel8.483334,53.5,01895
Leipzig
Ludwig Börne12.371292,51.33962,01893
Leipzig
Vermischte Schriften12.371292,51.33962,01893
Leipzig
Französische Zustände12.371292,51.33962,01893
Leipzig
Reisebilder12.371292,51.33962,01893
Leipzig
[Lyrische Gedichte]12.371292,51.33962,01893
Breslau
Briefe von Heinrich Heine an Heinrich Laube17.033333,51.1,01893
Leipzig
Ludwig Börne. Prosaische Nachlese12.371292,51.33962,01893
Leipzig
Vermischte Schriften. Der Doktor Faust12.371292,51.33962,01893
Leipzig
Französische Zustände. Die romantische Schule. Shakespeares Mädchen undFrauen.12.371292,51.33962,01893
Leipzig
Der Salon12.371292,51.33962,01893
Leipzig
Reisebilder12.371292,51.33962,01893
Leipzig
Nachlese zu den Gedichten12.371292,51.33962,01893
Leipzig
[Lyrische Gedichte]12.371292,51.33962,01893
Hamburg
Heinrich Heines Familienleben10.0,53.55,01892
Hamburg
Heinrich Heines Familienleben10.0,53.55,01892
Leipzig
Heinrich Heines sämtliche Werke12.371292,51.33962,01890
Berlin
Heinrich Heine's Autobiographie. Nach seinen Werken, Briefen undGesprächen13.4,52.516666,01888
Wien
Heinrich Heine's Werke16.372076,48.20849,01888
Leipzig
Heinrich Heine's Buch der Lieder. Vervollständigt hrsg. von Otto F.Lachmann12.371292,51.33962,01887
Hamburg
Neuer Frühling. Gedichte ; Gesammtausgabe der lyrischen Gedichte für dieFrauenhand10.0,53.55,01887
Stuttgart
Heinrich Heines Buch der Lieder. Nebst einer Nachlese nach den erstenDrucken oder Handschriften9.177017,48.782326,01887
Hamburg
Biographie10.0,53.55,01885
Hamburg
Heinrich Heine's sämmtliche Werke10.0,53.55,01885
Hamburg
Memoiren und neugesammelte Gedichte, Prosa und Briefe10.0,53.55,01884
Jena
Heinrich Heine's letzte Tage11.583333,50.933334,01884
Hamburg
Erinnerungen an ...10.0,53.55,01881
Hamburg
Briefe Teil 3 und 410.0,53.55,01876
Hamburg
Briefe Teil 1 und 210.0,53.55,01876
Hamburg
Dichtungen Teil 3 und 410.0,53.55,01876
Hamburg
Dichtungen Teil 1 und 210.0,53.55,01876
Hamburg
Vermischte Schriften Teil 1 und 210.0,53.55,01876
Hamburg
Französische Zustände Teil 4. Ludwig Börne10.0,53.55,01876
Hamburg
Französische Zustände Teil 2 und 310.0,53.55,01876
Hamburg
Über Deutschland Teil 3. Französische Zustände Teil 110.0,53.55,01876
Hamburg
Ãœber Deutschland Teil 1 und 210.0,53.55,01876
Hamburg
Englische Fragmente. Shakespeares's Mädchen und Frauen. NovellistischeFragmente10.0,53.55,01876
Hamburg
Reisebilder Teil 1 und 210.0,53.55,01876
Hamburg
Sämmtliche Werke. [in 22 Bänden]10.0,53.55,01876
Noto
Di Enrico Heine Intermezzo lirico. Versione dal tedesco per GiuseppeCassone15.069294,36.89014,01871
Berlin
Immortellen H. Heines13.4,52.516666,01871
Hamburg
Letzte Gedichte und Gedanken10.0,53.55,01869
Berlin
Erinnerungen an13.4,52.516666,01868
Hamburg
Ludwig Börne. Eine Denkschrift10.0,53.55,01867
Leipzig
Aus dem Nachlaß Varnhagen's von Ense. Briefe von Stägemann, Metternich,Heine und Bettina von Arnim ; nebst Briefen, Anmerkungen und Notizen vonVarnhagen von Ense12.371292,51.33962,01865
Hamburg
Briefe ; 1.210.0,53.55,01863
Hamburg
Romancero. Letzte Gedichte10.0,53.55,01863
Hamburg
Atta Troll. Deutschland. Zeitgedichte10.0,53.55,01863
Hamburg
Tragödien und neue Gedichte10.0,53.55,01862
Hamburg
Buch der Lieder10.0,53.55,01862
Hamburg
Vermischte Schriften ; 1.210.0,53.55,01862
Hamburg
Heinrich Heine über Ludwig Börne10.0,53.55,01862
Hamburg
Kunstberichte aus Paris10.0,53.55,01862
Hamburg
Die parlamentarische Periode des Bürgerkönigtums ; 2. Hälfte10.0,53.55,01862
Hamburg
Das Bürgerkönigthum im Jahr 183210.0,53.55,01862
Leipzig
Briefe von Heinrich Heine an seinen Freund Moses Moser12.371292,51.33962,01862
Leipzig
Briefe an Moses Moser12.371292,51.33962,01862
Amsterdam
Briefe4.8999023,52.373085,01861
Hamburg
Elementargeister und Dämonen10.0,53.55,01861
Hamburg
Die romantische Schule10.0,53.55,01861
Hamburg
Zur Geschichte der Religion und Philosophie in Deutschland10.0,53.55,01861
Hamburg
Novellistische Fragmente10.0,53.55,01861
Hamburg
Englische Fragmente und Shakespeare's Mädchen und Frauen10.0,53.55,01861
Hamburg
Heinrich Heine's sämmtliche Werke10.0,53.55,01861
Amsterdam
Vermischte Gedichte, Sonette, Auf rother Erde, Aus der Matrazengruft,Erzählendes, Burlesken, Parodien, Scherze, Verschollenes4.8999023,52.373085,01861
Amsterdam
Berlin. Herbstmährchen in 27 Kapiteln4.8999023,52.373085,01861
Hamburg
Sämmtliche Werke10.0,53.55,01861
Amsterdam
Dichtungen4.8999023,52.373085,01861
Amsterdam
Briefe4.8999023,52.373085,01861
Amsterdam
Berlin. Herbstmährchen in 27 Kap.4.8999023,52.373085,01861
Amsterdam
Reisebilder ; 44.8999023,52.373085,01860
Amsterdam
Reisebilder ; 34.8999023,52.373085,01860
Amsterdam
Reisebilder ; 24.8999023,52.373085,01860
Amsterdam
Reisebilder ; 14.8999023,52.373085,01860
Amsterdam
Vermischte Schriften ; 3. Lutezia. Berichte über Politik, Kunst undVolksleben, Teil 24.8999023,52.373085,01858
Amsterdam
Vermischte Schriften ; 2. Lutezia. Berichte über Politik, Kunst undVolksleben, Teil 14.8999023,52.373085,01858
Amsterdam
Vermischte Schriften ; 14.8999023,52.373085,01857
Amsterdam
Heinrich Heine's sämmtliche Werke4.8999023,52.373085,01857
Hamburg
Ãœber den Denuncianten. Eine Vorrede zum dritten Theile des Salons10.0,53.55,01857
Berlin
Ueber Heinrich Heine13.4,52.516666,01857
Hamburg
Deutschland. - Atta Troll10.0,53.55,01857
Hamburg
Tragödien, nebst ...10.0,53.55,01857
Trier
H. Heine's Himmelfahrt6.639347,49.755653,01857
Prag
H. Heine14.424132,50.087837,01857
Hamburg
Heinrich Heines Wirken10.0,53.55,01857
Stuttgart
Heinrich Heine, der Unsterbliche9.177017,48.782326,01857
Hamburg
Heinrich Heine10.0,53.55,01856
Philadelphia
Sämmtliche Werke-75.16379,39.952335,01855
Amsterdam
Sämmtliche Werke4.8999023,52.373085,01855
Paris
De l'Allemagne2.3488,48.85341,01855
Hamburg
Lutezia. Berichte über Politik, Kunst und Volksleben ; 210.0,53.55,01854
Hamburg
Lutezia. Berichte über Politik, Kunst und Volksleben ; 110.0,53.55,01854
Hamburg
Geständnisse. Gedichte. Die Götter im Exil. Ludwig Marcus. Denkworte10.0,53.55,01854
Hamburg
Vermischte Schriften10.0,53.55,01854
Hamburg
Vermischte Schriften10.0,53.55,01854
Hamburg
Neue Gedichte10.0,53.55,01853
Hamburg
Die Harzreise10.0,53.55,01853
Hamburg
Die Harzreise10.0,53.55,01853
Hamburg
Die Harzreise10.0,53.55,01853
Berlin
Die verbannten Götter. Nebst Mittheilungen über den kranken Dichter13.4,52.516666,01853
Berlin
Die verbannten Götter13.4,52.516666,01853
Hamburg
Die Harzreise10.0,53.55,01853
Hamburg
Romanzero10.0,53.55,01852
Hamburg
Romanzero10.0,53.55,01852
Hamburg
Neue Gedichte10.0,53.55,01852
Hamburg
Buch der Lieder10.0,53.55,01852
Hamburg
Der Doktor Faust. Ein Tanzpoem ; nebst kuriosen Berichten über Teufel,Hexen und Dichtkunst10.0,53.55,01851
Hamburg
Romanzero10.0,53.55,01851
Hamburg
Gedichte10.0,53.55,01851
Hamburg
Romanzero10.0,53.55,01851
Hamburg
Der Doktor Faust10.0,53.55,01851
Hildburghausen
Fragmente und Aphorismen10.73184,50.425526,01850
Leipzig
Heinrich Heine's politisches Glaubensbekenntniß oder: Epistel anDeutschland.. Geschrieben und gedruckt in Paris im October 1832 und durch diefreie deutsche Presse neu an's Licht gezogen im April 1848.12.371292,51.33962,01848
Leipzig
Politisches Glaubensbekenntniss12.371292,51.33962,01848
Hamburg
Atta Troll. Ein Sommernachtstraum10.0,53.55,01847
Hamburg
Atta Troll10.0,53.55,01847
Hamburg
Neue Gedichte10.0,53.55,01844
Hamburg
Neue Gedichte10.0,53.55,01844
Hamburg
Deutschland. Ein Wintermährchen10.0,53.55,01844
Hamburg
Buch der Lieder10.0,53.55,01844
Hamburg
Neue Gedichte (2. Aufl.)10.0,53.55,01844
Hamburg
Neue Gedichte10.0,53.55,01844
Hamburg
Deutschland10.0,53.55,01844
Hamburg
Buch der Lieder10.0,53.55,01841
Hamburg
Heinrich Heine über Ludwig Börne10.0,53.55,01840
Paris
Shakespeares Maedchen und Frauen2.3488,48.85341,01839
Hamburg
Jahrbuch der Literatur10.0,53.55,01839
Hamburg
Buch der Lieder10.0,53.55,01839
Stuttgart
Der sinnreiche Junker Don Quixote9.177017,48.782326,01838
Hamburg
Ueber den Denunzianten10.0,53.55,01837
Hamburg
Buch der Lieder10.0,53.55,01837
Hamburg
Die romantische Schule10.0,53.55,01836
Hamburg
Die romantische Schule10.0,53.55,01836
Hamburg
Der Salon10.0,53.55,01834
Hamburg
Der Salon10.0,53.55,01834
Hamburg
Französische Zustände10.0,53.55,01833
Paris
De la France2.3488,48.85341,01833
Paris
Zur Geschichte der neueren schönen Literatur in Deutschland2.3488,48.85341,01833
Hamburg
Französische Zustände10.0,53.55,01833
Paris
Zur Geschichte der Literatur in Deutschland2.3488,48.85341,01833
Leipzig
Vorrede zu Französischen Zuständen12.371292,51.33962,01833
Paris
Oeuvres2.3488,48.85341,01833
Hamburg
Französische Zustände10.0,53.55,01833
Hamburg
Nachträge zu den Reisebildern10.0,53.55,01831
Hamburg
Reisebilder10.0,53.55,01830
Hamburg
Buch der Lieder10.0,53.55,01827
Hamburg
Buch der Lieder10.0,53.55,01827
Hamburg
Buch der Lieder10.0,53.55,01827
Hamburg
Reisebilder10.0,53.55,01826
Berlin
Tragödien nebst einem lyrischen Intermezzo13.4,52.516666,01823
Berlin
Tragödien nebst einem lyrischen Intermezzo13.4,52.516666,01823
Berlin
Tragödien, nebst einem lyrischen Intermezzo13.4,52.516666,01823
Berlin
Tragödien, nebst einem lyrischen Intermezzo13.4,52.516666,01823
Berlin
Tragödien13.4,52.516666,01823
Berlin
Gedichte13.4,52.516666,01822
\ No newline at end of file diff --git a/data/kafka.kml b/data/kafka.kml new file mode 100644 index 0000000..444e3c2 --- /dev/null +++ b/data/kafka.kml @@ -0,0 +1,2 @@ + +
Frankfurt am Main
Oxforder Oktavheft 68.683333,50.116665,02009
Frankfurt am Main
Oxforder Oktavheft 58.683333,50.116665,02009
Frankfurt am Main
Franz-Kafka-Heft 7. [die Oxforder Oktavhefte 5 und 6 ; zur Einführung]8.683333,50.116665,02009
Weilerswist
Der Prozess6.8333335,50.766666,02009
Frankfurt am Main
Franz-Kafka-Heft 6. [Die Oxforder Oktavhefte 3 und 4 ; zur Einführung]8.683333,50.116665,02008
Frankfurt am Main
Oxforder Oktavheft 48.683333,50.116665,02008
Frankfurt am Main
Oxforder Oktavheft 38.683333,50.116665,02008
Düsseldorf
Die Erzählungen . Drucke zu Lebzeiten aus dem Nachlass6.776161,51.22172,02008
Frankfurt am Main
Brief an den Vater8.683333,50.116665,02008
Stuttgart
Erzählungen9.177017,48.782326,02006
Frankfurt am Main
Franz-Kafka-Heft 5. [zur kritischen Edition der ersten beiden OxforderQuarthefte]8.683333,50.116665,02006
Frankfurt am Main
Oxforder Oktavheft 28.683333,50.116665,02006
Frankfurt am Main
Oxforder Oktavheft 18.683333,50.116665,02006
Frankfurt am Main
In der Strafkolonie. [Text und Kommentar]8.683333,50.116665,02006
Weilerswist
Franz Kafka und sein Roman-Fragment 'Der Prozess'6.8333335,50.766666,02005
Frankfurt am Main
April 1914 - 19178.683333,50.116665,02005
Frankfurt am Main
April 1914 - 19178.683333,50.116665,02005
Frankfurt am Main
Amtliche Schriften8.683333,50.116665,02004
New York
The Metamorphosis-74.005974,40.714268,02003
Frankfurt am Main
Oxforder Quartheft 17. [Original-Manuskript]8.683333,50.116665,02003
Basel
Franz-Kafka-Heft 47.6,47.566666,02003
Frankfurt
Das Urteil und andere Erzählungen ; [Text und Kommentar]8.683333,50.116665,02003
Frankfurt am Main
Reisetagebücher. In der Fassung der Handschrift8.683333,50.116665,02003
Frankfurt am Main
Oxforder Quartheft 28.683333,50.116665,02001
Frankfurt am Main
Oxforder Quartheft 18.683333,50.116665,02001
Frankfurt am Main
Franz-Kafka-Heft 3. [zur kritischen Edition der ersten beiden OxforderQuarthefte]8.683333,50.116665,02001
Frankfurt am Main
1913 - März 19148.683333,50.116665,02001
Frankfurt am Main
Der Prozeß. Roman ; [Text und Kommentar]8.683333,50.116665,02000
Frankfurt am Main
1913 - März 19148.683333,50.116665,01999
Frankfurt am Main
Die Verwandlung. [Text und Kommentar]8.683333,50.116665,01999
Frankfurt am Main
1900 - 19128.683333,50.116665,01999
Frankfurt am Main
Briefe. [kommentierte Ausgabe]8.683333,50.116665,01999
Frankfurt am Main
1900 - 19128.683333,50.116665,01999
Frankfurt am Main
Franz-Kafka-Hefte 28.683333,50.116665,01999
Frankfurt am Main
Beschreibung eines Kampfes8.683333,50.116665,01999
Frankfurt am Main
Gegen zwölf Uhr [...]8.683333,50.116665,01999
Frankfurt am Main
Briefe an Milena8.683333,50.116665,01998
Kopenhagen
Drømme. Udvalgt, oversat og med forord af Villy Sørensen12.570934,55.67768,01998
Basel
Franz-Kafka-Hefte 17.6,47.566666,01997
Basel
Ende7.6,47.566666,01997
Basel
Kampf mit Dir Stellv.7.6,47.566666,01997
Basel
Als sie aus dem Teater traten [...]7.6,47.566666,01997
Basel
Staatsanwalt7.6,47.566666,01997
Basel
Das Haus7.6,47.566666,01997
Basel
Fahrt zur Mutter7.6,47.566666,01997
Basel
B's Freundin7.6,47.566666,01997
Basel
Der Prügler7.6,47.566666,01997
Basel
Zu Elsa7.6,47.566666,01997
Basel
Erste Untersuchung7.6,47.566666,01997
Basel
Jemand musste Josef K. verläumdet haben [...]7.6,47.566666,01997
Basel
Im leeren Sitzungssaal, der Student, die Kanzleien7.6,47.566666,01997
Basel
Advokat, Fabrikant, Maler7.6,47.566666,01997
Basel
Kaufmann Beck, Kündigung des Advokaten7.6,47.566666,01997
Basel
Der Onkel, Leni7.6,47.566666,01997
Basel
Im Dom7.6,47.566666,01997
Frankfurt am Main
Briefe an Felice und andere Korrespondenz aus der Verlobungszeit8.683333,50.116665,01995
Basel
Drei Briefe an Milena Jesenská vom Sommer 19207.6,47.566666,01995
Basel
Einleitung7.6,47.566666,01995
Basel
Historisch-kritische Ausgabe sämtlicher Handschriften, Drucke undTyposkripte. Eine Edition des Instituts für Textkritik e.V.7.6,47.566666,01995
Frankfurt am Main
Tagebücher. Band 1: 1909 - 1912 ; in der Fassung der Handschrift8.683333,50.116665,01994
Frankfurt am Main
Tagebücher. Band 3: 1914 - 1923 ; in der Fassung der Handschrift8.683333,50.116665,01994
Frankfurt am Main
Tagebücher. Band 2: 1912 - 1914 ; in der Fassung der Handschrift8.683333,50.116665,01994
Frankfurt am Main
Das Ehepaar. Und andere Schriften aus dem Nachlass ; in der Fassung derHandschrift8.683333,50.116665,01994
Frankfurt am Main
Zur Frage der Gesetze. Und andere Schriften aus dem Nachlass ; in derFassung der Handschrift8.683333,50.116665,01994
Frankfurt am Main
Beim Bau der chinesischen Mauer. Und andere Schriften aus dem Nachlaß ; inder Fassung der Handschrift8.683333,50.116665,01994
Frankfurt am Main
Beschreibung eines Kampfes. Und andere Schriften aus dem Nachlaß ; in derFassung der Handschrift8.683333,50.116665,01994
Frankfurt am Main
Das Schloss. Roman ; in der Fassung der Handschrift8.683333,50.116665,01994
Frankfurt am Main
Der Proceß. Roman ; in der Fassung der Handschrift8.683333,50.116665,01994
Frankfurt am Main
Der Verschollene. Roman ; in der Fassung der Handschrift8.683333,50.116665,01994
Frankfurt am Main
Ein Landarzt. Und andere Drucke zu Lebzeiten8.683333,50.116665,01994
Frankfurt am Main
Gesammelte Werke. In zwölf Bänden8.683333,50.116665,01994
Frankfurt am Main
Brief an den Vater8.683333,50.116665,01994
Frankfurt am Main
Apparatband8.683333,50.116665,01992
Frankfurt am Main
Tagebücher. In der Fassung der Handschrift8.683333,50.116665,01990
Frankfurt am Main
Briefe an die Eltern aus den Jahren 1922 - 19248.683333,50.116665,01990
Berlin
Amtliche Schriften13.4,52.516666,01984
Tallinn
Öösel24.753529,59.43696,01983
Frankfurt am Main
Schriften, Tagebücher, Briefe. Kritische Ausgabe8.683333,50.116665,01982
Frankfurt am Main
Brief an den Vater8.683333,50.116665,01981
Frankfurt am Main
Beschreibung eines Kampfes. Novellen, Skizzen, Aphorismen, aus demNachlass8.683333,50.116665,01980
Frankfurt am Main
Hochzeitsvorbereitungen auf dem Lande und andere Prosa aus dem Nachlass8.683333,50.116665,01980
Leipzig
Erzählungen. [1928 - 1978]12.371292,51.33962,01978
Berlin
In der Strafkolonie. Eine Geschichte aus dem Jahre 1914; mit Quellen ,Abb., Materialien aus d. Arbeiter-Unfall-Versicherungsanstalt, Chronik undAnm. von Klaus Wagenbach13.4,52.516666,01975
Frankfurt am Main
Beschreibung eines Kampfes. Die zwei Fassungen ; Parallelausgabe nach denHandschriften8.683333,50.116665,01969
München
Franz Kafka11.575491,48.137432,01969
Frankfurt am Main
Briefe an Felice und andere Korrespondenz aus der Verlobungszeit8.683333,50.116665,01967
Frankfurt am Main
Erzählungen8.683333,50.116665,01967
Frankfurt am Main
Briefe an Felice und andere Korrespondenz aus der Verlobungszeit8.683333,50.116665,01967
Frankfurt am Main
Hochzeitsvorbereitungen auf dem Lande. Und andere Prosa aus dem Nachlass ;[Fragmente]8.683333,50.116665,01966
Frankfurt am Main
Amerika. Roman8.683333,50.116665,01966
Frankfurt am Main
Erzählungen8.683333,50.116665,01965
Frankfurt am Main
Der Prozess. Roman8.683333,50.116665,01965
Frankfurt am Main
Briefe an Milena8.683333,50.116665,01965
Frankfurt am Main
Das Schloss. Roman8.683333,50.116665,01964
Frankfurt am Main
Die Erzählungen8.683333,50.116665,01961
Frankfurt am Main
Der Prozess. Roman8.683333,50.116665,01960
Frankfurt am Main
Der Prozeß. Roman8.683333,50.116665,01960
München
Brief an den Vater11.575491,48.137432,01960
Frankfurt am Main
Briefe 1902 - 19248.683333,50.116665,01958
Frankfurt am Main
Tagebücher 1910 - 19238.683333,50.116665,01954
Frankfurt
Das Urteil und andere Erzählungen8.683333,50.116665,01953
Frankfurt am Main
Amerika. Roman8.683333,50.116665,01953
Frankfurt am Main
Tagebücher 1910 - 19238.683333,50.116665,01951
Frankfurt am Main
Das Schloss. Roman8.683333,50.116665,01951
Frankfurt
Das Schloss. Roman8.683333,50.116665,01951
New York
1914-1923-74.005974,40.714268,01949
New York
1910-1913-74.005974,40.714268,01949
London
1914 - 1923-0.12553275,51.508415,01949
New York
The diaries-74.005974,40.714268,01948
Paris
Le procès. Pièce tirée du roman de Kafka2.3488,48.85341,01948
Frankfurt am Main
Tagebücher 1910 - 19238.683333,50.116665,01948
London
1910 - 1913-0.12553275,51.508415,01948
Weimar
Beim Bau der Chinesischen Mauer11.316667,50.983334,01948
London
The diaries of Franz Kafka-0.12553275,51.508415,01948
Lausanne
Journal intime. Suivi de esquisse d'une autobiographie, considérationssur le péch méditations6.632824,46.515995,01946
Frankfurt am Main
Gesammelte Werke8.683333,50.116665,01946
München
Amerika. Roman11.575491,48.137432,01927
München
Das Schloss. Roman11.575491,48.137432,01926
Berlin
Der Prozeß. Roman13.4,52.516666,01925
Berlin
Ein Hungerkünstler. Vier Geschichten13.4,52.516666,01924
Leipzig
In der Strafkolonie12.371292,51.33962,01919
München
Ein Landarzt. Kleine Erzählungen11.575491,48.137432,01919
Leipzig
Die Verwandlung12.371292,51.33962,01917
Leipzig
Das Urteil. Eine Geschichte12.371292,51.33962,01916
Leipzig
Der Heizer. Ein Fragment12.371292,51.33962,01913
\ No newline at end of file diff --git a/geotemco-min.js b/geotemco-min.js new file mode 100644 index 0000000..05f893b --- /dev/null +++ b/geotemco-min.js @@ -0,0 +1,2 @@ +/* jQuery v1.7.2 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement){cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+""),cl.close()}d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border"){for(;e=0===c})}function S(a){return !a||!a.parentNode||a.parentNode.nodeType===11}function K(){return !0}function J(){return !1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b])){continue}if(b!=="toJSON"){return !1}}return !0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else{d=b}}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a){return this}if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2]){return f.find(a)}this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return !d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a)){return f.ready(a)}a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0){return}A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete"){return setTimeout(e.ready,1)}if(c.addEventListener){c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1)}else{if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return !isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a)){return !1}try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf")){return !1}}catch(c){return !1}var d;for(d in a){}return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a){return !1}return !0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b){return null}b=e.trim(b);if(a.JSON&&a.JSON.parse){return a.JSON.parse(b)}if(n.test(b.replace(o,"@").replace(p,"]").replace(q,""))){return(new Function("return "+b))()}e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c){return null}var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a){if(c.apply(a[f],d)===!1){break}}}else{for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k){for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e){return{}}g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent){for(n in {submit:1,change:1,focusin:1}){m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o}}j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="
",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="
t
",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="
",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return !!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b){return}n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function"){e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c)}g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c]){return g.events}k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k]){return}if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a)){return this.each(function(b){f(this).addClass(a.call(this,b,this.className))})}if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c-1){return !0}}return !1},val:function(a){var c,d,e,g=this[0];if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set" in c)||c.set(this,h,"value")===b){this.value=h}}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get" in c&&(d=c.get(g,"value"))!==b){return d}d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return !b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0){return null}c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn){return f(a)[c](d)}if(typeof a.getAttribute=="undefined"){return f.prop(a,c,d)}i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set" in h&&i&&(g=h.set(a,d,c))!==b){return g}a.setAttribute(c,""+d);return d}if(h&&"get" in h&&i&&(g=h.get(a,c))!==null){return g}g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i=0}}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h]){return}c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j){j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0)}return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1){return}r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode){r.push([m,s]),n=m}n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9){return[]}if(!b||typeof b!="string"){return e}var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b)){if(w.length===2&&o.relative[w[0]]){j=y(w[0]+w[1],d,f)}else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length){b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}}}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length){q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}}else{k=w=[]}}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]"){if(!u){e.push.apply(e,k)}else{if(d&&d.nodeType===1){for(t=0;k[t]!=null;t++){k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t])}}else{for(t=0;k[t]!=null;t++){k[t]&&k[t].nodeType===1&&e.push(j[t])}}}}else{s(k,e)}l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h){for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a){return[]}for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1))}return !1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else{a[2]&&m.error(a[0])}a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not"){if((a.exec(b[3])||"").length>1||/^\w/.test(b[3])){b[3]=m(b[3],null,null,c)}else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return !1}}else{if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0])){return !0}}return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return !!a.firstChild},empty:function(a){return !a.firstChild},has:function(a,b,c){return !!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f){return f(a,c,b,d)}if(e==="contains"){return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0}if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f){return f(a,c,b,d)}}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match){o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q))}o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]"){Array.prototype.push.apply(d,a)}else{if(typeof a.length=="number"){for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++){c[e].nodeType===1&&d.push(c[e])}c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1]){return s(e.getElementsByTagName(b),f)}if(h[2]&&o.find.CLASS&&e.getElementsByClassName){return s(e.getElementsByClassName(h[2]),f)}}if(e.nodeType===9){if(b==="body"&&e.body){return s([e.body],f)}if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode){return s([],f)}if(i.id===h[3]){return s([i],f)}}try{return s(e.querySelectorAll(b),f)}catch(j){}}else{if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p){return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}}catch(r){}finally{l||k.removeAttribute("id")}}}}return a(b,e,f,g)};for(var e in a){m[e]=a[e]}b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a)){try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11){return f}}}catch(g){}}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1){return}o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c){return b.getElementsByClassName(a[1])}},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return !!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return !1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a)){f+=d[0],a=a.replace(o.match.PSEUDO,"")}a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0){for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11){break}}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a){return this[0]&&this[0].parentNode?this.prevAll().length:-1}if(typeof a=="string"){return f.inArray(this[0],f(a))}return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d))){g.nodeType===1&&e.push(g),g=g[c]}return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c]){if(a.nodeType===1&&++e===b){break}}return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling){a.nodeType===1&&a!==b&&c.push(a)}return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a)){return this.each(function(b){f(this).wrapAll(a.call(this,b))})}if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1){a=a.firstChild}return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a)){return this.each(function(b){f(this).wrapInner(a.call(this,b))})}return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)})}if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode){return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)})}if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++){if(!a||f.filter(a,[d]).length){!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d)}}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild){b.removeChild(b.firstChild)}}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b){return c.nodeType===1?c.innerHTML.replace(W,""):null}if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(;d1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g){e[g]&&bk(d[g],e[g])}}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g){bj(d[g],e[g])}}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l){continue}if(typeof l=="string"){if(!_.test(l)){l=b.createTextNode(l)}else{l=l.replace(Y,"<$1>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--){p=p.lastChild}if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]===""&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i){f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}}var u;if(!f.support.appendChecked){if(l[0]&&typeof(u=l.length)=="number"){for(i=0;i1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get" in k&&(g=k.get(a,!1,e))!==b){return g}return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d)){return}h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set" in k)||(d=k.set(a,d))!==b){try{j[c]=d}catch(l){}}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get" in g&&(e=g.get(a,!0,d))!==b){return e}if(by){return by(a,c)}},swap:function(a,b,c){var d={},e,f;for(f in b){d[f]=a.style[f],a.style[f]=b[f]}e=c.call(a);for(f in b){a.style[f]=d[f]}return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c){return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})}},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter){return}}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return !f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++){f[a+bx[d]+b]=e[d]||e[d-2]||e[0]}return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR){return bR.apply(this,arguments)}if(!this.length){return this}var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified")){f.lastModified[k]=y}if(z=v.getResponseHeader("Etag")){f.etag[k]=z}}if(a===304){w="notmodified",o=!0}else{try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}}else{u=w;if(!w||a){w="error",a<0&&(a=0)}}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n)){o[c[1].toLowerCase()]=c[2]}}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2){for(b in a){j[b]=[j[b],a[b]]}}else{b=a[v.status],v.then(b,b)}}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2){return !1}t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers){v.setRequestHeader(u,d.headers[u])}if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return !1}for(u in {success:1,error:1,complete:1}){v[u](d[u])}p=bZ(bT,d,c,v);if(!p){w(-1,"No Transport")}else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2){w(-1,z)}else{throw z}}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a)){f.each(a,function(){e(this.name,this.value)})}else{for(var g in a){b_(g,a[g],c,e)}}return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState)){d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")}},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg){cg[a](0,1)}}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return !this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials" in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields){for(j in c.xhrFields){h[j]=c.xhrFields[j]}}c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e){h.setRequestHeader(j,e[j])}}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e){h.readyState!==4&&h.abort()}else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0){return this.animate(ct("show",3),a,b,c)}for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties){i.animatedProperties[b]!==!0&&(g=!1)}if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show){for(b in i.animatedProperties){f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0)}}d=i.complete,d&&(i.complete=!1,d.call(h))}return !1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return !0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using" in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0]){return null}var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static"){a=a.offsetParent}return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b){return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e]}h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e]){return i[d]}return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);var arrayIndex=function(c,b){if(Array.indexOf){return c.indexOf(b)}for(var a=0;a','","");this.element_.insertAdjacentHTML("BeforeEnd",ac.join(""))};l.stroke=function(ah){var M=[];var N=false;var at=c(ah?this.fillStyle:this.strokeStyle);var ad=at.color;var an=at.alpha*this.globalAlpha;var J=10;var P=10;M.push("Z.x){Z.x=al.x}if(ar.y==null||al.yZ.y){Z.y=al.y}}}M.push(' ">');if(!ah){var Y=this.lineScale_*this.lineWidth;if(Y<1){an*=Y}M.push("')}else{if(typeof this.fillStyle=="object"){var Q=this.fillStyle;var V=0;var ak={x:0,y:0};var ae=0;var T=1;if(Q.type_=="gradient"){var S=Q.x0_/this.arcScaleX_;var m=Q.y0_/this.arcScaleY_;var R=Q.x1_/this.arcScaleX_;var au=Q.y1_/this.arcScaleY_;var ap=this.getCoords_(S,m);var ao=this.getCoords_(R,au);var L=ao.x-ap.x;var K=ao.y-ap.y;V=Math.atan2(L,K)*180/Math.PI;if(V<0){V+=360}if(V<0.000001){V=0}}else{var ap=this.getCoords_(Q.x0_,Q.y0_);var j=Z.x-ar.x;var I=Z.y-ar.y;ak={x:(ap.x-ar.x)/j,y:(ap.y-ar.y)/I};j/=this.arcScaleX_*a;I/=this.arcScaleY_*a;var aj=w.max(j,I);ae=2*Q.r0_/aj;T=2*Q.r1_/aj-ae}var ac=Q.colors_;ac.sort(function(W,H){return W.offset-H.offset});var X=ac.length;var ab=ac[0].color;var aa=ac[X-1].color;var ag=ac[0].alpha*this.globalAlpha;var af=ac[X-1].alpha*this.globalAlpha;var ai=[];for(var am=0;am')}else{M.push('')}}M.push("");this.element_.insertAdjacentHTML("beforeEnd",M.join(""))};l.fill=function(){this.stroke(true)};l.closePath=function(){this.currentPath_.push({type:"close"})};l.getCoords_=function(I,H){var j=this.m_;return{x:a*(I*j[0][0]+H*j[1][0]+j[2][0])-p,y:a*(I*j[0][1]+H*j[1][1]+j[2][1])-p}};l.save=function(){var j={};y(this,j);this.aStack_.push(j);this.mStack_.push(this.m_);this.m_=d(s(),this.m_)};l.restore=function(){y(this.aStack_.pop(),this);this.m_=this.mStack_.pop()};function g(H){for(var J=0;J<3;J++){for(var I=0;I<2;I++){if(!isFinite(H[J][I])||isNaN(H[J][I])){return false}}}return true}function C(H,j,I){if(!g(j)){return}H.m_=j;if(I){var J=j[0][0]*j[1][1]-j[0][1]*j[1][0];H.lineScale_=E(o(J))}}l.translate=function(H,m){var j=[[1,0,0],[0,1,0],[H,m,1]];C(this,d(j,this.m_),false)};l.rotate=function(m){var I=F(m);var H=t(m);var j=[[I,H,0],[-H,I,0],[0,0,1]];C(this,d(j,this.m_),false)};l.scale=function(H,m){this.arcScaleX_*=H;this.arcScaleY_*=m;var j=[[H,0,0],[0,m,0],[0,0,1]];C(this,d(j,this.m_),true)};l.transform=function(J,I,L,K,m,j){var H=[[J,I,0],[L,K,0],[m,j,1]];C(this,d(H,this.m_),true)};l.setTransform=function(K,J,M,L,I,H){var j=[[K,J,0],[M,L,0],[I,H,1]];C(this,j,true)};l.clip=function(){};l.arcTo=function(){};l.createPattern=function(){return new f};function B(j){this.type_=j;this.x0_=0;this.y0_=0;this.r0_=0;this.x1_=0;this.y1_=0;this.r1_=0;this.colors_=[]}B.prototype.addColorStop=function(m,j){j=c(j);this.colors_.push({offset:m,color:j.color,alpha:j.alpha})};function f(){}G_vmlCanvasManager=k;CanvasRenderingContext2D=r;CanvasGradient=B;CanvasPattern=f})()}SimileAjax_urlPrefix=GeoTemCoMinifier_urlPrefix+"lib/simile/ajax/";if(typeof window.SimileAjax=="undefined"){window.SimileAjax={loadingScriptsCount:0,error:null,params:{bundle:"true"}};SimileAjax.Platform=new Object();SimileAjax.includeCssFile=function(c,a){var b=c.createElement("link");b.setAttribute("rel","stylesheet");b.setAttribute("type","text/css");b.setAttribute("href",a);c.getElementsByTagName("head")[0].appendChild(b)};SimileAjax.urlPrefix=SimileAjax_urlPrefix}SimileAjax.version="2.2.1";SimileAjax.jQuery=jQuery.noConflict(true);if(typeof window["$"]=="undefined"){window.$=SimileAjax.jQuery}SimileAjax.Platform.os={isMac:false,isWin:false,isWin32:false,isUnix:false};SimileAjax.Platform.browser={isIE:false,isNetscape:false,isMozilla:false,isFirefox:false,isOpera:false,isSafari:false,majorVersion:0,minorVersion:0};(function(){var c=navigator.appName.toLowerCase();var a=navigator.userAgent.toLowerCase();SimileAjax.Platform.os.isMac=(a.indexOf("mac")!=-1);SimileAjax.Platform.os.isWin=(a.indexOf("win")!=-1);SimileAjax.Platform.os.isWin32=SimileAjax.Platform.isWin&&(a.indexOf("95")!=-1||a.indexOf("98")!=-1||a.indexOf("nt")!=-1||a.indexOf("win32")!=-1||a.indexOf("32bit")!=-1);SimileAjax.Platform.os.isUnix=(a.indexOf("x11")!=-1);SimileAjax.Platform.browser.isIE=(c.indexOf("microsoft")!=-1);SimileAjax.Platform.browser.isNetscape=(c.indexOf("netscape")!=-1);SimileAjax.Platform.browser.isMozilla=(a.indexOf("mozilla")!=-1);SimileAjax.Platform.browser.isFirefox=(a.indexOf("firefox")!=-1);SimileAjax.Platform.browser.isOpera=(c.indexOf("opera")!=-1);SimileAjax.Platform.browser.isSafari=(c.indexOf("safari")!=-1);var e=function(g){var f=g.split(".");SimileAjax.Platform.browser.majorVersion=parseInt(f[0]);SimileAjax.Platform.browser.minorVersion=parseInt(f[1])};var b=function(h,g,j){var f=h.indexOf(g,j);return f>=0?f:h.length};if(SimileAjax.Platform.browser.isMozilla){var d=a.indexOf("mozilla/");if(d>=0){e(a.substring(d+8,b(a," ",d)))}}if(SimileAjax.Platform.browser.isIE){var d=a.indexOf("msie ");if(d>=0){e(a.substring(d+5,b(a,";",d)))}}if(SimileAjax.Platform.browser.isNetscape){var d=a.indexOf("rv:");if(d>=0){e(a.substring(d+3,b(a,")",d)))}}if(SimileAjax.Platform.browser.isFirefox){var d=a.indexOf("firefox/");if(d>=0){e(a.substring(d+8,b(a," ",d)))}}if(!("localeCompare" in String.prototype)){String.prototype.localeCompare=function(f){if(thisf){return 1}else{return 0}}}}})();SimileAjax.Platform.getDefaultLocale=function(){return SimileAjax.Platform.clientLocale};SimileAjax.Debug={silent:false};SimileAjax.Debug.log=function(b){var a;if("console" in window&&"log" in window.console){a=function(c){console.log(c)}}else{a=function(c){if(!SimileAjax.Debug.silent){alert(c)}}}SimileAjax.Debug.log=a;a(b)};SimileAjax.Debug.warn=function(b){var a;if("console" in window&&"warn" in window.console){a=function(c){console.warn(c)}}else{a=function(c){if(!SimileAjax.Debug.silent){alert(c)}}}SimileAjax.Debug.warn=a;a(b)};SimileAjax.Debug.exception=function(b,d){var a,c=SimileAjax.parseURLParameters();if(c.errors=="throw"||SimileAjax.params.errors=="throw"){a=function(f,e){throw (f)}}else{if("console" in window&&"error" in window.console){a=function(f,e){if(e!=null){console.error(e+" %o",f)}else{console.error(f)}throw (f)}}else{a=function(f,e){if(!SimileAjax.Debug.silent){alert("Caught exception: "+e+"\n\nDetails: "+("description" in f?f.description:f))}throw (f)}}}SimileAjax.Debug.exception=a;a(b,d)};SimileAjax.Debug.objectToString=function(a){return SimileAjax.Debug._objectToString(a,"")};SimileAjax.Debug._objectToString=function(d,a){var c=a+" ";if(typeof d=="object"){var b="{";for(e in d){b+=c+e+": "+SimileAjax.Debug._objectToString(d[e],c)+"\n"}b+=a+"}";return b}else{if(typeof d=="array"){var b="[";for(var e=0;e-1){a=a.replace("px","")}if(c.indexOf("px")>-1){c=c.replace("px","")}return{w:a,h:c}};SimileAjax.DOM.getStyle=function(b,a){if(b.currentStyle){var c=b.currentStyle[a]}else{if(window.getComputedStyle){var c=document.defaultView.getComputedStyle(b,null).getPropertyValue(a)}else{var c=""}}return c};SimileAjax.DOM.getEventRelativeCoordinates=function(a,b){if(SimileAjax.Platform.browser.isIE){if(a.type=="mousewheel"){var c=SimileAjax.DOM.getPageCoordinates(b);return{x:a.clientX-c.left,y:a.clientY-c.top}}else{return{x:a.offsetX,y:a.offsetY}}}else{var c=SimileAjax.DOM.getPageCoordinates(b);if((a.type=="DOMMouseScroll")&&SimileAjax.Platform.browser.isFirefox&&(SimileAjax.Platform.browser.majorVersion==2)){return{x:a.screenX-c.left,y:a.screenY-c.top}}else{return{x:a.pageX-c.left,y:a.pageY-c.top}}}};SimileAjax.DOM.getEventPageCoordinates=function(a){if(SimileAjax.Platform.browser.isIE){return{x:a.clientX+document.body.scrollLeft,y:a.clientY+document.body.scrollTop}}else{return{x:a.pageX,y:a.pageY}}};SimileAjax.DOM.hittest=function(a,c,b){return SimileAjax.DOM._hittest(document.body,a,c,b)};SimileAjax.DOM._hittest=function(c,o,m,h){var p=c.childNodes;outer:for(var g=0;g";return b.firstChild};SimileAjax.DOM.createDOMFromTemplate=function(b){var a={};a.elmt=SimileAjax.DOM._createDOMFromTemplate(b,a,null);return a};SimileAjax.DOM._createDOMFromTemplate=function(a,j,e){if(a==null){return null}else{if(typeof a!="object"){var d=document.createTextNode(a);if(e!=null){e.appendChild(d)}return d}else{var c=null;if("tag" in a){var k=a.tag;if(e!=null){if(k=="tr"){c=e.insertRow(e.rows.length)}else{if(k=="td"){c=e.insertCell(e.cells.length)}}}if(c==null){c=k=="input"?SimileAjax.DOM.createInputElement(a.type):document.createElement(k);if(e!=null){e.appendChild(c)}}}else{c=a.elmt;if(e!=null){e.appendChild(c)}}for(var b in a){var g=a[b];if(b=="field"){j[g]=c}else{if(b=="className"){c.className=g}else{if(b=="id"){c.id=g}else{if(b=="title"){c.title=g}else{if(b=="type"&&c.tagName=="input"){}else{if(b=="style"){for(n in g){var h=g[n];if(n=="float"){n=SimileAjax.Platform.browser.isIE?"styleFloat":"cssFloat"}c.style[n]=h}}else{if(b=="children"){for(var f=0;f0){a.removeAttribute("id");if(e in b){var c=a.parentNode;c.insertBefore(b[e],a);c.removeChild(a);d[e]=b[e];return}else{d[e]=a}}if(a.hasChildNodes()){SimileAjax.DOM._processDOMChildrenConstructedFromString(d,a,b)}};SimileAjax.DOM._processDOMChildrenConstructedFromString=function(e,b,d){var c=b.firstChild;while(c!=null){var a=c.nextSibling;if(c.nodeType==1){SimileAjax.DOM._processDOMConstructedFromString(e,c,d)}c=a}};SimileAjax.Graphics=new Object();SimileAjax.Graphics.pngIsTranslucent=(!SimileAjax.Platform.browser.isIE)||(SimileAjax.Platform.browser.majorVersion>6);if(!SimileAjax.Graphics.pngIsTranslucent){SimileAjax.includeCssFile(document,SimileAjax.urlPrefix+"styles/graphics-ie6.css")}SimileAjax.Graphics._createTranslucentImage1=function(a,c){var b=document.createElement("img");b.setAttribute("src",a);if(c!=null){b.style.verticalAlign=c}return b};SimileAjax.Graphics._createTranslucentImage2=function(a,c){var b=document.createElement("img");b.style.width="1px";b.style.height="1px";b.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a+"', sizingMethod='image')";b.style.verticalAlign=(c!=null)?c:"middle";return b};SimileAjax.Graphics.createTranslucentImage=SimileAjax.Graphics.pngIsTranslucent?SimileAjax.Graphics._createTranslucentImage1:SimileAjax.Graphics._createTranslucentImage2;SimileAjax.Graphics._createTranslucentImageHTML1=function(a,b){return'"};SimileAjax.Graphics._createTranslucentImageHTML2=function(a,c){var b="width: 1px; height: 1px; filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a+"', sizingMethod='image');"+(c!=null?" vertical-align: "+c+";":"");return"'};SimileAjax.Graphics.createTranslucentImageHTML=SimileAjax.Graphics.pngIsTranslucent?SimileAjax.Graphics._createTranslucentImageHTML1:SimileAjax.Graphics._createTranslucentImageHTML2;SimileAjax.Graphics.setOpacity=function(b,a){if(SimileAjax.Platform.browser.isIE){b.style.filter="progid:DXImageTransform.Microsoft.Alpha(Style=0,Opacity="+a+")"}else{var c=(a/100).toString();b.style.opacity=c;b.style.MozOpacity=c}};SimileAjax.Graphics.bubbleConfig={containerCSSClass:"simileAjax-bubble-container",innerContainerCSSClass:"simileAjax-bubble-innerContainer",contentContainerCSSClass:"simileAjax-bubble-contentContainer",borderGraphicSize:50,borderGraphicCSSClassPrefix:"simileAjax-bubble-border-",arrowGraphicTargetOffset:33,arrowGraphicLength:100,arrowGraphicWidth:49,arrowGraphicCSSClassPrefix:"simileAjax-bubble-arrow-",closeGraphicCSSClass:"simileAjax-bubble-close",extraPadding:20};SimileAjax.Graphics.createBubbleForContentAndPoint=function(f,d,c,a,b,e){if(typeof a!="number"){a=300}if(typeof e!="number"){e=0}f.style.position="absolute";f.style.left="-5000px";f.style.top="0px";f.style.width=a+"px";document.body.appendChild(f);window.setTimeout(function(){var k=f.scrollWidth+10;var g=f.scrollHeight+10;var j=0;if(e>0&&g>e){g=e;j=k-25}var h=SimileAjax.Graphics.createBubbleForPoint(d,c,k,g,b);document.body.removeChild(f);f.style.position="static";f.style.left="";f.style.top="";if(j>0){var l=document.createElement("div");f.style.width="";l.style.width=j+"px";l.appendChild(f);h.content.appendChild(l)}else{f.style.width=k+"px";h.content.appendChild(f)}},200)};SimileAjax.Graphics.createBubbleForPoint=function(b,a,l,o,d){l=parseInt(l,10);o=parseInt(o,10);var e=SimileAjax.Graphics.bubbleConfig;var p=SimileAjax.Graphics.pngIsTranslucent?"pngTranslucent":"pngNotTranslucent";var m=l+2*e.borderGraphicSize;var r=o+2*e.borderGraphicSize;var q=function(u){return u+" "+u+"-"+p};var h=document.createElement("div");h.className=q(e.containerCSSClass);h.style.width=l+"px";h.style.height=o+"px";var f=document.createElement("div");f.className=q(e.innerContainerCSSClass);h.appendChild(f);var j=function(){if(!k._closed){document.body.removeChild(k._div);k._doc=null;k._div=null;k._content=null;k._closed=true}};var k={_closed:false};var t=SimileAjax.WindowManager.pushLayer(j,true,h);k._div=h;k.close=function(){SimileAjax.WindowManager.popLayer(t)};var g=function(v){var u=document.createElement("div");u.className=q(e.borderGraphicCSSClassPrefix+v);f.appendChild(u)};g("top-left");g("top-right");g("bottom-left");g("bottom-right");g("left");g("right");g("top");g("bottom");var c=document.createElement("div");c.className=q(e.contentContainerCSSClass);f.appendChild(c);k.content=c;var s=document.createElement("div");s.className=q(e.closeGraphicCSSClass);f.appendChild(s);SimileAjax.WindowManager.registerEventWithObject(s,"click",k,"close");(function(){var B=SimileAjax.Graphics.getWindowDimensions();var w=B.w;var u=B.h;var x=Math.ceil(e.arrowGraphicWidth/2);var A=function(C){var D=document.createElement("div");D.className=q(e.arrowGraphicCSSClassPrefix+"point-"+C);f.appendChild(D);return D};if(b-x-e.borderGraphicSize-e.extraPadding>0&&b+x+e.borderGraphicSize+e.extraPadding0))){var v=A("down");v.style.left=(b-x-z)+"px";h.style.left=z+"px";h.style.top=(a-e.arrowGraphicTargetOffset-o)+"px";return}else{if((d&&d=="bottom")||(!d&&(a+e.arrowGraphicTargetOffset+o+e.borderGraphicSize+e.extraPadding0))){var v=A("right");v.style.top=(a-x-y)+"px";h.style.top=y+"px";h.style.left=(b-e.arrowGraphicTargetOffset-l)+"px"}else{var v=A("left");v.style.top=(a-x-y)+"px";h.style.top=y+"px";h.style.left=(b+e.arrowGraphicTargetOffset)+"px"}})();document.body.appendChild(h);return k};SimileAjax.Graphics.getWindowDimensions=function(){if(typeof window.innerHeight=="number"){return{w:window.innerWidth,h:window.innerHeight}}else{if(document.documentElement&&document.documentElement.clientHeight){return{w:document.documentElement.clientWidth,h:document.documentElement.clientHeight}}else{if(document.body&&document.body.clientHeight){return{w:document.body.clientWidth,h:document.body.clientHeight}}}}};SimileAjax.Graphics.createMessageBubble=function(h){var g=h.createElement("div");if(SimileAjax.Graphics.pngIsTranslucent){var j=h.createElement("div");j.style.height="33px";j.style.background="url("+SimileAjax.urlPrefix+"images/message-top-left.png) top left no-repeat";j.style.paddingLeft="44px";g.appendChild(j);var c=h.createElement("div");c.style.height="33px";c.style.background="url("+SimileAjax.urlPrefix+"images/message-top-right.png) top right no-repeat";j.appendChild(c);var f=h.createElement("div");f.style.background="url("+SimileAjax.urlPrefix+"images/message-left.png) top left repeat-y";f.style.paddingLeft="44px";g.appendChild(f);var a=h.createElement("div");a.style.background="url("+SimileAjax.urlPrefix+"images/message-right.png) top right repeat-y";a.style.paddingRight="44px";f.appendChild(a);var d=h.createElement("div");a.appendChild(d);var b=h.createElement("div");b.style.height="55px";b.style.background="url("+SimileAjax.urlPrefix+"images/message-bottom-left.png) bottom left no-repeat";b.style.paddingLeft="44px";g.appendChild(b);var e=h.createElement("div");e.style.height="55px";e.style.background="url("+SimileAjax.urlPrefix+"images/message-bottom-right.png) bottom right no-repeat";b.appendChild(e)}else{g.style.border="2px solid #7777AA";g.style.padding="20px";g.style.background="white";SimileAjax.Graphics.setOpacity(g,90);var d=h.createElement("div");g.appendChild(d)}return{containerDiv:g,contentDiv:d}};SimileAjax.Graphics.createAnimation=function(b,e,d,c,a){return new SimileAjax.Graphics._Animation(b,e,d,c,a)};SimileAjax.Graphics._Animation=function(b,e,d,c,a){this.f=b;this.cont=(typeof a=="function")?a:function(){};this.from=e;this.to=d;this.current=e;this.duration=c;this.start=new Date().getTime();this.timePassed=0};SimileAjax.Graphics._Animation.prototype.run=function(){var b=this;window.setTimeout(function(){b.step()},50)};SimileAjax.Graphics._Animation.prototype.step=function(){this.timePassed+=50;var b=this.timePassed/this.duration;var a=-Math.cos(b*Math.PI)/2+0.5;var d=a*(this.to-this.from)+this.from;try{this.f(d,d-this.current)}catch(c){}this.current=d;if(this.timePassed";var b=g.firstChild;b.style.width=d+"px";b.style.height=a+"px";b.onmousedown=function(h){h=(h)?h:((event)?event:null);if(h.button==2){b.value=e();b.select()}};return g};SimileAjax.Graphics.getWidthHeight=function(c){var a,b;if(c.getBoundingClientRect==null){a=c.offsetWidth;b=c.offsetHeight}else{var d=c.getBoundingClientRect();a=Math.ceil(d.right-d.left);b=Math.ceil(d.bottom-d.top)}return{width:a,height:b}};SimileAjax.Graphics.getFontRenderingContext=function(a,b){return new SimileAjax.Graphics._FontRenderingContext(a,b)};SimileAjax.Graphics._FontRenderingContext=function(a,b){this._elmt=a;this._elmt.style.visibility="hidden";if(typeof b=="string"){this._elmt.style.width=b}else{if(typeof b=="number"){this._elmt.style.width=b+"px"}}};SimileAjax.Graphics._FontRenderingContext.prototype.dispose=function(){this._elmt=null};SimileAjax.Graphics._FontRenderingContext.prototype.update=function(){this._elmt.innerHTML="A";this._lineHeight=this._elmt.offsetHeight};SimileAjax.Graphics._FontRenderingContext.prototype.computeSize=function(d,c){var b=this._elmt;b.innerHTML=d;b.className=c===undefined?"":c;var a=SimileAjax.Graphics.getWidthHeight(b);b.className="";return a};SimileAjax.Graphics._FontRenderingContext.prototype.getLineHeight=function(){return this._lineHeight};SimileAjax.DateTime=new Object();SimileAjax.DateTime.MILLISECOND=0;SimileAjax.DateTime.SECOND=1;SimileAjax.DateTime.MINUTE=2;SimileAjax.DateTime.HOUR=3;SimileAjax.DateTime.DAY=4;SimileAjax.DateTime.WEEK=5;SimileAjax.DateTime.MONTH=6;SimileAjax.DateTime.YEAR=7;SimileAjax.DateTime.DECADE=8;SimileAjax.DateTime.CENTURY=9;SimileAjax.DateTime.MILLENNIUM=10;SimileAjax.DateTime.EPOCH=-1;SimileAjax.DateTime.ERA=-2;SimileAjax.DateTime.gregorianUnitLengths=[];(function(){var c=SimileAjax.DateTime;var b=c.gregorianUnitLengths;b[c.MILLISECOND]=1;b[c.SECOND]=1000;b[c.MINUTE]=b[c.SECOND]*60;b[c.HOUR]=b[c.MINUTE]*60;b[c.DAY]=b[c.HOUR]*24;b[c.WEEK]=b[c.DAY]*7;b[c.MONTH]=b[c.DAY]*31;b[c.YEAR]=b[c.DAY]*365;b[c.DECADE]=b[c.YEAR]*10;b[c.CENTURY]=b[c.YEAR]*100;b[c.MILLENNIUM]=b[c.YEAR]*1000})();SimileAjax.DateTime._dateRegexp=new RegExp("^(-?)([0-9]{4})("+["(-?([0-9]{2})(-?([0-9]{2}))?)","(-?([0-9]{3}))","(-?W([0-9]{2})(-?([1-7]))?)"].join("|")+")?$");SimileAjax.DateTime._timezoneRegexp=new RegExp("Z|(([-+])([0-9]{2})(:?([0-9]{2}))?)$");SimileAjax.DateTime._timeRegexp=new RegExp("^([0-9]{2})(:?([0-9]{2})(:?([0-9]{2})(.([0-9]+))?)?)?$");SimileAjax.DateTime.setIso8601Date=function(j,g){var k=g.match(SimileAjax.DateTime._dateRegexp);if(!k){throw new Error("Invalid date string: "+g)}var b=(k[1]=="-")?-1:1;var l=b*k[2];var h=k[5];var c=k[7];var f=k[9];var a=k[11];var p=(k[13])?k[13]:1;j.setUTCFullYear(l);if(f){j.setUTCMonth(0);j.setUTCDate(Number(f))}else{if(a){j.setUTCMonth(0);j.setUTCDate(1);var o=j.getUTCDay();var m=(o)?o:7;var e=Number(p)+(7*Number(a));if(m<=4){j.setUTCDate(e+1-m)}else{j.setUTCDate(e+8-m)}}else{if(h){j.setUTCDate(1);j.setUTCMonth(h-1)}if(c){j.setUTCDate(c)}}}return j};SimileAjax.DateTime.setIso8601Time=function(g,c){var h=c.match(SimileAjax.DateTime._timeRegexp);if(!h){SimileAjax.Debug.warn("Invalid time string: "+c);return false}var a=h[1];var f=Number((h[3])?h[3]:0);var e=(h[5])?h[5]:0;var b=h[7]?(Number("0."+h[7])*1000):0;g.setUTCHours(a);g.setUTCMinutes(f);g.setUTCSeconds(e);g.setUTCMilliseconds(b);return g};SimileAjax.DateTime.timezoneOffset=new Date().getTimezoneOffset();SimileAjax.DateTime.setIso8601=function(b,a){var e=null;var f=(a.indexOf("T")==-1)?a.split(" "):a.split("T");SimileAjax.DateTime.setIso8601Date(b,f[0]);if(f.length==2){var c=f[1].match(SimileAjax.DateTime._timezoneRegexp);if(c){if(c[0]=="Z"){e=0}else{e=(Number(c[3])*60)+Number(c[5]);e*=((c[2]=="-")?1:-1)}f[1]=f[1].substr(0,f[1].length-c[0].length)}SimileAjax.DateTime.setIso8601Time(b,f[1])}if(e==null){e=b.getTimezoneOffset()}b.setTime(b.getTime()+e*60000);return b};SimileAjax.DateTime.parseIso8601DateTime=function(a){try{return SimileAjax.DateTime.setIso8601(new Date(0),a)}catch(b){return null}};SimileAjax.DateTime.parseGregorianDateTime=function(j){if(j==null){return null}else{if(j instanceof Date){return j}}var b=j.toString();if(b.length>0&&b.length<8){var c=b.indexOf(" ");if(c>0){var a=parseInt(b.substr(0,c));var g=b.substr(c+1);if(g.toLowerCase()=="bc"){a=1-a}}else{var a=parseInt(b)}var h=new Date(0);h.setUTCFullYear(a);return h}try{return new Date(Date.parse(b))}catch(f){return null}};SimileAjax.DateTime.roundDownToInterval=function(b,h,l,m,a){var e=l*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR];var k=new Date(b.getTime()+e);var f=function(o){o.setUTCMilliseconds(0);o.setUTCSeconds(0);o.setUTCMinutes(0);o.setUTCHours(0)};var c=function(o){f(o);o.setUTCDate(1);o.setUTCMonth(0)};switch(h){case SimileAjax.DateTime.MILLISECOND:var j=k.getUTCMilliseconds();k.setUTCMilliseconds(j-(j%m));break;case SimileAjax.DateTime.SECOND:k.setUTCMilliseconds(0);var j=k.getUTCSeconds();k.setUTCSeconds(j-(j%m));break;case SimileAjax.DateTime.MINUTE:k.setUTCMilliseconds(0);k.setUTCSeconds(0);var j=k.getUTCMinutes();k.setTime(k.getTime()-(j%m)*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.MINUTE]);break;case SimileAjax.DateTime.HOUR:k.setUTCMilliseconds(0);k.setUTCSeconds(0);k.setUTCMinutes(0);var j=k.getUTCHours();k.setUTCHours(j-(j%m));break;case SimileAjax.DateTime.DAY:f(k);break;case SimileAjax.DateTime.WEEK:f(k);var g=(k.getUTCDay()+7-a)%7;k.setTime(k.getTime()-g*SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.DAY]);break;case SimileAjax.DateTime.MONTH:f(k);k.setUTCDate(1);var j=k.getUTCMonth();k.setUTCMonth(j-(j%m));break;case SimileAjax.DateTime.YEAR:c(k);var j=k.getUTCFullYear();k.setUTCFullYear(j-(j%m));break;case SimileAjax.DateTime.DECADE:c(k);k.setUTCFullYear(Math.floor(k.getUTCFullYear()/10)*10);break;case SimileAjax.DateTime.CENTURY:c(k);k.setUTCFullYear(Math.floor(k.getUTCFullYear()/100)*100);break;case SimileAjax.DateTime.MILLENNIUM:c(k);k.setUTCFullYear(Math.floor(k.getUTCFullYear()/1000)*1000);break}b.setTime(k.getTime()-e)};SimileAjax.DateTime.roundUpToInterval=function(d,f,c,a,b){var e=d.getTime();SimileAjax.DateTime.roundDownToInterval(d,f,c,a,b);if(d.getTime()=a.length&&this.substr(0,a.length)==a};String.prototype.endsWith=function(a){return this.length>=a.length&&this.substr(this.length-a.length)==a};String.substitute=function(b,d){var a="";var f=0;while(ff&&b.charAt(c-1)=="\\"){a+=b.substring(f,c-1)+"%";f=c+1}else{var e=parseInt(b.charAt(c+1));if(isNaN(e)||e>=d.length){a+=b.substring(f,c+2)}else{a+=b.substring(f,c)+d[e].toString()}f=c+2}}}if(f0)?this._a[0]:null};SimileAjax.SortedArray.prototype.getLast=function(){return(this._a.length>0)?this._a[this._a.length-1]:null};SimileAjax.EventIndex=function(b){var a=this;this._unit=(b!=null)?b:SimileAjax.NativeDateUnit;this._events=new SimileAjax.SortedArray(function(d,c){return a._unit.compare(d.getStart(),c.getStart())});this._idToEvent={};this._indexed=true};SimileAjax.EventIndex.prototype.getUnit=function(){return this._unit};SimileAjax.EventIndex.prototype.getEvent=function(a){return this._idToEvent[a]};SimileAjax.EventIndex.prototype.add=function(a){this._events.add(a);this._idToEvent[a.getID()]=a;this._indexed=false};SimileAjax.EventIndex.prototype.removeAll=function(){this._events.removeAll();this._idToEvent={};this._indexed=false};SimileAjax.EventIndex.prototype.getCount=function(){return this._events.length()};SimileAjax.EventIndex.prototype.getIterator=function(a,b){if(!this._indexed){this._index()}return new SimileAjax.EventIndex._Iterator(this._events,a,b,this._unit)};SimileAjax.EventIndex.prototype.getReverseIterator=function(a,b){if(!this._indexed){this._index()}return new SimileAjax.EventIndex._ReverseIterator(this._events,a,b,this._unit)};SimileAjax.EventIndex.prototype.getAllIterator=function(){return new SimileAjax.EventIndex._AllIterator(this._events)};SimileAjax.EventIndex.prototype.getEarliestDate=function(){var a=this._events.getFirst();return(a==null)?null:a.getStart()};SimileAjax.EventIndex.prototype.getLatestDate=function(){var a=this._events.getLast();if(a==null){return null}if(!this._indexed){this._index()}var c=a._earliestOverlapIndex;var b=this._events.elementAt(c).getEnd();for(var d=c+1;d=0){this._currentIndex=this._events.elementAt(this._currentIndex-1)._earliestOverlapIndex}this._currentIndex--;this._maxIndex=b.find(function(e){return c.compare(e.getStart(),d)});this._hasNext=false;this._next=null;this._findNext()};SimileAjax.EventIndex._Iterator.prototype={hasNext:function(){return this._hasNext},next:function(){if(this._hasNext){var a=this._next;this._findNext();return a}else{return null}},_findNext:function(){var b=this._unit;while((++this._currentIndex)0){this._next=a;this._hasNext=true;return}}this._next=null;this._hasNext=false}};SimileAjax.EventIndex._ReverseIterator=function(b,a,d,c){this._events=b;this._startDate=a;this._endDate=d;this._unit=c;this._minIndex=b.find(function(e){return c.compare(e.getStart(),a)});if(this._minIndex-1>=0){this._minIndex=this._events.elementAt(this._minIndex-1)._earliestOverlapIndex}this._maxIndex=b.find(function(e){return c.compare(e.getStart(),d)});this._currentIndex=this._maxIndex;this._hasNext=false;this._next=null;this._findNext()};SimileAjax.EventIndex._ReverseIterator.prototype={hasNext:function(){return this._hasNext},next:function(){if(this._hasNext){var a=this._next;this._findNext();return a}else{return null}},_findNext:function(){var b=this._unit;while((--this._currentIndex)>=this._minIndex){var a=this._events.elementAt(this._currentIndex);if(b.compare(a.getStart(),this._endDate)<0&&b.compare(a.getEnd(),this._startDate)>0){this._next=a;this._hasNext=true;return}}this._next=null;this._hasNext=false}};SimileAjax.EventIndex._AllIterator=function(a){this._events=a;this._index=0};SimileAjax.EventIndex._AllIterator.prototype={hasNext:function(){return this._index0?b:a};SimileAjax.NativeDateUnit.change=function(a,b){return new Date(a.getTime()+b)};SimileAjax.ListenerQueue=function(a){this._listeners=[];this._wildcardHandlerName=a};SimileAjax.ListenerQueue.prototype.add=function(a){this._listeners.push(a)};SimileAjax.ListenerQueue.prototype.remove=function(c){var b=this._listeners;for(var a=0;a0){SimileAjax.History._actions=SimileAjax.History._actions.slice(c);SimileAjax.History._baseIndex+=c}try{SimileAjax.History._iframe.contentWindow.location.search="?"+SimileAjax.History._currentIndex}catch(b){var d=SimileAjax.History.formatHistoryEntryTitle(a.label);document.title=d}}}catch(b){SimileAjax.Debug.exception(b,"Error adding action {"+a.label+"} to history")}},0)};SimileAjax.History.addLengthyAction=function(c,a,b){SimileAjax.History.addAction({perform:c,undo:a,label:b,uiLayer:SimileAjax.WindowManager.getBaseLayer(),lengthy:true})};SimileAjax.History._handleIFrameOnLoad=function(){try{var b=SimileAjax.History._iframe.contentWindow.location.search;var h=(b.length==0)?0:Math.max(0,parseInt(b.substr(1)));var g=function(){var c=h-SimileAjax.History._currentIndex;SimileAjax.History._currentIndex+=c;SimileAjax.History._baseIndex+=c;SimileAjax.History._iframe.contentWindow.location.search="?"+h};if(hh&&SimileAjax.History._currentIndex>SimileAjax.History._baseIndex){SimileAjax.History._currentIndex--;var c=SimileAjax.History._actions[SimileAjax.History._currentIndex-SimileAjax.History._baseIndex];try{c.undo()}catch(j){SimileAjax.Debug.exception(j,"History: Failed to undo action {"+c.label+"}")}}SimileAjax.History._listeners.fire("onAfterUndoSeveral",[]);g()},0)}else{if(h>SimileAjax.History._currentIndex){SimileAjax.History._listeners.fire("onBeforeRedoSeveral",[]);window.setTimeout(function(){while(SimileAjax.History._currentIndex=0&&a0&&SimileAjax.WindowManager._layers[e].ephemeral){var d=SimileAjax.WindowManager._layers[e];if(d.elmt!=null){var c=d.elmt;var b=SimileAjax.DOM.getPageCoordinates(c);if(f.x>=b.left&&f.x<(b.left+c.offsetWidth)&&f.y>=b.top&&f.y<(b.top+c.offsetHeight)){break}}e--}SimileAjax.WindowManager._popToLayer(e)};SimileAjax.WindowManager._onBodyMouseDown=function(b,a,c){if(!("eventPhase" in a)||a.eventPhase==a.BUBBLING_PHASE){SimileAjax.WindowManager.cancelPopups(a)}};SimileAjax.WindowManager._handleMouseDown=function(b,a,c){SimileAjax.WindowManager._draggedElement=b;SimileAjax.WindowManager._draggedElementCallback=c;SimileAjax.WindowManager._lastCoords={x:a.clientX,y:a.clientY};SimileAjax.DOM.cancelEvent(a);return false};SimileAjax.WindowManager._onBodyKeyDown=function(c,a,d){if(SimileAjax.WindowManager._dragging){if(a.keyCode==27){SimileAjax.WindowManager._cancelDragging()}else{if((a.keyCode==17||a.keyCode==16)&&SimileAjax.WindowManager._draggingMode!="copy"){SimileAjax.WindowManager._draggingMode="copy";var b=SimileAjax.Graphics.createTranslucentImage(SimileAjax.urlPrefix+"images/copy.png");b.style.position="absolute";b.style.left=(SimileAjax.WindowManager._ghostCoords.left-16)+"px";b.style.top=(SimileAjax.WindowManager._ghostCoords.top)+"px";document.body.appendChild(b);SimileAjax.WindowManager._draggingModeIndicatorElmt=b}}}};SimileAjax.WindowManager._onBodyKeyUp=function(b,a,c){if(SimileAjax.WindowManager._dragging){if(a.keyCode==17||a.keyCode==16){SimileAjax.WindowManager._draggingMode="";if(SimileAjax.WindowManager._draggingModeIndicatorElmt!=null){document.body.removeChild(SimileAjax.WindowManager._draggingModeIndicatorElmt);SimileAjax.WindowManager._draggingModeIndicatorElmt=null}}}};SimileAjax.WindowManager._onBodyMouseMove=function(a,q,j){if(SimileAjax.WindowManager._draggedElement!=null){var s=SimileAjax.WindowManager._draggedElementCallback;var f=SimileAjax.WindowManager._lastCoords;var p=q.clientX-f.x;var l=q.clientY-f.y;if(!SimileAjax.WindowManager._dragging){if(Math.abs(p)>5||Math.abs(l)>5){try{if("onDragStart" in s){s.onDragStart()}if("ghost" in s&&s.ghost){var m=SimileAjax.WindowManager._draggedElement;SimileAjax.WindowManager._ghostCoords=SimileAjax.DOM.getPageCoordinates(m);SimileAjax.WindowManager._ghostCoords.left+=p;SimileAjax.WindowManager._ghostCoords.top+=l;var r=m.cloneNode(true);r.style.position="absolute";r.style.left=SimileAjax.WindowManager._ghostCoords.left+"px";r.style.top=SimileAjax.WindowManager._ghostCoords.top+"px";r.style.zIndex=1000;SimileAjax.Graphics.setOpacity(r,50);document.body.appendChild(r);s._ghostElmt=r}SimileAjax.WindowManager._dragging=true;SimileAjax.WindowManager._lastCoords={x:q.clientX,y:q.clientY};document.body.focus()}catch(h){SimileAjax.Debug.exception("WindowManager: Error handling mouse down",h);SimileAjax.WindowManager._cancelDragging()}}}else{try{SimileAjax.WindowManager._lastCoords={x:q.clientX,y:q.clientY};if("onDragBy" in s){s.onDragBy(p,l)}if("_ghostElmt" in s){var r=s._ghostElmt;SimileAjax.WindowManager._ghostCoords.left+=p;SimileAjax.WindowManager._ghostCoords.top+=l;r.style.left=SimileAjax.WindowManager._ghostCoords.left+"px";r.style.top=SimileAjax.WindowManager._ghostCoords.top+"px";if(SimileAjax.WindowManager._draggingModeIndicatorElmt!=null){var k=SimileAjax.WindowManager._draggingModeIndicatorElmt;k.style.left=(SimileAjax.WindowManager._ghostCoords.left-16)+"px";k.style.top=SimileAjax.WindowManager._ghostCoords.top+"px"}if("droppable" in s&&s.droppable){var o=SimileAjax.DOM.getEventPageCoordinates(q);var j=SimileAjax.DOM.hittest(o.x,o.y,[SimileAjax.WindowManager._ghostElmt,SimileAjax.WindowManager._dropTargetHighlightElement]);j=SimileAjax.WindowManager._findDropTarget(j);if(j!=SimileAjax.WindowManager._potentialDropTarget){if(SimileAjax.WindowManager._dropTargetHighlightElement!=null){document.body.removeChild(SimileAjax.WindowManager._dropTargetHighlightElement);SimileAjax.WindowManager._dropTargetHighlightElement=null;SimileAjax.WindowManager._potentialDropTarget=null}var g=false;if(j!=null){if((!("canDropOn" in s)||s.canDropOn(j))&&(!("canDrop" in j)||j.canDrop(SimileAjax.WindowManager._draggedElement))){g=true}}if(g){var c=4;var d=SimileAjax.DOM.getPageCoordinates(j);var b=document.createElement("div");b.style.border=c+"px solid yellow";b.style.backgroundColor="yellow";b.style.position="absolute";b.style.left=d.left+"px";b.style.top=d.top+"px";b.style.width=(j.offsetWidth-c*2)+"px";b.style.height=(j.offsetHeight-c*2)+"px";SimileAjax.Graphics.setOpacity(b,30);document.body.appendChild(b);SimileAjax.WindowManager._potentialDropTarget=j;SimileAjax.WindowManager._dropTargetHighlightElement=b}}}}}catch(h){SimileAjax.Debug.exception("WindowManager: Error handling mouse move",h);SimileAjax.WindowManager._cancelDragging()}}SimileAjax.DOM.cancelEvent(q);return false}};SimileAjax.WindowManager._onBodyMouseUp=function(b,a,c){if(SimileAjax.WindowManager._draggedElement!=null){try{if(SimileAjax.WindowManager._dragging){var e=SimileAjax.WindowManager._draggedElementCallback;if("onDragEnd" in e){e.onDragEnd()}if("droppable" in e&&e.droppable){var d=false;var c=SimileAjax.WindowManager._potentialDropTarget;if(c!=null){if((!("canDropOn" in e)||e.canDropOn(c))&&(!("canDrop" in c)||c.canDrop(SimileAjax.WindowManager._draggedElement))){if("onDropOn" in e){e.onDropOn(c)}c.ondrop(SimileAjax.WindowManager._draggedElement,SimileAjax.WindowManager._draggingMode);d=true}}if(!d){}}}}finally{SimileAjax.WindowManager._cancelDragging()}SimileAjax.DOM.cancelEvent(a);return false}};SimileAjax.WindowManager._cancelDragging=function(){var b=SimileAjax.WindowManager._draggedElementCallback;if("_ghostElmt" in b){var a=b._ghostElmt;document.body.removeChild(a);delete b._ghostElmt}if(SimileAjax.WindowManager._dropTargetHighlightElement!=null){document.body.removeChild(SimileAjax.WindowManager._dropTargetHighlightElement);SimileAjax.WindowManager._dropTargetHighlightElement=null}if(SimileAjax.WindowManager._draggingModeIndicatorElmt!=null){document.body.removeChild(SimileAjax.WindowManager._draggingModeIndicatorElmt);SimileAjax.WindowManager._draggingModeIndicatorElmt=null}SimileAjax.WindowManager._draggedElement=null;SimileAjax.WindowManager._draggedElementCallback=null;SimileAjax.WindowManager._potentialDropTarget=null;SimileAjax.WindowManager._dropTargetHighlightElement=null;SimileAjax.WindowManager._lastCoords=null;SimileAjax.WindowManager._ghostCoords=null;SimileAjax.WindowManager._draggingMode="";SimileAjax.WindowManager._dragging=false};SimileAjax.WindowManager._findDropTarget=function(a){while(a!=null){if("ondrop" in a&&(typeof a.ondrop)=="function"){break}a=a.parentNode}return a};Timeline_urlPrefix=GeoTemCoMinifier_urlPrefix+"lib/simile/timeline/";SimileAjax.History.enabled=false;if(typeof window.Timeline=="undefined"){window.Timeline=new Object();Timeline.urlPrefix=Timeline_urlPrefix;window.Timeline.DateTime=window.SimileAjax.DateTime}(function(){var h=false;if(document.location.search.length>0){var g=document.location.search.substr(1).split("&");for(var c=0;c=0){Timeline.urlPrefix=l.substr(0,H);var L=l.indexOf("?");if(L>0){o(l.substr(L+1))}return}}}throw new Error("Failed to derive URL prefix for Timeline API code files")}})();var j=function(e,l){SimileAjax.includeJavascriptFiles(document,e,l)};var F=function(e,l){SimileAjax.includeCssFiles(document,e,l)};var x=(z)?["timeline-bundle.js"]:v;window.SimileAjax_onLoad=function(){Timeline.loaded.core.files=x;Timeline.loaded.core.loaded=true};if(z){j(Timeline.urlPrefix,["timeline-bundle.js"]);F(Timeline.urlPrefix,["timeline-bundle.css"])}else{j(Timeline.urlPrefix+"scripts/",v);F(Timeline.urlPrefix+"styles/",q)}var u=[];var r=function(e){for(var H=0;H0&&r(e.substr(0,l))){return e.substr(0,l)}else{if(r(e)){return e}}return null};if(!r(k)){k="en"}u[k]=true;for(var C=0;C=J){console.info("could not load Timeline core assets");return}setTimeout(function(){s()},10);return}var I=[];for(var H=0;H<\/script>")}catch(d){a()}}else{a()}}else{f()}})();Timeline.version="2.3.1";Timeline.ajax_lib_version=SimileAjax.version;Timeline.display_version=Timeline.version+" (with Ajax lib "+Timeline.ajax_lib_version+")";Timeline.strings={};Timeline.HORIZONTAL=0;Timeline.VERTICAL=1;Timeline._defaultTheme=null;Timeline.getDefaultLocale=function(){return Timeline.clientLocale};Timeline.create=function(d,c,b,f){if(Timeline.timelines==null){Timeline.timelines=[]}var a=Timeline.timelines.length;Timeline.timelines[a]=null;var e=new Timeline._Impl(d,c,b,f,a);Timeline.timelines[a]=e;return e};Timeline.createBandInfo=function(d){var e=("theme" in d)?d.theme:Timeline.getDefaultTheme();var b=("eventSource" in d)?d.eventSource:null;var f=new Timeline.LinearEther({centersOn:("date" in d)?d.date:new Date(),interval:SimileAjax.DateTime.gregorianUnitLengths[d.intervalUnit],pixelsPerInterval:d.intervalPixels,theme:e});var g=new Timeline.GregorianEtherPainter({unit:d.intervalUnit,multiple:("multiple" in d)?d.multiple:1,theme:e,align:("align" in d)?d.align:undefined});var j={showText:("showEventText" in d)?d.showEventText:true,theme:e};if("eventPainterParams" in d){for(var a in d.eventPainterParams){j[a]=d.eventPainterParams[a]}}if("trackHeight" in d){j.trackHeight=d.trackHeight}if("trackGap" in d){j.trackGap=d.trackGap}var h=("overview" in d&&d.overview)?"overview":("layout" in d?d.layout:"original");var c;if("eventPainter" in d){c=new d.eventPainter(j)}else{switch(h){case"overview":c=new Timeline.OverviewEventPainter(j);break;case"detailed":c=new Timeline.DetailedEventPainter(j);break;default:c=new Timeline.OriginalEventPainter(j)}}return{width:d.width,eventSource:b,timeZone:("timeZone" in d)?d.timeZone:0,ether:f,etherPainter:g,eventPainter:c,theme:e,zoomIndex:("zoomIndex" in d)?d.zoomIndex:0,zoomSteps:("zoomSteps" in d)?d.zoomSteps:null}};Timeline.createHotZoneBandInfo=function(d){var e=("theme" in d)?d.theme:Timeline.getDefaultTheme();var b=("eventSource" in d)?d.eventSource:null;var f=new Timeline.HotZoneEther({centersOn:("date" in d)?d.date:new Date(),interval:SimileAjax.DateTime.gregorianUnitLengths[d.intervalUnit],pixelsPerInterval:d.intervalPixels,zones:d.zones,theme:e});var g=new Timeline.HotZoneGregorianEtherPainter({unit:d.intervalUnit,zones:d.zones,theme:e,align:("align" in d)?d.align:undefined});var j={showText:("showEventText" in d)?d.showEventText:true,theme:e};if("eventPainterParams" in d){for(var a in d.eventPainterParams){j[a]=d.eventPainterParams[a]}}if("trackHeight" in d){j.trackHeight=d.trackHeight}if("trackGap" in d){j.trackGap=d.trackGap}var h=("overview" in d&&d.overview)?"overview":("layout" in d?d.layout:"original");var c;if("eventPainter" in d){c=new d.eventPainter(j)}else{switch(h){case"overview":c=new Timeline.OverviewEventPainter(j);break;case"detailed":c=new Timeline.DetailedEventPainter(j);break;default:c=new Timeline.OriginalEventPainter(j)}}return{width:d.width,eventSource:b,timeZone:("timeZone" in d)?d.timeZone:0,ether:f,etherPainter:g,eventPainter:c,theme:e,zoomIndex:("zoomIndex" in d)?d.zoomIndex:0,zoomSteps:("zoomSteps" in d)?d.zoomSteps:null}};Timeline.getDefaultTheme=function(){if(Timeline._defaultTheme==null){Timeline._defaultTheme=Timeline.ClassicTheme.create(Timeline.getDefaultLocale())}return Timeline._defaultTheme};Timeline.setDefaultTheme=function(a){Timeline._defaultTheme=a};Timeline.loadXML=function(a,c){var d=function(g,e,f){alert("Failed to load data xml from "+a+"\n"+g)};var b=function(f){var e=f.responseXML;if(!e.documentElement&&f.responseStream){e.load(f.responseStream)}c(e,a)};SimileAjax.XmlHttp.get(a,d,b)};Timeline.loadJSON=function(url,f){var fError=function(statusText,status,xmlhttp){alert("Failed to load json data from "+url+"\n"+statusText)};var fDone=function(xmlhttp){f(eval("("+xmlhttp.responseText+")"),url)};SimileAjax.XmlHttp.get(url,fError,fDone)};Timeline.getTimelineFromID=function(a){return Timeline.timelines[a]};Timeline.writeVersion=function(a){document.getElementById(a).innerHTML=this.display_version};Timeline._Impl=function(d,c,b,e,a){SimileAjax.WindowManager.initialize();this._containerDiv=d;this._bandInfos=c;this._orientation=b==null?Timeline.HORIZONTAL:b;this._unit=(e!=null)?e:SimileAjax.NativeDateUnit;this._starting=true;this._autoResizing=false;this.autoWidth=c&&c[0]&&c[0].theme&&c[0].theme.autoWidth;this.autoWidthAnimationTime=c&&c[0]&&c[0].theme&&c[0].theme.autoWidthAnimationTime;this.timelineID=a;this.timeline_start=c&&c[0]&&c[0].theme&&c[0].theme.timeline_start;this.timeline_stop=c&&c[0]&&c[0].theme&&c[0].theme.timeline_stop;this.timeline_at_start=false;this.timeline_at_stop=false;this._initialize()};Timeline._Impl.prototype.dispose=function(){for(var a=0;ag||c){d=j;a();e._distributeWidths()}}if(!e.autoWidth){return}f()};Timeline._Impl.prototype._initialize=function(){var h=this._containerDiv;var e=h.ownerDocument;h.className=h.className.split(" ").concat("timeline-container").join(" ");var b=(this.isHorizontal())?"horizontal":"vertical";h.className+=" timeline-"+b;while(h.firstChild){h.removeChild(h.firstChild)}var a=SimileAjax.Graphics.createTranslucentImage(Timeline.urlPrefix+(this.isHorizontal()?"images/copyright-vertical.png":"images/copyright.png"));a.className="timeline-copyright";a.title="Timeline copyright SIMILE - www.code.google.com/p/simile-widgets/";SimileAjax.DOM.registerEvent(a,"click",function(){window.location="http://code.google.com/p/simile-widgets/"});h.appendChild(a);this._bands=[];for(var c=0;c Loading...";this.showLoadingMessage=function(){d.containerDiv.style.display="block"};this.hideLoadingMessage=function(){d.containerDiv.style.display="none"}};Timeline._Impl.prototype._distributeWidths=function(){var b=this.getPixelLength();var a=this.getPixelWidth();var c=0;for(var e=0;e0){var g=parseInt(f.substr(0,h));d=Math.round(g*a/100)}else{d=parseInt(f)}}else{d=f}j.setBandShiftAndWidth(c,d);j.setViewLength(b);c+=d}};Timeline._Impl.prototype.shiftOK=function(d,b){var c=b>0,a=b<0;if((c&&this.timeline_start==null)||(a&&this.timeline_stop==null)||(b==0)){return(true)}var g=false;for(var f=0;f=this.timeline_start}else{e=(f==d?h.getMaxVisibleDateAfterDelta(b):h.getMaxVisibleDate())<=this.timeline_stop}}if(c){this.timeline_at_start=!e;this.timeline_at_stop=false}else{this.timeline_at_stop=!e;this.timeline_at_start=false}return(e)};Timeline._Impl.prototype.zoom=function(g,b,f,d){var c=new RegExp("^timeline-band-([0-9]+)$");var e=null;var a=c.exec(d.id);if(a){e=parseInt(a[1])}if(e!=null){this._bands[e].zoom(g,b,f,d)}this.paint()};Timeline._Band=function(g,h,c){if(g.autoWidth&&typeof h.width=="string"){h.width=h.width.indexOf("%")>-1?0:parseInt(h.width)}this._timeline=g;this._bandInfo=h;this._index=c;this._locale=("locale" in h)?h.locale:Timeline.getDefaultLocale();this._timeZone=("timeZone" in h)?h.timeZone:0;this._labeller=("labeller" in h)?h.labeller:(("createLabeller" in g.getUnit())?g.getUnit().createLabeller(this._locale,this._timeZone):new Timeline.GregorianDateLabeller(this._locale,this._timeZone));this._theme=h.theme;this._zoomIndex=("zoomIndex" in h)?h.zoomIndex:0;this._zoomSteps=("zoomSteps" in h)?h.zoomSteps:null;this._dragging=false;this._changing=false;this._originalScrollSpeed=5;this._scrollSpeed=this._originalScrollSpeed;this._onScrollListeners=[];var a=this;this._syncWithBand=null;this._syncWithBandHandler=function(b){a._onHighlightBandScroll()};this._selectorListener=function(b){a._onHighlightBandScroll()};var e=this._timeline.getDocument().createElement("div");e.className="timeline-band-input";this._timeline.addDiv(e);this._keyboardInput=document.createElement("input");this._keyboardInput.type="text";e.appendChild(this._keyboardInput);SimileAjax.DOM.registerEventWithObject(this._keyboardInput,"keydown",this,"_onKeyDown");SimileAjax.DOM.registerEventWithObject(this._keyboardInput,"keyup",this,"_onKeyUp");this._div=this._timeline.getDocument().createElement("div");this._div.id="timeline-band-"+c;this._div.className="timeline-band timeline-band-"+c;this._timeline.addDiv(this._div);SimileAjax.DOM.registerEventWithObject(this._div,"mousedown",this,"_onMouseDown");SimileAjax.DOM.registerEventWithObject(this._div,"mousemove",this,"_onMouseMove");SimileAjax.DOM.registerEventWithObject(this._div,"mouseup",this,"_onMouseUp");SimileAjax.DOM.registerEventWithObject(this._div,"mouseout",this,"_onMouseOut");SimileAjax.DOM.registerEventWithObject(this._div,"dblclick",this,"_onDblClick");var f=this._theme!=null?this._theme.mouseWheel:"scroll";if(f==="zoom"||f==="scroll"||this._zoomSteps){if(SimileAjax.Platform.browser.isFirefox){SimileAjax.DOM.registerEventWithObject(this._div,"DOMMouseScroll",this,"_onMouseScroll")}else{SimileAjax.DOM.registerEventWithObject(this._div,"mousewheel",this,"_onMouseScroll")}}this._innerDiv=this._timeline.getDocument().createElement("div");this._innerDiv.className="timeline-band-inner";this._div.appendChild(this._innerDiv);this._ether=h.ether;h.ether.initialize(this,g);this._etherPainter=h.etherPainter;h.etherPainter.initialize(this,g);this._eventSource=h.eventSource;if(this._eventSource){this._eventListener={onAddMany:function(){a._onAddMany()},onClear:function(){a._onClear()}};this._eventSource.addListener(this._eventListener)}this._eventPainter=h.eventPainter;this._eventTracksNeeded=0;this._eventTrackIncrement=0;h.eventPainter.initialize(this,g);this._decorators=("decorators" in h)?h.decorators:[];for(var d=0;dthis._eventTracksNeeded){this._eventTracksNeeded=b}};Timeline._Band.prototype.checkAutoWidth=function(){if(!this._timeline.autoWidth){return}var a=this._eventPainter.getType()=="overview";var c=a?this._theme.event.overviewTrack.autoWidthMargin:this._theme.event.track.autoWidthMargin;var b=Math.ceil((this._eventTracksNeeded+c)*this._eventTrackIncrement);b+=a?this._theme.event.overviewTrack.offset:this._theme.event.track.offset;var d=this._bandInfo;if(b!=d.width){d.width=b}};Timeline._Band.prototype.layout=function(){this.paint()};Timeline._Band.prototype.paint=function(){this._etherPainter.paint();this._paintDecorators();this._paintEvents()};Timeline._Band.prototype.softLayout=function(){this.softPaint()};Timeline._Band.prototype.softPaint=function(){this._etherPainter.softPaint();this._softPaintDecorators();this._softPaintEvents()};Timeline._Band.prototype.setBandShiftAndWidth=function(a,d){var c=this._keyboardInput.parentNode;var b=a+Math.floor(d/2);if(this._timeline.isHorizontal()){this._div.style.top=a+"px";this._div.style.height=d+"px";c.style.top=b+"px";c.style.left="-1em"}else{this._div.style.left=a+"px";this._div.style.width=d+"px";c.style.left=b+"px";c.style.top="-1em"}};Timeline._Band.prototype.getViewWidth=function(){if(this._timeline.isHorizontal()){return this._div.offsetHeight}else{return this._div.offsetWidth}};Timeline._Band.prototype.setViewLength=function(a){this._viewLength=a;this._recenterDiv();this._onChanging()};Timeline._Band.prototype.getViewLength=function(){return this._viewLength};Timeline._Band.prototype.getTotalViewLength=function(){return Timeline._Band.SCROLL_MULTIPLES*this._viewLength};Timeline._Band.prototype.getViewOffset=function(){return this._viewOffset};Timeline._Band.prototype.getMinDate=function(){return this._ether.pixelOffsetToDate(this._viewOffset)};Timeline._Band.prototype.getMaxDate=function(){return this._ether.pixelOffsetToDate(this._viewOffset+Timeline._Band.SCROLL_MULTIPLES*this._viewLength)};Timeline._Band.prototype.getMinVisibleDate=function(){return this._ether.pixelOffsetToDate(0)};Timeline._Band.prototype.getMinVisibleDateAfterDelta=function(a){return this._ether.pixelOffsetToDate(a)};Timeline._Band.prototype.getMaxVisibleDate=function(){return this._ether.pixelOffsetToDate(this._viewLength)};Timeline._Band.prototype.getMaxVisibleDateAfterDelta=function(a){return this._ether.pixelOffsetToDate(this._viewLength+a)};Timeline._Band.prototype.getCenterVisibleDate=function(){return this._ether.pixelOffsetToDate(this._viewLength/2)};Timeline._Band.prototype.setMinVisibleDate=function(a){if(!this._changing){this._moveEther(Math.round(-this._ether.dateToPixelOffset(a)))}};Timeline._Band.prototype.setMaxVisibleDate=function(a){if(!this._changing){this._moveEther(Math.round(this._viewLength-this._ether.dateToPixelOffset(a)))}};Timeline._Band.prototype.setCenterVisibleDate=function(a){if(!this._changing){this._moveEther(Math.round(this._viewLength/2-this._ether.dateToPixelOffset(a)))}};Timeline._Band.prototype.dateToPixelOffset=function(a){return this._ether.dateToPixelOffset(a)-this._viewOffset};Timeline._Band.prototype.pixelOffsetToDate=function(a){return this._ether.pixelOffsetToDate(a+this._viewOffset)};Timeline._Band.prototype.createLayerDiv=function(d,b){var c=this._timeline.getDocument().createElement("div");c.className="timeline-band-layer"+(typeof b=="string"?(" "+b):"");c.style.zIndex=d;this._innerDiv.appendChild(c);var a=this._timeline.getDocument().createElement("div");a.className="timeline-band-layer-inner";if(SimileAjax.Platform.browser.isIE){a.style.cursor="move"}else{a.style.cursor="-moz-grab"}c.appendChild(a);return a};Timeline._Band.prototype.removeLayerDiv=function(a){this._innerDiv.removeChild(a.parentNode)};Timeline._Band.prototype.scrollToCenter=function(b,c){var a=this._ether.dateToPixelOffset(b);if(a<-this._viewLength/2){this.setCenterVisibleDate(this.pixelOffsetToDate(a+this._viewLength))}else{if(a>3*this._viewLength/2){this.setCenterVisibleDate(this.pixelOffsetToDate(a-this._viewLength))}}this._autoScroll(Math.round(this._viewLength/2-this._ether.dateToPixelOffset(b)),c)};Timeline._Band.prototype.showBubbleForEvent=function(c){var a=this.getEventSource().getEvent(c);if(a){var b=this;this.scrollToCenter(a.getStart(),function(){b._eventPainter.showBubble(a)})}};Timeline._Band.prototype.zoom=function(f,a,e,c){if(!this._zoomSteps){return}a+=this._viewOffset;var d=this._ether.pixelOffsetToDate(a);var b=this._ether.zoom(f);this._etherPainter.zoom(b);this._moveEther(Math.round(-this._ether.dateToPixelOffset(d)));this._moveEther(a)};Timeline._Band.prototype._onMouseDown=function(b,a,c){this.closeBubble();this._dragging=true;this._dragX=a.clientX;this._dragY=a.clientY};Timeline._Band.prototype._onMouseMove=function(d,a,e){if(this._dragging){var c=a.clientX-this._dragX;var b=a.clientY-this._dragY;this._dragX=a.clientX;this._dragY=a.clientY;this._moveEther(this._timeline.isHorizontal()?c:b);this._positionHighlight()}};Timeline._Band.prototype._onMouseUp=function(b,a,c){this._dragging=false;this._keyboardInput.focus()};Timeline._Band.prototype._onMouseOut=function(b,a,d){var c=SimileAjax.DOM.getEventRelativeCoordinates(a,b);c.x+=this._viewOffset;if(c.x<0||c.x>b.offsetWidth||c.y<0||c.y>b.offsetHeight){this._dragging=false}};Timeline._Band.prototype._onMouseScroll=function(g,j,e){var a=new Date();a=a.getTime();if(!this._lastScrollTime||((a-this._lastScrollTime)>50)){this._lastScrollTime=a;var h=0;if(j.wheelDelta){h=j.wheelDelta/120}else{if(j.detail){h=-j.detail/3}}var f=this._theme.mouseWheel;if(this._zoomSteps||f==="zoom"){var d=SimileAjax.DOM.getEventRelativeCoordinates(j,g);if(h!=0){var c;if(h>0){c=true}if(h<0){c=false}this._timeline.zoom(c,d.x,d.y,g)}}else{if(f==="scroll"){var b=50*(h<0?-1:1);this._moveEther(b)}}}if(j.stopPropagation){j.stopPropagation()}j.cancelBubble=true;if(j.preventDefault){j.preventDefault()}j.returnValue=false};Timeline._Band.prototype._onDblClick=function(b,a,d){var c=SimileAjax.DOM.getEventRelativeCoordinates(a,b);var e=c.x-(this._viewLength/2-this._viewOffset);this._autoScroll(-e)};Timeline._Band.prototype._onKeyDown=function(b,a,c){if(!this._dragging){switch(a.keyCode){case 27:break;case 37:case 38:this._scrollSpeed=Math.min(50,Math.abs(this._scrollSpeed*1.05));this._moveEther(this._scrollSpeed);break;case 39:case 40:this._scrollSpeed=-Math.min(50,Math.abs(this._scrollSpeed*1.05));this._moveEther(this._scrollSpeed);break;default:return true}this.closeBubble();SimileAjax.DOM.cancelEvent(a);return false}return true};Timeline._Band.prototype._onKeyUp=function(b,a,c){if(!this._dragging){this._scrollSpeed=this._originalScrollSpeed;switch(a.keyCode){case 35:this.setCenterVisibleDate(this._eventSource.getLatestDate());break;case 36:this.setCenterVisibleDate(this._eventSource.getEarliestDate());break;case 33:this._autoScroll(this._timeline.getPixelLength());break;case 34:this._autoScroll(-this._timeline.getPixelLength());break;default:return true}this.closeBubble();SimileAjax.DOM.cancelEvent(a);return false}return true};Timeline._Band.prototype._autoScroll=function(g,e){var c=this;var d=SimileAjax.Graphics.createAnimation(function(a,b){c._moveEther(b)},0,g,1000,e);d.run()};Timeline._Band.prototype._moveEther=function(a){this.closeBubble();if(!this._timeline.shiftOK(this._index,a)){return}this._viewOffset+=a;this._ether.shiftPixels(-a);if(this._timeline.isHorizontal()){this._div.style.left=this._viewOffset+"px"}else{this._div.style.top=this._viewOffset+"px"}if(this._viewOffset>-this._viewLength*0.5||this._viewOffset<-this._viewLength*(Timeline._Band.SCROLL_MULTIPLES-1.5)){this._recenterDiv()}else{this.softLayout()}this._onChanging()};Timeline._Band.prototype._onChanging=function(){this._changing=true;this._fireOnScroll();this._setSyncWithBandDate();this._changing=false};Timeline._Band.prototype.busy=function(){return(this._changing)};Timeline._Band.prototype._fireOnScroll=function(){for(var a=0;a0)){c=a-1}if(!d&&(a<(this._band._zoomSteps.length-1))){c=a+1}this._band._zoomIndex=c;this._interval=SimileAjax.DateTime.gregorianUnitLengths[this._band._zoomSteps[c].unit];this._pixelsPerInterval=this._band._zoomSteps[c].pixelsPerInterval;b=this._band._zoomSteps[c].unit-this._band._zoomSteps[a].unit;return b};Timeline.HotZoneEther=function(a){this._params=a;this._interval=a.interval;this._pixelsPerInterval=a.pixelsPerInterval;this._theme=a.theme};Timeline.HotZoneEther.prototype.initialize=function(h,k){this._band=h;this._timeline=k;this._unit=k.getUnit();this._zones=[{startTime:Number.NEGATIVE_INFINITY,endTime:Number.POSITIVE_INFINITY,magnify:1}];var b=this._params;for(var d=0;d0;c++){var a=this._zones[c];if(this._unit.compare(e,a.endTime)<0){if(this._unit.compare(e,a.startTime)>0){this._zones.splice(c,0,{startTime:a.startTime,endTime:e,magnify:a.magnify});c++;a.startTime=e}if(this._unit.compare(f,a.endTime)<0){this._zones.splice(c,0,{startTime:e,endTime:f,magnify:g.magnify*a.magnify});c++;a.startTime=f;e=f}else{a.magnify*=g.magnify;e=a.endTime}}}}if("startsOn" in this._params){this._start=this._unit.parseFromObject(this._params.startsOn)}else{if("endsOn" in this._params){this._start=this._unit.parseFromObject(this._params.endsOn);this.shiftPixels(-this._timeline.getPixelLength())}else{if("centersOn" in this._params){this._start=this._unit.parseFromObject(this._params.centersOn);this.shiftPixels(-this._timeline.getPixelLength()/2)}else{this._start=this._unit.makeDefaultValue();this.shiftPixels(-this._timeline.getPixelLength()/2)}}}};Timeline.HotZoneEther.prototype.setDate=function(a){this._start=this._unit.cloneValue(a)};Timeline.HotZoneEther.prototype.shiftPixels=function(a){this._start=this.pixelOffsetToDate(a)};Timeline.HotZoneEther.prototype.dateToPixelOffset=function(a){return this._dateDiffToPixelOffset(this._start,a)};Timeline.HotZoneEther.prototype.pixelOffsetToDate=function(a){return this._pixelOffsetToDate(a,this._start)};Timeline.HotZoneEther.prototype.zoom=function(d){var b=0;var a=this._band._zoomIndex;var c=a;if(d&&(a>0)){c=a-1}if(!d&&(a<(this._band._zoomSteps.length-1))){c=a+1}this._band._zoomIndex=c;this._interval=SimileAjax.DateTime.gregorianUnitLengths[this._band._zoomSteps[c].unit];this._pixelsPerInterval=this._band._zoomSteps[c].pixelsPerInterval;b=this._band._zoomSteps[c].unit-this._band._zoomSteps[a].unit;return b};Timeline.HotZoneEther.prototype._dateDiffToPixelOffset=function(j,d){var b=this._getScale();var h=j;var c=d;var a=0;if(this._unit.compare(h,c)<0){var g=0;while(g=0){if(this._unit.compare(h,this._zones[g].startTime)>0){break}g--}while(this._unit.compare(h,c)>0){var e=this._zones[g];var f=this._unit.later(c,e.startTime);a+=(this._unit.compare(f,h)/(b/e.magnify));h=f;g--}}return a};Timeline.HotZoneEther.prototype._pixelOffsetToDate=function(h,c){var g=this._getScale();var e=c;if(h>0){var f=0;while(f0){var a=this._zones[f];var d=g/a.magnify;if(a.endTime==Number.POSITIVE_INFINITY){e=this._unit.change(e,h*d);h=0}else{var b=this._unit.compare(a.endTime,e)/d;if(b>h){e=this._unit.change(e,h*d);h=0}else{e=a.endTime;h-=b}}f++}}else{var f=this._zones.length-1;while(f>=0){if(this._unit.compare(e,this._zones[f].startTime)>0){break}f--}h=-h;while(h>0){var a=this._zones[f];var d=g/a.magnify;if(a.startTime==Number.NEGATIVE_INFINITY){e=this._unit.change(e,-h*d);h=0}else{var b=this._unit.compare(e,a.startTime)/d;if(b>h){e=this._unit.change(e,-h*d);h=0}else{e=a.startTime;h-=b}}f--}}return e};Timeline.HotZoneEther.prototype._getScale=function(){return this._interval/this._pixelsPerInterval};Timeline.GregorianEtherPainter=function(a){this._params=a;this._theme=a.theme;this._unit=a.unit;this._multiple=("multiple" in a)?a.multiple:1};Timeline.GregorianEtherPainter.prototype.initialize=function(c,b){this._band=c;this._timeline=b;this._backgroundLayer=c.createLayerDiv(0);this._backgroundLayer.setAttribute("name","ether-background");this._backgroundLayer.className="timeline-ether-bg";this._markerLayer=null;this._lineLayer=null;var d=("align" in this._params&&this._params.align!=undefined)?this._params.align:this._theme.ether.interval.marker[b.isHorizontal()?"hAlign":"vAlign"];var a=("showLine" in this._params)?this._params.showLine:this._theme.ether.interval.line.show;this._intervalMarkerLayout=new Timeline.EtherIntervalMarkerLayout(this._timeline,this._band,this._theme,d,a);this._highlight=new Timeline.EtherHighlight(this._timeline,this._band,this._theme,this._backgroundLayer)};Timeline.GregorianEtherPainter.prototype.setHighlight=function(a,b){this._highlight.position(a,b)};Timeline.GregorianEtherPainter.prototype.paint=function(){if(this._markerLayer){this._band.removeLayerDiv(this._markerLayer)}this._markerLayer=this._band.createLayerDiv(100);this._markerLayer.setAttribute("name","ether-markers");this._markerLayer.style.display="none";if(this._lineLayer){this._band.removeLayerDiv(this._lineLayer)}this._lineLayer=this._band.createLayerDiv(1);this._lineLayer.setAttribute("name","ether-lines");this._lineLayer.style.display="none";var c=this._band.getMinDate();var f=this._band.getMaxDate();var b=this._band.getTimeZone();var e=this._band.getLabeller();SimileAjax.DateTime.roundDownToInterval(c,this._unit,b,this._multiple,this._theme.firstDayOfWeek);var d=this;var a=function(g){for(var h=0;hd;c++){var a=this._zones[c];if(da.startTime){this._zones.splice(c,0,{startTime:a.startTime,endTime:d,unit:a.unit,multiple:a.multiple});c++;a.startTime=d}if(f=0){if(a.getTime()>this._zones[e].startTime){break}e--}for(var h=c;h<=e;h++){var g=this._zones[h];var k=new Date(Math.max(d.getTime(),g.startTime));var f=new Date(Math.min(a.getTime(),g.endTime));SimileAjax.DateTime.roundDownToInterval(k,g.unit,l,g.multiple,this._theme.firstDayOfWeek);SimileAjax.DateTime.roundUpToInterval(f,g.unit,l,g.multiple,this._theme.firstDayOfWeek);while(k.getTime()0){c=b.getUTCFullYear()}else{c=(1-d)+"BC"}e=(f==SimileAjax.DateTime.MONTH)||(f==SimileAjax.DateTime.DECADE&&d%100==0)||(f==SimileAjax.DateTime.CENTURY&&d%1000==0);break;default:c=b.toUTCString()}return{text:c,emphasized:e}};Timeline.DefaultEventSource=function(a){this._events=(a instanceof Object)?a:new SimileAjax.EventIndex();this._listeners=[]};Timeline.DefaultEventSource.prototype.addListener=function(a){this._listeners.push(a)};Timeline.DefaultEventSource.prototype.removeListener=function(b){for(var a=0;a0){return a}else{if(a.substr(0,1)=="/"){return b.substr(0,b.indexOf("/",b.indexOf("://")+3))+a}else{return b+a}}}};Timeline.DefaultEventSource.Event=function(a){function d(e){return(a[e]!=null&&a[e]!="")?a[e]:null}var c=a.id?a.id.trim():"";this._id=c.length>0?c:Timeline.EventUtils.getNewEventID();this._instant=a.instant||(a.end==null);this._start=a.start;this._end=(a.end!=null)?a.end:a.start;this._latestStart=(a.latestStart!=null)?a.latestStart:(a.instant?this._end:this._start);this._earliestEnd=(a.earliestEnd!=null)?a.earliestEnd:this._end;var b=[];if(this._start>this._latestStart){this._latestStart=this._start;b.push("start is > latestStart")}if(this._start>this._earliestEnd){this._earliestEnd=this._latestStart;b.push("start is > earliestEnd")}if(this._start>this._end){this._end=this._earliestEnd;b.push("start is > end")}if(this._latestStart>this._earliestEnd){this._earliestEnd=this._latestStart;b.push("latestStart is > earliestEnd")}if(this._latestStart>this._end){this._end=this._earliestEnd;b.push("latestStart is > end")}if(this._earliestEnd>this._end){this._end=this._earliestEnd;b.push("earliestEnd is > end")}this._eventID=d("eventID");this._text=(a.text!=null)?SimileAjax.HTML.deEntify(a.text):"";if(b.length>0){this._text+=" PROBLEM: "+b.join(", ")}this._description=SimileAjax.HTML.deEntify(a.description);this._image=d("image");this._link=d("link");this._title=d("hoverText");this._title=d("caption");this._icon=d("icon");this._color=d("color");this._textColor=d("textColor");this._classname=d("classname");this._tapeImage=d("tapeImage");this._tapeRepeat=d("tapeRepeat");this._trackNum=d("trackNum");if(this._trackNum!=null){this._trackNum=parseInt(this._trackNum)}this._wikiURL=null;this._wikiSection=null};Timeline.DefaultEventSource.Event.prototype={getID:function(){return this._id},isInstant:function(){return this._instant},isImprecise:function(){return this._start!=this._latestStart||this._end!=this._earliestEnd},getStart:function(){return this._start},getEnd:function(){return this._end},getLatestStart:function(){return this._latestStart},getEarliestEnd:function(){return this._earliestEnd},getEventID:function(){return this._eventID},getText:function(){return this._text},getDescription:function(){return this._description},getImage:function(){return this._image},getLink:function(){return this._link},getIcon:function(){return this._icon},getColor:function(){return this._color},getTextColor:function(){return this._textColor},getClassName:function(){return this._classname},getTapeImage:function(){return this._tapeImage},getTapeRepeat:function(){return this._tapeRepeat},getTrackNum:function(){return this._trackNum},getProperty:function(a){return null},getWikiURL:function(){return this._wikiURL},getWikiSection:function(){return this._wikiSection},setWikiInfo:function(b,a){this._wikiURL=b;this._wikiSection=a},fillDescription:function(a){a.innerHTML=this._description},fillWikiInfo:function(e){e.style.display="none";if(this._wikiURL==null||this._wikiSection==null){return}var d=this.getProperty("wikiID");if(d==null||d.length==0){d=this.getText()}if(d==null||d.length==0){return}e.style.display="inline";d=d.replace(/\s/g,"_");var c=this._wikiURL+this._wikiSection.replace(/\s/g,"_")+"/"+d;var b=document.createElement("a");b.href=c;b.target="new";b.innerHTML=Timeline.strings[Timeline.clientLocale].wikiLinkLabel;e.appendChild(document.createTextNode("["));e.appendChild(b);e.appendChild(document.createTextNode("]"))},fillTime:function(a,b){if(this._instant){if(this.isImprecise()){a.appendChild(a.ownerDocument.createTextNode(b.labelPrecise(this._start)));a.appendChild(a.ownerDocument.createElement("br"));a.appendChild(a.ownerDocument.createTextNode(b.labelPrecise(this._end)))}else{a.appendChild(a.ownerDocument.createTextNode(b.labelPrecise(this._start)))}}else{if(this.isImprecise()){a.appendChild(a.ownerDocument.createTextNode(b.labelPrecise(this._start)+" ~ "+b.labelPrecise(this._latestStart)));a.appendChild(a.ownerDocument.createElement("br"));a.appendChild(a.ownerDocument.createTextNode(b.labelPrecise(this._earliestEnd)+" ~ "+b.labelPrecise(this._end)))}else{a.appendChild(a.ownerDocument.createTextNode(b.labelPrecise(this._start)));a.appendChild(a.ownerDocument.createElement("br"));a.appendChild(a.ownerDocument.createTextNode(b.labelPrecise(this._end)))}}},fillInfoBubble:function(b,e,m){var o=b.ownerDocument;var l=this.getText();var j=this.getLink();var d=this.getImage();if(d!=null){var f=o.createElement("img");f.src=d;e.event.bubble.imageStyler(f);b.appendChild(f)}var p=o.createElement("div");var c=o.createTextNode(l);if(j!=null){var k=o.createElement("a");k.href=j;k.appendChild(c);p.appendChild(k)}else{p.appendChild(c)}e.event.bubble.titleStyler(p);b.appendChild(p);var q=o.createElement("div");this.fillDescription(q);e.event.bubble.bodyStyler(q);b.appendChild(q);var h=o.createElement("div");this.fillTime(h,m);e.event.bubble.timeStyler(h);b.appendChild(h);var g=o.createElement("div");this.fillWikiInfo(g);e.event.bubble.wikiStyler(g);b.appendChild(g)}};Timeline.OriginalEventPainter=function(a){this._params=a;this._onSelectListeners=[];this._eventPaintListeners=[];this._filterMatcher=null;this._highlightMatcher=null;this._frc=null;this._eventIdToElmt={}};Timeline.OriginalEventPainter.prototype.initialize=function(b,a){this._band=b;this._timeline=a;this._backLayer=null;this._eventLayer=null;this._lineLayer=null;this._highlightLayer=null;this._eventIdToElmt=null};Timeline.OriginalEventPainter.prototype.getType=function(){return"original"};Timeline.OriginalEventPainter.prototype.addOnSelectListener=function(a){this._onSelectListeners.push(a)};Timeline.OriginalEventPainter.prototype.removeOnSelectListener=function(b){for(var a=0;aa){break}}return c};Timeline.OriginalEventPainter.prototype._paintEventIcon=function(k,f,b,g,e,c){var j=k.getIcon();j=j!=null?j:g.icon;var h;if(c>0){h=g.trackOffset+f*g.trackIncrement+c+g.impreciseIconMargin}else{var l=g.trackOffset+f*g.trackIncrement+g.trackHeight/2;h=Math.round(l-g.iconHeight/2)}var d=SimileAjax.Graphics.createTranslucentImage(j);var a=this._timeline.getDocument().createElement("div");a.className=this._getElClassName("timeline-event-icon",k,"icon");a.id=this._encodeEventElID("icon",k);a.style.left=b+"px";a.style.top=h+"px";a.appendChild(d);if(k._title!=null){a.title=k._title}this._eventLayer.appendChild(a);return{left:b,top:h,width:g.iconWidth,height:g.iconHeight,elmt:a}};Timeline.OriginalEventPainter.prototype._paintEventLabel=function(k,l,c,h,a,m,e,f,b){var j=this._timeline.getDocument();var g=j.createElement("div");g.className=f;g.id=this._encodeEventElID("label",k);g.style.left=c+"px";g.style.width=a+"px";g.style.top=h+"px";g.innerHTML=l;if(k._title!=null){g.title=k._title}var d=k.getTextColor();if(d==null){d=k.getColor()}if(d!=null){g.style.color=d}if(e.event.highlightLabelBackground&&b>=0){g.style.background=this._getHighlightColor(b,e)}this._eventLayer.appendChild(g);return{left:c,top:h,width:a,height:m,elmt:g}};Timeline.OriginalEventPainter.prototype._paintEventTape=function(p,j,f,a,c,h,k,g,q){var b=a-f;var e=g.event.tape.height;var l=k.trackOffset+j*k.trackIncrement;var o=this._timeline.getDocument().createElement("div");o.className=this._getElClassName("timeline-event-tape",p,"tape");o.id=this._encodeEventElID("tape"+q,p);o.style.left=f+"px";o.style.width=b+"px";o.style.height=e+"px";o.style.top=l+"px";if(p._title!=null){o.title=p._title}if(c!=null){o.style.backgroundColor=c}var m=p.getTapeImage();var d=p.getTapeRepeat();d=d!=null?d:"repeat";if(m!=null){o.style.backgroundImage="url("+m+")";o.style.backgroundRepeat=d}SimileAjax.Graphics.setOpacity(o,h);this._eventLayer.appendChild(o);return{left:f,top:l,width:b,height:e,elmt:o}};Timeline.OriginalEventPainter.prototype._getLabelDivClassName=function(a){return this._getElClassName("timeline-event-label",a,"label")};Timeline.OriginalEventPainter.prototype._getElClassName=function(b,a,d){var e=a.getClassName(),c=[];if(e){if(d){c.push(d+"-"+e+" ")}c.push(e+" ")}c.push(b);return(c.join(""))};Timeline.OriginalEventPainter.prototype._getHighlightColor=function(a,c){var b=c.event.highlightColors;return b[Math.min(a,b.length-1)]};Timeline.OriginalEventPainter.prototype._createHighlightDiv=function(a,d,f,b){var g=null;if(a>=0){var e=this._timeline.getDocument();var c=this._getHighlightColor(a,f);g=e.createElement("div");g.className=this._getElClassName("timeline-event-highlight",b,"highlight");g.id=this._encodeEventElID("highlight0",b);g.style.position="absolute";g.style.overflow="hidden";g.style.left=(d.left-2)+"px";g.style.width=(d.width+4)+"px";g.style.top=(d.top-2)+"px";g.style.height=(d.height+4)+"px";g.style.background=c;this._highlightLayer.appendChild(g)}return g};Timeline.OriginalEventPainter.prototype._onClickInstantEvent=function(b,d,a){var e=SimileAjax.DOM.getPageCoordinates(b);this._showBubble(e.left+Math.ceil(b.offsetWidth/2),e.top+Math.ceil(b.offsetHeight/2),a);this._fireOnSelect(a.getID());d.cancelBubble=true;SimileAjax.DOM.cancelEvent(d);return false};Timeline.OriginalEventPainter.prototype._onClickDurationEvent=function(e,d,b){if("pageX" in d){var a=d.pageX;var g=d.pageY}else{var f=SimileAjax.DOM.getPageCoordinates(e);var a=d.offsetX+f.left;var g=d.offsetY+f.top}this._showBubble(a,g,b);this._fireOnSelect(b.getID());d.cancelBubble=true;SimileAjax.DOM.cancelEvent(d);return false};Timeline.OriginalEventPainter.prototype.showBubble=function(a){var b=this._eventIdToElmt[a.getID()];if(b){var d=SimileAjax.DOM.getPageCoordinates(b);this._showBubble(d.left+b.offsetWidth/2,d.top+b.offsetHeight/2,a)}};Timeline.OriginalEventPainter.prototype._showBubble=function(a,e,b){var d=document.createElement("div");var c=this._params.theme.event.bubble;b.fillInfoBubble(d,this._params.theme,this._band.getLabeller());SimileAjax.WindowManager.cancelPopups();SimileAjax.Graphics.createBubbleForContentAndPoint(d,a,e,c.width,null,c.maxHeight)};Timeline.OriginalEventPainter.prototype._fireOnSelect=function(b){for(var a=0;a=v+g.width){f.solid=j;f.text=v}else{f.solid=j;v=c+s.event.label.offsetFromLine;r=this._findFreeTrackForText(d,v+g.width,function(w){w.line=c-2});this._getTrackData(r).text=j;this._paintEventLine(l,c,d,r,p,s)}var t=Math.round(p.trackOffset+r*p.trackIncrement+p.trackHeight/2-g.height/2);var o=this._paintEventLabel(l,k,v,t,g.width,g.height,s);var m=this;var h=function(w,x,y){return m._onClickInstantEvent(b.elmt,x,l)};SimileAjax.DOM.registerEvent(b.elmt,"mousedown",h);SimileAjax.DOM.registerEvent(o.elmt,"mousedown",h);this._createHighlightDiv(q,b,s);this._eventIdToElmt[l.getID()]=b.elmt};Timeline.DetailedEventPainter.prototype.paintImpreciseInstantEvent=function(p,s,x,t){var z=this._timeline.getDocument();var o=p.getText();var h=p.getStart();var u=p.getEnd();var e=Math.round(this._band.dateToPixelOffset(h));var b=Math.round(this._band.dateToPixelOffset(u));var a=Math.round(e+s.iconWidth/2);var m=Math.round(e-s.iconWidth/2);var k=this._frc.computeSize(o);var f=this._findFreeTrackForSolid(b,e);var g=this._paintEventTape(p,f,e,b,x.event.instant.impreciseColor,x.event.instant.impreciseOpacity,s,x);var c=this._paintEventIcon(p,f,m,s,x);var j=this._getTrackData(f);j.solid=m;var y=a+x.event.label.offsetFromLine;var d=y+k.width;var v;if(db&&(!(a)||c.line>a)){return d}}else{this._lowerTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});return d}if(db&&(!(a)||c.line>a)){return -1-d}}else{this._upperTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY});return -1-d}}};Timeline.DetailedEventPainter.prototype._findFreeTrackForText=function(d,c,h){var f;var g;var b;var k;if(d<0){f=true;b=-d;g=this._findFreeUpperTrackForText(b,c);k=-1-g}else{if(d>0){f=false;b=d+1;g=this._findFreeLowerTrackForText(b,c);k=g}else{var a=this._findFreeUpperTrackForText(0,c);var j=this._findFreeLowerTrackForText(1,c);if(j-1<=a){f=false;b=1;g=j;k=g}else{f=true;b=0;g=a;k=-1-g}}}if(f){if(g==this._upperTracks.length){this._upperTracks.push({solid:Number.POSITIVE_INFINITY,text:Number.POSITIVE_INFINITY,line:Number.POSITIVE_INFINITY})}for(var e=b;e=c){break}}return a};Timeline.DetailedEventPainter.prototype._findFreeUpperTrackForText=function(a,c){for(;a=c){break}}return a};Timeline.DetailedEventPainter.prototype._getTrackData=function(a){return(a<0)?this._upperTracks[-a-1]:this._lowerTracks[a]};Timeline.DetailedEventPainter.prototype._paintEventLine=function(j,c,f,a,g,d){var h=Math.round(g.trackOffset+f*g.trackIncrement+g.trackHeight/2);var k=Math.round(Math.abs(a-f)*g.trackIncrement);var e="1px solid "+d.event.label.lineColor;var b=this._timeline.getDocument().createElement("div");b.style.position="absolute";b.style.left=c+"px";b.style.width=d.event.label.offsetFromLine+"px";b.style.height=k+"px";if(f>a){b.style.top=(h-k)+"px";b.style.borderTop=e}else{b.style.top=h+"px";b.style.borderBottom=e}b.style.borderLeft=e;this._lineLayer.appendChild(b)};Timeline.DetailedEventPainter.prototype._paintEventIcon=function(j,e,b,f,d){var h=j.getIcon();h=h!=null?h:f.icon;var k=f.trackOffset+e*f.trackIncrement+f.trackHeight/2;var g=Math.round(k-f.iconHeight/2);var c=SimileAjax.Graphics.createTranslucentImage(h);var a=this._timeline.getDocument().createElement("div");a.style.position="absolute";a.style.left=b+"px";a.style.top=g+"px";a.appendChild(c);a.style.cursor="pointer";if(j._title!=null){a.title=j._title}this._eventLayer.appendChild(a);return{left:b,top:g,width:f.iconWidth,height:f.iconHeight,elmt:a}};Timeline.DetailedEventPainter.prototype._paintEventLabel=function(h,j,b,f,a,k,d){var g=this._timeline.getDocument();var l=g.createElement("div");l.style.position="absolute";l.style.left=b+"px";l.style.width=a+"px";l.style.top=f+"px";l.style.height=k+"px";l.style.backgroundColor=d.event.label.backgroundColor;SimileAjax.Graphics.setOpacity(l,d.event.label.backgroundOpacity);this._eventLayer.appendChild(l);var e=g.createElement("div");e.style.position="absolute";e.style.left=b+"px";e.style.width=a+"px";e.style.top=f+"px";e.innerHTML=j;e.style.cursor="pointer";if(h._title!=null){e.title=h._title}var c=h.getTextColor();if(c==null){c=h.getColor()}if(c!=null){e.style.color=c}this._eventLayer.appendChild(e);return{left:b,top:f,width:a,height:k,elmt:e}};Timeline.DetailedEventPainter.prototype._paintEventTape=function(m,h,e,a,c,g,j,f){var b=a-e;var d=f.event.tape.height;var o=j.trackOffset+h*j.trackIncrement+j.trackHeight/2;var k=Math.round(o-d/2);var l=this._timeline.getDocument().createElement("div");l.style.position="absolute";l.style.left=e+"px";l.style.width=b+"px";l.style.top=k+"px";l.style.height=d+"px";l.style.backgroundColor=c;l.style.overflow="hidden";l.style.cursor="pointer";if(m._title!=null){l.title=m._title}SimileAjax.Graphics.setOpacity(l,g);this._eventLayer.appendChild(l);return{left:e,top:k,width:b,height:d,elmt:l}};Timeline.DetailedEventPainter.prototype._createHighlightDiv=function(a,c,e){if(a>=0){var d=this._timeline.getDocument();var g=e.event;var b=g.highlightColors[Math.min(a,g.highlightColors.length-1)];var f=d.createElement("div");f.style.position="absolute";f.style.overflow="hidden";f.style.left=(c.left-2)+"px";f.style.width=(c.width+4)+"px";f.style.top=(c.top-2)+"px";f.style.height=(c.height+4)+"px";f.style.background=b;this._highlightLayer.appendChild(f)}};Timeline.DetailedEventPainter.prototype._onClickInstantEvent=function(b,d,a){var e=SimileAjax.DOM.getPageCoordinates(b);this._showBubble(e.left+Math.ceil(b.offsetWidth/2),e.top+Math.ceil(b.offsetHeight/2),a);this._fireOnSelect(a.getID());d.cancelBubble=true;SimileAjax.DOM.cancelEvent(d);return false};Timeline.DetailedEventPainter.prototype._onClickDurationEvent=function(e,d,b){if("pageX" in d){var a=d.pageX;var g=d.pageY}else{var f=SimileAjax.DOM.getPageCoordinates(e);var a=d.offsetX+f.left;var g=d.offsetY+f.top}this._showBubble(a,g,b);this._fireOnSelect(b.getID());d.cancelBubble=true;SimileAjax.DOM.cancelEvent(d);return false};Timeline.DetailedEventPainter.prototype.showBubble=function(a){var b=this._eventIdToElmt[a.getID()];if(b){var d=SimileAjax.DOM.getPageCoordinates(b);this._showBubble(d.left+b.offsetWidth/2,d.top+b.offsetHeight/2,a)}};Timeline.DetailedEventPainter.prototype._showBubble=function(a,e,b){var d=document.createElement("div");var c=this._params.theme.event.bubble;b.fillInfoBubble(d,this._params.theme,this._band.getLabeller());SimileAjax.WindowManager.cancelPopups();SimileAjax.Graphics.createBubbleForContentAndPoint(d,a,e,c.width,null,c.maxHeight)};Timeline.DetailedEventPainter.prototype._fireOnSelect=function(b){for(var a=0;a=0){var d=this._timeline.getDocument();var g=e.event;var b=g.highlightColors[Math.min(a,g.highlightColors.length-1)];var f=d.createElement("div");f.style.position="absolute";f.style.overflow="hidden";f.style.left=(c.left-1)+"px";f.style.width=(c.width+2)+"px";f.style.top=(c.top-1)+"px";f.style.height=(c.height+2)+"px";f.style.background=b;this._highlightLayer.appendChild(f)}};Timeline.OverviewEventPainter.prototype.showBubble=function(a){};Timeline.CompactEventPainter=function(a){this._params=a;this._onSelectListeners=[];this._filterMatcher=null;this._highlightMatcher=null;this._frc=null;this._eventIdToElmt={}};Timeline.CompactEventPainter.prototype.initialize=function(b,a){this._band=b;this._timeline=a;this._backLayer=null;this._eventLayer=null;this._lineLayer=null;this._highlightLayer=null;this._eventIdToElmt=null};Timeline.CompactEventPainter.prototype.addOnSelectListener=function(a){this._onSelectListeners.push(a)};Timeline.CompactEventPainter.prototype.removeOnSelectListener=function(b){for(var a=0;a
";this._eventLayer.appendChild(a);var k=this;var s=function(T){try{var X=parseInt(this.getAttribute("index"));var V=a.firstChild.childNodes;for(var S=0;S0){E[q-1].end=Math.max(E[q-1].end,x)}var k=e.height+y.iconBottomMargin+p;while(k>0){E.push({start:b,end:x});k-=y.trackHeight}}var r=A.text;var g=this._frc.computeSize(r);var c=g.height+y.labelBottomMargin+p;var f=x+g.width+y.labelRightMargin;if(q>0){E[q-1].end=Math.max(E[q-1].end,f)}for(var z=0;c>0;z++){if(q+z=0){var d=this._timeline.getDocument();var g=e.event;var b=g.highlightColors[Math.min(a,g.highlightColors.length-1)];var f=d.createElement("div");f.style.position="absolute";f.style.overflow="hidden";f.style.left=(c.left-2)+"px";f.style.width=(c.width+4)+"px";f.style.top=(c.top-2)+"px";f.style.height=(c.height+4)+"px";this._highlightLayer.appendChild(f)}};Timeline.CompactEventPainter.prototype._onClickMultiplePreciseInstantEvent=function(e,f,b){var g=SimileAjax.DOM.getPageCoordinates(e);this._showBubble(g.left+Math.ceil(e.offsetWidth/2),g.top+Math.ceil(e.offsetHeight/2),b);var d=[];for(var a=0;a0){f=this._unit.later(f,this._startDate);c=this._unit.earlier(c,this._endDate);var d=this._band.dateToPixelOffset(f);var l=this._band.dateToPixelOffset(c);var j=this._timeline.getDocument();var h=function(){var m=j.createElement("table");m.insertRow(0).insertCell(0);return m};var b=j.createElement("div");b.className="timeline-highlight-decorator";if(this._cssClass){b.className+=" "+this._cssClass}if(this._color!=null){b.style.backgroundColor=this._color}if(this._opacity<100){SimileAjax.Graphics.setOpacity(b,this._opacity)}this._layerDiv.appendChild(b);var k=h();k.className="timeline-highlight-label timeline-highlight-label-start";var g=k.rows[0].cells[0];g.innerHTML=this._startLabel;if(this._cssClass){g.className="label_"+this._cssClass}this._layerDiv.appendChild(k);var a=h();a.className="timeline-highlight-label timeline-highlight-label-end";var e=a.rows[0].cells[0];e.innerHTML=this._endLabel;if(this._cssClass){e.className="label_"+this._cssClass}this._layerDiv.appendChild(a);if(this._timeline.isHorizontal()){b.style.left=d+"px";b.style.width=(l-d)+"px";k.style.right=(this._band.getTotalViewLength()-d)+"px";k.style.width=(this._startLabel.length)+"em";a.style.left=l+"px";a.style.width=(this._endLabel.length)+"em"}else{b.style.top=d+"px";b.style.height=(l-d)+"px";k.style.bottom=d+"px";k.style.height="1.5px";a.style.top=l+"px";a.style.height="1.5px"}}this._layerDiv.style.display="block"};Timeline.SpanHighlightDecorator.prototype.softPaint=function(){};Timeline.PointHighlightDecorator=function(a){this._unit=a.unit!=null?a.unit:SimileAjax.NativeDateUnit;this._date=(typeof a.date=="string")?this._unit.parseFromObject(a.date):a.date;this._width=a.width!=null?a.width:10;this._color=a.color;this._cssClass=a.cssClass!=null?a.cssClass:"";this._opacity=a.opacity!=null?a.opacity:100};Timeline.PointHighlightDecorator.prototype.initialize=function(b,a){this._band=b;this._timeline=a;this._layerDiv=null};Timeline.PointHighlightDecorator.prototype.paint=function(){if(this._layerDiv!=null){this._band.removeLayerDiv(this._layerDiv)}this._layerDiv=this._band.createLayerDiv(10);this._layerDiv.setAttribute("name","span-highlight-decorator");this._layerDiv.style.display="none";var c=this._band.getMinDate();var e=this._band.getMaxDate();if(this._unit.compare(this._date,e)<0&&this._unit.compare(this._date,c)>0){var b=this._band.dateToPixelOffset(this._date);var a=b-Math.round(this._width/2);var d=this._timeline.getDocument();var f=d.createElement("div");f.className="timeline-highlight-point-decorator";f.className+=" "+this._cssClass;if(this._color!=null){f.style.backgroundColor=this._color}if(this._opacity<100){SimileAjax.Graphics.setOpacity(f,this._opacity)}this._layerDiv.appendChild(f);if(this._timeline.isHorizontal()){f.style.left=a+"px";f.style.width=this._width}else{f.style.top=a+"px";f.style.height=this._width}}this._layerDiv.style.display="block"};Timeline.PointHighlightDecorator.prototype.softPaint=function(){};Timeline.NativeDateUnit=new Object();Timeline.NativeDateUnit.createLabeller=function(a,b){return new Timeline.GregorianDateLabeller(a,b)};Timeline.NativeDateUnit.makeDefaultValue=function(){return new Date()};Timeline.NativeDateUnit.cloneValue=function(a){return new Date(a.getTime())};Timeline.NativeDateUnit.getParser=function(a){if(typeof a=="string"){a=a.toLowerCase()}return(a=="iso8601"||a=="iso 8601")?Timeline.DateTime.parseIso8601DateTime:Timeline.DateTime.parseGregorianDateTime};Timeline.NativeDateUnit.parseFromObject=function(a){return Timeline.DateTime.parseGregorianDateTime(a)};Timeline.NativeDateUnit.toNumber=function(a){return a.getTime()};Timeline.NativeDateUnit.fromNumber=function(a){return new Date(a)};Timeline.NativeDateUnit.compare=function(d,c){var b,a;if(typeof d=="object"){b=d.getTime()}else{b=Number(d)}if(typeof c=="object"){a=c.getTime()}else{a=Number(c)}return b-a};Timeline.NativeDateUnit.earlier=function(b,a){return Timeline.NativeDateUnit.compare(b,a)<0?b:a};Timeline.NativeDateUnit.later=function(b,a){return Timeline.NativeDateUnit.compare(b,a)>0?b:a};Timeline.NativeDateUnit.change=function(a,b){return new Date(a.getTime()+b)};Timeline.strings.en={wikiLinkLabel:"Discuss"};Timeline.GregorianDateLabeller.monthNames.en=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Timeline.GregorianDateLabeller.dayNames.en=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];if(typeof window.Timeplot=="undefined"){window.Timeplot={params:{bundle:true,autoCreate:true},namespace:"http://simile.mit.edu/2007/06/timeplot#",importers:{}};Timeplot.urlPrefix=GeoTemCoMinifier_urlPrefix+"lib/simile/timeplot/"}(function(){var local=false;if(document.location.search.length>0){var params=document.location.search.substr(1).split("&");for(var i=0;i=0){local=(url.indexOf("local")>=0)}}node=node.nextSibling}}}var loadTimeplot=function(){if(typeof window.Timeplot!="undefined"){return}window.Timeplot={loaded:false,params:{bundle:true,autoCreate:true},namespace:"http://simile.mit.edu/2007/06/timeplot#",importers:{}};var javascriptFiles=["timeplot.js","plot.js","sources.js","geometry.js","color.js","math.js","processor.js"];var cssFiles=["timeplot.css"];var locales=["en"];var defaultClientLocales=("language" in navigator?navigator.language:navigator.browserLanguage).split(";");for(var l=0;l1&&segments[0]!="en"){locales.push(segments[0])}locales.push(locale)}}var paramTypes={bundle:Boolean,js:Array,css:Array,autoCreate:Boolean};if(typeof Timeplot_urlPrefix=="string"){Timeplot.urlPrefix=Timeplot_urlPrefix;if("Timeplot_parameters" in window){SimileAjax.parseURLParameters(Timeplot_parameters,Timeplot.params,paramTypes)}}else{var url=SimileAjax.findScript(document,"/timeplot-api.js");if(url==null){Timeplot.error=new Error("Failed to derive URL prefix for Simile Timeplot API code files");return}Timeplot.urlPrefix=url.substr(0,url.indexOf("timeplot-api.js"));SimileAjax.parseURLParameters(url,Timeplot.params,paramTypes)}if(Timeplot.params.locale){if(Timeplot.params.locale!="en"){var segments=Timeplot.params.locale.split("-");if(segments.length>1&&segments[0]!="en"){locales.push(segments[0])}locales.push(Timeplot.params.locale)}}var timeplotURLPrefix=Timeplot.urlPrefix;if(local&&!("console" in window)){var firebug=[timeplotURLPrefix+"lib/firebug/firebug.js"];SimileAjax.includeJavascriptFiles(document,"",firebug)}var canvas=document.createElement("canvas");if(!canvas.getContext){var excanvas=[timeplotURLPrefix+"lib/excanvas.js"];SimileAjax.includeJavascriptFiles(document,"",excanvas)}var scriptURLs=Timeplot.params.js||[];var cssURLs=Timeplot.params.css||[];if(Timeplot.params.bundle&&!local){scriptURLs.push(timeplotURLPrefix+"timeplot-bundle.js");cssURLs.push(timeplotURLPrefix+"timeplot-bundle.css")}else{SimileAjax.prefixURLs(scriptURLs,timeplotURLPrefix+"scripts/",javascriptFiles);SimileAjax.prefixURLs(cssURLs,timeplotURLPrefix+"styles/",cssFiles)}window.SimileAjax_onLoad=function(){if(local&&window.console.open){window.console.open()}if(Timeplot.params.callback){eval(Timeplot.params.callback+"()")}};SimileAjax.includeJavascriptFiles(document,"",scriptURLs);SimileAjax.includeCssFiles(document,"",cssURLs);Timeplot.loaded=true};var loadTimeline=function(){if(typeof Timeline!="undefined"){loadTimeplot()}else{var timelineURL="http://api.simile-widgets.org/timeline/2.3.1/timeline-api.js?bundle=true";window.SimileAjax_onLoad=loadTimeplot;SimileAjax.includeJavascriptFile(document,timelineURL)}};if(typeof SimileAjax=="undefined"){window.SimileAjax_onLoad=loadTimeline;var url="http://api.simile-widgets.org/ajax/2.2.1/simile-ajax-api.js?bundle=true";var createScriptElement=function(){var script=document.createElement("script");script.type="text/javascript";script.language="JavaScript";script.src=url;document.getElementsByTagName("head")[0].appendChild(script)};if(document.body==null){try{document.write(" + * + * + * To host the Timeline files on your own server: + * 1) Install the Timeline and Simile-Ajax files onto your webserver using + * timeline_libraries.zip or timeline_source.zip + * + * 2) Set global js variables used to send parameters to this script: + * Timeline_ajax_url -- url for simile-ajax-api.js + * Timeline_urlPrefix -- url for the *directory* that contains timeline-api.js + * Include trailing slash + * Timeline_parameters='bundle=true'; // you must set bundle to true if you are using + * // timeline_libraries.zip since only the + * // bundled libraries are included + * + * eg your html page would include + * + * + * + * + * SCRIPT PARAMETERS + * This script auto-magically figures out locale and has defaults for other parameters + * To set parameters explicity, set js global variable Timeline_parameters or include as + * parameters on the url using GET style. Eg the two next lines pass the same parameters: + * Timeline_parameters='bundle=true'; // pass parameter via js variable + * "); + } catch (e) { + createScriptElement(); + } + } else { + createScriptElement(); + } + } else { + loadMe(); + } + +})(); +/*================================================= + * + * Coding standards: + * + * We aim towards Douglas Crockford's Javascript conventions. + * See: http://javascript.crockford.com/code.html + * See also: http://www.crockford.com/javascript/javascript.html + * + * That said, this JS code was written before some recent JS + * support libraries became widely used or available. + * In particular, the _ character is used to indicate a class function or + * variable that should be considered private to the class. + * + * The code mostly uses accessor methods for getting/setting the private + * class variables. + * + * Over time, we'd like to formalize the convention by using support libraries + * which enforce privacy in objects. + * + * We also want to use jslint: http://www.jslint.com/ + * + * + *================================================== + */ + + + +/*================================================== + * Timeline VERSION + *================================================== + */ +// Note: version is also stored in the build.xml file +Timeline.version = '2.3.1'; // use format 'pre 1.2.3' for trunk versions +Timeline.ajax_lib_version = SimileAjax.version; // Waiting for version string method from Ajax library +Timeline.display_version = Timeline.version + ' (with Ajax lib ' + Timeline.ajax_lib_version + ')'; + // cf method Timeline.writeVersion + +/*================================================== + * Timeline + *================================================== + */ +Timeline.strings = {}; // localization string tables +Timeline.HORIZONTAL = 0; +Timeline.VERTICAL = 1; +Timeline._defaultTheme = null; + +Timeline.getDefaultLocale = function() { + return Timeline.clientLocale; +}; + +Timeline.create = function(elmt, bandInfos, orientation, unit) { + if (Timeline.timelines == null) { + Timeline.timelines = []; + // Timeline.timelines array can have null members--Timelines that + // once existed on the page, but were later disposed of. + } + + var timelineID = Timeline.timelines.length; + Timeline.timelines[timelineID] = null; // placeholder until we have the object + var new_tl = new Timeline._Impl(elmt, bandInfos, orientation, unit, + timelineID); + Timeline.timelines[timelineID] = new_tl; + return new_tl; +}; + +Timeline.createBandInfo = function(params) { + var theme = ("theme" in params) ? params.theme : Timeline.getDefaultTheme(); + + var eventSource = ("eventSource" in params) ? params.eventSource : null; + + var ether = new Timeline.LinearEther({ + centersOn: ("date" in params) ? params.date : new Date(), + interval: SimileAjax.DateTime.gregorianUnitLengths[params.intervalUnit], + pixelsPerInterval: params.intervalPixels, + theme: theme + }); + + var etherPainter = new Timeline.GregorianEtherPainter({ + unit: params.intervalUnit, + multiple: ("multiple" in params) ? params.multiple : 1, + theme: theme, + align: ("align" in params) ? params.align : undefined + }); + + var eventPainterParams = { + showText: ("showEventText" in params) ? params.showEventText : true, + theme: theme + }; + // pass in custom parameters for the event painter + if ("eventPainterParams" in params) { + for (var prop in params.eventPainterParams) { + eventPainterParams[prop] = params.eventPainterParams[prop]; + } + } + + if ("trackHeight" in params) { + eventPainterParams.trackHeight = params.trackHeight; + } + if ("trackGap" in params) { + eventPainterParams.trackGap = params.trackGap; + } + + var layout = ("overview" in params && params.overview) ? "overview" : ("layout" in params ? params.layout : "original"); + var eventPainter; + if ("eventPainter" in params) { + eventPainter = new params.eventPainter(eventPainterParams); + } else { + switch (layout) { + case "overview" : + eventPainter = new Timeline.OverviewEventPainter(eventPainterParams); + break; + case "detailed" : + eventPainter = new Timeline.DetailedEventPainter(eventPainterParams); + break; + default: + eventPainter = new Timeline.OriginalEventPainter(eventPainterParams); + } + } + + return { + width: params.width, + eventSource: eventSource, + timeZone: ("timeZone" in params) ? params.timeZone : 0, + ether: ether, + etherPainter: etherPainter, + eventPainter: eventPainter, + theme: theme, + zoomIndex: ("zoomIndex" in params) ? params.zoomIndex : 0, + zoomSteps: ("zoomSteps" in params) ? params.zoomSteps : null + }; +}; + +Timeline.createHotZoneBandInfo = function(params) { + var theme = ("theme" in params) ? params.theme : Timeline.getDefaultTheme(); + + var eventSource = ("eventSource" in params) ? params.eventSource : null; + + var ether = new Timeline.HotZoneEther({ + centersOn: ("date" in params) ? params.date : new Date(), + interval: SimileAjax.DateTime.gregorianUnitLengths[params.intervalUnit], + pixelsPerInterval: params.intervalPixels, + zones: params.zones, + theme: theme + }); + + var etherPainter = new Timeline.HotZoneGregorianEtherPainter({ + unit: params.intervalUnit, + zones: params.zones, + theme: theme, + align: ("align" in params) ? params.align : undefined + }); + + var eventPainterParams = { + showText: ("showEventText" in params) ? params.showEventText : true, + theme: theme + }; + // pass in custom parameters for the event painter + if ("eventPainterParams" in params) { + for (var prop in params.eventPainterParams) { + eventPainterParams[prop] = params.eventPainterParams[prop]; + } + } + if ("trackHeight" in params) { + eventPainterParams.trackHeight = params.trackHeight; + } + if ("trackGap" in params) { + eventPainterParams.trackGap = params.trackGap; + } + + var layout = ("overview" in params && params.overview) ? "overview" : ("layout" in params ? params.layout : "original"); + var eventPainter; + if ("eventPainter" in params) { + eventPainter = new params.eventPainter(eventPainterParams); + } else { + switch (layout) { + case "overview" : + eventPainter = new Timeline.OverviewEventPainter(eventPainterParams); + break; + case "detailed" : + eventPainter = new Timeline.DetailedEventPainter(eventPainterParams); + break; + default: + eventPainter = new Timeline.OriginalEventPainter(eventPainterParams); + } + } + return { + width: params.width, + eventSource: eventSource, + timeZone: ("timeZone" in params) ? params.timeZone : 0, + ether: ether, + etherPainter: etherPainter, + eventPainter: eventPainter, + theme: theme, + zoomIndex: ("zoomIndex" in params) ? params.zoomIndex : 0, + zoomSteps: ("zoomSteps" in params) ? params.zoomSteps : null + }; +}; + +Timeline.getDefaultTheme = function() { + if (Timeline._defaultTheme == null) { + Timeline._defaultTheme = Timeline.ClassicTheme.create(Timeline.getDefaultLocale()); + } + return Timeline._defaultTheme; +}; + +Timeline.setDefaultTheme = function(theme) { + Timeline._defaultTheme = theme; +}; + +Timeline.loadXML = function(url, f) { + var fError = function(statusText, status, xmlhttp) { + alert("Failed to load data xml from " + url + "\n" + statusText); + }; + var fDone = function(xmlhttp) { + var xml = xmlhttp.responseXML; + if (!xml.documentElement && xmlhttp.responseStream) { + xml.load(xmlhttp.responseStream); + } + f(xml, url); + }; + SimileAjax.XmlHttp.get(url, fError, fDone); +}; + + +Timeline.loadJSON = function(url, f) { + var fError = function(statusText, status, xmlhttp) { + alert("Failed to load json data from " + url + "\n" + statusText); + }; + var fDone = function(xmlhttp) { + f(eval('(' + xmlhttp.responseText + ')'), url); + }; + SimileAjax.XmlHttp.get(url, fError, fDone); +}; + +Timeline.getTimelineFromID = function(timelineID) { + return Timeline.timelines[timelineID]; +}; + +// Write the current Timeline version as the contents of element with id el_id +Timeline.writeVersion = function(el_id) { + document.getElementById(el_id).innerHTML = this.display_version; +}; + + + +/*================================================== + * Timeline Implementation object + *================================================== + */ +Timeline._Impl = function(elmt, bandInfos, orientation, unit, timelineID) { + SimileAjax.WindowManager.initialize(); + + this._containerDiv = elmt; + + this._bandInfos = bandInfos; + this._orientation = orientation == null ? Timeline.HORIZONTAL : orientation; + this._unit = (unit != null) ? unit : SimileAjax.NativeDateUnit; + this._starting = true; // is the Timeline being created? Used by autoWidth + // functions + this._autoResizing = false; + + // autoWidth is a "public" property of the Timeline object + this.autoWidth = bandInfos && bandInfos[0] && bandInfos[0].theme && + bandInfos[0].theme.autoWidth; + this.autoWidthAnimationTime = bandInfos && bandInfos[0] && bandInfos[0].theme && + bandInfos[0].theme.autoWidthAnimationTime; + this.timelineID = timelineID; // also public attribute + this.timeline_start = bandInfos && bandInfos[0] && bandInfos[0].theme && + bandInfos[0].theme.timeline_start; + this.timeline_stop = bandInfos && bandInfos[0] && bandInfos[0].theme && + bandInfos[0].theme.timeline_stop; + this.timeline_at_start = false; // already at start or stop? Then won't + this.timeline_at_stop = false; // try to move further in the wrong direction + + this._initialize(); +}; + +// +// Public functions used by client sw +// +Timeline._Impl.prototype.dispose = function() { + for (var i = 0; i < this._bands.length; i++) { + this._bands[i].dispose(); + } + this._bands = null; + this._bandInfos = null; + this._containerDiv.innerHTML = ""; + // remove from array of Timelines + Timeline.timelines[this.timelineID] = null; +}; + +Timeline._Impl.prototype.getBandCount = function() { + return this._bands.length; +}; + +Timeline._Impl.prototype.getBand = function(index) { + return this._bands[index]; +}; + +Timeline._Impl.prototype.finishedEventLoading = function() { + // Called by client after events have been loaded into Timeline + // Only used if the client has set autoWidth + // Sets width to Timeline's requested amount and will shrink down the div if + // need be. + this._autoWidthCheck(true); + this._starting = false; +}; + +Timeline._Impl.prototype.layout = function() { + // called by client when browser is resized + this._autoWidthCheck(true); + this._distributeWidths(); +}; + +Timeline._Impl.prototype.paint = function() { + for (var i = 0; i < this._bands.length; i++) { + this._bands[i].paint(); + } +}; + +Timeline._Impl.prototype.getDocument = function() { + return this._containerDiv.ownerDocument; +}; + +Timeline._Impl.prototype.addDiv = function(div) { + this._containerDiv.appendChild(div); +}; + +Timeline._Impl.prototype.removeDiv = function(div) { + this._containerDiv.removeChild(div); +}; + +Timeline._Impl.prototype.isHorizontal = function() { + return this._orientation == Timeline.HORIZONTAL; +}; + +Timeline._Impl.prototype.isVertical = function() { + return this._orientation == Timeline.VERTICAL; +}; + +Timeline._Impl.prototype.getPixelLength = function() { + return this._orientation == Timeline.HORIZONTAL ? + this._containerDiv.offsetWidth : this._containerDiv.offsetHeight; +}; + +Timeline._Impl.prototype.getPixelWidth = function() { + return this._orientation == Timeline.VERTICAL ? + this._containerDiv.offsetWidth : this._containerDiv.offsetHeight; +}; + +Timeline._Impl.prototype.getUnit = function() { + return this._unit; +}; + +Timeline._Impl.prototype.getWidthStyle = function() { + // which element.style attribute should be changed to affect Timeline's "width" + return this._orientation == Timeline.HORIZONTAL ? 'height' : 'width'; +}; + +Timeline._Impl.prototype.loadXML = function(url, f) { + var tl = this; + + + var fError = function(statusText, status, xmlhttp) { + alert("Failed to load data xml from " + url + "\n" + statusText); + tl.hideLoadingMessage(); + }; + var fDone = function(xmlhttp) { + try { + var xml = xmlhttp.responseXML; + if (!xml.documentElement && xmlhttp.responseStream) { + xml.load(xmlhttp.responseStream); + } + f(xml, url); + } finally { + tl.hideLoadingMessage(); + } + }; + + this.showLoadingMessage(); + window.setTimeout(function() { SimileAjax.XmlHttp.get(url, fError, fDone); }, 0); +}; + +Timeline._Impl.prototype.loadJSON = function(url, f) { + var tl = this; + + var fError = function(statusText, status, xmlhttp) { + alert("Failed to load json data from " + url + "\n" + statusText); + tl.hideLoadingMessage(); + }; + var fDone = function(xmlhttp) { + try { + f(eval('(' + xmlhttp.responseText + ')'), url); + } finally { + tl.hideLoadingMessage(); + } + }; + + this.showLoadingMessage(); + window.setTimeout(function() { SimileAjax.XmlHttp.get(url, fError, fDone); }, 0); +}; + + +// +// Private functions used by Timeline object functions +// + +Timeline._Impl.prototype._autoWidthScrollListener = function(band) { + band.getTimeline()._autoWidthCheck(false); +}; + +// called to re-calculate auto width and adjust the overall Timeline div if needed +Timeline._Impl.prototype._autoWidthCheck = function(okToShrink) { + var timeline = this; // this Timeline + var immediateChange = timeline._starting; + var newWidth = 0; + + function changeTimelineWidth() { + var widthStyle = timeline.getWidthStyle(); + if (immediateChange) { + timeline._containerDiv.style[widthStyle] = newWidth + 'px'; + } else { + // animate change + timeline._autoResizing = true; + var animateParam ={}; + animateParam[widthStyle] = newWidth + 'px'; + + SimileAjax.jQuery(timeline._containerDiv).animate( + animateParam, timeline.autoWidthAnimationTime, + 'linear', function(){timeline._autoResizing = false;}); + } + } + + function checkTimelineWidth() { + var targetWidth = 0; // the new desired width + var currentWidth = timeline.getPixelWidth(); + + if (timeline._autoResizing) { + return; // early return + } + + // compute targetWidth + for (var i = 0; i < timeline._bands.length; i++) { + timeline._bands[i].checkAutoWidth(); + targetWidth += timeline._bandInfos[i].width; + } + + if (targetWidth > currentWidth || okToShrink) { + // yes, let's change the size + newWidth = targetWidth; + changeTimelineWidth(); + timeline._distributeWidths(); + } + } + + // function's mainline + if (!timeline.autoWidth) { + return; // early return + } + + checkTimelineWidth(); +}; + +Timeline._Impl.prototype._initialize = function() { + var containerDiv = this._containerDiv; + var doc = containerDiv.ownerDocument; + + containerDiv.className = + containerDiv.className.split(" ").concat("timeline-container").join(" "); + + /* + * Set css-class on container div that will define orientation + */ + var orientation = (this.isHorizontal()) ? 'horizontal' : 'vertical' + containerDiv.className +=' timeline-'+orientation; + + + while (containerDiv.firstChild) { + containerDiv.removeChild(containerDiv.firstChild); + } + + /* + * inserting copyright and link to simile + */ + var elmtCopyright = SimileAjax.Graphics.createTranslucentImage(Timeline.urlPrefix + (this.isHorizontal() ? "images/copyright-vertical.png" : "images/copyright.png")); + elmtCopyright.className = "timeline-copyright"; + elmtCopyright.title = "Timeline copyright SIMILE - www.code.google.com/p/simile-widgets/"; + SimileAjax.DOM.registerEvent(elmtCopyright, "click", function() { window.location = "http://code.google.com/p/simile-widgets/"; }); + containerDiv.appendChild(elmtCopyright); + + /* + * creating bands + */ + this._bands = []; + for (var i = 0; i < this._bandInfos.length; i++) { + var band = new Timeline._Band(this, this._bandInfos[i], i); + this._bands.push(band); + } + this._distributeWidths(); + + /* + * sync'ing bands + */ + for (var i = 0; i < this._bandInfos.length; i++) { + var bandInfo = this._bandInfos[i]; + if ("syncWith" in bandInfo) { + this._bands[i].setSyncWithBand( + this._bands[bandInfo.syncWith], + ("highlight" in bandInfo) ? bandInfo.highlight : false + ); + } + } + + + if (this.autoWidth) { + for (var i = 0; i < this._bands.length; i++) { + this._bands[i].addOnScrollListener(this._autoWidthScrollListener); + } + } + + + /* + * creating loading UI + */ + var message = SimileAjax.Graphics.createMessageBubble(doc); + message.containerDiv.className = "timeline-message-container"; + containerDiv.appendChild(message.containerDiv); + + message.contentDiv.className = "timeline-message"; + message.contentDiv.innerHTML = " Loading..."; + + this.showLoadingMessage = function() { message.containerDiv.style.display = "block"; }; + this.hideLoadingMessage = function() { message.containerDiv.style.display = "none"; }; +}; + +Timeline._Impl.prototype._distributeWidths = function() { + var length = this.getPixelLength(); + var width = this.getPixelWidth(); + var cumulativeWidth = 0; + + for (var i = 0; i < this._bands.length; i++) { + var band = this._bands[i]; + var bandInfos = this._bandInfos[i]; + var widthString = bandInfos.width; + var bandWidth; + + if (typeof widthString == 'string') { + var x = widthString.indexOf("%"); + if (x > 0) { + var percent = parseInt(widthString.substr(0, x)); + bandWidth = Math.round(percent * width / 100); + } else { + bandWidth = parseInt(widthString); + } + } else { + // was given an integer + bandWidth = widthString; + } + + band.setBandShiftAndWidth(cumulativeWidth, bandWidth); + band.setViewLength(length); + + cumulativeWidth += bandWidth; + } +}; + +Timeline._Impl.prototype.shiftOK = function(index, shift) { + // Returns true if the proposed shift is ok + // + // Positive shift means going back in time + var going_back = shift > 0, + going_forward = shift < 0; + + // Is there an edge? + if ((going_back && this.timeline_start == null) || + (going_forward && this.timeline_stop == null) || + (shift == 0)) { + return (true); // early return + } + + // If any of the bands has noted that it is changing the others, + // then this shift is a secondary shift in reaction to the real shift, + // which already happened. In such cases, ignore it. (The issue is + // that a positive original shift can cause a negative secondary shift, + // as the bands adjust.) + var secondary_shift = false; + for (var i = 0; i < this._bands.length && !secondary_shift; i++) { + secondary_shift = this._bands[i].busy(); + } + if (secondary_shift) { + return(true); // early return + } + + // If we are already at an edge, then don't even think about going any further + if ((going_back && this.timeline_at_start) || + (going_forward && this.timeline_at_stop)) { + return (false); // early return + } + + // Need to check all the bands + var ok = false; // return value + // If any of the bands will be or are showing an ok date, then let the shift proceed. + for (var i = 0; i < this._bands.length && !ok; i++) { + var band = this._bands[i]; + if (going_back) { + ok = (i == index ? band.getMinVisibleDateAfterDelta(shift) : band.getMinVisibleDate()) + >= this.timeline_start; + } else { + ok = (i == index ? band.getMaxVisibleDateAfterDelta(shift) : band.getMaxVisibleDate()) + <= this.timeline_stop; + } + } + + // process results + if (going_back) { + this.timeline_at_start = !ok; + this.timeline_at_stop = false; + } else { + this.timeline_at_stop = !ok; + this.timeline_at_start = false; + } + // This is where you could have an effect once per hitting an + // edge of the Timeline. Eg jitter the Timeline + //if (!ok) { + //alert(going_back ? "At beginning" : "At end"); + //} + return (ok); +}; + +Timeline._Impl.prototype.zoom = function (zoomIn, x, y, target) { + var matcher = new RegExp("^timeline-band-([0-9]+)$"); + var bandIndex = null; + + var result = matcher.exec(target.id); + if (result) { + bandIndex = parseInt(result[1]); + } + + if (bandIndex != null) { + this._bands[bandIndex].zoom(zoomIn, x, y, target); + } + + this.paint(); +}; + +/*================================================= + * + * Coding standards: + * + * We aim towards Douglas Crockford's Javascript conventions. + * See: http://javascript.crockford.com/code.html + * See also: http://www.crockford.com/javascript/javascript.html + * + * That said, this JS code was written before some recent JS + * support libraries became widely used or available. + * In particular, the _ character is used to indicate a class function or + * variable that should be considered private to the class. + * + * The code mostly uses accessor methods for getting/setting the private + * class variables. + * + * Over time, we'd like to formalize the convention by using support libraries + * which enforce privacy in objects. + * + * We also want to use jslint: http://www.jslint.com/ + * + * + *================================================== + */ + + + +/*================================================== + * Band + *================================================== + */ +Timeline._Band = function(timeline, bandInfo, index) { + // Set up the band's object + + // Munge params: If autoWidth is on for the Timeline, then ensure that + // bandInfo.width is an integer + if (timeline.autoWidth && typeof bandInfo.width == 'string') { + bandInfo.width = bandInfo.width.indexOf("%") > -1 ? 0 : parseInt(bandInfo.width); + } + + this._timeline = timeline; + this._bandInfo = bandInfo; + + this._index = index; + + this._locale = ("locale" in bandInfo) ? bandInfo.locale : Timeline.getDefaultLocale(); + this._timeZone = ("timeZone" in bandInfo) ? bandInfo.timeZone : 0; + this._labeller = ("labeller" in bandInfo) ? bandInfo.labeller : + (("createLabeller" in timeline.getUnit()) ? + timeline.getUnit().createLabeller(this._locale, this._timeZone) : + new Timeline.GregorianDateLabeller(this._locale, this._timeZone)); + this._theme = bandInfo.theme; + this._zoomIndex = ("zoomIndex" in bandInfo) ? bandInfo.zoomIndex : 0; + this._zoomSteps = ("zoomSteps" in bandInfo) ? bandInfo.zoomSteps : null; + + this._dragging = false; + this._changing = false; + this._originalScrollSpeed = 5; // pixels + this._scrollSpeed = this._originalScrollSpeed; + this._onScrollListeners = []; + + var b = this; + this._syncWithBand = null; + this._syncWithBandHandler = function(band) { + b._onHighlightBandScroll(); + }; + this._selectorListener = function(band) { + b._onHighlightBandScroll(); + }; + + /* + * Install a textbox to capture keyboard events + */ + var inputDiv = this._timeline.getDocument().createElement("div"); + inputDiv.className = "timeline-band-input"; + this._timeline.addDiv(inputDiv); + + this._keyboardInput = document.createElement("input"); + this._keyboardInput.type = "text"; + inputDiv.appendChild(this._keyboardInput); + SimileAjax.DOM.registerEventWithObject(this._keyboardInput, "keydown", this, "_onKeyDown"); + SimileAjax.DOM.registerEventWithObject(this._keyboardInput, "keyup", this, "_onKeyUp"); + + /* + * The band's outer most div that slides with respect to the timeline's div + */ + this._div = this._timeline.getDocument().createElement("div"); + this._div.id = "timeline-band-" + index; + this._div.className = "timeline-band timeline-band-" + index; + this._timeline.addDiv(this._div); + + SimileAjax.DOM.registerEventWithObject(this._div, "mousedown", this, "_onMouseDown"); + SimileAjax.DOM.registerEventWithObject(this._div, "mousemove", this, "_onMouseMove"); + SimileAjax.DOM.registerEventWithObject(this._div, "mouseup", this, "_onMouseUp"); + SimileAjax.DOM.registerEventWithObject(this._div, "mouseout", this, "_onMouseOut"); + SimileAjax.DOM.registerEventWithObject(this._div, "dblclick", this, "_onDblClick"); + + var mouseWheel = this._theme!= null ? this._theme.mouseWheel : 'scroll'; // theme is not always defined + if (mouseWheel === 'zoom' || mouseWheel === 'scroll' || this._zoomSteps) { + // capture mouse scroll + if (SimileAjax.Platform.browser.isFirefox) { + SimileAjax.DOM.registerEventWithObject(this._div, "DOMMouseScroll", this, "_onMouseScroll"); + } else { + SimileAjax.DOM.registerEventWithObject(this._div, "mousewheel", this, "_onMouseScroll"); + } + } + + /* + * The inner div that contains layers + */ + this._innerDiv = this._timeline.getDocument().createElement("div"); + this._innerDiv.className = "timeline-band-inner"; + this._div.appendChild(this._innerDiv); + + /* + * Initialize parts of the band + */ + this._ether = bandInfo.ether; + bandInfo.ether.initialize(this, timeline); + + this._etherPainter = bandInfo.etherPainter; + bandInfo.etherPainter.initialize(this, timeline); + + this._eventSource = bandInfo.eventSource; + if (this._eventSource) { + this._eventListener = { + onAddMany: function() { b._onAddMany(); }, + onClear: function() { b._onClear(); } + } + this._eventSource.addListener(this._eventListener); + } + + this._eventPainter = bandInfo.eventPainter; + this._eventTracksNeeded = 0; // set by painter via updateEventTrackInfo + this._eventTrackIncrement = 0; + bandInfo.eventPainter.initialize(this, timeline); + + this._decorators = ("decorators" in bandInfo) ? bandInfo.decorators : []; + for (var i = 0; i < this._decorators.length; i++) { + this._decorators[i].initialize(this, timeline); + } +}; + +Timeline._Band.SCROLL_MULTIPLES = 5; + +Timeline._Band.prototype.dispose = function() { + this.closeBubble(); + + if (this._eventSource) { + this._eventSource.removeListener(this._eventListener); + this._eventListener = null; + this._eventSource = null; + } + + this._timeline = null; + this._bandInfo = null; + + this._labeller = null; + this._ether = null; + this._etherPainter = null; + this._eventPainter = null; + this._decorators = null; + + this._onScrollListeners = null; + this._syncWithBandHandler = null; + this._selectorListener = null; + + this._div = null; + this._innerDiv = null; + this._keyboardInput = null; +}; + +Timeline._Band.prototype.addOnScrollListener = function(listener) { + this._onScrollListeners.push(listener); +}; + +Timeline._Band.prototype.removeOnScrollListener = function(listener) { + for (var i = 0; i < this._onScrollListeners.length; i++) { + if (this._onScrollListeners[i] == listener) { + this._onScrollListeners.splice(i, 1); + break; + } + } +}; + +Timeline._Band.prototype.setSyncWithBand = function(band, highlight) { + if (this._syncWithBand) { + this._syncWithBand.removeOnScrollListener(this._syncWithBandHandler); + } + + this._syncWithBand = band; + this._syncWithBand.addOnScrollListener(this._syncWithBandHandler); + this._highlight = highlight; + this._positionHighlight(); +}; + +Timeline._Band.prototype.getLocale = function() { + return this._locale; +}; + +Timeline._Band.prototype.getTimeZone = function() { + return this._timeZone; +}; + +Timeline._Band.prototype.getLabeller = function() { + return this._labeller; +}; + +Timeline._Band.prototype.getIndex = function() { + return this._index; +}; + +Timeline._Band.prototype.getEther = function() { + return this._ether; +}; + +Timeline._Band.prototype.getEtherPainter = function() { + return this._etherPainter; +}; + +Timeline._Band.prototype.getEventSource = function() { + return this._eventSource; +}; + +Timeline._Band.prototype.getEventPainter = function() { + return this._eventPainter; +}; + +Timeline._Band.prototype.getTimeline = function() { + return this._timeline; +}; + +// Autowidth support +Timeline._Band.prototype.updateEventTrackInfo = function(tracks, increment) { + this._eventTrackIncrement = increment; // doesn't vary for a specific band + + if (tracks > this._eventTracksNeeded) { + this._eventTracksNeeded = tracks; + } +}; + +// Autowidth support +Timeline._Band.prototype.checkAutoWidth = function() { + // if a new (larger) width is needed by the band + // then: a) updates the band's bandInfo.width + // + // desiredWidth for the band is + // (number of tracks + margin) * track increment + if (! this._timeline.autoWidth) { + return; // early return + } + + var overviewBand = this._eventPainter.getType() == 'overview'; + var margin = overviewBand ? + this._theme.event.overviewTrack.autoWidthMargin : + this._theme.event.track.autoWidthMargin; + var desiredWidth = Math.ceil((this._eventTracksNeeded + margin) * + this._eventTrackIncrement); + // add offset amount (additional margin) + desiredWidth += overviewBand ? this._theme.event.overviewTrack.offset : + this._theme.event.track.offset; + var bandInfo = this._bandInfo; + + if (desiredWidth != bandInfo.width) { + bandInfo.width = desiredWidth; + } +}; + +Timeline._Band.prototype.layout = function() { + this.paint(); +}; + +Timeline._Band.prototype.paint = function() { + this._etherPainter.paint(); + this._paintDecorators(); + this._paintEvents(); +}; + +Timeline._Band.prototype.softLayout = function() { + this.softPaint(); +}; + +Timeline._Band.prototype.softPaint = function() { + this._etherPainter.softPaint(); + this._softPaintDecorators(); + this._softPaintEvents(); +}; + +Timeline._Band.prototype.setBandShiftAndWidth = function(shift, width) { + var inputDiv = this._keyboardInput.parentNode; + var middle = shift + Math.floor(width / 2); + if (this._timeline.isHorizontal()) { + this._div.style.top = shift + "px"; + this._div.style.height = width + "px"; + + inputDiv.style.top = middle + "px"; + inputDiv.style.left = "-1em"; + } else { + this._div.style.left = shift + "px"; + this._div.style.width = width + "px"; + + inputDiv.style.left = middle + "px"; + inputDiv.style.top = "-1em"; + } +}; + +Timeline._Band.prototype.getViewWidth = function() { + if (this._timeline.isHorizontal()) { + return this._div.offsetHeight; + } else { + return this._div.offsetWidth; + } +}; + +Timeline._Band.prototype.setViewLength = function(length) { + this._viewLength = length; + this._recenterDiv(); + this._onChanging(); +}; + +Timeline._Band.prototype.getViewLength = function() { + return this._viewLength; +}; + +Timeline._Band.prototype.getTotalViewLength = function() { + return Timeline._Band.SCROLL_MULTIPLES * this._viewLength; +}; + +Timeline._Band.prototype.getViewOffset = function() { + return this._viewOffset; +}; + +Timeline._Band.prototype.getMinDate = function() { + return this._ether.pixelOffsetToDate(this._viewOffset); +}; + +Timeline._Band.prototype.getMaxDate = function() { + return this._ether.pixelOffsetToDate(this._viewOffset + Timeline._Band.SCROLL_MULTIPLES * this._viewLength); +}; + +Timeline._Band.prototype.getMinVisibleDate = function() { + return this._ether.pixelOffsetToDate(0); +}; + +Timeline._Band.prototype.getMinVisibleDateAfterDelta = function(delta) { + return this._ether.pixelOffsetToDate(delta); +}; + +Timeline._Band.prototype.getMaxVisibleDate = function() { + // Max date currently visible on band + return this._ether.pixelOffsetToDate(this._viewLength); +}; + +Timeline._Band.prototype.getMaxVisibleDateAfterDelta = function(delta) { + // Max date visible on band after delta px view change is applied + return this._ether.pixelOffsetToDate(this._viewLength + delta); +}; + +Timeline._Band.prototype.getCenterVisibleDate = function() { + return this._ether.pixelOffsetToDate(this._viewLength / 2); +}; + +Timeline._Band.prototype.setMinVisibleDate = function(date) { + if (!this._changing) { + this._moveEther(Math.round(-this._ether.dateToPixelOffset(date))); + } +}; + +Timeline._Band.prototype.setMaxVisibleDate = function(date) { + if (!this._changing) { + this._moveEther(Math.round(this._viewLength - this._ether.dateToPixelOffset(date))); + } +}; + +Timeline._Band.prototype.setCenterVisibleDate = function(date) { + if (!this._changing) { + this._moveEther(Math.round(this._viewLength / 2 - this._ether.dateToPixelOffset(date))); + } +}; + +Timeline._Band.prototype.dateToPixelOffset = function(date) { + return this._ether.dateToPixelOffset(date) - this._viewOffset; +}; + +Timeline._Band.prototype.pixelOffsetToDate = function(pixels) { + return this._ether.pixelOffsetToDate(pixels + this._viewOffset); +}; + +Timeline._Band.prototype.createLayerDiv = function(zIndex, className) { + var div = this._timeline.getDocument().createElement("div"); + div.className = "timeline-band-layer" + (typeof className == "string" ? (" " + className) : ""); + div.style.zIndex = zIndex; + this._innerDiv.appendChild(div); + + var innerDiv = this._timeline.getDocument().createElement("div"); + innerDiv.className = "timeline-band-layer-inner"; + if (SimileAjax.Platform.browser.isIE) { + innerDiv.style.cursor = "move"; + } else { + innerDiv.style.cursor = "-moz-grab"; + } + div.appendChild(innerDiv); + + return innerDiv; +}; + +Timeline._Band.prototype.removeLayerDiv = function(div) { + this._innerDiv.removeChild(div.parentNode); +}; + +Timeline._Band.prototype.scrollToCenter = function(date, f) { + var pixelOffset = this._ether.dateToPixelOffset(date); + if (pixelOffset < -this._viewLength / 2) { + this.setCenterVisibleDate(this.pixelOffsetToDate(pixelOffset + this._viewLength)); + } else if (pixelOffset > 3 * this._viewLength / 2) { + this.setCenterVisibleDate(this.pixelOffsetToDate(pixelOffset - this._viewLength)); + } + this._autoScroll(Math.round(this._viewLength / 2 - this._ether.dateToPixelOffset(date)), f); +}; + +Timeline._Band.prototype.showBubbleForEvent = function(eventID) { + var evt = this.getEventSource().getEvent(eventID); + if (evt) { + var self = this; + this.scrollToCenter(evt.getStart(), function() { + self._eventPainter.showBubble(evt); + }); + } +}; + +Timeline._Band.prototype.zoom = function(zoomIn, x, y, target) { + if (!this._zoomSteps) { + // zoom disabled + return; + } + + // shift the x value by our offset + x += this._viewOffset; + + var zoomDate = this._ether.pixelOffsetToDate(x); + var netIntervalChange = this._ether.zoom(zoomIn); + this._etherPainter.zoom(netIntervalChange); + + // shift our zoom date to the far left + this._moveEther(Math.round(-this._ether.dateToPixelOffset(zoomDate))); + // then shift it back to where the mouse was + this._moveEther(x); +}; + +Timeline._Band.prototype._onMouseDown = function(innerFrame, evt, target) { + this.closeBubble(); + + this._dragging = true; + this._dragX = evt.clientX; + this._dragY = evt.clientY; +}; + +Timeline._Band.prototype._onMouseMove = function(innerFrame, evt, target) { + if (this._dragging) { + var diffX = evt.clientX - this._dragX; + var diffY = evt.clientY - this._dragY; + + this._dragX = evt.clientX; + this._dragY = evt.clientY; + + this._moveEther(this._timeline.isHorizontal() ? diffX : diffY); + this._positionHighlight(); + } +}; + +Timeline._Band.prototype._onMouseUp = function(innerFrame, evt, target) { + this._dragging = false; + this._keyboardInput.focus(); +}; + +Timeline._Band.prototype._onMouseOut = function(innerFrame, evt, target) { + var coords = SimileAjax.DOM.getEventRelativeCoordinates(evt, innerFrame); + coords.x += this._viewOffset; + if (coords.x < 0 || coords.x > innerFrame.offsetWidth || + coords.y < 0 || coords.y > innerFrame.offsetHeight) { + this._dragging = false; + } +}; + +Timeline._Band.prototype._onMouseScroll = function(innerFrame, evt, target) { + var now = new Date(); + now = now.getTime(); + + if (!this._lastScrollTime || ((now - this._lastScrollTime) > 50)) { + // limit 1 scroll per 200ms due to FF3 sending multiple events back to back + this._lastScrollTime = now; + + var delta = 0; + if (evt.wheelDelta) { + delta = evt.wheelDelta/120; + } else if (evt.detail) { + delta = -evt.detail/3; + } + + // either scroll or zoom + var mouseWheel = this._theme.mouseWheel; + + if (this._zoomSteps || mouseWheel === 'zoom') { + var loc = SimileAjax.DOM.getEventRelativeCoordinates(evt, innerFrame); + if (delta != 0) { + var zoomIn; + if (delta > 0) + zoomIn = true; + if (delta < 0) + zoomIn = false; + // call zoom on the timeline so we could zoom multiple bands if desired + this._timeline.zoom(zoomIn, loc.x, loc.y, innerFrame); + } + } + else if (mouseWheel === 'scroll') { + var move_amt = 50 * (delta < 0 ? -1 : 1); + this._moveEther(move_amt); + } + } + + // prevent bubble + if (evt.stopPropagation) { + evt.stopPropagation(); + } + evt.cancelBubble = true; + + // prevent the default action + if (evt.preventDefault) { + evt.preventDefault(); + } + evt.returnValue = false; +}; + +Timeline._Band.prototype._onDblClick = function(innerFrame, evt, target) { + var coords = SimileAjax.DOM.getEventRelativeCoordinates(evt, innerFrame); + var distance = coords.x - (this._viewLength / 2 - this._viewOffset); + + this._autoScroll(-distance); +}; + +Timeline._Band.prototype._onKeyDown = function(keyboardInput, evt, target) { + if (!this._dragging) { + switch (evt.keyCode) { + case 27: // ESC + break; + case 37: // left arrow + case 38: // up arrow + this._scrollSpeed = Math.min(50, Math.abs(this._scrollSpeed * 1.05)); + this._moveEther(this._scrollSpeed); + break; + case 39: // right arrow + case 40: // down arrow + this._scrollSpeed = -Math.min(50, Math.abs(this._scrollSpeed * 1.05)); + this._moveEther(this._scrollSpeed); + break; + default: + return true; + } + this.closeBubble(); + + SimileAjax.DOM.cancelEvent(evt); + return false; + } + return true; +}; + +Timeline._Band.prototype._onKeyUp = function(keyboardInput, evt, target) { + if (!this._dragging) { + this._scrollSpeed = this._originalScrollSpeed; + + switch (evt.keyCode) { + case 35: // end + this.setCenterVisibleDate(this._eventSource.getLatestDate()); + break; + case 36: // home + this.setCenterVisibleDate(this._eventSource.getEarliestDate()); + break; + case 33: // page up + this._autoScroll(this._timeline.getPixelLength()); + break; + case 34: // page down + this._autoScroll(-this._timeline.getPixelLength()); + break; + default: + return true; + } + + this.closeBubble(); + + SimileAjax.DOM.cancelEvent(evt); + return false; + } + return true; +}; + +Timeline._Band.prototype._autoScroll = function(distance, f) { + var b = this; + var a = SimileAjax.Graphics.createAnimation( + function(abs, diff) { + b._moveEther(diff); + }, + 0, + distance, + 1000, + f + ); + a.run(); +}; + +Timeline._Band.prototype._moveEther = function(shift) { + this.closeBubble(); + + // A positive shift means back in time + // Check that we're not moving beyond Timeline's limits + if (!this._timeline.shiftOK(this._index, shift)) { + return; // early return + } + + this._viewOffset += shift; + this._ether.shiftPixels(-shift); + if (this._timeline.isHorizontal()) { + this._div.style.left = this._viewOffset + "px"; + } else { + this._div.style.top = this._viewOffset + "px"; + } + + if (this._viewOffset > -this._viewLength * 0.5 || + this._viewOffset < -this._viewLength * (Timeline._Band.SCROLL_MULTIPLES - 1.5)) { + + this._recenterDiv(); + } else { + this.softLayout(); + } + + this._onChanging(); +} + +Timeline._Band.prototype._onChanging = function() { + this._changing = true; + + this._fireOnScroll(); + this._setSyncWithBandDate(); + + this._changing = false; +}; + +Timeline._Band.prototype.busy = function() { + // Is this band busy changing other bands? + return(this._changing); +}; + +Timeline._Band.prototype._fireOnScroll = function() { + for (var i = 0; i < this._onScrollListeners.length; i++) { + this._onScrollListeners[i](this); + } +}; + +Timeline._Band.prototype._setSyncWithBandDate = function() { + if (this._syncWithBand) { + var centerDate = this._ether.pixelOffsetToDate(this.getViewLength() / 2); + this._syncWithBand.setCenterVisibleDate(centerDate); + } +}; + +Timeline._Band.prototype._onHighlightBandScroll = function() { + if (this._syncWithBand) { + var centerDate = this._syncWithBand.getCenterVisibleDate(); + var centerPixelOffset = this._ether.dateToPixelOffset(centerDate); + + this._moveEther(Math.round(this._viewLength / 2 - centerPixelOffset)); + + if (this._highlight) { + this._etherPainter.setHighlight( + this._syncWithBand.getMinVisibleDate(), + this._syncWithBand.getMaxVisibleDate()); + } + } +}; + +Timeline._Band.prototype._onAddMany = function() { + this._paintEvents(); +}; + +Timeline._Band.prototype._onClear = function() { + this._paintEvents(); +}; + +Timeline._Band.prototype._positionHighlight = function() { + if (this._syncWithBand) { + var startDate = this._syncWithBand.getMinVisibleDate(); + var endDate = this._syncWithBand.getMaxVisibleDate(); + + if (this._highlight) { + this._etherPainter.setHighlight(startDate, endDate); + } + } +}; + +Timeline._Band.prototype._recenterDiv = function() { + this._viewOffset = -this._viewLength * (Timeline._Band.SCROLL_MULTIPLES - 1) / 2; + if (this._timeline.isHorizontal()) { + this._div.style.left = this._viewOffset + "px"; + this._div.style.width = (Timeline._Band.SCROLL_MULTIPLES * this._viewLength) + "px"; + } else { + this._div.style.top = this._viewOffset + "px"; + this._div.style.height = (Timeline._Band.SCROLL_MULTIPLES * this._viewLength) + "px"; + } + this.layout(); +}; + +Timeline._Band.prototype._paintEvents = function() { + this._eventPainter.paint(); +}; + +Timeline._Band.prototype._softPaintEvents = function() { + this._eventPainter.softPaint(); +}; + +Timeline._Band.prototype._paintDecorators = function() { + for (var i = 0; i < this._decorators.length; i++) { + this._decorators[i].paint(); + } +}; + +Timeline._Band.prototype._softPaintDecorators = function() { + for (var i = 0; i < this._decorators.length; i++) { + this._decorators[i].softPaint(); + } +}; + +Timeline._Band.prototype.closeBubble = function() { + SimileAjax.WindowManager.cancelPopups(); +}; +/*================================================== + * Classic Theme + *================================================== + */ + + + +Timeline.ClassicTheme = new Object(); + +Timeline.ClassicTheme.implementations = []; + +Timeline.ClassicTheme.create = function(locale) { + if (locale == null) { + locale = Timeline.getDefaultLocale(); + } + + var f = Timeline.ClassicTheme.implementations[locale]; + if (f == null) { + f = Timeline.ClassicTheme._Impl; + } + return new f(); +}; + +Timeline.ClassicTheme._Impl = function() { + this.firstDayOfWeek = 0; // Sunday + + // Note: Many styles previously set here are now set using CSS + // The comments indicate settings controlled by CSS, not + // lines to be un-commented. + // + // + // Attributes autoWidth, autoWidthAnimationTime, timeline_start + // and timeline_stop must be set on the first band's theme. + // The other attributes can be set differently for each + // band by using different themes for the bands. + this.autoWidth = false; // Should the Timeline automatically grow itself, as + // needed when too many events for the available width + // are painted on the visible part of the Timeline? + this.autoWidthAnimationTime = 500; // mSec + this.timeline_start = null; // Setting a date, eg new Date(Date.UTC(2008,0,17,20,00,00,0)) will prevent the + // Timeline from being moved to anytime before the date. + this.timeline_stop = null; // Use for setting a maximum date. The Timeline will not be able + // to be moved to anytime after this date. + this.ether = { + backgroundColors: [ + // "#EEE", + // "#DDD", + // "#CCC", + // "#AAA" + ], + // highlightColor: "white", + highlightOpacity: 50, + interval: { + line: { + show: true, + opacity: 25 + // color: "#aaa", + }, + weekend: { + opacity: 30 + // color: "#FFFFE0", + }, + marker: { + hAlign: "Bottom", + vAlign: "Right" + /* + hBottomStyler: function(elmt) { + elmt.className = "timeline-ether-marker-bottom"; + }, + hBottomEmphasizedStyler: function(elmt) { + elmt.className = "timeline-ether-marker-bottom-emphasized"; + }, + hTopStyler: function(elmt) { + elmt.className = "timeline-ether-marker-top"; + }, + hTopEmphasizedStyler: function(elmt) { + elmt.className = "timeline-ether-marker-top-emphasized"; + }, + */ + + + /* + vRightStyler: function(elmt) { + elmt.className = "timeline-ether-marker-right"; + }, + vRightEmphasizedStyler: function(elmt) { + elmt.className = "timeline-ether-marker-right-emphasized"; + }, + vLeftStyler: function(elmt) { + elmt.className = "timeline-ether-marker-left"; + }, + vLeftEmphasizedStyler:function(elmt) { + elmt.className = "timeline-ether-marker-left-emphasized"; + } + */ + } + } + }; + + this.event = { + track: { + height: 10, // px. You will need to change the track + // height if you change the tape height. + gap: 2, // px. Gap between tracks + offset: 2, // px. top margin above tapes + autoWidthMargin: 1.5 + /* autoWidthMargin is only used if autoWidth (see above) is true. + The autoWidthMargin setting is used to set how close the bottom of the + lowest track is to the edge of the band's div. The units are total track + width (tape + label + gap). A min of 0.5 is suggested. Use this setting to + move the bottom track's tapes above the axis markers, if needed for your + Timeline. + */ + }, + overviewTrack: { + offset: 20, // px -- top margin above tapes + tickHeight: 6, // px + height: 2, // px + gap: 1, // px + autoWidthMargin: 5 // This attribute is only used if autoWidth (see above) is true. + }, + tape: { + height: 4 // px. For thicker tapes, remember to change track height too. + }, + instant: { + icon: Timeline.urlPrefix + "images/dull-blue-circle.png", + // default icon. Icon can also be specified per event + iconWidth: 10, + iconHeight: 10, + impreciseOpacity: 20, // opacity of the tape when durationEvent is false + impreciseIconMargin: 3 // A tape and an icon are painted for imprecise instant + // events. This attribute is the margin between the + // bottom of the tape and the top of the icon in that + // case. + // color: "#58A0DC", + // impreciseColor: "#58A0DC", + }, + duration: { + impreciseOpacity: 20 // tape opacity for imprecise part of duration events + // color: "#58A0DC", + // impreciseColor: "#58A0DC", + }, + label: { + backgroundOpacity: 50,// only used in detailed painter + offsetFromLine: 3 // px left margin amount from icon's right edge + // backgroundColor: "white", + // lineColor: "#58A0DC", + }, + highlightColors: [ // Use with getEventPainter().setHighlightMatcher + // See webapp/examples/examples.js + "#FFFF00", + "#FFC000", + "#FF0000", + "#0000FF" + ], + highlightLabelBackground: false, // When highlighting an event, also change the event's label background? + bubble: { + width: 250, // px + maxHeight: 0, // px Maximum height of bubbles. 0 means no max height. + // scrollbar will be added for taller bubbles + titleStyler: function(elmt) { + elmt.className = "timeline-event-bubble-title"; + }, + bodyStyler: function(elmt) { + elmt.className = "timeline-event-bubble-body"; + }, + imageStyler: function(elmt) { + elmt.className = "timeline-event-bubble-image"; + }, + wikiStyler: function(elmt) { + elmt.className = "timeline-event-bubble-wiki"; + }, + timeStyler: function(elmt) { + elmt.className = "timeline-event-bubble-time"; + } + } + }; + + this.mouseWheel = 'scroll'; // 'default', 'zoom', 'scroll' +}; +/*================================================== + * An "ether" is a object that maps date/time to pixel coordinates. + *================================================== + */ + +/*================================================== + * Linear Ether + *================================================== + */ + +Timeline.LinearEther = function(params) { + this._params = params; + this._interval = params.interval; + this._pixelsPerInterval = params.pixelsPerInterval; +}; + +Timeline.LinearEther.prototype.initialize = function(band, timeline) { + this._band = band; + this._timeline = timeline; + this._unit = timeline.getUnit(); + + if ("startsOn" in this._params) { + this._start = this._unit.parseFromObject(this._params.startsOn); + } else if ("endsOn" in this._params) { + this._start = this._unit.parseFromObject(this._params.endsOn); + this.shiftPixels(-this._timeline.getPixelLength()); + } else if ("centersOn" in this._params) { + this._start = this._unit.parseFromObject(this._params.centersOn); + this.shiftPixels(-this._timeline.getPixelLength() / 2); + } else { + this._start = this._unit.makeDefaultValue(); + this.shiftPixels(-this._timeline.getPixelLength() / 2); + } +}; + +Timeline.LinearEther.prototype.setDate = function(date) { + this._start = this._unit.cloneValue(date); +}; + +Timeline.LinearEther.prototype.shiftPixels = function(pixels) { + var numeric = this._interval * pixels / this._pixelsPerInterval; + this._start = this._unit.change(this._start, numeric); +}; + +Timeline.LinearEther.prototype.dateToPixelOffset = function(date) { + var numeric = this._unit.compare(date, this._start); + return this._pixelsPerInterval * numeric / this._interval; +}; + +Timeline.LinearEther.prototype.pixelOffsetToDate = function(pixels) { + var numeric = pixels * this._interval / this._pixelsPerInterval; + return this._unit.change(this._start, numeric); +}; + +Timeline.LinearEther.prototype.zoom = function(zoomIn) { + var netIntervalChange = 0; + var currentZoomIndex = this._band._zoomIndex; + var newZoomIndex = currentZoomIndex; + + if (zoomIn && (currentZoomIndex > 0)) { + newZoomIndex = currentZoomIndex - 1; + } + + if (!zoomIn && (currentZoomIndex < (this._band._zoomSteps.length - 1))) { + newZoomIndex = currentZoomIndex + 1; + } + + this._band._zoomIndex = newZoomIndex; + this._interval = + SimileAjax.DateTime.gregorianUnitLengths[this._band._zoomSteps[newZoomIndex].unit]; + this._pixelsPerInterval = this._band._zoomSteps[newZoomIndex].pixelsPerInterval; + netIntervalChange = this._band._zoomSteps[newZoomIndex].unit - + this._band._zoomSteps[currentZoomIndex].unit; + + return netIntervalChange; +}; + + +/*================================================== + * Hot Zone Ether + *================================================== + */ + +Timeline.HotZoneEther = function(params) { + this._params = params; + this._interval = params.interval; + this._pixelsPerInterval = params.pixelsPerInterval; + this._theme = params.theme; +}; + +Timeline.HotZoneEther.prototype.initialize = function(band, timeline) { + this._band = band; + this._timeline = timeline; + this._unit = timeline.getUnit(); + + this._zones = [{ + startTime: Number.NEGATIVE_INFINITY, + endTime: Number.POSITIVE_INFINITY, + magnify: 1 + }]; + var params = this._params; + for (var i = 0; i < params.zones.length; i++) { + var zone = params.zones[i]; + var zoneStart = this._unit.parseFromObject(zone.start); + var zoneEnd = this._unit.parseFromObject(zone.end); + + for (var j = 0; j < this._zones.length && this._unit.compare(zoneEnd, zoneStart) > 0; j++) { + var zone2 = this._zones[j]; + + if (this._unit.compare(zoneStart, zone2.endTime) < 0) { + if (this._unit.compare(zoneStart, zone2.startTime) > 0) { + this._zones.splice(j, 0, { + startTime: zone2.startTime, + endTime: zoneStart, + magnify: zone2.magnify + }); + j++; + + zone2.startTime = zoneStart; + } + + if (this._unit.compare(zoneEnd, zone2.endTime) < 0) { + this._zones.splice(j, 0, { + startTime: zoneStart, + endTime: zoneEnd, + magnify: zone.magnify * zone2.magnify + }); + j++; + + zone2.startTime = zoneEnd; + zoneStart = zoneEnd; + } else { + zone2.magnify *= zone.magnify; + zoneStart = zone2.endTime; + } + } // else, try the next existing zone + } + } + + if ("startsOn" in this._params) { + this._start = this._unit.parseFromObject(this._params.startsOn); + } else if ("endsOn" in this._params) { + this._start = this._unit.parseFromObject(this._params.endsOn); + this.shiftPixels(-this._timeline.getPixelLength()); + } else if ("centersOn" in this._params) { + this._start = this._unit.parseFromObject(this._params.centersOn); + this.shiftPixels(-this._timeline.getPixelLength() / 2); + } else { + this._start = this._unit.makeDefaultValue(); + this.shiftPixels(-this._timeline.getPixelLength() / 2); + } +}; + +Timeline.HotZoneEther.prototype.setDate = function(date) { + this._start = this._unit.cloneValue(date); +}; + +Timeline.HotZoneEther.prototype.shiftPixels = function(pixels) { + this._start = this.pixelOffsetToDate(pixels); +}; + +Timeline.HotZoneEther.prototype.dateToPixelOffset = function(date) { + return this._dateDiffToPixelOffset(this._start, date); +}; + +Timeline.HotZoneEther.prototype.pixelOffsetToDate = function(pixels) { + return this._pixelOffsetToDate(pixels, this._start); +}; + +Timeline.HotZoneEther.prototype.zoom = function(zoomIn) { + var netIntervalChange = 0; + var currentZoomIndex = this._band._zoomIndex; + var newZoomIndex = currentZoomIndex; + + if (zoomIn && (currentZoomIndex > 0)) { + newZoomIndex = currentZoomIndex - 1; + } + + if (!zoomIn && (currentZoomIndex < (this._band._zoomSteps.length - 1))) { + newZoomIndex = currentZoomIndex + 1; + } + + this._band._zoomIndex = newZoomIndex; + this._interval = + SimileAjax.DateTime.gregorianUnitLengths[this._band._zoomSteps[newZoomIndex].unit]; + this._pixelsPerInterval = this._band._zoomSteps[newZoomIndex].pixelsPerInterval; + netIntervalChange = this._band._zoomSteps[newZoomIndex].unit - + this._band._zoomSteps[currentZoomIndex].unit; + + return netIntervalChange; +}; + +Timeline.HotZoneEther.prototype._dateDiffToPixelOffset = function(fromDate, toDate) { + var scale = this._getScale(); + var fromTime = fromDate; + var toTime = toDate; + + var pixels = 0; + if (this._unit.compare(fromTime, toTime) < 0) { + var z = 0; + while (z < this._zones.length) { + if (this._unit.compare(fromTime, this._zones[z].endTime) < 0) { + break; + } + z++; + } + + while (this._unit.compare(fromTime, toTime) < 0) { + var zone = this._zones[z]; + var toTime2 = this._unit.earlier(toTime, zone.endTime); + + pixels += (this._unit.compare(toTime2, fromTime) / (scale / zone.magnify)); + + fromTime = toTime2; + z++; + } + } else { + var z = this._zones.length - 1; + while (z >= 0) { + if (this._unit.compare(fromTime, this._zones[z].startTime) > 0) { + break; + } + z--; + } + + while (this._unit.compare(fromTime, toTime) > 0) { + var zone = this._zones[z]; + var toTime2 = this._unit.later(toTime, zone.startTime); + + pixels += (this._unit.compare(toTime2, fromTime) / (scale / zone.magnify)); + + fromTime = toTime2; + z--; + } + } + return pixels; +}; + +Timeline.HotZoneEther.prototype._pixelOffsetToDate = function(pixels, fromDate) { + var scale = this._getScale(); + var time = fromDate; + if (pixels > 0) { + var z = 0; + while (z < this._zones.length) { + if (this._unit.compare(time, this._zones[z].endTime) < 0) { + break; + } + z++; + } + + while (pixels > 0) { + var zone = this._zones[z]; + var scale2 = scale / zone.magnify; + + if (zone.endTime == Number.POSITIVE_INFINITY) { + time = this._unit.change(time, pixels * scale2); + pixels = 0; + } else { + var pixels2 = this._unit.compare(zone.endTime, time) / scale2; + if (pixels2 > pixels) { + time = this._unit.change(time, pixels * scale2); + pixels = 0; + } else { + time = zone.endTime; + pixels -= pixels2; + } + } + z++; + } + } else { + var z = this._zones.length - 1; + while (z >= 0) { + if (this._unit.compare(time, this._zones[z].startTime) > 0) { + break; + } + z--; + } + + pixels = -pixels; + while (pixels > 0) { + var zone = this._zones[z]; + var scale2 = scale / zone.magnify; + + if (zone.startTime == Number.NEGATIVE_INFINITY) { + time = this._unit.change(time, -pixels * scale2); + pixels = 0; + } else { + var pixels2 = this._unit.compare(time, zone.startTime) / scale2; + if (pixels2 > pixels) { + time = this._unit.change(time, -pixels * scale2); + pixels = 0; + } else { + time = zone.startTime; + pixels -= pixels2; + } + } + z--; + } + } + return time; +}; + +Timeline.HotZoneEther.prototype._getScale = function() { + return this._interval / this._pixelsPerInterval; +}; +/*================================================== + * Gregorian Ether Painter + *================================================== + */ + +Timeline.GregorianEtherPainter = function(params) { + this._params = params; + this._theme = params.theme; + this._unit = params.unit; + this._multiple = ("multiple" in params) ? params.multiple : 1; +}; + +Timeline.GregorianEtherPainter.prototype.initialize = function(band, timeline) { + this._band = band; + this._timeline = timeline; + + this._backgroundLayer = band.createLayerDiv(0); + this._backgroundLayer.setAttribute("name", "ether-background"); // for debugging + this._backgroundLayer.className = 'timeline-ether-bg'; + // this._backgroundLayer.style.background = this._theme.ether.backgroundColors[band.getIndex()]; + + + this._markerLayer = null; + this._lineLayer = null; + + var align = ("align" in this._params && this._params.align != undefined) ? this._params.align : + this._theme.ether.interval.marker[timeline.isHorizontal() ? "hAlign" : "vAlign"]; + var showLine = ("showLine" in this._params) ? this._params.showLine : + this._theme.ether.interval.line.show; + + this._intervalMarkerLayout = new Timeline.EtherIntervalMarkerLayout( + this._timeline, this._band, this._theme, align, showLine); + + this._highlight = new Timeline.EtherHighlight( + this._timeline, this._band, this._theme, this._backgroundLayer); +} + +Timeline.GregorianEtherPainter.prototype.setHighlight = function(startDate, endDate) { + this._highlight.position(startDate, endDate); +} + +Timeline.GregorianEtherPainter.prototype.paint = function() { + if (this._markerLayer) { + this._band.removeLayerDiv(this._markerLayer); + } + this._markerLayer = this._band.createLayerDiv(100); + this._markerLayer.setAttribute("name", "ether-markers"); // for debugging + this._markerLayer.style.display = "none"; + + if (this._lineLayer) { + this._band.removeLayerDiv(this._lineLayer); + } + this._lineLayer = this._band.createLayerDiv(1); + this._lineLayer.setAttribute("name", "ether-lines"); // for debugging + this._lineLayer.style.display = "none"; + + var minDate = this._band.getMinDate(); + var maxDate = this._band.getMaxDate(); + + var timeZone = this._band.getTimeZone(); + var labeller = this._band.getLabeller(); + + SimileAjax.DateTime.roundDownToInterval(minDate, this._unit, timeZone, this._multiple, this._theme.firstDayOfWeek); + + var p = this; + var incrementDate = function(date) { + for (var i = 0; i < p._multiple; i++) { + SimileAjax.DateTime.incrementByInterval(date, p._unit); + } + }; + + while (minDate.getTime() < maxDate.getTime()) { + this._intervalMarkerLayout.createIntervalMarker( + minDate, labeller, this._unit, this._markerLayer, this._lineLayer); + + incrementDate(minDate); + } + this._markerLayer.style.display = "block"; + this._lineLayer.style.display = "block"; +}; + +Timeline.GregorianEtherPainter.prototype.softPaint = function() { +}; + +Timeline.GregorianEtherPainter.prototype.zoom = function(netIntervalChange) { + if (netIntervalChange != 0) { + this._unit += netIntervalChange; + } +}; + + +/*================================================== + * Hot Zone Gregorian Ether Painter + *================================================== + */ + +Timeline.HotZoneGregorianEtherPainter = function(params) { + this._params = params; + this._theme = params.theme; + + this._zones = [{ + startTime: Number.NEGATIVE_INFINITY, + endTime: Number.POSITIVE_INFINITY, + unit: params.unit, + multiple: 1 + }]; + for (var i = 0; i < params.zones.length; i++) { + var zone = params.zones[i]; + var zoneStart = SimileAjax.DateTime.parseGregorianDateTime(zone.start).getTime(); + var zoneEnd = SimileAjax.DateTime.parseGregorianDateTime(zone.end).getTime(); + + for (var j = 0; j < this._zones.length && zoneEnd > zoneStart; j++) { + var zone2 = this._zones[j]; + + if (zoneStart < zone2.endTime) { + if (zoneStart > zone2.startTime) { + this._zones.splice(j, 0, { + startTime: zone2.startTime, + endTime: zoneStart, + unit: zone2.unit, + multiple: zone2.multiple + }); + j++; + + zone2.startTime = zoneStart; + } + + if (zoneEnd < zone2.endTime) { + this._zones.splice(j, 0, { + startTime: zoneStart, + endTime: zoneEnd, + unit: zone.unit, + multiple: (zone.multiple) ? zone.multiple : 1 + }); + j++; + + zone2.startTime = zoneEnd; + zoneStart = zoneEnd; + } else { + zone2.multiple = zone.multiple; + zone2.unit = zone.unit; + zoneStart = zone2.endTime; + } + } // else, try the next existing zone + } + } +}; + +Timeline.HotZoneGregorianEtherPainter.prototype.initialize = function(band, timeline) { + this._band = band; + this._timeline = timeline; + + this._backgroundLayer = band.createLayerDiv(0); + this._backgroundLayer.setAttribute("name", "ether-background"); // for debugging + this._backgroundLayer.className ='timeline-ether-bg'; + //this._backgroundLayer.style.background = this._theme.ether.backgroundColors[band.getIndex()]; + + this._markerLayer = null; + this._lineLayer = null; + + var align = ("align" in this._params && this._params.align != undefined) ? this._params.align : + this._theme.ether.interval.marker[timeline.isHorizontal() ? "hAlign" : "vAlign"]; + var showLine = ("showLine" in this._params) ? this._params.showLine : + this._theme.ether.interval.line.show; + + this._intervalMarkerLayout = new Timeline.EtherIntervalMarkerLayout( + this._timeline, this._band, this._theme, align, showLine); + + this._highlight = new Timeline.EtherHighlight( + this._timeline, this._band, this._theme, this._backgroundLayer); +} + +Timeline.HotZoneGregorianEtherPainter.prototype.setHighlight = function(startDate, endDate) { + this._highlight.position(startDate, endDate); +} + +Timeline.HotZoneGregorianEtherPainter.prototype.paint = function() { + if (this._markerLayer) { + this._band.removeLayerDiv(this._markerLayer); + } + this._markerLayer = this._band.createLayerDiv(100); + this._markerLayer.setAttribute("name", "ether-markers"); // for debugging + this._markerLayer.style.display = "none"; + + if (this._lineLayer) { + this._band.removeLayerDiv(this._lineLayer); + } + this._lineLayer = this._band.createLayerDiv(1); + this._lineLayer.setAttribute("name", "ether-lines"); // for debugging + this._lineLayer.style.display = "none"; + + var minDate = this._band.getMinDate(); + var maxDate = this._band.getMaxDate(); + + var timeZone = this._band.getTimeZone(); + var labeller = this._band.getLabeller(); + + var p = this; + var incrementDate = function(date, zone) { + for (var i = 0; i < zone.multiple; i++) { + SimileAjax.DateTime.incrementByInterval(date, zone.unit); + } + }; + + var zStart = 0; + while (zStart < this._zones.length) { + if (minDate.getTime() < this._zones[zStart].endTime) { + break; + } + zStart++; + } + var zEnd = this._zones.length - 1; + while (zEnd >= 0) { + if (maxDate.getTime() > this._zones[zEnd].startTime) { + break; + } + zEnd--; + } + + for (var z = zStart; z <= zEnd; z++) { + var zone = this._zones[z]; + + var minDate2 = new Date(Math.max(minDate.getTime(), zone.startTime)); + var maxDate2 = new Date(Math.min(maxDate.getTime(), zone.endTime)); + + SimileAjax.DateTime.roundDownToInterval(minDate2, zone.unit, timeZone, zone.multiple, this._theme.firstDayOfWeek); + SimileAjax.DateTime.roundUpToInterval(maxDate2, zone.unit, timeZone, zone.multiple, this._theme.firstDayOfWeek); + + while (minDate2.getTime() < maxDate2.getTime()) { + this._intervalMarkerLayout.createIntervalMarker( + minDate2, labeller, zone.unit, this._markerLayer, this._lineLayer); + + incrementDate(minDate2, zone); + } + } + this._markerLayer.style.display = "block"; + this._lineLayer.style.display = "block"; +}; + +Timeline.HotZoneGregorianEtherPainter.prototype.softPaint = function() { +}; + +Timeline.HotZoneGregorianEtherPainter.prototype.zoom = function(netIntervalChange) { + if (netIntervalChange != 0) { + for (var i = 0; i < this._zones.length; ++i) { + if (this._zones[i]) { + this._zones[i].unit += netIntervalChange; + } + } + } +}; + +/*================================================== + * Year Count Ether Painter + *================================================== + */ + +Timeline.YearCountEtherPainter = function(params) { + this._params = params; + this._theme = params.theme; + this._startDate = SimileAjax.DateTime.parseGregorianDateTime(params.startDate); + this._multiple = ("multiple" in params) ? params.multiple : 1; +}; + +Timeline.YearCountEtherPainter.prototype.initialize = function(band, timeline) { + this._band = band; + this._timeline = timeline; + + this._backgroundLayer = band.createLayerDiv(0); + this._backgroundLayer.setAttribute("name", "ether-background"); // for debugging + this._backgroundLayer.className = 'timeline-ether-bg'; + // this._backgroundLayer.style.background = this._theme.ether.backgroundColors[band.getIndex()]; + + this._markerLayer = null; + this._lineLayer = null; + + var align = ("align" in this._params) ? this._params.align : + this._theme.ether.interval.marker[timeline.isHorizontal() ? "hAlign" : "vAlign"]; + var showLine = ("showLine" in this._params) ? this._params.showLine : + this._theme.ether.interval.line.show; + + this._intervalMarkerLayout = new Timeline.EtherIntervalMarkerLayout( + this._timeline, this._band, this._theme, align, showLine); + + this._highlight = new Timeline.EtherHighlight( + this._timeline, this._band, this._theme, this._backgroundLayer); +}; + +Timeline.YearCountEtherPainter.prototype.setHighlight = function(startDate, endDate) { + this._highlight.position(startDate, endDate); +}; + +Timeline.YearCountEtherPainter.prototype.paint = function() { + if (this._markerLayer) { + this._band.removeLayerDiv(this._markerLayer); + } + this._markerLayer = this._band.createLayerDiv(100); + this._markerLayer.setAttribute("name", "ether-markers"); // for debugging + this._markerLayer.style.display = "none"; + + if (this._lineLayer) { + this._band.removeLayerDiv(this._lineLayer); + } + this._lineLayer = this._band.createLayerDiv(1); + this._lineLayer.setAttribute("name", "ether-lines"); // for debugging + this._lineLayer.style.display = "none"; + + var minDate = new Date(this._startDate.getTime()); + var maxDate = this._band.getMaxDate(); + var yearDiff = this._band.getMinDate().getUTCFullYear() - this._startDate.getUTCFullYear(); + minDate.setUTCFullYear(this._band.getMinDate().getUTCFullYear() - yearDiff % this._multiple); + + var p = this; + var incrementDate = function(date) { + for (var i = 0; i < p._multiple; i++) { + SimileAjax.DateTime.incrementByInterval(date, SimileAjax.DateTime.YEAR); + } + }; + var labeller = { + labelInterval: function(date, intervalUnit) { + var diff = date.getUTCFullYear() - p._startDate.getUTCFullYear(); + return { + text: diff, + emphasized: diff == 0 + }; + } + }; + + while (minDate.getTime() < maxDate.getTime()) { + this._intervalMarkerLayout.createIntervalMarker( + minDate, labeller, SimileAjax.DateTime.YEAR, this._markerLayer, this._lineLayer); + + incrementDate(minDate); + } + this._markerLayer.style.display = "block"; + this._lineLayer.style.display = "block"; +}; + +Timeline.YearCountEtherPainter.prototype.softPaint = function() { +}; + +/*================================================== + * Quarterly Ether Painter + *================================================== + */ + +Timeline.QuarterlyEtherPainter = function(params) { + this._params = params; + this._theme = params.theme; + this._startDate = SimileAjax.DateTime.parseGregorianDateTime(params.startDate); +}; + +Timeline.QuarterlyEtherPainter.prototype.initialize = function(band, timeline) { + this._band = band; + this._timeline = timeline; + + this._backgroundLayer = band.createLayerDiv(0); + this._backgroundLayer.setAttribute("name", "ether-background"); // for debugging + this._backgroundLayer.className = 'timeline-ether-bg'; + // this._backgroundLayer.style.background = this._theme.ether.backgroundColors[band.getIndex()]; + + this._markerLayer = null; + this._lineLayer = null; + + var align = ("align" in this._params) ? this._params.align : + this._theme.ether.interval.marker[timeline.isHorizontal() ? "hAlign" : "vAlign"]; + var showLine = ("showLine" in this._params) ? this._params.showLine : + this._theme.ether.interval.line.show; + + this._intervalMarkerLayout = new Timeline.EtherIntervalMarkerLayout( + this._timeline, this._band, this._theme, align, showLine); + + this._highlight = new Timeline.EtherHighlight( + this._timeline, this._band, this._theme, this._backgroundLayer); +}; + +Timeline.QuarterlyEtherPainter.prototype.setHighlight = function(startDate, endDate) { + this._highlight.position(startDate, endDate); +}; + +Timeline.QuarterlyEtherPainter.prototype.paint = function() { + if (this._markerLayer) { + this._band.removeLayerDiv(this._markerLayer); + } + this._markerLayer = this._band.createLayerDiv(100); + this._markerLayer.setAttribute("name", "ether-markers"); // for debugging + this._markerLayer.style.display = "none"; + + if (this._lineLayer) { + this._band.removeLayerDiv(this._lineLayer); + } + this._lineLayer = this._band.createLayerDiv(1); + this._lineLayer.setAttribute("name", "ether-lines"); // for debugging + this._lineLayer.style.display = "none"; + + var minDate = new Date(0); + var maxDate = this._band.getMaxDate(); + + minDate.setUTCFullYear(Math.max(this._startDate.getUTCFullYear(), this._band.getMinDate().getUTCFullYear())); + minDate.setUTCMonth(this._startDate.getUTCMonth()); + + var p = this; + var incrementDate = function(date) { + date.setUTCMonth(date.getUTCMonth() + 3); + }; + var labeller = { + labelInterval: function(date, intervalUnit) { + var quarters = (4 + (date.getUTCMonth() - p._startDate.getUTCMonth()) / 3) % 4; + if (quarters != 0) { + return { text: "Q" + (quarters + 1), emphasized: false }; + } else { + return { text: "Y" + (date.getUTCFullYear() - p._startDate.getUTCFullYear() + 1), emphasized: true }; + } + } + }; + + while (minDate.getTime() < maxDate.getTime()) { + this._intervalMarkerLayout.createIntervalMarker( + minDate, labeller, SimileAjax.DateTime.YEAR, this._markerLayer, this._lineLayer); + + incrementDate(minDate); + } + this._markerLayer.style.display = "block"; + this._lineLayer.style.display = "block"; +}; + +Timeline.QuarterlyEtherPainter.prototype.softPaint = function() { +}; + +/*================================================== + * Ether Interval Marker Layout + *================================================== + */ + +Timeline.EtherIntervalMarkerLayout = function(timeline, band, theme, align, showLine) { + var horizontal = timeline.isHorizontal(); + if (horizontal) { + if (align == "Top") { + this.positionDiv = function(div, offset) { + div.style.left = offset + "px"; + div.style.top = "0px"; + }; + } else { + this.positionDiv = function(div, offset) { + div.style.left = offset + "px"; + div.style.bottom = "0px"; + }; + } + } else { + if (align == "Left") { + this.positionDiv = function(div, offset) { + div.style.top = offset + "px"; + div.style.left = "0px"; + }; + } else { + this.positionDiv = function(div, offset) { + div.style.top = offset + "px"; + div.style.right = "0px"; + }; + } + } + + var markerTheme = theme.ether.interval.marker; + var lineTheme = theme.ether.interval.line; + var weekendTheme = theme.ether.interval.weekend; + + var stylePrefix = (horizontal ? "h" : "v") + align; + var labelStyler = markerTheme[stylePrefix + "Styler"]; + var emphasizedLabelStyler = markerTheme[stylePrefix + "EmphasizedStyler"]; + var day = SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.DAY]; + + this.createIntervalMarker = function(date, labeller, unit, markerDiv, lineDiv) { + var offset = Math.round(band.dateToPixelOffset(date)); + + if (showLine && unit != SimileAjax.DateTime.WEEK) { + var divLine = timeline.getDocument().createElement("div"); + divLine.className = "timeline-ether-lines"; + + if (lineTheme.opacity < 100) { + SimileAjax.Graphics.setOpacity(divLine, lineTheme.opacity); + } + + if (horizontal) { + //divLine.className += " timeline-ether-lines-vertical"; + divLine.style.left = offset + "px"; + } else { + //divLine.className += " timeline-ether-lines-horizontal"; + divLine.style.top = offset + "px"; + } + lineDiv.appendChild(divLine); + } + if (unit == SimileAjax.DateTime.WEEK) { + var firstDayOfWeek = theme.firstDayOfWeek; + + var saturday = new Date(date.getTime() + (6 - firstDayOfWeek - 7) * day); + var monday = new Date(saturday.getTime() + 2 * day); + + var saturdayPixel = Math.round(band.dateToPixelOffset(saturday)); + var mondayPixel = Math.round(band.dateToPixelOffset(monday)); + var length = Math.max(1, mondayPixel - saturdayPixel); + + var divWeekend = timeline.getDocument().createElement("div"); + divWeekend.className = 'timeline-ether-weekends' + + if (weekendTheme.opacity < 100) { + SimileAjax.Graphics.setOpacity(divWeekend, weekendTheme.opacity); + } + + if (horizontal) { + divWeekend.style.left = saturdayPixel + "px"; + divWeekend.style.width = length + "px"; + } else { + divWeekend.style.top = saturdayPixel + "px"; + divWeekend.style.height = length + "px"; + } + lineDiv.appendChild(divWeekend); + } + + var label = labeller.labelInterval(date, unit); + + var div = timeline.getDocument().createElement("div"); + div.innerHTML = label.text; + + + + div.className = 'timeline-date-label' + if(label.emphasized) div.className += ' timeline-date-label-em' + + this.positionDiv(div, offset); + markerDiv.appendChild(div); + + return div; + }; +}; + +/*================================================== + * Ether Highlight Layout + *================================================== + */ + +Timeline.EtherHighlight = function(timeline, band, theme, backgroundLayer) { + var horizontal = timeline.isHorizontal(); + + this._highlightDiv = null; + this._createHighlightDiv = function() { + if (this._highlightDiv == null) { + this._highlightDiv = timeline.getDocument().createElement("div"); + this._highlightDiv.setAttribute("name", "ether-highlight"); // for debugging + this._highlightDiv.className = 'timeline-ether-highlight' + + var opacity = theme.ether.highlightOpacity; + if (opacity < 100) { + SimileAjax.Graphics.setOpacity(this._highlightDiv, opacity); + } + + backgroundLayer.appendChild(this._highlightDiv); + } + } + + this.position = function(startDate, endDate) { + this._createHighlightDiv(); + + var startPixel = Math.round(band.dateToPixelOffset(startDate)); + var endPixel = Math.round(band.dateToPixelOffset(endDate)); + var length = Math.max(endPixel - startPixel, 3); + if (horizontal) { + this._highlightDiv.style.left = startPixel + "px"; + this._highlightDiv.style.width = length + "px"; + this._highlightDiv.style.height = (band.getViewWidth() - 4) + "px"; + } else { + this._highlightDiv.style.top = startPixel + "px"; + this._highlightDiv.style.height = length + "px"; + this._highlightDiv.style.width = (band.getViewWidth() - 4) + "px"; + } + } +}; +/*================================================== + * Event Utils + *================================================== + */ +Timeline.EventUtils = {}; + +Timeline.EventUtils.getNewEventID = function() { + // global across page + if (this._lastEventID == null) { + this._lastEventID = 0; + } + + this._lastEventID += 1; + return "e" + this._lastEventID; +}; + +Timeline.EventUtils.decodeEventElID = function(elementID) { + /*================================================== + * + * Use this function to decode an event element's id on a band (label div, + * tape div or icon img). + * + * Returns {band: , evt: } + * + * To enable a single event listener to monitor everything + * on a Timeline, a set format is used for the id's of the + * elements on the Timeline-- + * + * element id format for labels, icons, tapes: + * labels: label-tl--- + * icons: icon-tl--- + * tapes: tape1-tl--- + * tape2-tl--- + * // some events have more than one tape + * highlight: highlight1-tl--- + * highlight2-tl--- + * // some events have more than one highlight div (future) + * Note: use split('-') to get array of the format's parts + * + * You can then retrieve the timeline object and event object + * by using Timeline.getTimeline, Timeline.getBand, or + * Timeline.getEvent and passing in the element's id + * + *================================================== + */ + + var parts = elementID.split('-'); + if (parts[1] != 'tl') { + alert("Internal Timeline problem 101, please consult support"); + return {band: null, evt: null}; // early return + } + + var timeline = Timeline.getTimelineFromID(parts[2]); + var band = timeline.getBand(parts[3]); + var evt = band.getEventSource.getEvent(parts[4]); + + return {band: band, evt: evt}; +}; + +Timeline.EventUtils.encodeEventElID = function(timeline, band, elType, evt) { + // elType should be one of {label | icon | tapeN | highlightN} + return elType + "-tl-" + timeline.timelineID + + "-" + band.getIndex() + "-" + evt.getID(); +}; +/*================================================== + * Gregorian Date Labeller + *================================================== + */ + +Timeline.GregorianDateLabeller = function(locale, timeZone) { + this._locale = locale; + this._timeZone = timeZone; +}; + +Timeline.GregorianDateLabeller.monthNames = []; +Timeline.GregorianDateLabeller.dayNames = []; +Timeline.GregorianDateLabeller.labelIntervalFunctions = []; + +Timeline.GregorianDateLabeller.getMonthName = function(month, locale) { + return Timeline.GregorianDateLabeller.monthNames[locale][month]; +}; + +Timeline.GregorianDateLabeller.prototype.labelInterval = function(date, intervalUnit) { + var f = Timeline.GregorianDateLabeller.labelIntervalFunctions[this._locale]; + if (f == null) { + f = Timeline.GregorianDateLabeller.prototype.defaultLabelInterval; + } + return f.call(this, date, intervalUnit); +}; + +Timeline.GregorianDateLabeller.prototype.labelPrecise = function(date) { + return SimileAjax.DateTime.removeTimeZoneOffset( + date, + this._timeZone //+ (new Date().getTimezoneOffset() / 60) + ).toUTCString(); +}; + +Timeline.GregorianDateLabeller.prototype.defaultLabelInterval = function(date, intervalUnit) { + var text; + var emphasized = false; + + date = SimileAjax.DateTime.removeTimeZoneOffset(date, this._timeZone); + + switch(intervalUnit) { + case SimileAjax.DateTime.MILLISECOND: + text = date.getUTCMilliseconds(); + break; + case SimileAjax.DateTime.SECOND: + text = date.getUTCSeconds(); + break; + case SimileAjax.DateTime.MINUTE: + var m = date.getUTCMinutes(); + if (m == 0) { + text = date.getUTCHours() + ":00"; + emphasized = true; + } else { + text = m; + } + break; + case SimileAjax.DateTime.HOUR: + text = date.getUTCHours() + "hr"; + break; + case SimileAjax.DateTime.DAY: + text = Timeline.GregorianDateLabeller.getMonthName(date.getUTCMonth(), this._locale) + " " + date.getUTCDate(); + break; + case SimileAjax.DateTime.WEEK: + text = Timeline.GregorianDateLabeller.getMonthName(date.getUTCMonth(), this._locale) + " " + date.getUTCDate(); + break; + case SimileAjax.DateTime.MONTH: + var m = date.getUTCMonth(); + if (m != 0) { + text = Timeline.GregorianDateLabeller.getMonthName(m, this._locale); + break; + } // else, fall through + case SimileAjax.DateTime.YEAR: + case SimileAjax.DateTime.DECADE: + case SimileAjax.DateTime.CENTURY: + case SimileAjax.DateTime.MILLENNIUM: + var y = date.getUTCFullYear(); + if (y > 0) { + text = date.getUTCFullYear(); + } else { + text = (1 - y) + "BC"; + } + emphasized = + (intervalUnit == SimileAjax.DateTime.MONTH) || + (intervalUnit == SimileAjax.DateTime.DECADE && y % 100 == 0) || + (intervalUnit == SimileAjax.DateTime.CENTURY && y % 1000 == 0); + break; + default: + text = date.toUTCString(); + } + return { text: text, emphasized: emphasized }; +} + +/*================================================== + * Default Event Source + *================================================== + */ + + +Timeline.DefaultEventSource = function(eventIndex) { + this._events = (eventIndex instanceof Object) ? eventIndex : new SimileAjax.EventIndex(); + this._listeners = []; +}; + +Timeline.DefaultEventSource.prototype.addListener = function(listener) { + this._listeners.push(listener); +}; + +Timeline.DefaultEventSource.prototype.removeListener = function(listener) { + for (var i = 0; i < this._listeners.length; i++) { + if (this._listeners[i] == listener) { + this._listeners.splice(i, 1); + break; + } + } +}; + +Timeline.DefaultEventSource.prototype.loadXML = function(xml, url) { + var base = this._getBaseURL(url); + + var wikiURL = xml.documentElement.getAttribute("wiki-url"); + var wikiSection = xml.documentElement.getAttribute("wiki-section"); + + var dateTimeFormat = xml.documentElement.getAttribute("date-time-format"); + var parseDateTimeFunction = this._events.getUnit().getParser(dateTimeFormat); + + var node = xml.documentElement.firstChild; + var added = false; + while (node != null) { + if (node.nodeType == 1) { + var description = ""; + if (node.firstChild != null && node.firstChild.nodeType == 3) { + description = node.firstChild.nodeValue; + } + // instant event: default is true. Or use values from isDuration or durationEvent + var instant = (node.getAttribute("isDuration") === null && + node.getAttribute("durationEvent") === null) || + node.getAttribute("isDuration") == "false" || + node.getAttribute("durationEvent") == "false"; + + var evt = new Timeline.DefaultEventSource.Event( { + id: node.getAttribute("id"), + start: parseDateTimeFunction(node.getAttribute("start")), + end: parseDateTimeFunction(node.getAttribute("end")), + latestStart: parseDateTimeFunction(node.getAttribute("latestStart")), + earliestEnd: parseDateTimeFunction(node.getAttribute("earliestEnd")), + instant: instant, + text: node.getAttribute("title"), + description: description, + image: this._resolveRelativeURL(node.getAttribute("image"), base), + link: this._resolveRelativeURL(node.getAttribute("link") , base), + icon: this._resolveRelativeURL(node.getAttribute("icon") , base), + color: node.getAttribute("color"), + textColor: node.getAttribute("textColor"), + hoverText: node.getAttribute("hoverText"), + classname: node.getAttribute("classname"), + tapeImage: node.getAttribute("tapeImage"), + tapeRepeat: node.getAttribute("tapeRepeat"), + caption: node.getAttribute("caption"), + eventID: node.getAttribute("eventID"), + trackNum: node.getAttribute("trackNum") + }); + + evt._node = node; + evt.getProperty = function(name) { + return this._node.getAttribute(name); + }; + evt.setWikiInfo(wikiURL, wikiSection); + + this._events.add(evt); + + added = true; + } + node = node.nextSibling; + } + + if (added) { + this._fire("onAddMany", []); + } +}; + + +Timeline.DefaultEventSource.prototype.loadJSON = function(data, url) { + var base = this._getBaseURL(url); + var added = false; + if (data && data.events){ + var wikiURL = ("wikiURL" in data) ? data.wikiURL : null; + var wikiSection = ("wikiSection" in data) ? data.wikiSection : null; + + var dateTimeFormat = ("dateTimeFormat" in data) ? data.dateTimeFormat : null; + var parseDateTimeFunction = this._events.getUnit().getParser(dateTimeFormat); + + for (var i=0; i < data.events.length; i++){ + var event = data.events[i]; + // Fixing issue 33: + // instant event: default (for JSON only) is false. Or use values from isDuration or durationEvent + // isDuration was negated (see issue 33, so keep that interpretation + var instant = event.isDuration || (event.durationEvent != null && !event.durationEvent); + + var evt = new Timeline.DefaultEventSource.Event({ + id: ("id" in event) ? event.id : undefined, + start: parseDateTimeFunction(event.start), + end: parseDateTimeFunction(event.end), + latestStart: parseDateTimeFunction(event.latestStart), + earliestEnd: parseDateTimeFunction(event.earliestEnd), + instant: instant, + text: event.title, + description: event.description, + image: this._resolveRelativeURL(event.image, base), + link: this._resolveRelativeURL(event.link , base), + icon: this._resolveRelativeURL(event.icon , base), + color: event.color, + textColor: event.textColor, + hoverText: event.hoverText, + classname: event.classname, + tapeImage: event.tapeImage, + tapeRepeat: event.tapeRepeat, + caption: event.caption, + eventID: event.eventID, + trackNum: event.trackNum + }); + evt._obj = event; + evt.getProperty = function(name) { + return this._obj[name]; + }; + evt.setWikiInfo(wikiURL, wikiSection); + + this._events.add(evt); + added = true; + } + } + + if (added) { + this._fire("onAddMany", []); + } +}; + +/* + * Contributed by Morten Frederiksen, http://www.wasab.dk/morten/ + */ +Timeline.DefaultEventSource.prototype.loadSPARQL = function(xml, url) { + var base = this._getBaseURL(url); + + var dateTimeFormat = 'iso8601'; + var parseDateTimeFunction = this._events.getUnit().getParser(dateTimeFormat); + + if (xml == null) { + return; + } + + /* + * Find tag + */ + var node = xml.documentElement.firstChild; + while (node != null && (node.nodeType != 1 || node.nodeName != 'results')) { + node = node.nextSibling; + } + + var wikiURL = null; + var wikiSection = null; + if (node != null) { + wikiURL = node.getAttribute("wiki-url"); + wikiSection = node.getAttribute("wiki-section"); + + node = node.firstChild; + } + + var added = false; + while (node != null) { + if (node.nodeType == 1) { + var bindings = { }; + var binding = node.firstChild; + while (binding != null) { + if (binding.nodeType == 1 && + binding.firstChild != null && + binding.firstChild.nodeType == 1 && + binding.firstChild.firstChild != null && + binding.firstChild.firstChild.nodeType == 3) { + bindings[binding.getAttribute('name')] = binding.firstChild.firstChild.nodeValue; + } + binding = binding.nextSibling; + } + + if (bindings["start"] == null && bindings["date"] != null) { + bindings["start"] = bindings["date"]; + } + + // instant event: default is true. Or use values from isDuration or durationEvent + var instant = (bindings["isDuration"] === null && + bindings["durationEvent"] === null) || + bindings["isDuration"] == "false" || + bindings["durationEvent"] == "false"; + + var evt = new Timeline.DefaultEventSource.Event({ + id: bindings["id"], + start: parseDateTimeFunction(bindings["start"]), + end: parseDateTimeFunction(bindings["end"]), + latestStart: parseDateTimeFunction(bindings["latestStart"]), + earliestEnd: parseDateTimeFunction(bindings["earliestEnd"]), + instant: instant, // instant + text: bindings["title"], // text + description: bindings["description"], + image: this._resolveRelativeURL(bindings["image"], base), + link: this._resolveRelativeURL(bindings["link"] , base), + icon: this._resolveRelativeURL(bindings["icon"] , base), + color: bindings["color"], + textColor: bindings["textColor"], + hoverText: bindings["hoverText"], + caption: bindings["caption"], + classname: bindings["classname"], + tapeImage: bindings["tapeImage"], + tapeRepeat: bindings["tapeRepeat"], + eventID: bindings["eventID"], + trackNum: bindings["trackNum"] + }); + evt._bindings = bindings; + evt.getProperty = function(name) { + return this._bindings[name]; + }; + evt.setWikiInfo(wikiURL, wikiSection); + + this._events.add(evt); + added = true; + } + node = node.nextSibling; + } + + if (added) { + this._fire("onAddMany", []); + } +}; + +Timeline.DefaultEventSource.prototype.add = function(evt) { + this._events.add(evt); + this._fire("onAddOne", [evt]); +}; + +Timeline.DefaultEventSource.prototype.addMany = function(events) { + for (var i = 0; i < events.length; i++) { + this._events.add(events[i]); + } + this._fire("onAddMany", []); +}; + +Timeline.DefaultEventSource.prototype.clear = function() { + this._events.removeAll(); + this._fire("onClear", []); +}; + +Timeline.DefaultEventSource.prototype.getEvent = function(id) { + return this._events.getEvent(id); +}; + +Timeline.DefaultEventSource.prototype.getEventIterator = function(startDate, endDate) { + return this._events.getIterator(startDate, endDate); +}; + +Timeline.DefaultEventSource.prototype.getEventReverseIterator = function(startDate, endDate) { + return this._events.getReverseIterator(startDate, endDate); +}; + +Timeline.DefaultEventSource.prototype.getAllEventIterator = function() { + return this._events.getAllIterator(); +}; + +Timeline.DefaultEventSource.prototype.getCount = function() { + return this._events.getCount(); +}; + +Timeline.DefaultEventSource.prototype.getEarliestDate = function() { + return this._events.getEarliestDate(); +}; + +Timeline.DefaultEventSource.prototype.getLatestDate = function() { + return this._events.getLatestDate(); +}; + +Timeline.DefaultEventSource.prototype._fire = function(handlerName, args) { + for (var i = 0; i < this._listeners.length; i++) { + var listener = this._listeners[i]; + if (handlerName in listener) { + try { + listener[handlerName].apply(listener, args); + } catch (e) { + SimileAjax.Debug.exception(e); + } + } + } +}; + +Timeline.DefaultEventSource.prototype._getBaseURL = function(url) { + if (url.indexOf("://") < 0) { + var url2 = this._getBaseURL(document.location.href); + if (url.substr(0,1) == "/") { + url = url2.substr(0, url2.indexOf("/", url2.indexOf("://") + 3)) + url; + } else { + url = url2 + url; + } + } + + var i = url.lastIndexOf("/"); + if (i < 0) { + return ""; + } else { + return url.substr(0, i+1); + } +}; + +Timeline.DefaultEventSource.prototype._resolveRelativeURL = function(url, base) { + if (url == null || url == "") { + return url; + } else if (url.indexOf("://") > 0) { + return url; + } else if (url.substr(0,1) == "/") { + return base.substr(0, base.indexOf("/", base.indexOf("://") + 3)) + url; + } else { + return base + url; + } +}; + + +Timeline.DefaultEventSource.Event = function(args) { + // + // Attention developers! + // If you add a new event attribute, please be sure to add it to + // all three load functions: loadXML, loadSPARCL, loadJSON. + // Thanks! + // + // args is a hash/object. It supports the following keys. Most are optional + // id -- an internal id. Really shouldn't be used by events. + // Timeline library clients should use eventID + // eventID -- For use by library client when writing custom painters or + // custom fillInfoBubble + // start + // end + // latestStart + // earliestEnd + // instant -- boolean. Controls precise/non-precise logic & duration/instant issues + // text -- event source attribute 'title' -- used as the label on Timelines and in bubbles. + // description -- used in bubbles + // image -- used in bubbles + // link -- used in bubbles + // icon -- on the Timeline + // color -- Timeline label and tape color + // textColor -- Timeline label color, overrides color attribute + // hoverText -- deprecated, here for backwards compatibility. + // Superceeded by caption + // caption -- tooltip-like caption on the Timeline. Uses HTML title attribute + // classname -- used to set classname in Timeline. Enables better CSS selector rules + // tapeImage -- background image of the duration event's tape div on the Timeline + // tapeRepeat -- repeat attribute for tapeImage. {repeat | repeat-x | repeat-y } + + function cleanArg(arg) { + // clean up an arg + return (args[arg] != null && args[arg] != "") ? args[arg] : null; + } + + var id = args.id ? args.id.trim() : ""; + this._id = id.length > 0 ? id : Timeline.EventUtils.getNewEventID(); + + this._instant = args.instant || (args.end == null); + + this._start = args.start; + this._end = (args.end != null) ? args.end : args.start; + + this._latestStart = (args.latestStart != null) ? + args.latestStart : (args.instant ? this._end : this._start); + this._earliestEnd = (args.earliestEnd != null) ? args.earliestEnd : this._end; + + // check sanity of dates since incorrect dates will later cause calculation errors + // when painting + var err=[]; + if (this._start > this._latestStart) { + this._latestStart = this._start; + err.push("start is > latestStart");} + if (this._start > this._earliestEnd) { + this._earliestEnd = this._latestStart; + err.push("start is > earliestEnd");} + if (this._start > this._end) { + this._end = this._earliestEnd; + err.push("start is > end");} + if (this._latestStart > this._earliestEnd) { + this._earliestEnd = this._latestStart; + err.push("latestStart is > earliestEnd");} + if (this._latestStart > this._end) { + this._end = this._earliestEnd; + err.push("latestStart is > end");} + if (this._earliestEnd > this._end) { + this._end = this._earliestEnd; + err.push("earliestEnd is > end");} + + this._eventID = cleanArg('eventID'); + this._text = (args.text != null) ? SimileAjax.HTML.deEntify(args.text) : ""; // Change blank titles to "" + if (err.length > 0) { + this._text += " PROBLEM: " + err.join(", "); + } + + this._description = SimileAjax.HTML.deEntify(args.description); + this._image = cleanArg('image'); + this._link = cleanArg('link'); + this._title = cleanArg('hoverText'); + this._title = cleanArg('caption'); + + this._icon = cleanArg('icon'); + this._color = cleanArg('color'); + this._textColor = cleanArg('textColor'); + this._classname = cleanArg('classname'); + this._tapeImage = cleanArg('tapeImage'); + this._tapeRepeat = cleanArg('tapeRepeat'); + this._trackNum = cleanArg('trackNum'); + if (this._trackNum != null) { + this._trackNum = parseInt(this._trackNum); + } + + this._wikiURL = null; + this._wikiSection = null; +}; + +Timeline.DefaultEventSource.Event.prototype = { + getID: function() { return this._id; }, + + isInstant: function() { return this._instant; }, + isImprecise: function() { return this._start != this._latestStart || this._end != this._earliestEnd; }, + + getStart: function() { return this._start; }, + getEnd: function() { return this._end; }, + getLatestStart: function() { return this._latestStart; }, + getEarliestEnd: function() { return this._earliestEnd; }, + + getEventID: function() { return this._eventID; }, + getText: function() { return this._text; }, // title + getDescription: function() { return this._description; }, + getImage: function() { return this._image; }, + getLink: function() { return this._link; }, + + getIcon: function() { return this._icon; }, + getColor: function() { return this._color; }, + getTextColor: function() { return this._textColor; }, + getClassName: function() { return this._classname; }, + getTapeImage: function() { return this._tapeImage; }, + getTapeRepeat: function() { return this._tapeRepeat; }, + getTrackNum: function() { return this._trackNum; }, + + getProperty: function(name) { return null; }, + + getWikiURL: function() { return this._wikiURL; }, + getWikiSection: function() { return this._wikiSection; }, + setWikiInfo: function(wikiURL, wikiSection) { + this._wikiURL = wikiURL; + this._wikiSection = wikiSection; + }, + + fillDescription: function(elmt) { + elmt.innerHTML = this._description; + }, + fillWikiInfo: function(elmt) { + // Many bubbles will not support a wiki link. + // + // Strategy: assume no wiki link. If we do have + // enough parameters for one, then create it. + elmt.style.display = "none"; // default + + if (this._wikiURL == null || this._wikiSection == null) { + return; // EARLY RETURN + } + + // create the wikiID from the property or from the event text (the title) + var wikiID = this.getProperty("wikiID"); + if (wikiID == null || wikiID.length == 0) { + wikiID = this.getText(); // use the title as the backup wiki id + } + + if (wikiID == null || wikiID.length == 0) { + return; // No wikiID. Thus EARLY RETURN + } + + // ready to go... + elmt.style.display = "inline"; + wikiID = wikiID.replace(/\s/g, "_"); + var url = this._wikiURL + this._wikiSection.replace(/\s/g, "_") + "/" + wikiID; + var a = document.createElement("a"); + a.href = url; + a.target = "new"; + a.innerHTML = Timeline.strings[Timeline.clientLocale].wikiLinkLabel; + + elmt.appendChild(document.createTextNode("[")); + elmt.appendChild(a); + elmt.appendChild(document.createTextNode("]")); + }, + + fillTime: function(elmt, labeller) { + if (this._instant) { + if (this.isImprecise()) { + elmt.appendChild(elmt.ownerDocument.createTextNode(labeller.labelPrecise(this._start))); + elmt.appendChild(elmt.ownerDocument.createElement("br")); + elmt.appendChild(elmt.ownerDocument.createTextNode(labeller.labelPrecise(this._end))); + } else { + elmt.appendChild(elmt.ownerDocument.createTextNode(labeller.labelPrecise(this._start))); + } + } else { + if (this.isImprecise()) { + elmt.appendChild(elmt.ownerDocument.createTextNode( + labeller.labelPrecise(this._start) + " ~ " + labeller.labelPrecise(this._latestStart))); + elmt.appendChild(elmt.ownerDocument.createElement("br")); + elmt.appendChild(elmt.ownerDocument.createTextNode( + labeller.labelPrecise(this._earliestEnd) + " ~ " + labeller.labelPrecise(this._end))); + } else { + elmt.appendChild(elmt.ownerDocument.createTextNode(labeller.labelPrecise(this._start))); + elmt.appendChild(elmt.ownerDocument.createElement("br")); + elmt.appendChild(elmt.ownerDocument.createTextNode(labeller.labelPrecise(this._end))); + } + } + }, + + fillInfoBubble: function(elmt, theme, labeller) { + var doc = elmt.ownerDocument; + + var title = this.getText(); + var link = this.getLink(); + var image = this.getImage(); + + if (image != null) { + var img = doc.createElement("img"); + img.src = image; + + theme.event.bubble.imageStyler(img); + elmt.appendChild(img); + } + + var divTitle = doc.createElement("div"); + var textTitle = doc.createTextNode(title); + if (link != null) { + var a = doc.createElement("a"); + a.href = link; + a.appendChild(textTitle); + divTitle.appendChild(a); + } else { + divTitle.appendChild(textTitle); + } + theme.event.bubble.titleStyler(divTitle); + elmt.appendChild(divTitle); + + var divBody = doc.createElement("div"); + this.fillDescription(divBody); + theme.event.bubble.bodyStyler(divBody); + elmt.appendChild(divBody); + + var divTime = doc.createElement("div"); + this.fillTime(divTime, labeller); + theme.event.bubble.timeStyler(divTime); + elmt.appendChild(divTime); + + var divWiki = doc.createElement("div"); + this.fillWikiInfo(divWiki); + theme.event.bubble.wikiStyler(divWiki); + elmt.appendChild(divWiki); + } +}; + + +/*================================================== + * Original Event Painter + *================================================== + */ + +/*================================================== + * + * To enable a single event listener to monitor everything + * on a Timeline, we need a way to map from an event's icon, + * label or tape element to the associated timeline, band and + * specific event. + * + * Thus a set format is used for the id's of the + * events' elements on the Timeline-- + * + * element id format for labels, icons, tapes: + * labels: label-tl--- + * icons: icon-tl--- + * tapes: tape1-tl--- + * tape2-tl--- + * // some events have more than one tape + * highlight: highlight1-tl--- + * highlight2-tl--- + * // some events have more than one highlight div (future) + * You can then retrieve the band/timeline objects and event object + * by using Timeline.EventUtils.decodeEventElID + * + *================================================== + */ + +/* + * eventPaintListener functions receive calls about painting. + * function(band, op, evt, els) + * context: 'this' will be an OriginalEventPainter object. + * It has properties and methods for obtaining + * the relevant band, timeline, etc + * band = the band being painted + * op = 'paintStarting' // the painter is about to remove + * all previously painted events, if any. It will + * then start painting all of the visible events that + * pass the filter. + * evt = null, els = null + * op = 'paintEnded' // the painter has finished painting + * all of the visible events that passed the filter + * evt = null, els = null + * op = 'paintedEvent' // the painter just finished painting an event + * evt = event just painted + * els = array of painted elements' divs. Depending on the event, + * the array could be just a tape or icon (if no label). + * Or could include label, multiple tape divs (imprecise event), + * highlight divs. The array is not ordered. The meaning of + * each el is available by decoding the el's id + * Note that there may be no paintedEvent calls if no events were visible + * or passed the filter. + */ + +Timeline.OriginalEventPainter = function(params) { + this._params = params; + this._onSelectListeners = []; + this._eventPaintListeners = []; + + this._filterMatcher = null; + this._highlightMatcher = null; + this._frc = null; + + this._eventIdToElmt = {}; +}; + +Timeline.OriginalEventPainter.prototype.initialize = function(band, timeline) { + this._band = band; + this._timeline = timeline; + + this._backLayer = null; + this._eventLayer = null; + this._lineLayer = null; + this._highlightLayer = null; + + this._eventIdToElmt = null; +}; + +Timeline.OriginalEventPainter.prototype.getType = function() { + return 'original'; +}; + +Timeline.OriginalEventPainter.prototype.addOnSelectListener = function(listener) { + this._onSelectListeners.push(listener); +}; + +Timeline.OriginalEventPainter.prototype.removeOnSelectListener = function(listener) { + for (var i = 0; i < this._onSelectListeners.length; i++) { + if (this._onSelectListeners[i] == listener) { + this._onSelectListeners.splice(i, 1); + break; + } + } +}; + +Timeline.OriginalEventPainter.prototype.addEventPaintListener = function(listener) { + this._eventPaintListeners.push(listener); +}; + +Timeline.OriginalEventPainter.prototype.removeEventPaintListener = function(listener) { + for (var i = 0; i < this._eventPaintListeners.length; i++) { + if (this._eventPaintListeners[i] == listener) { + this._eventPaintListeners.splice(i, 1); + break; + } + } +}; + +Timeline.OriginalEventPainter.prototype.getFilterMatcher = function() { + return this._filterMatcher; +}; + +Timeline.OriginalEventPainter.prototype.setFilterMatcher = function(filterMatcher) { + this._filterMatcher = filterMatcher; +}; + +Timeline.OriginalEventPainter.prototype.getHighlightMatcher = function() { + return this._highlightMatcher; +}; + +Timeline.OriginalEventPainter.prototype.setHighlightMatcher = function(highlightMatcher) { + this._highlightMatcher = highlightMatcher; +}; + +Timeline.OriginalEventPainter.prototype.paint = function() { + // Paints the events for a given section of the band--what is + // visible on screen and some extra. + var eventSource = this._band.getEventSource(); + if (eventSource == null) { + return; + } + + this._eventIdToElmt = {}; + this._fireEventPaintListeners('paintStarting', null, null); + this._prepareForPainting(); + + var eventTheme = this._params.theme.event; + var trackHeight = Math.max(eventTheme.track.height, eventTheme.tape.height + + this._frc.getLineHeight()); + var metrics = { + trackOffset: eventTheme.track.offset, + trackHeight: trackHeight, + trackGap: eventTheme.track.gap, + trackIncrement: trackHeight + eventTheme.track.gap, + icon: eventTheme.instant.icon, + iconWidth: eventTheme.instant.iconWidth, + iconHeight: eventTheme.instant.iconHeight, + labelWidth: eventTheme.label.width, + maxLabelChar: eventTheme.label.maxLabelChar, + impreciseIconMargin: eventTheme.instant.impreciseIconMargin + } + + var minDate = this._band.getMinDate(); + var maxDate = this._band.getMaxDate(); + + var filterMatcher = (this._filterMatcher != null) ? + this._filterMatcher : + function(evt) { return true; }; + var highlightMatcher = (this._highlightMatcher != null) ? + this._highlightMatcher : + function(evt) { return -1; }; + + var iterator = eventSource.getEventReverseIterator(minDate, maxDate); + while (iterator.hasNext()) { + var evt = iterator.next(); + if (filterMatcher(evt)) { + this.paintEvent(evt, metrics, this._params.theme, highlightMatcher(evt)); + } + } + + this._highlightLayer.style.display = "block"; + this._lineLayer.style.display = "block"; + this._eventLayer.style.display = "block"; + // update the band object for max number of tracks in this section of the ether + this._band.updateEventTrackInfo(this._tracks.length, metrics.trackIncrement); + this._fireEventPaintListeners('paintEnded', null, null); +}; + +Timeline.OriginalEventPainter.prototype.softPaint = function() { +}; + +Timeline.OriginalEventPainter.prototype._prepareForPainting = function() { + // Remove everything previously painted: highlight, line and event layers. + // Prepare blank layers for painting. + var band = this._band; + + if (this._backLayer == null) { + this._backLayer = this._band.createLayerDiv(0, "timeline-band-events"); + this._backLayer.style.visibility = "hidden"; + + var eventLabelPrototype = document.createElement("span"); + eventLabelPrototype.className = "timeline-event-label"; + this._backLayer.appendChild(eventLabelPrototype); + this._frc = SimileAjax.Graphics.getFontRenderingContext(eventLabelPrototype); + } + this._frc.update(); + this._tracks = []; + + if (this._highlightLayer != null) { + band.removeLayerDiv(this._highlightLayer); + } + this._highlightLayer = band.createLayerDiv(105, "timeline-band-highlights"); + this._highlightLayer.style.display = "none"; + + if (this._lineLayer != null) { + band.removeLayerDiv(this._lineLayer); + } + this._lineLayer = band.createLayerDiv(110, "timeline-band-lines"); + this._lineLayer.style.display = "none"; + + if (this._eventLayer != null) { + band.removeLayerDiv(this._eventLayer); + } + this._eventLayer = band.createLayerDiv(115, "timeline-band-events"); + this._eventLayer.style.display = "none"; +}; + +Timeline.OriginalEventPainter.prototype.paintEvent = function(evt, metrics, theme, highlightIndex) { + if (evt.isInstant()) { + this.paintInstantEvent(evt, metrics, theme, highlightIndex); + } else { + this.paintDurationEvent(evt, metrics, theme, highlightIndex); + } +}; + +Timeline.OriginalEventPainter.prototype.paintInstantEvent = function(evt, metrics, theme, highlightIndex) { + if (evt.isImprecise()) { + this.paintImpreciseInstantEvent(evt, metrics, theme, highlightIndex); + } else { + this.paintPreciseInstantEvent(evt, metrics, theme, highlightIndex); + } +} + +Timeline.OriginalEventPainter.prototype.paintDurationEvent = function(evt, metrics, theme, highlightIndex) { + if (evt.isImprecise()) { + this.paintImpreciseDurationEvent(evt, metrics, theme, highlightIndex); + } else { + this.paintPreciseDurationEvent(evt, metrics, theme, highlightIndex); + } +} + +Timeline.OriginalEventPainter.prototype.paintPreciseInstantEvent = function(evt, metrics, theme, highlightIndex) { + var doc = this._timeline.getDocument(); + var text = evt.getText(); + + var startDate = evt.getStart(); + var startPixel = Math.round(this._band.dateToPixelOffset(startDate)); + var iconRightEdge = Math.round(startPixel + metrics.iconWidth / 2); + var iconLeftEdge = Math.round(startPixel - metrics.iconWidth / 2); + + var labelDivClassName = this._getLabelDivClassName(evt); + var labelSize = this._frc.computeSize(text, labelDivClassName); + var labelLeft = iconRightEdge + theme.event.label.offsetFromLine; + var labelRight = labelLeft + labelSize.width; + + var rightEdge = labelRight; + var track = this._findFreeTrack(evt, rightEdge); + + var labelTop = Math.round( + metrics.trackOffset + track * metrics.trackIncrement + + metrics.trackHeight / 2 - labelSize.height / 2); + + var iconElmtData = this._paintEventIcon(evt, track, iconLeftEdge, metrics, theme, 0); + var labelElmtData = this._paintEventLabel(evt, text, labelLeft, labelTop, labelSize.width, + labelSize.height, theme, labelDivClassName, highlightIndex); + var els = [iconElmtData.elmt, labelElmtData.elmt]; + + var self = this; + var clickHandler = function(elmt, domEvt, target) { + return self._onClickInstantEvent(iconElmtData.elmt, domEvt, evt); + }; + SimileAjax.DOM.registerEvent(iconElmtData.elmt, "mousedown", clickHandler); + SimileAjax.DOM.registerEvent(labelElmtData.elmt, "mousedown", clickHandler); + + var hDiv = this._createHighlightDiv(highlightIndex, iconElmtData, theme, evt); + if (hDiv != null) {els.push(hDiv);} + this._fireEventPaintListeners('paintedEvent', evt, els); + + + this._eventIdToElmt[evt.getID()] = iconElmtData.elmt; + this._tracks[track] = iconLeftEdge; +}; + +Timeline.OriginalEventPainter.prototype.paintImpreciseInstantEvent = function(evt, metrics, theme, highlightIndex) { + var doc = this._timeline.getDocument(); + var text = evt.getText(); + + var startDate = evt.getStart(); + var endDate = evt.getEnd(); + var startPixel = Math.round(this._band.dateToPixelOffset(startDate)); + var endPixel = Math.round(this._band.dateToPixelOffset(endDate)); + + var iconRightEdge = Math.round(startPixel + metrics.iconWidth / 2); + var iconLeftEdge = Math.round(startPixel - metrics.iconWidth / 2); + + var labelDivClassName = this._getLabelDivClassName(evt); + var labelSize = this._frc.computeSize(text, labelDivClassName); + var labelLeft = iconRightEdge + theme.event.label.offsetFromLine; + var labelRight = labelLeft + labelSize.width; + + var rightEdge = Math.max(labelRight, endPixel); + var track = this._findFreeTrack(evt, rightEdge); + var tapeHeight = theme.event.tape.height; + var labelTop = Math.round( + metrics.trackOffset + track * metrics.trackIncrement + tapeHeight); + + var iconElmtData = this._paintEventIcon(evt, track, iconLeftEdge, metrics, theme, tapeHeight); + var labelElmtData = this._paintEventLabel(evt, text, labelLeft, labelTop, labelSize.width, + labelSize.height, theme, labelDivClassName, highlightIndex); + + var color = evt.getColor(); + color = color != null ? color : theme.event.instant.impreciseColor; + + var tapeElmtData = this._paintEventTape(evt, track, startPixel, endPixel, + color, theme.event.instant.impreciseOpacity, metrics, theme, 0); + var els = [iconElmtData.elmt, labelElmtData.elmt, tapeElmtData.elmt]; + + var self = this; + var clickHandler = function(elmt, domEvt, target) { + return self._onClickInstantEvent(iconElmtData.elmt, domEvt, evt); + }; + SimileAjax.DOM.registerEvent(iconElmtData.elmt, "mousedown", clickHandler); + SimileAjax.DOM.registerEvent(tapeElmtData.elmt, "mousedown", clickHandler); + SimileAjax.DOM.registerEvent(labelElmtData.elmt, "mousedown", clickHandler); + + var hDiv = this._createHighlightDiv(highlightIndex, iconElmtData, theme, evt); + if (hDiv != null) {els.push(hDiv);} + this._fireEventPaintListeners('paintedEvent', evt, els); + + this._eventIdToElmt[evt.getID()] = iconElmtData.elmt; + this._tracks[track] = iconLeftEdge; +}; + +Timeline.OriginalEventPainter.prototype.paintPreciseDurationEvent = function(evt, metrics, theme, highlightIndex) { + var doc = this._timeline.getDocument(); + var text = evt.getText(); + + var startDate = evt.getStart(); + var endDate = evt.getEnd(); + var startPixel = Math.round(this._band.dateToPixelOffset(startDate)); + var endPixel = Math.round(this._band.dateToPixelOffset(endDate)); + + var labelDivClassName = this._getLabelDivClassName(evt); + var labelSize = this._frc.computeSize(text, labelDivClassName); + var labelLeft = startPixel; + var labelRight = labelLeft + labelSize.width; + + var rightEdge = Math.max(labelRight, endPixel); + var track = this._findFreeTrack(evt, rightEdge); + var labelTop = Math.round( + metrics.trackOffset + track * metrics.trackIncrement + theme.event.tape.height); + + var color = evt.getColor(); + color = color != null ? color : theme.event.duration.color; + + var tapeElmtData = this._paintEventTape(evt, track, startPixel, endPixel, color, 100, metrics, theme, 0); + var labelElmtData = this._paintEventLabel(evt, text, labelLeft, labelTop, labelSize.width, + labelSize.height, theme, labelDivClassName, highlightIndex); + var els = [tapeElmtData.elmt, labelElmtData.elmt]; + + var self = this; + var clickHandler = function(elmt, domEvt, target) { + return self._onClickDurationEvent(tapeElmtData.elmt, domEvt, evt); + }; + SimileAjax.DOM.registerEvent(tapeElmtData.elmt, "mousedown", clickHandler); + SimileAjax.DOM.registerEvent(labelElmtData.elmt, "mousedown", clickHandler); + + var hDiv = this._createHighlightDiv(highlightIndex, tapeElmtData, theme, evt); + if (hDiv != null) {els.push(hDiv);} + this._fireEventPaintListeners('paintedEvent', evt, els); + + this._eventIdToElmt[evt.getID()] = tapeElmtData.elmt; + this._tracks[track] = startPixel; +}; + +Timeline.OriginalEventPainter.prototype.paintImpreciseDurationEvent = function(evt, metrics, theme, highlightIndex) { + var doc = this._timeline.getDocument(); + var text = evt.getText(); + + var startDate = evt.getStart(); + var latestStartDate = evt.getLatestStart(); + var endDate = evt.getEnd(); + var earliestEndDate = evt.getEarliestEnd(); + + var startPixel = Math.round(this._band.dateToPixelOffset(startDate)); + var latestStartPixel = Math.round(this._band.dateToPixelOffset(latestStartDate)); + var endPixel = Math.round(this._band.dateToPixelOffset(endDate)); + var earliestEndPixel = Math.round(this._band.dateToPixelOffset(earliestEndDate)); + + var labelDivClassName = this._getLabelDivClassName(evt); + var labelSize = this._frc.computeSize(text, labelDivClassName); + var labelLeft = latestStartPixel; + var labelRight = labelLeft + labelSize.width; + + var rightEdge = Math.max(labelRight, endPixel); + var track = this._findFreeTrack(evt, rightEdge); + var labelTop = Math.round( + metrics.trackOffset + track * metrics.trackIncrement + theme.event.tape.height); + + var color = evt.getColor(); + color = color != null ? color : theme.event.duration.color; + + // Imprecise events can have two event tapes + // The imprecise dates tape, uses opacity to be dimmer than precise dates + var impreciseTapeElmtData = this._paintEventTape(evt, track, startPixel, endPixel, + theme.event.duration.impreciseColor, + theme.event.duration.impreciseOpacity, metrics, theme, 0); + // The precise dates tape, regular (100%) opacity + var tapeElmtData = this._paintEventTape(evt, track, latestStartPixel, + earliestEndPixel, color, 100, metrics, theme, 1); + + var labelElmtData = this._paintEventLabel(evt, text, labelLeft, labelTop, + labelSize.width, labelSize.height, theme, labelDivClassName, highlightIndex); + var els = [impreciseTapeElmtData.elmt, tapeElmtData.elmt, labelElmtData.elmt]; + + var self = this; + var clickHandler = function(elmt, domEvt, target) { + return self._onClickDurationEvent(tapeElmtData.elmt, domEvt, evt); + }; + SimileAjax.DOM.registerEvent(tapeElmtData.elmt, "mousedown", clickHandler); + SimileAjax.DOM.registerEvent(labelElmtData.elmt, "mousedown", clickHandler); + + var hDiv = this._createHighlightDiv(highlightIndex, tapeElmtData, theme, evt); + if (hDiv != null) {els.push(hDiv);} + this._fireEventPaintListeners('paintedEvent', evt, els); + + this._eventIdToElmt[evt.getID()] = tapeElmtData.elmt; + this._tracks[track] = startPixel; +}; + +Timeline.OriginalEventPainter.prototype._encodeEventElID = function(elType, evt) { + return Timeline.EventUtils.encodeEventElID(this._timeline, this._band, elType, evt); +}; + +Timeline.OriginalEventPainter.prototype._findFreeTrack = function(event, rightEdge) { + var trackAttribute = event.getTrackNum(); + if (trackAttribute != null) { + return trackAttribute; // early return since event includes track number + } + + // normal case: find an open track + for (var i = 0; i < this._tracks.length; i++) { + var t = this._tracks[i]; + if (t > rightEdge) { + break; + } + } + return i; +}; + +Timeline.OriginalEventPainter.prototype._paintEventIcon = function(evt, iconTrack, left, metrics, theme, tapeHeight) { + // If no tape, then paint the icon in the middle of the track. + // If there is a tape, paint the icon below the tape + impreciseIconMargin + var icon = evt.getIcon(); + icon = icon != null ? icon : metrics.icon; + + var top; // top of the icon + if (tapeHeight > 0) { + top = metrics.trackOffset + iconTrack * metrics.trackIncrement + + tapeHeight + metrics.impreciseIconMargin; + } else { + var middle = metrics.trackOffset + iconTrack * metrics.trackIncrement + + metrics.trackHeight / 2; + top = Math.round(middle - metrics.iconHeight / 2); + } + var img = SimileAjax.Graphics.createTranslucentImage(icon); + var iconDiv = this._timeline.getDocument().createElement("div"); + iconDiv.className = this._getElClassName('timeline-event-icon', evt, 'icon'); + iconDiv.id = this._encodeEventElID('icon', evt); + iconDiv.style.left = left + "px"; + iconDiv.style.top = top + "px"; + iconDiv.appendChild(img); + + if(evt._title != null) + iconDiv.title = evt._title; + + this._eventLayer.appendChild(iconDiv); + + return { + left: left, + top: top, + width: metrics.iconWidth, + height: metrics.iconHeight, + elmt: iconDiv + }; +}; + +Timeline.OriginalEventPainter.prototype._paintEventLabel = function(evt, text, left, top, width, + height, theme, labelDivClassName, highlightIndex) { + var doc = this._timeline.getDocument(); + + var labelDiv = doc.createElement("div"); + labelDiv.className = labelDivClassName; + labelDiv.id = this._encodeEventElID('label', evt); + labelDiv.style.left = left + "px"; + labelDiv.style.width = width + "px"; + labelDiv.style.top = top + "px"; + labelDiv.innerHTML = text; + + if(evt._title != null) + labelDiv.title = evt._title; + + var color = evt.getTextColor(); + if (color == null) { + color = evt.getColor(); + } + if (color != null) { + labelDiv.style.color = color; + } + if (theme.event.highlightLabelBackground && highlightIndex >= 0) { + labelDiv.style.background = this._getHighlightColor(highlightIndex, theme); + } + + this._eventLayer.appendChild(labelDiv); + + return { + left: left, + top: top, + width: width, + height: height, + elmt: labelDiv + }; +}; + +Timeline.OriginalEventPainter.prototype._paintEventTape = function( + evt, iconTrack, startPixel, endPixel, color, opacity, metrics, theme, tape_index) { + + var tapeWidth = endPixel - startPixel; + var tapeHeight = theme.event.tape.height; + var top = metrics.trackOffset + iconTrack * metrics.trackIncrement; + + var tapeDiv = this._timeline.getDocument().createElement("div"); + tapeDiv.className = this._getElClassName('timeline-event-tape', evt, 'tape'); + tapeDiv.id = this._encodeEventElID('tape' + tape_index, evt); + tapeDiv.style.left = startPixel + "px"; + tapeDiv.style.width = tapeWidth + "px"; + tapeDiv.style.height = tapeHeight + "px"; + tapeDiv.style.top = top + "px"; + + if(evt._title != null) + tapeDiv.title = evt._title; + + if(color != null) { + tapeDiv.style.backgroundColor = color; + } + + var backgroundImage = evt.getTapeImage(); + var backgroundRepeat = evt.getTapeRepeat(); + backgroundRepeat = backgroundRepeat != null ? backgroundRepeat : 'repeat'; + if(backgroundImage != null) { + tapeDiv.style.backgroundImage = "url(" + backgroundImage + ")"; + tapeDiv.style.backgroundRepeat = backgroundRepeat; + } + + SimileAjax.Graphics.setOpacity(tapeDiv, opacity); + + this._eventLayer.appendChild(tapeDiv); + + return { + left: startPixel, + top: top, + width: tapeWidth, + height: tapeHeight, + elmt: tapeDiv + }; +} + +Timeline.OriginalEventPainter.prototype._getLabelDivClassName = function(evt) { + return this._getElClassName('timeline-event-label', evt, 'label'); +}; + +Timeline.OriginalEventPainter.prototype._getElClassName = function(elClassName, evt, prefix) { + // Prefix and '_' is added to the event's classname. Set to null for no prefix + var evt_classname = evt.getClassName(), + pieces = []; + + if (evt_classname) { + if (prefix) {pieces.push(prefix + '-' + evt_classname + ' ');} + pieces.push(evt_classname + ' '); + } + pieces.push(elClassName); + return(pieces.join('')); +}; + +Timeline.OriginalEventPainter.prototype._getHighlightColor = function(highlightIndex, theme) { + var highlightColors = theme.event.highlightColors; + return highlightColors[Math.min(highlightIndex, highlightColors.length - 1)]; +}; + +Timeline.OriginalEventPainter.prototype._createHighlightDiv = function(highlightIndex, dimensions, theme, evt) { + var div = null; + if (highlightIndex >= 0) { + var doc = this._timeline.getDocument(); + var color = this._getHighlightColor(highlightIndex, theme); + + div = doc.createElement("div"); + div.className = this._getElClassName('timeline-event-highlight', evt, 'highlight'); + div.id = this._encodeEventElID('highlight0', evt); // in future will have other + // highlight divs for tapes + icons + div.style.position = "absolute"; + div.style.overflow = "hidden"; + div.style.left = (dimensions.left - 2) + "px"; + div.style.width = (dimensions.width + 4) + "px"; + div.style.top = (dimensions.top - 2) + "px"; + div.style.height = (dimensions.height + 4) + "px"; + div.style.background = color; + + this._highlightLayer.appendChild(div); + } + return div; +}; + +Timeline.OriginalEventPainter.prototype._onClickInstantEvent = function(icon, domEvt, evt) { + var c = SimileAjax.DOM.getPageCoordinates(icon); + this._showBubble( + c.left + Math.ceil(icon.offsetWidth / 2), + c.top + Math.ceil(icon.offsetHeight / 2), + evt + ); + this._fireOnSelect(evt.getID()); + + domEvt.cancelBubble = true; + SimileAjax.DOM.cancelEvent(domEvt); + return false; +}; + +Timeline.OriginalEventPainter.prototype._onClickDurationEvent = function(target, domEvt, evt) { + if ("pageX" in domEvt) { + var x = domEvt.pageX; + var y = domEvt.pageY; + } else { + var c = SimileAjax.DOM.getPageCoordinates(target); + var x = domEvt.offsetX + c.left; + var y = domEvt.offsetY + c.top; + } + this._showBubble(x, y, evt); + this._fireOnSelect(evt.getID()); + + domEvt.cancelBubble = true; + SimileAjax.DOM.cancelEvent(domEvt); + return false; +}; + +Timeline.OriginalEventPainter.prototype.showBubble = function(evt) { + var elmt = this._eventIdToElmt[evt.getID()]; + if (elmt) { + var c = SimileAjax.DOM.getPageCoordinates(elmt); + this._showBubble(c.left + elmt.offsetWidth / 2, c.top + elmt.offsetHeight / 2, evt); + } +}; + +Timeline.OriginalEventPainter.prototype._showBubble = function(x, y, evt) { + var div = document.createElement("div"); + var themeBubble = this._params.theme.event.bubble; + evt.fillInfoBubble(div, this._params.theme, this._band.getLabeller()); + + SimileAjax.WindowManager.cancelPopups(); + SimileAjax.Graphics.createBubbleForContentAndPoint(div, x, y, + themeBubble.width, null, themeBubble.maxHeight); +}; + +Timeline.OriginalEventPainter.prototype._fireOnSelect = function(eventID) { + for (var i = 0; i < this._onSelectListeners.length; i++) { + this._onSelectListeners[i](eventID); + } +}; + +Timeline.OriginalEventPainter.prototype._fireEventPaintListeners = function(op, evt, els) { + for (var i = 0; i < this._eventPaintListeners.length; i++) { + this._eventPaintListeners[i](this._band, op, evt, els); + } +}; +/*================================================== + * Detailed Event Painter + *================================================== + */ + +// Note: a number of features from original-painter +// are not yet implemented in detailed painter. +// Eg classname, id attributes for icons, labels, tapes + +Timeline.DetailedEventPainter = function(params) { + this._params = params; + this._onSelectListeners = []; + + this._filterMatcher = null; + this._highlightMatcher = null; + this._frc = null; + + this._eventIdToElmt = {}; +}; + +Timeline.DetailedEventPainter.prototype.initialize = function(band, timeline) { + this._band = band; + this._timeline = timeline; + + this._backLayer = null; + this._eventLayer = null; + this._lineLayer = null; + this._highlightLayer = null; + + this._eventIdToElmt = null; +}; + +Timeline.DetailedEventPainter.prototype.getType = function() { + return 'detailed'; +}; + +Timeline.DetailedEventPainter.prototype.addOnSelectListener = function(listener) { + this._onSelectListeners.push(listener); +}; + +Timeline.DetailedEventPainter.prototype.removeOnSelectListener = function(listener) { + for (var i = 0; i < this._onSelectListeners.length; i++) { + if (this._onSelectListeners[i] == listener) { + this._onSelectListeners.splice(i, 1); + break; + } + } +}; + +Timeline.DetailedEventPainter.prototype.getFilterMatcher = function() { + return this._filterMatcher; +}; + +Timeline.DetailedEventPainter.prototype.setFilterMatcher = function(filterMatcher) { + this._filterMatcher = filterMatcher; +}; + +Timeline.DetailedEventPainter.prototype.getHighlightMatcher = function() { + return this._highlightMatcher; +}; + +Timeline.DetailedEventPainter.prototype.setHighlightMatcher = function(highlightMatcher) { + this._highlightMatcher = highlightMatcher; +}; + +Timeline.DetailedEventPainter.prototype.paint = function() { + var eventSource = this._band.getEventSource(); + if (eventSource == null) { + return; + } + + this._eventIdToElmt = {}; + this._prepareForPainting(); + + var eventTheme = this._params.theme.event; + var trackHeight = Math.max(eventTheme.track.height, this._frc.getLineHeight()); + var metrics = { + trackOffset: Math.round(this._band.getViewWidth() / 2 - trackHeight / 2), + trackHeight: trackHeight, + trackGap: eventTheme.track.gap, + trackIncrement: trackHeight + eventTheme.track.gap, + icon: eventTheme.instant.icon, + iconWidth: eventTheme.instant.iconWidth, + iconHeight: eventTheme.instant.iconHeight, + labelWidth: eventTheme.label.width + } + + var minDate = this._band.getMinDate(); + var maxDate = this._band.getMaxDate(); + + var filterMatcher = (this._filterMatcher != null) ? + this._filterMatcher : + function(evt) { return true; }; + var highlightMatcher = (this._highlightMatcher != null) ? + this._highlightMatcher : + function(evt) { return -1; }; + + var iterator = eventSource.getEventReverseIterator(minDate, maxDate); + while (iterator.hasNext()) { + var evt = iterator.next(); + if (filterMatcher(evt)) { + this.paintEvent(evt, metrics, this._params.theme, highlightMatcher(evt)); + } + } + + this._highlightLayer.style.display = "block"; + this._lineLayer.style.display = "block"; + this._eventLayer.style.display = "block"; + // update the band object for max number of tracks in this section of the ether + this._band.updateEventTrackInfo(this._lowerTracks.length + this._upperTracks.length, + metrics.trackIncrement); +}; + +Timeline.DetailedEventPainter.prototype.softPaint = function() { +}; + +Timeline.DetailedEventPainter.prototype._prepareForPainting = function() { + var band = this._band; + + if (this._backLayer == null) { + this._backLayer = this._band.createLayerDiv(0, "timeline-band-events"); + this._backLayer.style.visibility = "hidden"; + + var eventLabelPrototype = document.createElement("span"); + eventLabelPrototype.className = "timeline-event-label"; + this._backLayer.appendChild(eventLabelPrototype); + this._frc = SimileAjax.Graphics.getFontRenderingContext(eventLabelPrototype); + } + this._frc.update(); + this._lowerTracks = []; + this._upperTracks = []; + + if (this._highlightLayer != null) { + band.removeLayerDiv(this._highlightLayer); + } + this._highlightLayer = band.createLayerDiv(105, "timeline-band-highlights"); + this._highlightLayer.style.display = "none"; + + if (this._lineLayer != null) { + band.removeLayerDiv(this._lineLayer); + } + this._lineLayer = band.createLayerDiv(110, "timeline-band-lines"); + this._lineLayer.style.display = "none"; + + if (this._eventLayer != null) { + band.removeLayerDiv(this._eventLayer); + } + this._eventLayer = band.createLayerDiv(110, "timeline-band-events"); + this._eventLayer.style.display = "none"; +}; + +Timeline.DetailedEventPainter.prototype.paintEvent = function(evt, metrics, theme, highlightIndex) { + if (evt.isInstant()) { + this.paintInstantEvent(evt, metrics, theme, highlightIndex); + } else { + this.paintDurationEvent(evt, metrics, theme, highlightIndex); + } +}; + +Timeline.DetailedEventPainter.prototype.paintInstantEvent = function(evt, metrics, theme, highlightIndex) { + if (evt.isImprecise()) { + this.paintImpreciseInstantEvent(evt, metrics, theme, highlightIndex); + } else { + this.paintPreciseInstantEvent(evt, metrics, theme, highlightIndex); + } +} + +Timeline.DetailedEventPainter.prototype.paintDurationEvent = function(evt, metrics, theme, highlightIndex) { + if (evt.isImprecise()) { + this.paintImpreciseDurationEvent(evt, metrics, theme, highlightIndex); + } else { + this.paintPreciseDurationEvent(evt, metrics, theme, highlightIndex); + } +} + +Timeline.DetailedEventPainter.prototype.paintPreciseInstantEvent = function(evt, metrics, theme, highlightIndex) { + var doc = this._timeline.getDocument(); + var text = evt.getText(); + + var startDate = evt.getStart(); + var startPixel = Math.round(this._band.dateToPixelOffset(startDate)); + var iconRightEdge = Math.round(startPixel + metrics.iconWidth / 2); + var iconLeftEdge = Math.round(startPixel - metrics.iconWidth / 2); + + var labelSize = this._frc.computeSize(text); + var iconTrack = this._findFreeTrackForSolid(iconRightEdge, startPixel); + var iconElmtData = this._paintEventIcon(evt, iconTrack, iconLeftEdge, metrics, theme); + + var labelLeft = iconRightEdge + theme.event.label.offsetFromLine; + var labelTrack = iconTrack; + + var iconTrackData = this._getTrackData(iconTrack); + if (Math.min(iconTrackData.solid, iconTrackData.text) >= labelLeft + labelSize.width) { // label on the same track, to the right of icon + iconTrackData.solid = iconLeftEdge; + iconTrackData.text = labelLeft; + } else { // label on a different track, below icon + iconTrackData.solid = iconLeftEdge; + + labelLeft = startPixel + theme.event.label.offsetFromLine; + labelTrack = this._findFreeTrackForText(iconTrack, labelLeft + labelSize.width, function(t) { t.line = startPixel - 2; }); + this._getTrackData(labelTrack).text = iconLeftEdge; + + this._paintEventLine(evt, startPixel, iconTrack, labelTrack, metrics, theme); + } + + var labelTop = Math.round( + metrics.trackOffset + labelTrack * metrics.trackIncrement + + metrics.trackHeight / 2 - labelSize.height / 2); + + var labelElmtData = this._paintEventLabel(evt, text, labelLeft, labelTop, labelSize.width, labelSize.height, theme); + + var self = this; + var clickHandler = function(elmt, domEvt, target) { + return self._onClickInstantEvent(iconElmtData.elmt, domEvt, evt); + }; + SimileAjax.DOM.registerEvent(iconElmtData.elmt, "mousedown", clickHandler); + SimileAjax.DOM.registerEvent(labelElmtData.elmt, "mousedown", clickHandler); + + this._createHighlightDiv(highlightIndex, iconElmtData, theme); + + this._eventIdToElmt[evt.getID()] = iconElmtData.elmt; +}; + +Timeline.DetailedEventPainter.prototype.paintImpreciseInstantEvent = function(evt, metrics, theme, highlightIndex) { + var doc = this._timeline.getDocument(); + var text = evt.getText(); + + var startDate = evt.getStart(); + var endDate = evt.getEnd(); + var startPixel = Math.round(this._band.dateToPixelOffset(startDate)); + var endPixel = Math.round(this._band.dateToPixelOffset(endDate)); + + var iconRightEdge = Math.round(startPixel + metrics.iconWidth / 2); + var iconLeftEdge = Math.round(startPixel - metrics.iconWidth / 2); + + var labelSize = this._frc.computeSize(text); + var iconTrack = this._findFreeTrackForSolid(endPixel, startPixel); + + var tapeElmtData = this._paintEventTape(evt, iconTrack, startPixel, endPixel, + theme.event.instant.impreciseColor, theme.event.instant.impreciseOpacity, metrics, theme); + var iconElmtData = this._paintEventIcon(evt, iconTrack, iconLeftEdge, metrics, theme); + + var iconTrackData = this._getTrackData(iconTrack); + iconTrackData.solid = iconLeftEdge; + + var labelLeft = iconRightEdge + theme.event.label.offsetFromLine; + var labelRight = labelLeft + labelSize.width; + var labelTrack; + if (labelRight < endPixel) { + labelTrack = iconTrack; + } else { + labelLeft = startPixel + theme.event.label.offsetFromLine; + labelRight = labelLeft + labelSize.width; + + labelTrack = this._findFreeTrackForText(iconTrack, labelRight, function(t) { t.line = startPixel - 2; }); + this._getTrackData(labelTrack).text = iconLeftEdge; + + this._paintEventLine(evt, startPixel, iconTrack, labelTrack, metrics, theme); + } + var labelTop = Math.round( + metrics.trackOffset + labelTrack * metrics.trackIncrement + + metrics.trackHeight / 2 - labelSize.height / 2); + + var labelElmtData = this._paintEventLabel(evt, text, labelLeft, labelTop, labelSize.width, labelSize.height, theme); + + var self = this; + var clickHandler = function(elmt, domEvt, target) { + return self._onClickInstantEvent(iconElmtData.elmt, domEvt, evt); + }; + SimileAjax.DOM.registerEvent(iconElmtData.elmt, "mousedown", clickHandler); + SimileAjax.DOM.registerEvent(tapeElmtData.elmt, "mousedown", clickHandler); + SimileAjax.DOM.registerEvent(labelElmtData.elmt, "mousedown", clickHandler); + + this._createHighlightDiv(highlightIndex, iconElmtData, theme); + + this._eventIdToElmt[evt.getID()] = iconElmtData.elmt; +}; + +Timeline.DetailedEventPainter.prototype.paintPreciseDurationEvent = function(evt, metrics, theme, highlightIndex) { + var doc = this._timeline.getDocument(); + var text = evt.getText(); + + var startDate = evt.getStart(); + var endDate = evt.getEnd(); + var startPixel = Math.round(this._band.dateToPixelOffset(startDate)); + var endPixel = Math.round(this._band.dateToPixelOffset(endDate)); + + var labelSize = this._frc.computeSize(text); + var tapeTrack = this._findFreeTrackForSolid(endPixel); + var color = evt.getColor(); + color = color != null ? color : theme.event.duration.color; + + var tapeElmtData = this._paintEventTape(evt, tapeTrack, startPixel, endPixel, color, 100, metrics, theme); + + var tapeTrackData = this._getTrackData(tapeTrack); + tapeTrackData.solid = startPixel; + + var labelLeft = startPixel + theme.event.label.offsetFromLine; + var labelTrack = this._findFreeTrackForText(tapeTrack, labelLeft + labelSize.width, function(t) { t.line = startPixel - 2; }); + this._getTrackData(labelTrack).text = startPixel - 2; + + this._paintEventLine(evt, startPixel, tapeTrack, labelTrack, metrics, theme); + + var labelTop = Math.round( + metrics.trackOffset + labelTrack * metrics.trackIncrement + + metrics.trackHeight / 2 - labelSize.height / 2); + + var labelElmtData = this._paintEventLabel(evt, text, labelLeft, labelTop, labelSize.width, labelSize.height, theme); + + var self = this; + var clickHandler = function(elmt, domEvt, target) { + return self._onClickDurationEvent(tapeElmtData.elmt, domEvt, evt); + }; + SimileAjax.DOM.registerEvent(tapeElmtData.elmt, "mousedown", clickHandler); + SimileAjax.DOM.registerEvent(labelElmtData.elmt, "mousedown", clickHandler); + + this._createHighlightDiv(highlightIndex, tapeElmtData, theme); + + this._eventIdToElmt[evt.getID()] = tapeElmtData.elmt; +}; + +Timeline.DetailedEventPainter.prototype.paintImpreciseDurationEvent = function(evt, metrics, theme, highlightIndex) { + var doc = this._timeline.getDocument(); + var text = evt.getText(); + + var startDate = evt.getStart(); + var latestStartDate = evt.getLatestStart(); + var endDate = evt.getEnd(); + var earliestEndDate = evt.getEarliestEnd(); + + var startPixel = Math.round(this._band.dateToPixelOffset(startDate)); + var latestStartPixel = Math.round(this._band.dateToPixelOffset(latestStartDate)); + var endPixel = Math.round(this._band.dateToPixelOffset(endDate)); + var earliestEndPixel = Math.round(this._band.dateToPixelOffset(earliestEndDate)); + + var labelSize = this._frc.computeSize(text); + var tapeTrack = this._findFreeTrackForSolid(endPixel); + var color = evt.getColor(); + color = color != null ? color : theme.event.duration.color; + + var impreciseTapeElmtData = this._paintEventTape(evt, tapeTrack, startPixel, endPixel, + theme.event.duration.impreciseColor, theme.event.duration.impreciseOpacity, metrics, theme); + var tapeElmtData = this._paintEventTape(evt, tapeTrack, latestStartPixel, earliestEndPixel, color, 100, metrics, theme); + + var tapeTrackData = this._getTrackData(tapeTrack); + tapeTrackData.solid = startPixel; + + var labelLeft = latestStartPixel + theme.event.label.offsetFromLine; + var labelTrack = this._findFreeTrackForText(tapeTrack, labelLeft + labelSize.width, function(t) { t.line = latestStartPixel - 2; }); + this._getTrackData(labelTrack).text = latestStartPixel - 2; + + this._paintEventLine(evt, latestStartPixel, tapeTrack, labelTrack, metrics, theme); + + var labelTop = Math.round( + metrics.trackOffset + labelTrack * metrics.trackIncrement + + metrics.trackHeight / 2 - labelSize.height / 2); + + var labelElmtData = this._paintEventLabel(evt, text, labelLeft, labelTop, labelSize.width, labelSize.height, theme); + + var self = this; + var clickHandler = function(elmt, domEvt, target) { + return self._onClickDurationEvent(tapeElmtData.elmt, domEvt, evt); + }; + SimileAjax.DOM.registerEvent(tapeElmtData.elmt, "mousedown", clickHandler); + SimileAjax.DOM.registerEvent(labelElmtData.elmt, "mousedown", clickHandler); + + this._createHighlightDiv(highlightIndex, tapeElmtData, theme); + + this._eventIdToElmt[evt.getID()] = tapeElmtData.elmt; +}; + +Timeline.DetailedEventPainter.prototype._findFreeTrackForSolid = function(solidEdge, softEdge) { + for (var i = 0; true; i++) { + if (i < this._lowerTracks.length) { + var t = this._lowerTracks[i]; + if (Math.min(t.solid, t.text) > solidEdge && (!(softEdge) || t.line > softEdge)) { + return i; + } + } else { + this._lowerTracks.push({ + solid: Number.POSITIVE_INFINITY, + text: Number.POSITIVE_INFINITY, + line: Number.POSITIVE_INFINITY + }); + + return i; + } + + if (i < this._upperTracks.length) { + var t = this._upperTracks[i]; + if (Math.min(t.solid, t.text) > solidEdge && (!(softEdge) || t.line > softEdge)) { + return -1 - i; + } + } else { + this._upperTracks.push({ + solid: Number.POSITIVE_INFINITY, + text: Number.POSITIVE_INFINITY, + line: Number.POSITIVE_INFINITY + }); + + return -1 - i; + } + } +}; + +Timeline.DetailedEventPainter.prototype._findFreeTrackForText = function(fromTrack, edge, occupiedTrackVisitor) { + var extendUp; + var index; + var firstIndex; + var result; + + if (fromTrack < 0) { + extendUp = true; + firstIndex = -fromTrack; + + index = this._findFreeUpperTrackForText(firstIndex, edge); + result = -1 - index; + } else if (fromTrack > 0) { + extendUp = false; + firstIndex = fromTrack + 1; + + index = this._findFreeLowerTrackForText(firstIndex, edge); + result = index; + } else { + var upIndex = this._findFreeUpperTrackForText(0, edge); + var downIndex = this._findFreeLowerTrackForText(1, edge); + + if (downIndex - 1 <= upIndex) { + extendUp = false; + firstIndex = 1; + index = downIndex; + result = index; + } else { + extendUp = true; + firstIndex = 0; + index = upIndex; + result = -1 - index; + } + } + + if (extendUp) { + if (index == this._upperTracks.length) { + this._upperTracks.push({ + solid: Number.POSITIVE_INFINITY, + text: Number.POSITIVE_INFINITY, + line: Number.POSITIVE_INFINITY + }); + } + for (var i = firstIndex; i < index; i++) { + occupiedTrackVisitor(this._upperTracks[i]); + } + } else { + if (index == this._lowerTracks.length) { + this._lowerTracks.push({ + solid: Number.POSITIVE_INFINITY, + text: Number.POSITIVE_INFINITY, + line: Number.POSITIVE_INFINITY + }); + } + for (var i = firstIndex; i < index; i++) { + occupiedTrackVisitor(this._lowerTracks[i]); + } + } + return result; +}; + +Timeline.DetailedEventPainter.prototype._findFreeLowerTrackForText = function(index, edge) { + for (; index < this._lowerTracks.length; index++) { + var t = this._lowerTracks[index]; + if (Math.min(t.solid, t.text) >= edge) { + break; + } + } + return index; +}; + +Timeline.DetailedEventPainter.prototype._findFreeUpperTrackForText = function(index, edge) { + for (; index < this._upperTracks.length; index++) { + var t = this._upperTracks[index]; + if (Math.min(t.solid, t.text) >= edge) { + break; + } + } + return index; +}; + +Timeline.DetailedEventPainter.prototype._getTrackData = function(index) { + return (index < 0) ? this._upperTracks[-index - 1] : this._lowerTracks[index]; +}; + +Timeline.DetailedEventPainter.prototype._paintEventLine = function(evt, left, startTrack, endTrack, metrics, theme) { + var top = Math.round(metrics.trackOffset + startTrack * metrics.trackIncrement + metrics.trackHeight / 2); + var height = Math.round(Math.abs(endTrack - startTrack) * metrics.trackIncrement); + + var lineStyle = "1px solid " + theme.event.label.lineColor; + var lineDiv = this._timeline.getDocument().createElement("div"); + lineDiv.style.position = "absolute"; + lineDiv.style.left = left + "px"; + lineDiv.style.width = theme.event.label.offsetFromLine + "px"; + lineDiv.style.height = height + "px"; + if (startTrack > endTrack) { + lineDiv.style.top = (top - height) + "px"; + lineDiv.style.borderTop = lineStyle; + } else { + lineDiv.style.top = top + "px"; + lineDiv.style.borderBottom = lineStyle; + } + lineDiv.style.borderLeft = lineStyle; + this._lineLayer.appendChild(lineDiv); +}; + +Timeline.DetailedEventPainter.prototype._paintEventIcon = function(evt, iconTrack, left, metrics, theme) { + var icon = evt.getIcon(); + icon = icon != null ? icon : metrics.icon; + + var middle = metrics.trackOffset + iconTrack * metrics.trackIncrement + metrics.trackHeight / 2; + var top = Math.round(middle - metrics.iconHeight / 2); + + var img = SimileAjax.Graphics.createTranslucentImage(icon); + var iconDiv = this._timeline.getDocument().createElement("div"); + iconDiv.style.position = "absolute"; + iconDiv.style.left = left + "px"; + iconDiv.style.top = top + "px"; + iconDiv.appendChild(img); + iconDiv.style.cursor = "pointer"; + + if(evt._title != null) + iconDiv.title = evt._title + + this._eventLayer.appendChild(iconDiv); + + return { + left: left, + top: top, + width: metrics.iconWidth, + height: metrics.iconHeight, + elmt: iconDiv + }; +}; + +Timeline.DetailedEventPainter.prototype._paintEventLabel = function(evt, text, left, top, width, height, theme) { + var doc = this._timeline.getDocument(); + + var labelBackgroundDiv = doc.createElement("div"); + labelBackgroundDiv.style.position = "absolute"; + labelBackgroundDiv.style.left = left + "px"; + labelBackgroundDiv.style.width = width + "px"; + labelBackgroundDiv.style.top = top + "px"; + labelBackgroundDiv.style.height = height + "px"; + labelBackgroundDiv.style.backgroundColor = theme.event.label.backgroundColor; + SimileAjax.Graphics.setOpacity(labelBackgroundDiv, theme.event.label.backgroundOpacity); + this._eventLayer.appendChild(labelBackgroundDiv); + + var labelDiv = doc.createElement("div"); + labelDiv.style.position = "absolute"; + labelDiv.style.left = left + "px"; + labelDiv.style.width = width + "px"; + labelDiv.style.top = top + "px"; + labelDiv.innerHTML = text; + labelDiv.style.cursor = "pointer"; + + if(evt._title != null) + labelDiv.title = evt._title; + + var color = evt.getTextColor(); + if (color == null) { + color = evt.getColor(); + } + if (color != null) { + labelDiv.style.color = color; + } + + this._eventLayer.appendChild(labelDiv); + + return { + left: left, + top: top, + width: width, + height: height, + elmt: labelDiv + }; +}; + +Timeline.DetailedEventPainter.prototype._paintEventTape = function( + evt, iconTrack, startPixel, endPixel, color, opacity, metrics, theme) { + + var tapeWidth = endPixel - startPixel; + var tapeHeight = theme.event.tape.height; + var middle = metrics.trackOffset + iconTrack * metrics.trackIncrement + metrics.trackHeight / 2; + var top = Math.round(middle - tapeHeight / 2); + + var tapeDiv = this._timeline.getDocument().createElement("div"); + tapeDiv.style.position = "absolute"; + tapeDiv.style.left = startPixel + "px"; + tapeDiv.style.width = tapeWidth + "px"; + tapeDiv.style.top = top + "px"; + tapeDiv.style.height = tapeHeight + "px"; + tapeDiv.style.backgroundColor = color; + tapeDiv.style.overflow = "hidden"; + tapeDiv.style.cursor = "pointer"; + + if(evt._title != null) + tapeDiv.title = evt._title; + + SimileAjax.Graphics.setOpacity(tapeDiv, opacity); + + this._eventLayer.appendChild(tapeDiv); + + return { + left: startPixel, + top: top, + width: tapeWidth, + height: tapeHeight, + elmt: tapeDiv + }; +} + +Timeline.DetailedEventPainter.prototype._createHighlightDiv = function(highlightIndex, dimensions, theme) { + if (highlightIndex >= 0) { + var doc = this._timeline.getDocument(); + var eventTheme = theme.event; + + var color = eventTheme.highlightColors[Math.min(highlightIndex, eventTheme.highlightColors.length - 1)]; + + var div = doc.createElement("div"); + div.style.position = "absolute"; + div.style.overflow = "hidden"; + div.style.left = (dimensions.left - 2) + "px"; + div.style.width = (dimensions.width + 4) + "px"; + div.style.top = (dimensions.top - 2) + "px"; + div.style.height = (dimensions.height + 4) + "px"; + div.style.background = color; + + this._highlightLayer.appendChild(div); + } +}; + +Timeline.DetailedEventPainter.prototype._onClickInstantEvent = function(icon, domEvt, evt) { + var c = SimileAjax.DOM.getPageCoordinates(icon); + this._showBubble( + c.left + Math.ceil(icon.offsetWidth / 2), + c.top + Math.ceil(icon.offsetHeight / 2), + evt + ); + this._fireOnSelect(evt.getID()); + + domEvt.cancelBubble = true; + SimileAjax.DOM.cancelEvent(domEvt); + return false; +}; + +Timeline.DetailedEventPainter.prototype._onClickDurationEvent = function(target, domEvt, evt) { + if ("pageX" in domEvt) { + var x = domEvt.pageX; + var y = domEvt.pageY; + } else { + var c = SimileAjax.DOM.getPageCoordinates(target); + var x = domEvt.offsetX + c.left; + var y = domEvt.offsetY + c.top; + } + this._showBubble(x, y, evt); + this._fireOnSelect(evt.getID()); + + domEvt.cancelBubble = true; + SimileAjax.DOM.cancelEvent(domEvt); + return false; +}; + +Timeline.DetailedEventPainter.prototype.showBubble = function(evt) { + var elmt = this._eventIdToElmt[evt.getID()]; + if (elmt) { + var c = SimileAjax.DOM.getPageCoordinates(elmt); + this._showBubble(c.left + elmt.offsetWidth / 2, c.top + elmt.offsetHeight / 2, evt); + } +}; + +Timeline.DetailedEventPainter.prototype._showBubble = function(x, y, evt) { + var div = document.createElement("div"); + var themeBubble = this._params.theme.event.bubble; + evt.fillInfoBubble(div, this._params.theme, this._band.getLabeller()); + + SimileAjax.WindowManager.cancelPopups(); + SimileAjax.Graphics.createBubbleForContentAndPoint(div, x, y, + themeBubble.width, null, themeBubble.maxHeight); +}; + +Timeline.DetailedEventPainter.prototype._fireOnSelect = function(eventID) { + for (var i = 0; i < this._onSelectListeners.length; i++) { + this._onSelectListeners[i](eventID); + } +}; +/*================================================== + * Overview Event Painter + *================================================== + */ + +Timeline.OverviewEventPainter = function(params) { + this._params = params; + this._onSelectListeners = []; + + this._filterMatcher = null; + this._highlightMatcher = null; +}; + +Timeline.OverviewEventPainter.prototype.initialize = function(band, timeline) { + this._band = band; + this._timeline = timeline; + + this._eventLayer = null; + this._highlightLayer = null; +}; + +Timeline.OverviewEventPainter.prototype.getType = function() { + return 'overview'; +}; + +Timeline.OverviewEventPainter.prototype.addOnSelectListener = function(listener) { + this._onSelectListeners.push(listener); +}; + +Timeline.OverviewEventPainter.prototype.removeOnSelectListener = function(listener) { + for (var i = 0; i < this._onSelectListeners.length; i++) { + if (this._onSelectListeners[i] == listener) { + this._onSelectListeners.splice(i, 1); + break; + } + } +}; + +Timeline.OverviewEventPainter.prototype.getFilterMatcher = function() { + return this._filterMatcher; +}; + +Timeline.OverviewEventPainter.prototype.setFilterMatcher = function(filterMatcher) { + this._filterMatcher = filterMatcher; +}; + +Timeline.OverviewEventPainter.prototype.getHighlightMatcher = function() { + return this._highlightMatcher; +}; + +Timeline.OverviewEventPainter.prototype.setHighlightMatcher = function(highlightMatcher) { + this._highlightMatcher = highlightMatcher; +}; + +Timeline.OverviewEventPainter.prototype.paint = function() { + var eventSource = this._band.getEventSource(); + if (eventSource == null) { + return; + } + + this._prepareForPainting(); + + var eventTheme = this._params.theme.event; + var metrics = { + trackOffset: eventTheme.overviewTrack.offset, + trackHeight: eventTheme.overviewTrack.height, + trackGap: eventTheme.overviewTrack.gap, + trackIncrement: eventTheme.overviewTrack.height + eventTheme.overviewTrack.gap + } + + var minDate = this._band.getMinDate(); + var maxDate = this._band.getMaxDate(); + + var filterMatcher = (this._filterMatcher != null) ? + this._filterMatcher : + function(evt) { return true; }; + var highlightMatcher = (this._highlightMatcher != null) ? + this._highlightMatcher : + function(evt) { return -1; }; + + var iterator = eventSource.getEventReverseIterator(minDate, maxDate); + while (iterator.hasNext()) { + var evt = iterator.next(); + if (filterMatcher(evt)) { + this.paintEvent(evt, metrics, this._params.theme, highlightMatcher(evt)); + } + } + + this._highlightLayer.style.display = "block"; + this._eventLayer.style.display = "block"; + // update the band object for max number of tracks in this section of the ether + this._band.updateEventTrackInfo(this._tracks.length, metrics.trackIncrement); +}; + +Timeline.OverviewEventPainter.prototype.softPaint = function() { +}; + +Timeline.OverviewEventPainter.prototype._prepareForPainting = function() { + var band = this._band; + + this._tracks = []; + + if (this._highlightLayer != null) { + band.removeLayerDiv(this._highlightLayer); + } + this._highlightLayer = band.createLayerDiv(105, "timeline-band-highlights"); + this._highlightLayer.style.display = "none"; + + if (this._eventLayer != null) { + band.removeLayerDiv(this._eventLayer); + } + this._eventLayer = band.createLayerDiv(110, "timeline-band-events"); + this._eventLayer.style.display = "none"; +}; + +Timeline.OverviewEventPainter.prototype.paintEvent = function(evt, metrics, theme, highlightIndex) { + if (evt.isInstant()) { + this.paintInstantEvent(evt, metrics, theme, highlightIndex); + } else { + this.paintDurationEvent(evt, metrics, theme, highlightIndex); + } +}; + +Timeline.OverviewEventPainter.prototype.paintInstantEvent = function(evt, metrics, theme, highlightIndex) { + var startDate = evt.getStart(); + var startPixel = Math.round(this._band.dateToPixelOffset(startDate)); + + var color = evt.getColor(), + klassName = evt.getClassName(); + if (klassName) { + color = null; + } else { + color = color != null ? color : theme.event.duration.color; + } + + var tickElmtData = this._paintEventTick(evt, startPixel, color, 100, metrics, theme); + + this._createHighlightDiv(highlightIndex, tickElmtData, theme); +}; + +Timeline.OverviewEventPainter.prototype.paintDurationEvent = function(evt, metrics, theme, highlightIndex) { + var latestStartDate = evt.getLatestStart(); + var earliestEndDate = evt.getEarliestEnd(); + + var latestStartPixel = Math.round(this._band.dateToPixelOffset(latestStartDate)); + var earliestEndPixel = Math.round(this._band.dateToPixelOffset(earliestEndDate)); + + var tapeTrack = 0; + for (; tapeTrack < this._tracks.length; tapeTrack++) { + if (earliestEndPixel < this._tracks[tapeTrack]) { + break; + } + } + this._tracks[tapeTrack] = earliestEndPixel; + + var color = evt.getColor(), + klassName = evt.getClassName(); + if (klassName) { + color = null; + } else { + color = color != null ? color : theme.event.duration.color; + } + + var tapeElmtData = this._paintEventTape(evt, tapeTrack, latestStartPixel, earliestEndPixel, + color, 100, metrics, theme, klassName); + + this._createHighlightDiv(highlightIndex, tapeElmtData, theme); +}; + +Timeline.OverviewEventPainter.prototype._paintEventTape = function( + evt, track, left, right, color, opacity, metrics, theme, klassName) { + + var top = metrics.trackOffset + track * metrics.trackIncrement; + var width = right - left; + var height = metrics.trackHeight; + + var tapeDiv = this._timeline.getDocument().createElement("div"); + tapeDiv.className = 'timeline-small-event-tape' + if (klassName) {tapeDiv.className += ' small-' + klassName;} + tapeDiv.style.left = left + "px"; + tapeDiv.style.width = width + "px"; + tapeDiv.style.top = top + "px"; + tapeDiv.style.height = height + "px"; + + if (color) { + tapeDiv.style.backgroundColor = color; // set color here if defined by event. Else use css + } + // tapeDiv.style.overflow = "hidden"; // now set in css + // tapeDiv.style.position = "absolute"; + if(opacity<100) SimileAjax.Graphics.setOpacity(tapeDiv, opacity); + + this._eventLayer.appendChild(tapeDiv); + + return { + left: left, + top: top, + width: width, + height: height, + elmt: tapeDiv + }; +} + +Timeline.OverviewEventPainter.prototype._paintEventTick = function( + evt, left, color, opacity, metrics, theme) { + + var height = theme.event.overviewTrack.tickHeight; + var top = metrics.trackOffset - height; + var width = 1; + + var tickDiv = this._timeline.getDocument().createElement("div"); + tickDiv.className = 'timeline-small-event-icon' + tickDiv.style.left = left + "px"; + tickDiv.style.top = top + "px"; + // tickDiv.style.width = width + "px"; + // tickDiv.style.position = "absolute"; + // tickDiv.style.height = height + "px"; + // tickDiv.style.backgroundColor = color; + // tickDiv.style.overflow = "hidden"; + + var klassName = evt.getClassName() + if (klassName) {tickDiv.className +=' small-' + klassName}; + + if(opacity<100) {SimileAjax.Graphics.setOpacity(tickDiv, opacity)}; + + this._eventLayer.appendChild(tickDiv); + + return { + left: left, + top: top, + width: width, + height: height, + elmt: tickDiv + }; +} + +Timeline.OverviewEventPainter.prototype._createHighlightDiv = function(highlightIndex, dimensions, theme) { + if (highlightIndex >= 0) { + var doc = this._timeline.getDocument(); + var eventTheme = theme.event; + + var color = eventTheme.highlightColors[Math.min(highlightIndex, eventTheme.highlightColors.length - 1)]; + + var div = doc.createElement("div"); + div.style.position = "absolute"; + div.style.overflow = "hidden"; + div.style.left = (dimensions.left - 1) + "px"; + div.style.width = (dimensions.width + 2) + "px"; + div.style.top = (dimensions.top - 1) + "px"; + div.style.height = (dimensions.height + 2) + "px"; + div.style.background = color; + + this._highlightLayer.appendChild(div); + } +}; + +Timeline.OverviewEventPainter.prototype.showBubble = function(evt) { + // not implemented +}; +/*================================================== + * Original Event Painter + *================================================== + */ + +Timeline.CompactEventPainter = function(params) { + this._params = params; + this._onSelectListeners = []; + + this._filterMatcher = null; + this._highlightMatcher = null; + this._frc = null; + + this._eventIdToElmt = {}; +}; + +Timeline.CompactEventPainter.prototype.initialize = function(band, timeline) { + this._band = band; + this._timeline = timeline; + + this._backLayer = null; + this._eventLayer = null; + this._lineLayer = null; + this._highlightLayer = null; + + this._eventIdToElmt = null; +}; + +Timeline.CompactEventPainter.prototype.addOnSelectListener = function(listener) { + this._onSelectListeners.push(listener); +}; + +Timeline.CompactEventPainter.prototype.removeOnSelectListener = function(listener) { + for (var i = 0; i < this._onSelectListeners.length; i++) { + if (this._onSelectListeners[i] == listener) { + this._onSelectListeners.splice(i, 1); + break; + } + } +}; + +Timeline.CompactEventPainter.prototype.getFilterMatcher = function() { + return this._filterMatcher; +}; + +Timeline.CompactEventPainter.prototype.setFilterMatcher = function(filterMatcher) { + this._filterMatcher = filterMatcher; +}; + +Timeline.CompactEventPainter.prototype.getHighlightMatcher = function() { + return this._highlightMatcher; +}; + +Timeline.CompactEventPainter.prototype.setHighlightMatcher = function(highlightMatcher) { + this._highlightMatcher = highlightMatcher; +}; + +Timeline.CompactEventPainter.prototype.paint = function() { + var eventSource = this._band.getEventSource(); + if (eventSource == null) { + return; + } + + this._eventIdToElmt = {}; + this._prepareForPainting(); + + var theme = this._params.theme; + var eventTheme = theme.event; + + var metrics = { + trackOffset: "trackOffset" in this._params ? this._params.trackOffset : 10, + trackHeight: "trackHeight" in this._params ? this._params.trackHeight : 10, + + tapeHeight: theme.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: eventTheme.instant.icon, + defaultIconWidth: eventTheme.instant.iconWidth, + defaultIconHeight: eventTheme.instant.iconHeight, + + customIconWidth: "iconWidth" in this._params ? this._params.iconWidth : eventTheme.instant.iconWidth, + customIconHeight: "iconHeight" in this._params ? this._params.iconHeight : eventTheme.instant.iconHeight, + + iconLabelGap: "iconLabelGap" in this._params ? this._params.iconLabelGap : 2, + iconBottomMargin: "iconBottomMargin" in this._params ? this._params.iconBottomMargin : 2 + }; + if ("compositeIcon" in this._params) { + metrics.compositeIcon = this._params.compositeIcon; + metrics.compositeIconWidth = this._params.compositeIconWidth || metrics.customIconWidth; + metrics.compositeIconHeight = this._params.compositeIconHeight || metrics.customIconHeight; + } else { + metrics.compositeIcon = metrics.defaultIcon; + metrics.compositeIconWidth = metrics.defaultIconWidth; + metrics.compositeIconHeight = metrics.defaultIconHeight; + } + metrics.defaultStackIcon = "icon" in this._params.stackConcurrentPreciseInstantEvents ? + this._params.stackConcurrentPreciseInstantEvents.icon : metrics.defaultIcon; + metrics.defaultStackIconWidth = "iconWidth" in this._params.stackConcurrentPreciseInstantEvents ? + this._params.stackConcurrentPreciseInstantEvents.iconWidth : metrics.defaultIconWidth; + metrics.defaultStackIconHeight = "iconHeight" in this._params.stackConcurrentPreciseInstantEvents ? + this._params.stackConcurrentPreciseInstantEvents.iconHeight : metrics.defaultIconHeight; + + var minDate = this._band.getMinDate(); + var maxDate = this._band.getMaxDate(); + + var filterMatcher = (this._filterMatcher != null) ? + this._filterMatcher : + function(evt) { return true; }; + + var highlightMatcher = (this._highlightMatcher != null) ? + this._highlightMatcher : + function(evt) { return -1; }; + + var iterator = eventSource.getEventIterator(minDate, maxDate); + + var stackConcurrentPreciseInstantEvents = "stackConcurrentPreciseInstantEvents" in this._params && typeof this._params.stackConcurrentPreciseInstantEvents == "object"; + var collapseConcurrentPreciseInstantEvents = "collapseConcurrentPreciseInstantEvents" in this._params && this._params.collapseConcurrentPreciseInstantEvents; + if (collapseConcurrentPreciseInstantEvents || stackConcurrentPreciseInstantEvents) { + var bufferedEvents = []; + var previousInstantEvent = null; + + while (iterator.hasNext()) { + var evt = iterator.next(); + if (filterMatcher(evt)) { + if (!evt.isInstant() || evt.isImprecise()) { + this.paintEvent(evt, metrics, this._params.theme, highlightMatcher(evt)); + } else if (previousInstantEvent != null && + previousInstantEvent.getStart().getTime() == evt.getStart().getTime()) { + bufferedEvents[bufferedEvents.length - 1].push(evt); + } else { + bufferedEvents.push([ evt ]); + previousInstantEvent = evt; + } + } + } + + for (var i = 0; i < bufferedEvents.length; i++) { + var compositeEvents = bufferedEvents[i]; + if (compositeEvents.length == 1) { + this.paintEvent(compositeEvents[0], metrics, this._params.theme, highlightMatcher(evt)); + } else { + var match = -1; + for (var j = 0; match < 0 && j < compositeEvents.length; j++) { + match = highlightMatcher(compositeEvents[j]); + } + + if (stackConcurrentPreciseInstantEvents) { + this.paintStackedPreciseInstantEvents(compositeEvents, metrics, this._params.theme, match); + } else { + this.paintCompositePreciseInstantEvents(compositeEvents, metrics, this._params.theme, match); + } + } + } + } else { + while (iterator.hasNext()) { + var evt = iterator.next(); + if (filterMatcher(evt)) { + this.paintEvent(evt, metrics, this._params.theme, highlightMatcher(evt)); + } + } + } + + this._highlightLayer.style.display = "block"; + this._lineLayer.style.display = "block"; + this._eventLayer.style.display = "block"; +}; + +Timeline.CompactEventPainter.prototype.softPaint = function() { +}; + +Timeline.CompactEventPainter.prototype._prepareForPainting = function() { + var band = this._band; + + if (this._backLayer == null) { + this._backLayer = this._band.createLayerDiv(0, "timeline-band-events"); + this._backLayer.style.visibility = "hidden"; + + var eventLabelPrototype = document.createElement("span"); + eventLabelPrototype.className = "timeline-event-label"; + this._backLayer.appendChild(eventLabelPrototype); + this._frc = SimileAjax.Graphics.getFontRenderingContext(eventLabelPrototype); + } + this._frc.update(); + this._tracks = []; + + if (this._highlightLayer != null) { + band.removeLayerDiv(this._highlightLayer); + } + this._highlightLayer = band.createLayerDiv(105, "timeline-band-highlights"); + this._highlightLayer.style.display = "none"; + + if (this._lineLayer != null) { + band.removeLayerDiv(this._lineLayer); + } + this._lineLayer = band.createLayerDiv(110, "timeline-band-lines"); + this._lineLayer.style.display = "none"; + + if (this._eventLayer != null) { + band.removeLayerDiv(this._eventLayer); + } + this._eventLayer = band.createLayerDiv(115, "timeline-band-events"); + this._eventLayer.style.display = "none"; +}; + +Timeline.CompactEventPainter.prototype.paintEvent = function(evt, metrics, theme, highlightIndex) { + if (evt.isInstant()) { + this.paintInstantEvent(evt, metrics, theme, highlightIndex); + } else { + this.paintDurationEvent(evt, metrics, theme, highlightIndex); + } +}; + +Timeline.CompactEventPainter.prototype.paintInstantEvent = function(evt, metrics, theme, highlightIndex) { + if (evt.isImprecise()) { + this.paintImpreciseInstantEvent(evt, metrics, theme, highlightIndex); + } else { + this.paintPreciseInstantEvent(evt, metrics, theme, highlightIndex); + } +} + +Timeline.CompactEventPainter.prototype.paintDurationEvent = function(evt, metrics, theme, highlightIndex) { + if (evt.isImprecise()) { + this.paintImpreciseDurationEvent(evt, metrics, theme, highlightIndex); + } else { + this.paintPreciseDurationEvent(evt, metrics, theme, highlightIndex); + } +} + +Timeline.CompactEventPainter.prototype.paintPreciseInstantEvent = function(evt, metrics, theme, highlightIndex) { + var commonData = { + tooltip: evt.getProperty("tooltip") || evt.getText() + }; + + var iconData = { + url: evt.getIcon() + }; + if (iconData.url == null) { + iconData.url = metrics.defaultIcon; + iconData.width = metrics.defaultIconWidth; + iconData.height = metrics.defaultIconHeight; + iconData.className = "timeline-event-icon-default"; + } else { + iconData.width = evt.getProperty("iconWidth") || metrics.customIconWidth; + iconData.height = evt.getProperty("iconHeight") || metrics.customIconHeight; + } + + var labelData = { + text: evt.getText(), + color: evt.getTextColor() || evt.getColor(), + className: evt.getClassName() + }; + + var result = this.paintTapeIconLabel( + evt.getStart(), + commonData, + null, // no tape data + iconData, + labelData, + metrics, + theme, + highlightIndex + ); + + var self = this; + var clickHandler = function(elmt, domEvt, target) { + return self._onClickInstantEvent(result.iconElmtData.elmt, domEvt, evt); + }; + SimileAjax.DOM.registerEvent(result.iconElmtData.elmt, "mousedown", clickHandler); + SimileAjax.DOM.registerEvent(result.labelElmtData.elmt, "mousedown", clickHandler); + + this._eventIdToElmt[evt.getID()] = result.iconElmtData.elmt; +}; + +Timeline.CompactEventPainter.prototype.paintCompositePreciseInstantEvents = function(events, metrics, theme, highlightIndex) { + var evt = events[0]; + + var tooltips = []; + for (var i = 0; i < events.length; i++) { + tooltips.push(events[i].getProperty("tooltip") || events[i].getText()); + } + var commonData = { + tooltip: tooltips.join("; ") + }; + + var iconData = { + url: metrics.compositeIcon, + width: metrics.compositeIconWidth, + height: metrics.compositeIconHeight, + className: "timeline-event-icon-composite" + }; + + var labelData = { + text: String.substitute(this._params.compositeEventLabelTemplate, [ events.length ]) + }; + + var result = this.paintTapeIconLabel( + evt.getStart(), + commonData, + null, // no tape data + iconData, + labelData, + metrics, + theme, + highlightIndex + ); + + var self = this; + var clickHandler = function(elmt, domEvt, target) { + return self._onClickMultiplePreciseInstantEvent(result.iconElmtData.elmt, domEvt, events); + }; + + SimileAjax.DOM.registerEvent(result.iconElmtData.elmt, "mousedown", clickHandler); + SimileAjax.DOM.registerEvent(result.labelElmtData.elmt, "mousedown", clickHandler); + + for (var i = 0; i < events.length; i++) { + this._eventIdToElmt[events[i].getID()] = result.iconElmtData.elmt; + } +}; + +Timeline.CompactEventPainter.prototype.paintStackedPreciseInstantEvents = function(events, metrics, theme, highlightIndex) { + var limit = "limit" in this._params.stackConcurrentPreciseInstantEvents ? + this._params.stackConcurrentPreciseInstantEvents.limit : 10; + var moreMessageTemplate = "moreMessageTemplate" in this._params.stackConcurrentPreciseInstantEvents ? + this._params.stackConcurrentPreciseInstantEvents.moreMessageTemplate : "%0 More Events"; + var showMoreMessage = limit <= events.length - 2; // We want at least 2 more events above the limit. + // Otherwise we'd need the singular case of "1 More Event" + + var band = this._band; + var getPixelOffset = function(date) { + return Math.round(band.dateToPixelOffset(date)); + }; + var getIconData = function(evt) { + var iconData = { + url: evt.getIcon() + }; + if (iconData.url == null) { + iconData.url = metrics.defaultStackIcon; + iconData.width = metrics.defaultStackIconWidth; + iconData.height = metrics.defaultStackIconHeight; + iconData.className = "timeline-event-icon-stack timeline-event-icon-default"; + } else { + iconData.width = evt.getProperty("iconWidth") || metrics.customIconWidth; + iconData.height = evt.getProperty("iconHeight") || metrics.customIconHeight; + iconData.className = "timeline-event-icon-stack"; + } + return iconData; + }; + + var firstIconData = getIconData(events[0]); + var horizontalIncrement = 5; + var leftIconEdge = 0; + var totalLabelWidth = 0; + var totalLabelHeight = 0; + var totalIconHeight = 0; + + var records = []; + for (var i = 0; i < events.length && (!showMoreMessage || i < limit); i++) { + var evt = events[i]; + var text = evt.getText(); + var iconData = getIconData(evt); + var labelSize = this._frc.computeSize(text); + var record = { + text: text, + iconData: iconData, + labelSize: labelSize, + iconLeft: firstIconData.width + i * horizontalIncrement - iconData.width + }; + record.labelLeft = firstIconData.width + i * horizontalIncrement + metrics.iconLabelGap; + record.top = totalLabelHeight; + records.push(record); + + leftIconEdge = Math.min(leftIconEdge, record.iconLeft); + totalLabelHeight += labelSize.height; + totalLabelWidth = Math.max(totalLabelWidth, record.labelLeft + labelSize.width); + totalIconHeight = Math.max(totalIconHeight, record.top + iconData.height); + } + if (showMoreMessage) { + var moreMessage = String.substitute(moreMessageTemplate, [ events.length - limit ]); + + var moreMessageLabelSize = this._frc.computeSize(moreMessage); + var moreMessageLabelLeft = firstIconData.width + (limit - 1) * horizontalIncrement + metrics.iconLabelGap; + var moreMessageLabelTop = totalLabelHeight; + + totalLabelHeight += moreMessageLabelSize.height; + totalLabelWidth = Math.max(totalLabelWidth, moreMessageLabelLeft + moreMessageLabelSize.width); + } + totalLabelWidth += metrics.labelRightMargin; + totalLabelHeight += metrics.labelBottomMargin; + totalIconHeight += metrics.iconBottomMargin; + + var anchorPixel = getPixelOffset(events[0].getStart()); + var newTracks = []; + + var trackCount = Math.ceil(Math.max(totalIconHeight, totalLabelHeight) / metrics.trackHeight); + var rightIconEdge = firstIconData.width + (events.length - 1) * horizontalIncrement; + for (var i = 0; i < trackCount; i++) { + newTracks.push({ start: leftIconEdge, end: rightIconEdge }); + } + var labelTrackCount = Math.ceil(totalLabelHeight / metrics.trackHeight); + for (var i = 0; i < labelTrackCount; i++) { + var track = newTracks[i]; + track.end = Math.max(track.end, totalLabelWidth); + } + + var firstTrack = this._fitTracks(anchorPixel, newTracks); + var verticalPixelOffset = firstTrack * metrics.trackHeight + metrics.trackOffset; + + var iconStackDiv = this._timeline.getDocument().createElement("div"); + iconStackDiv.className = 'timeline-event-icon-stack'; + iconStackDiv.style.position = "absolute"; + iconStackDiv.style.overflow = "visible"; + iconStackDiv.style.left = anchorPixel + "px"; + iconStackDiv.style.top = verticalPixelOffset + "px"; + iconStackDiv.style.width = rightIconEdge + "px"; + iconStackDiv.style.height = totalIconHeight + "px"; + iconStackDiv.innerHTML = "
"; + this._eventLayer.appendChild(iconStackDiv); + + var self = this; + var onMouseOver = function(domEvt) { + try { + var n = parseInt(this.getAttribute("index")); + var childNodes = iconStackDiv.firstChild.childNodes; + for (var i = 0; i < childNodes.length; i++) { + var child = childNodes[i]; + if (i == n) { + child.style.zIndex = childNodes.length; + } else { + child.style.zIndex = childNodes.length - i; + } + } + } catch (e) { + } + }; + var paintEvent = function(index) { + var record = records[index]; + var evt = events[index]; + var tooltip = evt.getProperty("tooltip") || evt.getText(); + + var labelElmtData = self._paintEventLabel( + { tooltip: tooltip }, + { text: record.text }, + anchorPixel + record.labelLeft, + verticalPixelOffset + record.top, + record.labelSize.width, + record.labelSize.height, + theme + ); + labelElmtData.elmt.setAttribute("index", index); + labelElmtData.elmt.onmouseover = onMouseOver; + + var img = SimileAjax.Graphics.createTranslucentImage(record.iconData.url); + var iconDiv = self._timeline.getDocument().createElement("div"); + iconDiv.className = 'timeline-event-icon' + ("className" in record.iconData ? (" " + record.iconData.className) : ""); + iconDiv.style.left = record.iconLeft + "px"; + iconDiv.style.top = record.top + "px"; + iconDiv.style.zIndex = (records.length - index); + iconDiv.appendChild(img); + iconDiv.setAttribute("index", index); + iconDiv.onmouseover = onMouseOver; + + iconStackDiv.firstChild.appendChild(iconDiv); + + var clickHandler = function(elmt, domEvt, target) { + return self._onClickInstantEvent(labelElmtData.elmt, domEvt, evt); + }; + + SimileAjax.DOM.registerEvent(iconDiv, "mousedown", clickHandler); + SimileAjax.DOM.registerEvent(labelElmtData.elmt, "mousedown", clickHandler); + + self._eventIdToElmt[evt.getID()] = iconDiv; + }; + for (var i = 0; i < records.length; i++) { + paintEvent(i); + } + + if (showMoreMessage) { + var moreEvents = events.slice(limit); + var moreMessageLabelElmtData = this._paintEventLabel( + { tooltip: moreMessage }, + { text: moreMessage }, + anchorPixel + moreMessageLabelLeft, + verticalPixelOffset + moreMessageLabelTop, + moreMessageLabelSize.width, + moreMessageLabelSize.height, + theme + ); + + var moreMessageClickHandler = function(elmt, domEvt, target) { + return self._onClickMultiplePreciseInstantEvent(moreMessageLabelElmtData.elmt, domEvt, moreEvents); + }; + SimileAjax.DOM.registerEvent(moreMessageLabelElmtData.elmt, "mousedown", moreMessageClickHandler); + + for (var i = 0; i < moreEvents.length; i++) { + this._eventIdToElmt[moreEvents[i].getID()] = moreMessageLabelElmtData.elmt; + } + } + //this._createHighlightDiv(highlightIndex, iconElmtData, theme); +}; + +Timeline.CompactEventPainter.prototype.paintImpreciseInstantEvent = function(evt, metrics, theme, highlightIndex) { + var commonData = { + tooltip: evt.getProperty("tooltip") || evt.getText() + }; + + var tapeData = { + start: evt.getStart(), + end: evt.getEnd(), + latestStart: evt.getLatestStart(), + earliestEnd: evt.getEarliestEnd(), + isInstant: true + }; + + var iconData = { + url: evt.getIcon() + }; + if (iconData.url == null) { + iconData = null; + } else { + iconData.width = evt.getProperty("iconWidth") || metrics.customIconWidth; + iconData.height = evt.getProperty("iconHeight") || metrics.customIconHeight; + } + + var labelData = { + text: evt.getText(), + color: evt.getTextColor() || evt.getColor(), + className: evt.getClassName() + }; + + var result = this.paintTapeIconLabel( + evt.getStart(), + commonData, + tapeData, // no tape data + iconData, + labelData, + metrics, + theme, + highlightIndex + ); + + var self = this; + var clickHandler = iconData != null ? + function(elmt, domEvt, target) { + return self._onClickInstantEvent(result.iconElmtData.elmt, domEvt, evt); + } : + function(elmt, domEvt, target) { + return self._onClickInstantEvent(result.labelElmtData.elmt, domEvt, evt); + }; + + SimileAjax.DOM.registerEvent(result.labelElmtData.elmt, "mousedown", clickHandler); + SimileAjax.DOM.registerEvent(result.impreciseTapeElmtData.elmt, "mousedown", clickHandler); + + if (iconData != null) { + SimileAjax.DOM.registerEvent(result.iconElmtData.elmt, "mousedown", clickHandler); + this._eventIdToElmt[evt.getID()] = result.iconElmtData.elmt; + } else { + this._eventIdToElmt[evt.getID()] = result.labelElmtData.elmt; + } +}; + +Timeline.CompactEventPainter.prototype.paintPreciseDurationEvent = function(evt, metrics, theme, highlightIndex) { + var commonData = { + tooltip: evt.getProperty("tooltip") || evt.getText() + }; + + var tapeData = { + start: evt.getStart(), + end: evt.getEnd(), + isInstant: false + }; + + var iconData = { + url: evt.getIcon() + }; + if (iconData.url == null) { + iconData = null; + } else { + iconData.width = evt.getProperty("iconWidth") || metrics.customIconWidth; + iconData.height = evt.getProperty("iconHeight") || metrics.customIconHeight; + } + + var labelData = { + text: evt.getText(), + color: evt.getTextColor() || evt.getColor(), + className: evt.getClassName() + }; + + var result = this.paintTapeIconLabel( + evt.getLatestStart(), + commonData, + tapeData, // no tape data + iconData, + labelData, + metrics, + theme, + highlightIndex + ); + + var self = this; + var clickHandler = iconData != null ? + function(elmt, domEvt, target) { + return self._onClickInstantEvent(result.iconElmtData.elmt, domEvt, evt); + } : + function(elmt, domEvt, target) { + return self._onClickInstantEvent(result.labelElmtData.elmt, domEvt, evt); + }; + + SimileAjax.DOM.registerEvent(result.labelElmtData.elmt, "mousedown", clickHandler); + SimileAjax.DOM.registerEvent(result.tapeElmtData.elmt, "mousedown", clickHandler); + + if (iconData != null) { + SimileAjax.DOM.registerEvent(result.iconElmtData.elmt, "mousedown", clickHandler); + this._eventIdToElmt[evt.getID()] = result.iconElmtData.elmt; + } else { + this._eventIdToElmt[evt.getID()] = result.labelElmtData.elmt; + } +}; + +Timeline.CompactEventPainter.prototype.paintImpreciseDurationEvent = function(evt, metrics, theme, highlightIndex) { + var commonData = { + tooltip: evt.getProperty("tooltip") || evt.getText() + }; + + var tapeData = { + start: evt.getStart(), + end: evt.getEnd(), + latestStart: evt.getLatestStart(), + earliestEnd: evt.getEarliestEnd(), + isInstant: false + }; + + var iconData = { + url: evt.getIcon() + }; + if (iconData.url == null) { + iconData = null; + } else { + iconData.width = evt.getProperty("iconWidth") || metrics.customIconWidth; + iconData.height = evt.getProperty("iconHeight") || metrics.customIconHeight; + } + + var labelData = { + text: evt.getText(), + color: evt.getTextColor() || evt.getColor(), + className: evt.getClassName() + }; + + var result = this.paintTapeIconLabel( + evt.getLatestStart(), + commonData, + tapeData, // no tape data + iconData, + labelData, + metrics, + theme, + highlightIndex + ); + + var self = this; + var clickHandler = iconData != null ? + function(elmt, domEvt, target) { + return self._onClickInstantEvent(result.iconElmtData.elmt, domEvt, evt); + } : + function(elmt, domEvt, target) { + return self._onClickInstantEvent(result.labelElmtData.elmt, domEvt, evt); + }; + + SimileAjax.DOM.registerEvent(result.labelElmtData.elmt, "mousedown", clickHandler); + SimileAjax.DOM.registerEvent(result.tapeElmtData.elmt, "mousedown", clickHandler); + + if (iconData != null) { + SimileAjax.DOM.registerEvent(result.iconElmtData.elmt, "mousedown", clickHandler); + this._eventIdToElmt[evt.getID()] = result.iconElmtData.elmt; + } else { + this._eventIdToElmt[evt.getID()] = result.labelElmtData.elmt; + } +}; + +Timeline.CompactEventPainter.prototype.paintTapeIconLabel = function( + anchorDate, + commonData, + tapeData, + iconData, + labelData, + metrics, + theme, + highlightIndex +) { + var band = this._band; + var getPixelOffset = function(date) { + return Math.round(band.dateToPixelOffset(date)); + }; + + var anchorPixel = getPixelOffset(anchorDate); + var newTracks = []; + + var tapeHeightOccupied = 0; // how many pixels (vertically) the tape occupies, including bottom margin + var tapeTrackCount = 0; // how many tracks the tape takes up, usually just 1 + var tapeLastTrackExtraSpace = 0; // on the last track that the tape occupies, how many pixels are left (for icon and label to occupy as well) + if (tapeData != null) { + tapeHeightOccupied = metrics.tapeHeight + metrics.tapeBottomMargin; + tapeTrackCount = Math.ceil(metrics.tapeHeight / metrics.trackHeight); + + var tapeEndPixelOffset = getPixelOffset(tapeData.end) - anchorPixel; + var tapeStartPixelOffset = getPixelOffset(tapeData.start) - anchorPixel; + + for (var t = 0; t < tapeTrackCount; t++) { + newTracks.push({ start: tapeStartPixelOffset, end: tapeEndPixelOffset }); + } + + tapeLastTrackExtraSpace = metrics.trackHeight - (tapeHeightOccupied % metrics.tapeHeight); + } + + var iconStartPixelOffset = 0; // where the icon starts compared to the anchor pixel; + // this can be negative if the icon is center-aligned around the anchor + var iconHorizontalSpaceOccupied = 0; // how many pixels the icon take up from the anchor pixel, + // including the gap between the icon and the label + if (iconData != null) { + if ("iconAlign" in iconData && iconData.iconAlign == "center") { + iconStartPixelOffset = -Math.floor(iconData.width / 2); + } + iconHorizontalSpaceOccupied = iconStartPixelOffset + iconData.width + metrics.iconLabelGap; + + if (tapeTrackCount > 0) { + newTracks[tapeTrackCount - 1].end = Math.max(newTracks[tapeTrackCount - 1].end, iconHorizontalSpaceOccupied); + } + + var iconHeight = iconData.height + metrics.iconBottomMargin + tapeLastTrackExtraSpace; + while (iconHeight > 0) { + newTracks.push({ start: iconStartPixelOffset, end: iconHorizontalSpaceOccupied }); + iconHeight -= metrics.trackHeight; + } + } + + var text = labelData.text; + var labelSize = this._frc.computeSize(text); + var labelHeight = labelSize.height + metrics.labelBottomMargin + tapeLastTrackExtraSpace; + var labelEndPixelOffset = iconHorizontalSpaceOccupied + labelSize.width + metrics.labelRightMargin; + if (tapeTrackCount > 0) { + newTracks[tapeTrackCount - 1].end = Math.max(newTracks[tapeTrackCount - 1].end, labelEndPixelOffset); + } + for (var i = 0; labelHeight > 0; i++) { + if (tapeTrackCount + i < newTracks.length) { + var track = newTracks[tapeTrackCount + i]; + track.end = labelEndPixelOffset; + } else { + newTracks.push({ start: 0, end: labelEndPixelOffset }); + } + labelHeight -= metrics.trackHeight; + } + + /* + * Try to fit the new track on top of the existing tracks, then + * render the various elements. + */ + var firstTrack = this._fitTracks(anchorPixel, newTracks); + var verticalPixelOffset = firstTrack * metrics.trackHeight + metrics.trackOffset; + var result = {}; + + result.labelElmtData = this._paintEventLabel( + commonData, + labelData, + anchorPixel + iconHorizontalSpaceOccupied, + verticalPixelOffset + tapeHeightOccupied, + labelSize.width, + labelSize.height, + theme + ); + + if (tapeData != null) { + if ("latestStart" in tapeData || "earliestEnd" in tapeData) { + result.impreciseTapeElmtData = this._paintEventTape( + commonData, + tapeData, + metrics.tapeHeight, + verticalPixelOffset, + getPixelOffset(tapeData.start), + getPixelOffset(tapeData.end), + theme.event.duration.impreciseColor, + theme.event.duration.impreciseOpacity, + metrics, + theme + ); + } + if (!tapeData.isInstant && "start" in tapeData && "end" in tapeData) { + result.tapeElmtData = this._paintEventTape( + commonData, + tapeData, + metrics.tapeHeight, + verticalPixelOffset, + anchorPixel, + getPixelOffset("earliestEnd" in tapeData ? tapeData.earliestEnd : tapeData.end), + tapeData.color, + 100, + metrics, + theme + ); + } + } + + if (iconData != null) { + result.iconElmtData = this._paintEventIcon( + commonData, + iconData, + verticalPixelOffset + tapeHeightOccupied, + anchorPixel + iconStartPixelOffset, + metrics, + theme + ); + } + //this._createHighlightDiv(highlightIndex, iconElmtData, theme); + + return result; +}; + +Timeline.CompactEventPainter.prototype._fitTracks = function(anchorPixel, newTracks) { + var firstTrack; + for (firstTrack = 0; firstTrack < this._tracks.length; firstTrack++) { + var fit = true; + for (var j = 0; j < newTracks.length && (firstTrack + j) < this._tracks.length; j++) { + var existingTrack = this._tracks[firstTrack + j]; + var newTrack = newTracks[j]; + if (anchorPixel + newTrack.start < existingTrack) { + fit = false; + break; + } + } + + if (fit) { + break; + } + } + for (var i = 0; i < newTracks.length; i++) { + this._tracks[firstTrack + i] = anchorPixel + newTracks[i].end; + } + + return firstTrack; +}; + + +Timeline.CompactEventPainter.prototype._paintEventIcon = function(commonData, iconData, top, left, metrics, theme) { + var img = SimileAjax.Graphics.createTranslucentImage(iconData.url); + var iconDiv = this._timeline.getDocument().createElement("div"); + iconDiv.className = 'timeline-event-icon' + ("className" in iconData ? (" " + iconData.className) : ""); + iconDiv.style.left = left + "px"; + iconDiv.style.top = top + "px"; + iconDiv.appendChild(img); + + if ("tooltip" in commonData && typeof commonData.tooltip == "string") { + iconDiv.title = commonData.tooltip; + } + + this._eventLayer.appendChild(iconDiv); + + return { + left: left, + top: top, + width: metrics.iconWidth, + height: metrics.iconHeight, + elmt: iconDiv + }; +}; + +Timeline.CompactEventPainter.prototype._paintEventLabel = function(commonData, labelData, left, top, width, height, theme) { + var doc = this._timeline.getDocument(); + + var labelDiv = doc.createElement("div"); + labelDiv.className = 'timeline-event-label'; + + labelDiv.style.left = left + "px"; + labelDiv.style.width = (width + 1) + "px"; + labelDiv.style.top = top + "px"; + labelDiv.innerHTML = labelData.text; + + if ("tooltip" in commonData && typeof commonData.tooltip == "string") { + labelDiv.title = commonData.tooltip; + } + if ("color" in labelData && typeof labelData.color == "string") { + labelDiv.style.color = labelData.color; + } + if ("className" in labelData && typeof labelData.className == "string") { + labelDiv.className += ' ' + labelData.className; + } + + this._eventLayer.appendChild(labelDiv); + + return { + left: left, + top: top, + width: width, + height: height, + elmt: labelDiv + }; +}; + +Timeline.CompactEventPainter.prototype._paintEventTape = function( + commonData, tapeData, height, top, startPixel, endPixel, color, opacity, metrics, theme) { + + var width = endPixel - startPixel; + + var tapeDiv = this._timeline.getDocument().createElement("div"); + tapeDiv.className = "timeline-event-tape" + + tapeDiv.style.left = startPixel + "px"; + tapeDiv.style.top = top + "px"; + tapeDiv.style.width = width + "px"; + tapeDiv.style.height = height + "px"; + + if ("tooltip" in commonData && typeof commonData.tooltip == "string") { + tapeDiv.title = commonData.tooltip; + } + if (color != null && typeof tapeData.color == "string") { + tapeDiv.style.backgroundColor = color; + } + + if ("backgroundImage" in tapeData && typeof tapeData.backgroundImage == "string") { + tapeDiv.style.backgroundImage = "url(" + backgroundImage + ")"; + tapeDiv.style.backgroundRepeat = + ("backgroundRepeat" in tapeData && typeof tapeData.backgroundRepeat == "string") + ? tapeData.backgroundRepeat : 'repeat'; + } + + SimileAjax.Graphics.setOpacity(tapeDiv, opacity); + + if ("className" in tapeData && typeof tapeData.className == "string") { + tapeDiv.className += ' ' + tapeData.className; + } + + this._eventLayer.appendChild(tapeDiv); + + return { + left: startPixel, + top: top, + width: width, + height: height, + elmt: tapeDiv + }; +} + +Timeline.CompactEventPainter.prototype._createHighlightDiv = function(highlightIndex, dimensions, theme) { + if (highlightIndex >= 0) { + var doc = this._timeline.getDocument(); + var eventTheme = theme.event; + + var color = eventTheme.highlightColors[Math.min(highlightIndex, eventTheme.highlightColors.length - 1)]; + + var div = doc.createElement("div"); + div.style.position = "absolute"; + div.style.overflow = "hidden"; + div.style.left = (dimensions.left - 2) + "px"; + div.style.width = (dimensions.width + 4) + "px"; + div.style.top = (dimensions.top - 2) + "px"; + div.style.height = (dimensions.height + 4) + "px"; +// div.style.background = color; + + this._highlightLayer.appendChild(div); + } +}; + +Timeline.CompactEventPainter.prototype._onClickMultiplePreciseInstantEvent = function(icon, domEvt, events) { + var c = SimileAjax.DOM.getPageCoordinates(icon); + this._showBubble( + c.left + Math.ceil(icon.offsetWidth / 2), + c.top + Math.ceil(icon.offsetHeight / 2), + events + ); + + var ids = []; + for (var i = 0; i < events.length; i++) { + ids.push(events[i].getID()); + } + this._fireOnSelect(ids); + + domEvt.cancelBubble = true; + SimileAjax.DOM.cancelEvent(domEvt); + + return false; +}; + +Timeline.CompactEventPainter.prototype._onClickInstantEvent = function(icon, domEvt, evt) { + var c = SimileAjax.DOM.getPageCoordinates(icon); + this._showBubble( + c.left + Math.ceil(icon.offsetWidth / 2), + c.top + Math.ceil(icon.offsetHeight / 2), + [evt] + ); + this._fireOnSelect([evt.getID()]); + + domEvt.cancelBubble = true; + SimileAjax.DOM.cancelEvent(domEvt); + return false; +}; + +Timeline.CompactEventPainter.prototype._onClickDurationEvent = function(target, domEvt, evt) { + if ("pageX" in domEvt) { + var x = domEvt.pageX; + var y = domEvt.pageY; + } else { + var c = SimileAjax.DOM.getPageCoordinates(target); + var x = domEvt.offsetX + c.left; + var y = domEvt.offsetY + c.top; + } + this._showBubble(x, y, [evt]); + this._fireOnSelect([evt.getID()]); + + domEvt.cancelBubble = true; + SimileAjax.DOM.cancelEvent(domEvt); + return false; +}; + +Timeline.CompactEventPainter.prototype.showBubble = function(evt) { + var elmt = this._eventIdToElmt[evt.getID()]; + if (elmt) { + var c = SimileAjax.DOM.getPageCoordinates(elmt); + this._showBubble(c.left + elmt.offsetWidth / 2, c.top + elmt.offsetHeight / 2, [evt]); + } +}; + +Timeline.CompactEventPainter.prototype._showBubble = function(x, y, evts) { + var div = document.createElement("div"); + + evts = ("fillInfoBubble" in evts) ? [evts] : evts; + for (var i = 0; i < evts.length; i++) { + var div2 = document.createElement("div"); + div.appendChild(div2); + + evts[i].fillInfoBubble(div2, this._params.theme, this._band.getLabeller()); + } + + SimileAjax.WindowManager.cancelPopups(); + SimileAjax.Graphics.createBubbleForContentAndPoint(div, x, y, this._params.theme.event.bubble.width); +}; + +Timeline.CompactEventPainter.prototype._fireOnSelect = function(eventIDs) { + for (var i = 0; i < this._onSelectListeners.length; i++) { + this._onSelectListeners[i](eventIDs); + } +}; +/*================================================== + * Span Highlight Decorator + *================================================== + */ + +Timeline.SpanHighlightDecorator = function(params) { + // When evaluating params, test against null. Not "p in params". Testing against + // null enables caller to explicitly request the default. Testing against "in" means + // that the param has to be ommitted to get the default. + this._unit = params.unit != null ? params.unit : SimileAjax.NativeDateUnit; + this._startDate = (typeof params.startDate == "string") ? + this._unit.parseFromObject(params.startDate) : params.startDate; + this._endDate = (typeof params.endDate == "string") ? + this._unit.parseFromObject(params.endDate) : params.endDate; + this._startLabel = params.startLabel != null ? params.startLabel : ""; // not null! + this._endLabel = params.endLabel != null ? params.endLabel : ""; // not null! + this._color = params.color; + this._cssClass = params.cssClass != null ? params.cssClass : null; + this._opacity = params.opacity != null ? params.opacity : 100; + // Default z is 10, behind everything but background grid. + // If inFront, then place just behind events, in front of everything else + this._zIndex = (params.inFront != null && params.inFront) ? 113 : 10; +}; + +Timeline.SpanHighlightDecorator.prototype.initialize = function(band, timeline) { + this._band = band; + this._timeline = timeline; + + this._layerDiv = null; +}; + +Timeline.SpanHighlightDecorator.prototype.paint = function() { + if (this._layerDiv != null) { + this._band.removeLayerDiv(this._layerDiv); + } + this._layerDiv = this._band.createLayerDiv(this._zIndex); + this._layerDiv.setAttribute("name", "span-highlight-decorator"); // for debugging + this._layerDiv.style.display = "none"; + + var minDate = this._band.getMinDate(); + var maxDate = this._band.getMaxDate(); + + if (this._unit.compare(this._startDate, maxDate) < 0 && + this._unit.compare(this._endDate, minDate) > 0) { + + minDate = this._unit.later(minDate, this._startDate); + maxDate = this._unit.earlier(maxDate, this._endDate); + + var minPixel = this._band.dateToPixelOffset(minDate); + var maxPixel = this._band.dateToPixelOffset(maxDate); + + var doc = this._timeline.getDocument(); + + var createTable = function() { + var table = doc.createElement("table"); + table.insertRow(0).insertCell(0); + return table; + }; + + var div = doc.createElement("div"); + div.className='timeline-highlight-decorator' + if(this._cssClass) { + div.className += ' ' + this._cssClass; + } + if(this._color != null) { + div.style.backgroundColor = this._color; + } + if (this._opacity < 100) { + SimileAjax.Graphics.setOpacity(div, this._opacity); + } + this._layerDiv.appendChild(div); + + var tableStartLabel = createTable(); + tableStartLabel.className = 'timeline-highlight-label timeline-highlight-label-start' + var tdStart = tableStartLabel.rows[0].cells[0] + tdStart.innerHTML = this._startLabel; + if (this._cssClass) { + tdStart.className = 'label_' + this._cssClass; + } + this._layerDiv.appendChild(tableStartLabel); + + var tableEndLabel = createTable(); + tableEndLabel.className = 'timeline-highlight-label timeline-highlight-label-end' + var tdEnd = tableEndLabel.rows[0].cells[0] + tdEnd.innerHTML = this._endLabel; + if (this._cssClass) { + tdEnd.className = 'label_' + this._cssClass; + } + this._layerDiv.appendChild(tableEndLabel); + + if (this._timeline.isHorizontal()){ + div.style.left = minPixel + "px"; + div.style.width = (maxPixel - minPixel) + "px"; + + tableStartLabel.style.right = (this._band.getTotalViewLength() - minPixel) + "px"; + tableStartLabel.style.width = (this._startLabel.length) + "em"; + + tableEndLabel.style.left = maxPixel + "px"; + tableEndLabel.style.width = (this._endLabel.length) + "em"; + + } else { + div.style.top = minPixel + "px"; + div.style.height = (maxPixel - minPixel) + "px"; + + tableStartLabel.style.bottom = minPixel + "px"; + tableStartLabel.style.height = "1.5px"; + + tableEndLabel.style.top = maxPixel + "px"; + tableEndLabel.style.height = "1.5px"; + } + } + this._layerDiv.style.display = "block"; +}; + +Timeline.SpanHighlightDecorator.prototype.softPaint = function() { +}; + +/*================================================== + * Point Highlight Decorator + *================================================== + */ + +Timeline.PointHighlightDecorator = function(params) { + this._unit = params.unit != null ? params.unit : SimileAjax.NativeDateUnit; + this._date = (typeof params.date == "string") ? + this._unit.parseFromObject(params.date) : params.date; + this._width = params.width != null ? params.width : 10; + // Since the width is used to calculate placements (see minPixel, below), we + // specify width here, not in css. + this._color = params.color; + this._cssClass = params.cssClass != null ? params.cssClass : ''; + this._opacity = params.opacity != null ? params.opacity : 100; +}; + +Timeline.PointHighlightDecorator.prototype.initialize = function(band, timeline) { + this._band = band; + this._timeline = timeline; + this._layerDiv = null; +}; + +Timeline.PointHighlightDecorator.prototype.paint = function() { + if (this._layerDiv != null) { + this._band.removeLayerDiv(this._layerDiv); + } + this._layerDiv = this._band.createLayerDiv(10); + this._layerDiv.setAttribute("name", "span-highlight-decorator"); // for debugging + this._layerDiv.style.display = "none"; + + var minDate = this._band.getMinDate(); + var maxDate = this._band.getMaxDate(); + + if (this._unit.compare(this._date, maxDate) < 0 && + this._unit.compare(this._date, minDate) > 0) { + + var pixel = this._band.dateToPixelOffset(this._date); + var minPixel = pixel - Math.round(this._width / 2); + + var doc = this._timeline.getDocument(); + + var div = doc.createElement("div"); + div.className='timeline-highlight-point-decorator'; + div.className += ' ' + this._cssClass; + + if(this._color != null) { + div.style.backgroundColor = this._color; + } + if (this._opacity < 100) { + SimileAjax.Graphics.setOpacity(div, this._opacity); + } + this._layerDiv.appendChild(div); + + if (this._timeline.isHorizontal()) { + div.style.left = minPixel + "px"; + div.style.width = this._width; + } else { + div.style.top = minPixel + "px"; + div.style.height = this._width; + } + } + this._layerDiv.style.display = "block"; +}; + +Timeline.PointHighlightDecorator.prototype.softPaint = function() { +}; +/*================================================== + * Default Unit + *================================================== + */ + +Timeline.NativeDateUnit = new Object(); + +Timeline.NativeDateUnit.createLabeller = function(locale, timeZone) { + return new Timeline.GregorianDateLabeller(locale, timeZone); +}; + +Timeline.NativeDateUnit.makeDefaultValue = function() { + return new Date(); +}; + +Timeline.NativeDateUnit.cloneValue = function(v) { + return new Date(v.getTime()); +}; + +Timeline.NativeDateUnit.getParser = function(format) { + if (typeof format == "string") { + format = format.toLowerCase(); + } + return (format == "iso8601" || format == "iso 8601") ? + Timeline.DateTime.parseIso8601DateTime : + Timeline.DateTime.parseGregorianDateTime; +}; + +Timeline.NativeDateUnit.parseFromObject = function(o) { + return Timeline.DateTime.parseGregorianDateTime(o); +}; + +Timeline.NativeDateUnit.toNumber = function(v) { + return v.getTime(); +}; + +Timeline.NativeDateUnit.fromNumber = function(n) { + return new Date(n); +}; + +Timeline.NativeDateUnit.compare = function(v1, v2) { + var n1, n2; + if (typeof v1 == "object") { + n1 = v1.getTime(); + } else { + n1 = Number(v1); + } + if (typeof v2 == "object") { + n2 = v2.getTime(); + } else { + n2 = Number(v2); + } + + return n1 - n2; +}; + +Timeline.NativeDateUnit.earlier = function(v1, v2) { + return Timeline.NativeDateUnit.compare(v1, v2) < 0 ? v1 : v2; +}; + +Timeline.NativeDateUnit.later = function(v1, v2) { + return Timeline.NativeDateUnit.compare(v1, v2) > 0 ? v1 : v2; +}; + +Timeline.NativeDateUnit.change = function(v, n) { + return new Date(v.getTime() + n); +}; + +/*================================================== + * Common localization strings + *================================================== + */ + +Timeline.strings["en"] = { + wikiLinkLabel: "Discuss" +}; + +/*================================================== + * Localization of labellers.js + *================================================== + */ + +Timeline.GregorianDateLabeller.monthNames["en"] = [ + "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" +]; + +Timeline.GregorianDateLabeller.dayNames["en"] = [ + "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" +]; +/* +* timeplot-ajax-basic.js +* +* Copyright (c) 2012, Stefan Jänicke. All rights reserved. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 3 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +* MA 02110-1301 USA +*/ + +/** + * basic code which is included in front of timeplot code for the minified version + * @author Stefan Jänicke (stjaenicke@informatik.uni-leipzig.de) + * @release 1.0 + * @release date: 2012-07-25 + * @version date: 2012-07-25 + */ + +if ( typeof window.Timeplot == "undefined") { + window.Timeplot = { + params : { + bundle : true, + autoCreate : true + }, + namespace : "http://simile.mit.edu/2007/06/timeplot#", + importers : {} + }; + Timeplot.urlPrefix = GeoTemCoMinifier_urlPrefix + 'lib/simile/timeplot/'; +} + +/*================================================== + * Simile Timeplot API + * + * Include Timeplot in your HTML file as follows: + * + * + *==================================================*/ + +(function() { + + var local = false; + + // obtain local mode from the document URL + if (document.location.search.length > 0) { + var params = document.location.search.substr(1).split("&"); + for (var i = 0; i < params.length; i++) { + if (params[i] == "local") { + local = true; + } + } + } + + // obtain local mode from the script URL params attribute + if (!local) { + var heads = document.documentElement.getElementsByTagName("head"); + for (var h = 0; h < heads.length; h++) { + var node = heads[h].firstChild; + while (node != null) { + if (node.nodeType == 1 && node.tagName.toLowerCase() == "script") { + var url = node.src; + if (url.indexOf("timeplot-api") >= 0) { + local = (url.indexOf("local") >= 0); + } + } + node = node.nextSibling; + } + } + } + + // Load Timeplot if it's not already loaded (after SimileAjax and Timeline) + var loadTimeplot = function() { + + if (typeof window.Timeplot != "undefined") { + return; + } + + window.Timeplot = { + loaded: false, + params: { bundle: true, autoCreate: true }, + namespace: "http://simile.mit.edu/2007/06/timeplot#", + importers: {} + }; + + var javascriptFiles = [ + "timeplot.js", + "plot.js", + "sources.js", + "geometry.js", + "color.js", + "math.js", + "processor.js" + ]; + var cssFiles = [ + "timeplot.css" + ]; + + var locales = [ "en" ]; + + var defaultClientLocales = ("language" in navigator ? navigator.language : navigator.browserLanguage).split(";"); + for (var l = 0; l < defaultClientLocales.length; l++) { + var locale = defaultClientLocales[l]; + if (locale != "en") { + var segments = locale.split("-"); + if (segments.length > 1 && segments[0] != "en") { + locales.push(segments[0]); + } + locales.push(locale); + } + } + + var paramTypes = { bundle:Boolean, js:Array, css:Array, autoCreate:Boolean }; + if (typeof Timeplot_urlPrefix == "string") { + Timeplot.urlPrefix = Timeplot_urlPrefix; + if ("Timeplot_parameters" in window) { + SimileAjax.parseURLParameters(Timeplot_parameters, Timeplot.params, paramTypes); + } + } else { + var url = SimileAjax.findScript(document, "/timeplot-api.js"); + if (url == null) { + Timeplot.error = new Error("Failed to derive URL prefix for Simile Timeplot API code files"); + return; + } + Timeplot.urlPrefix = url.substr(0, url.indexOf("timeplot-api.js")); + + SimileAjax.parseURLParameters(url, Timeplot.params, paramTypes); + } + + if (Timeplot.params.locale) { // ISO-639 language codes, + // optional ISO-3166 country codes (2 characters) + if (Timeplot.params.locale != "en") { + var segments = Timeplot.params.locale.split("-"); + if (segments.length > 1 && segments[0] != "en") { + locales.push(segments[0]); + } + locales.push(Timeplot.params.locale); + } + } + + var timeplotURLPrefix = Timeplot.urlPrefix; + + if (local && !("console" in window)) { + var firebug = [ timeplotURLPrefix + "lib/firebug/firebug.js" ]; + SimileAjax.includeJavascriptFiles(document, "", firebug); + } + + var canvas = document.createElement("canvas"); + + if (!canvas.getContext) { + var excanvas = [ timeplotURLPrefix + "lib/excanvas.js" ]; + SimileAjax.includeJavascriptFiles(document, "", excanvas); + } + + var scriptURLs = Timeplot.params.js || []; + var cssURLs = Timeplot.params.css || []; + + // Core scripts and styles + if (Timeplot.params.bundle && !local) { + scriptURLs.push(timeplotURLPrefix + "timeplot-bundle.js"); + cssURLs.push(timeplotURLPrefix + "timeplot-bundle.css"); + } else { + SimileAjax.prefixURLs(scriptURLs, timeplotURLPrefix + "scripts/", javascriptFiles); + SimileAjax.prefixURLs(cssURLs, timeplotURLPrefix + "styles/", cssFiles); + } + + // Localization + //for (var i = 0; i < locales.length; i++) { + // scriptURLs.push(Timeplot.urlPrefix + "locales/" + locales[i] + "/locale.js"); + //}; + + window.SimileAjax_onLoad = function() { + if (local && window.console.open) window.console.open(); + if (Timeplot.params.callback) { + eval(Timeplot.params.callback + "()"); + } + } + + SimileAjax.includeJavascriptFiles(document, "", scriptURLs); + SimileAjax.includeCssFiles(document, "", cssURLs); + Timeplot.loaded = true; + }; + + // Load Timeline if it's not already loaded (after SimileAjax and before Timeplot) + var loadTimeline = function() { + if (typeof Timeline != "undefined") { + loadTimeplot(); + } else { + var timelineURL = "http://api.simile-widgets.org/timeline/2.3.1/timeline-api.js?bundle=true"; + window.SimileAjax_onLoad = loadTimeplot; + SimileAjax.includeJavascriptFile(document, timelineURL); + } + }; + + // Load SimileAjax if it's not already loaded + if (typeof SimileAjax == "undefined") { + window.SimileAjax_onLoad = loadTimeline; + + var url = "http://api.simile-widgets.org/ajax/2.2.1/simile-ajax-api.js?bundle=true"; + + var createScriptElement = function() { + var script = document.createElement("script"); + script.type = "text/javascript"; + script.language = "JavaScript"; + script.src = url; + document.getElementsByTagName("head")[0].appendChild(script); + } + + if (document.body == null) { + try { + document.write(""); + } catch (e) { + createScriptElement(); + } + } else { + createScriptElement(); + } + } else { + loadTimeline(); + } +})(); +/** + * Timeplot + * + * @fileOverview Timeplot + * @name Timeplot + */ + +Timeline.Debug = SimileAjax.Debug; // timeline uses it's own debug system which is not as advanced +var log = SimileAjax.Debug.log; // shorter name is easier to use + +/* + * This function is used to implement a raw but effective OOP-like inheritance + * in various Timeplot classes. + */ +Object.extend = function(destination, source) { + for (var property in source) { + destination[property] = source[property]; + } + return destination; +} + +// --------------------------------------------- + +/** + * Create a timeplot attached to the given element and using the configuration from the given array of PlotInfos + */ +Timeplot.create = function(elmt, plotInfos) { + return new Timeplot._Impl(elmt, plotInfos); +}; + +/** + * Create a PlotInfo configuration from the given map of params + */ +Timeplot.createPlotInfo = function(params) { + return { + id: ("id" in params) ? params.id : "p" + Math.round(Math.random() * 1000000), + dataSource: ("dataSource" in params) ? params.dataSource : null, + eventSource: ("eventSource" in params) ? params.eventSource : null, + timeGeometry: ("timeGeometry" in params) ? params.timeGeometry : new Timeplot.DefaultTimeGeometry(), + valueGeometry: ("valueGeometry" in params) ? params.valueGeometry : new Timeplot.DefaultValueGeometry(), + timeZone: ("timeZone" in params) ? params.timeZone : 0, + fillColor: ("fillColor" in params) ? ((params.fillColor == "string") ? new Timeplot.Color(params.fillColor) : params.fillColor) : null, + fillGradient: ("fillGradient" in params) ? params.fillGradient : true, + fillFrom: ("fillFrom" in params) ? params.fillFrom : Number.NEGATIVE_INFINITY, + lineColor: ("lineColor" in params) ? ((params.lineColor == "string") ? new Timeplot.Color(params.lineColor) : params.lineColor) : new Timeplot.Color("#606060"), + lineWidth: ("lineWidth" in params) ? params.lineWidth : 1.0, + dotRadius: ("dotRadius" in params) ? params.dotRadius : 2.0, + dotColor: ("dotColor" in params) ? params.dotColor : null, + eventLineWidth: ("eventLineWidth" in params) ? params.eventLineWidth : 1.0, + showValues: ("showValues" in params) ? params.showValues : false, + roundValues: ("roundValues" in params) ? params.roundValues : true, + valuesOpacity: ("valuesOpacity" in params) ? params.valuesOpacity : 75, + bubbleWidth: ("bubbleWidth" in params) ? params.bubbleWidth : 300, + bubbleHeight: ("bubbleHeight" in params) ? params.bubbleHeight : 200 + }; +}; + +// ------------------------------------------------------- + +/** + * This is the implementation of the Timeplot object. + * + * @constructor + */ +Timeplot._Impl = function(elmt, plotInfos) { + this._id = "t" + Math.round(Math.random() * 1000000); + this._containerDiv = elmt; + this._plotInfos = plotInfos; + this._painters = { + background: [], + foreground: [] + }; + this._painter = null; + this._active = false; + this._upright = false; + this._initialize(); +}; + +Timeplot._Impl.prototype = { + + dispose: function() { + for (var i = 0; i < this._plots.length; i++) { + this._plots[i].dispose(); + } + this._plots = null; + this._plotsInfos = null; + this._containerDiv.innerHTML = ""; + }, + + /** + * Returns the main container div this timeplot is operating on. + */ + getElement: function() { + return this._containerDiv; + }, + + /** + * Returns document this timeplot belongs to. + */ + getDocument: function() { + return this._containerDiv.ownerDocument; + }, + + /** + * Append the given element to the timeplot DOM + */ + add: function(div) { + this._containerDiv.appendChild(div); + }, + + /** + * Remove the given element to the timeplot DOM + */ + remove: function(div) { + this._containerDiv.removeChild(div); + }, + + /** + * Add a painter to the timeplot + */ + addPainter: function(layerName, painter) { + var layer = this._painters[layerName]; + if (layer) { + for (var i = 0; i < layer.length; i++) { + if (layer[i].context._id == painter.context._id) { + return; + } + } + layer.push(painter); + } + }, + + /** + * Remove a painter from the timeplot + */ + removePainter: function(layerName, painter) { + var layer = this._painters[layerName]; + if (layer) { + for (var i = 0; i < layer.length; i++) { + if (layer[i].context._id == painter.context._id) { + layer.splice(i, 1); + break; + } + } + } + }, + + /** + * Get the width in pixels of the area occupied by the entire timeplot in the page + */ + getWidth: function() { + return this._containerDiv.clientWidth; + }, + + /** + * Get the height in pixels of the area occupied by the entire timeplot in the page + */ + getHeight: function() { + return this._containerDiv.clientHeight; + }, + + /** + * Get the drawing canvas associated with this timeplot + */ + getCanvas: function() { + return this._canvas; + }, + + /** + *

Load the data from the given url into the given eventSource, using + * the given separator to parse the columns and preprocess it before parsing + * thru the optional filter function. The filter is useful for when + * the data is row-oriented but the format is not compatible with the + * one that Timeplot expects.

+ * + *

Here is an example of a filter that changes dates in the form 'yyyy/mm/dd' + * in the required 'yyyy-mm-dd' format: + *

var dataFilter = function(data) {
+     *     for (var i = 0; i < data.length; i++) {
+     *         var row = data[i];
+     *         row[0] = row[0].replace(/\//g,"-");
+     *     }
+     *     return data;
+     * };

+ */ + loadText: function(url, separator, eventSource, filter, format) { + if (this._active) { + var tp = this; + + var fError = function(statusText, status, xmlhttp) { + alert("Failed to load data xml from " + url + "\n" + statusText); + tp.hideLoadingMessage(); + }; + + var fDone = function(xmlhttp) { + try { + eventSource.loadText(xmlhttp.responseText, separator, url, filter, format); + } catch (e) { + SimileAjax.Debug.exception(e); + } finally { + tp.hideLoadingMessage(); + } + }; + + this.showLoadingMessage(); + window.setTimeout(function() { SimileAjax.XmlHttp.get(url, fError, fDone); }, 0); + } + }, + + /** + * Load event data from the given url into the given eventSource, using + * the Timeline XML event format. + */ + loadXML: function(url, eventSource) { + if (this._active) { + var tl = this; + + var fError = function(statusText, status, xmlhttp) { + alert("Failed to load data xml from " + url + "\n" + statusText); + tl.hideLoadingMessage(); + }; + + var fDone = function(xmlhttp) { + try { + var xml = xmlhttp.responseXML; + if (!xml.documentElement && xmlhttp.responseStream) { + xml.load(xmlhttp.responseStream); + } + eventSource.loadXML(xml, url); + } finally { + tl.hideLoadingMessage(); + } + }; + + this.showLoadingMessage(); + window.setTimeout(function() { SimileAjax.XmlHttp.get(url, fError, fDone); }, 0); + } + }, + + /** + * Overlay a 'div' element filled with the given text and styles to this timeplot + * This is used to implement labels since canvas does not support drawing text. + */ + putText: function(id, text, clazz, styles) { + var div = this.putDiv(id, "timeplot-div " + clazz, styles); + div.innerHTML = text; + return div; + }, + + /** + * Overlay a 'div' element, with the given class and the given styles to this timeplot. + * This is used for labels and horizontal and vertical grids. + */ + putDiv: function(id, clazz, styles) { + var tid = this._id + "-" + id; + var div = document.getElementById(tid); + if (!div) { + var container = this._containerDiv.firstChild; // get the divs container + div = document.createElement("div"); + div.setAttribute("id",tid); + container.appendChild(div); + } + div.setAttribute("class","timeplot-div " + clazz); + div.setAttribute("className","timeplot-div " + clazz); + this.placeDiv(div,styles); + return div; + }, + + /** + * Associate the given map of styles to the given element. + * In case such styles indicate position (left,right,top,bottom) correct them + * with the padding information so that they align to the 'internal' area + * of the timeplot. + */ + placeDiv: function(div, styles) { + if (styles) { + for (style in styles) { + if (style == "left") { + styles[style] += this._paddingX; + styles[style] += "px"; + } else if (style == "right") { + styles[style] += this._paddingX; + styles[style] += "px"; + } else if (style == "top") { + styles[style] += this._paddingY; + styles[style] += "px"; + } else if (style == "bottom") { + styles[style] += this._paddingY; + styles[style] += "px"; + } else if (style == "width") { + if (styles[style] < 0) styles[style] = 0; + styles[style] += "px"; + } else if (style == "height") { + if (styles[style] < 0) styles[style] = 0; + styles[style] += "px"; + } + div.style[style] = styles[style]; + } + } + }, + + /** + * return a {x,y} map with the location of the given element relative to the 'internal' area of the timeplot + * (that is, without the container padding) + */ + locate: function(div) { + return { + x: div.offsetLeft - this._paddingX, + y: div.offsetTop - this._paddingY + } + }, + + /** + * Forces timeplot to re-evaluate the various value and time geometries + * associated with its plot layers and repaint accordingly. This should + * be invoked after the data in any of the data sources has been + * modified. + */ + update: function() { + if (this._active) { + for (var i = 0; i < this._plots.length; i++) { + var plot = this._plots[i]; + var dataSource = plot.getDataSource(); + if (dataSource) { + var range = dataSource.getRange(); + if (range) { + plot._valueGeometry.setRange(range); + plot._timeGeometry.setRange(range); + } + } + plot.hideValues(); + } + this.paint(); + } + }, + + /** + * Forces timeplot to re-evaluate its own geometry, clear itself and paint. + * This should be used instead of paint() when you're not sure if the + * geometry of the page has changed or not. + */ + repaint: function() { + if (this._active) { + this._prepareCanvas(); + for (var i = 0; i < this._plots.length; i++) { + var plot = this._plots[i]; + if (plot._timeGeometry) plot._timeGeometry.reset(); + if (plot._valueGeometry) plot._valueGeometry.reset(); + } + this.paint(); + } + }, + + /** + * Calls all the painters that were registered to this timeplot and makes them + * paint the timeplot. This should be used only when you're sure that the geometry + * of the page hasn't changed. + * NOTE: painting is performed by a different thread and it's safe to call this + * function in bursts (as in mousemove or during window resizing + */ + paint: function() { + if (this._active && this._painter == null) { + var timeplot = this; + this._painter = window.setTimeout(function() { + timeplot._clearCanvas(); + + var run = function(action,context) { + try { + if (context.setTimeplot) context.setTimeplot(timeplot); + action.apply(context,[]); + } catch (e) { + SimileAjax.Debug.exception(e); + } + } + + var background = timeplot._painters.background; + for (var i = 0; i < background.length; i++) { + run(background[i].action, background[i].context); + } + var foreground = timeplot._painters.foreground; + for (var i = 0; i < foreground.length; i++) { + run(foreground[i].action, foreground[i].context); + } + + timeplot._painter = null; + }, 20); + } + }, + + _clearCanvas: function() { + var canvas = this.getCanvas(); + var ctx = canvas.getContext('2d'); + ctx.clearRect(0,0,canvas.width,canvas.height); + }, + + _clearLabels: function() { + var labels = this._containerDiv.firstChild; + if (labels) this._containerDiv.removeChild(labels); + labels = document.createElement("div"); + this._containerDiv.appendChild(labels); + }, + + _prepareCanvas: function() { + var canvas = this.getCanvas(); + + // using jQuery. note we calculate the average padding; if your + // padding settings are not symmetrical, the labels will be off + // since they expect to be centered on the canvas. + var con = SimileAjax.jQuery(this._containerDiv); + this._paddingX = (parseInt(con.css('paddingLeft')) + + parseInt(con.css('paddingRight'))) / 2; + this._paddingY = (parseInt(con.css('paddingTop')) + + parseInt(con.css('paddingBottom'))) / 2; + + canvas.width = this.getWidth() - (this._paddingX * 2); + canvas.height = this.getHeight() - (this._paddingY * 2); + + var ctx = canvas.getContext('2d'); + this._setUpright(ctx, canvas); + ctx.globalCompositeOperation = 'source-over'; + }, + + _setUpright: function(ctx, canvas) { + // excanvas+IE requires this to be done only once, ever; actual canvas + // implementations reset and require this for each call to re-layout + if (!SimileAjax.Platform.browser.isIE) this._upright = false; + if (!this._upright) { + this._upright = true; + ctx.translate(0, canvas.height); + ctx.scale(1,-1); + } + }, + + _isBrowserSupported: function(canvas) { + var browser = SimileAjax.Platform.browser; + if ((canvas.getContext && window.getComputedStyle) || + (browser.isIE && browser.majorVersion >= 6)) { + return true; + } else { + return false; + } + }, + + _initialize: function() { + + // initialize the window manager (used to handle the popups) + // NOTE: this is a singleton and it's safe to call multiple times + SimileAjax.WindowManager.initialize(); + + var containerDiv = this._containerDiv; + var doc = containerDiv.ownerDocument; + + // make sure the timeplot div has the right class + containerDiv.className = "timeplot-container " + containerDiv.className; + + // clean it up if it contains some content + while (containerDiv.firstChild) { + containerDiv.removeChild(containerDiv.firstChild); + } + + var canvas = doc.createElement("canvas"); + + if (this._isBrowserSupported(canvas)) { + this._clearLabels(); + + this._canvas = canvas; + canvas.className = "timeplot-canvas"; + containerDiv.appendChild(canvas); + if(!canvas.getContext && G_vmlCanvasManager) { + canvas = G_vmlCanvasManager.initElement(this._canvas); + this._canvas = canvas; + } + this._prepareCanvas(); + + // inserting copyright and link to simile + var elmtCopyright = SimileAjax.Graphics.createTranslucentImage(Timeplot.urlPrefix + "images/copyright.png"); + elmtCopyright.className = "timeplot-copyright"; + elmtCopyright.title = "Timeplot (c) SIMILE - http://simile.mit.edu/timeplot/"; + SimileAjax.DOM.registerEvent(elmtCopyright, "click", function() { window.location = "http://simile.mit.edu/timeplot/"; }); + containerDiv.appendChild(elmtCopyright); + + var timeplot = this; + var painter = { + onAddMany: function() { timeplot.update(); }, + onClear: function() { timeplot.update(); } + } + + // creating painters + this._plots = []; + if (this._plotInfos) { + for (var i = 0; i < this._plotInfos.length; i++) { + var plot = new Timeplot.Plot(this, this._plotInfos[i]); + var dataSource = plot.getDataSource(); + if (dataSource) { + dataSource.addListener(painter); + } + this.addPainter("background", { + context: plot.getTimeGeometry(), + action: plot.getTimeGeometry().paint + }); + this.addPainter("background", { + context: plot.getValueGeometry(), + action: plot.getValueGeometry().paint + }); + this.addPainter("foreground", { + context: plot, + action: plot.paint + }); + this._plots.push(plot); + plot.initialize(); + } + } + + // creating loading UI + var message = SimileAjax.Graphics.createMessageBubble(doc); + message.containerDiv.className = "timeplot-message-container"; + containerDiv.appendChild(message.containerDiv); + + message.contentDiv.className = "timeplot-message"; + message.contentDiv.innerHTML = " Loading..."; + + this.showLoadingMessage = function() { message.containerDiv.style.display = "block"; }; + this.hideLoadingMessage = function() { message.containerDiv.style.display = "none"; }; + + this._active = true; + + } else { + + this._message = SimileAjax.Graphics.createMessageBubble(doc); + this._message.containerDiv.className = "timeplot-message-container"; + this._message.containerDiv.style.top = "15%"; + this._message.containerDiv.style.left = "20%"; + this._message.containerDiv.style.right = "20%"; + this._message.containerDiv.style.minWidth = "20em"; + this._message.contentDiv.className = "timeplot-message"; + this._message.contentDiv.innerHTML = "We're terribly sorry, but your browser is not currently supported by Timeplot.

We are working on supporting it in the near future but, for now, see the list of currently supported browsers."; + this._message.containerDiv.style.display = "block"; + + containerDiv.appendChild(this._message.containerDiv); + + } + } +}; +/** + * Plot Layer + * + * @fileOverview Plot Layer + * @name Plot + */ + +/** + * A plot layer is the main building block for timeplots and it's the object + * that is responsible for painting the plot itself. Each plot needs to have + * a time geometry, either a DataSource (for time series + * plots) or an EventSource (for event plots) and a value geometry in case + * of time series plots. Such parameters are passed along + * in the 'plotInfo' map. + * + * @constructor + */ +Timeplot.Plot = function(timeplot, plotInfo) { + this._timeplot = timeplot; + this._canvas = timeplot.getCanvas(); + this._plotInfo = plotInfo; + this._id = plotInfo.id; + this._timeGeometry = plotInfo.timeGeometry; + this._valueGeometry = plotInfo.valueGeometry; + this._theme = new Timeline.getDefaultTheme(); + this._dataSource = plotInfo.dataSource; + this._eventSource = plotInfo.eventSource; + this._bubble = null; +}; + +Timeplot.Plot.prototype = { + + /** + * Initialize the plot layer + */ + initialize: function() { + if (this._dataSource && this._dataSource.getValue) { + this._timeFlag = this._timeplot.putDiv("timeflag","timeplot-timeflag"); + this._valueFlag = this._timeplot.putDiv(this._id + "valueflag","timeplot-valueflag"); + this._valueFlagLineLeft = this._timeplot.putDiv(this._id + "valueflagLineLeft","timeplot-valueflag-line"); + this._valueFlagLineRight = this._timeplot.putDiv(this._id + "valueflagLineRight","timeplot-valueflag-line"); + if (!this._valueFlagLineLeft.firstChild) { + this._valueFlagLineLeft.appendChild(SimileAjax.Graphics.createTranslucentImage(Timeplot.urlPrefix + "images/line_left.png")); + this._valueFlagLineRight.appendChild(SimileAjax.Graphics.createTranslucentImage(Timeplot.urlPrefix + "images/line_right.png")); + } + this._valueFlagPole = this._timeplot.putDiv(this._id + "valuepole","timeplot-valueflag-pole"); + + var opacity = this._plotInfo.valuesOpacity; + + SimileAjax.Graphics.setOpacity(this._timeFlag, opacity); + SimileAjax.Graphics.setOpacity(this._valueFlag, opacity); + SimileAjax.Graphics.setOpacity(this._valueFlagLineLeft, opacity); + SimileAjax.Graphics.setOpacity(this._valueFlagLineRight, opacity); + SimileAjax.Graphics.setOpacity(this._valueFlagPole, opacity); + + var plot = this; + + var mouseOverHandler = function(elmt, evt, target) { + if (plot._plotInfo.showValues) { + plot._valueFlag.style.display = "block"; + mouseMoveHandler(elmt, evt, target); + } + } + + var day = 24 * 60 * 60 * 1000; + var month = 30 * day; + + var mouseMoveHandler = function(elmt, evt, target) { + if (typeof SimileAjax != "undefined" && plot._plotInfo.showValues) { + var c = plot._canvas; + var x = Math.round(SimileAjax.DOM.getEventRelativeCoordinates(evt,plot._canvas).x); + if (x > c.width) x = c.width; + if (isNaN(x) || x < 0) x = 0; + var t = plot._timeGeometry.fromScreen(x); + if (t == 0) { // something is wrong + plot._valueFlag.style.display = "none"; + return; + } + + var validTime = plot._dataSource.getClosestValidTime(t); + x = plot._timeGeometry.toScreen(validTime); + var v = plot._dataSource.getValue(validTime); + if (plot._plotInfo.roundValues) v = Math.round(v); + plot._valueFlag.innerHTML = new String(v); + var d = new Date(validTime); + var p = plot._timeGeometry.getPeriod(); + if (p < day) { + plot._timeFlag.innerHTML = d.toLocaleTimeString(); + } else if (p > month) { + plot._timeFlag.innerHTML = d.toLocaleDateString(); + } else { + plot._timeFlag.innerHTML = d.toLocaleString(); + } + + var tw = plot._timeFlag.clientWidth; + var th = plot._timeFlag.clientHeight; + var tdw = Math.round(tw / 2); + var vw = plot._valueFlag.clientWidth; + var vh = plot._valueFlag.clientHeight; + var y = plot._valueGeometry.toScreen(v); + + if (x + tdw > c.width) { + var tx = c.width - tdw; + } else if (x - tdw < 0) { + var tx = tdw; + } else { + var tx = x; + } + + if (plot._timeGeometry._timeValuePosition == "top") { + plot._timeplot.placeDiv(plot._valueFlagPole, { + left: x, + top: th - 5, + height: c.height - y - th + 6, + display: "block" + }); + plot._timeplot.placeDiv(plot._timeFlag,{ + left: tx - tdw, + top: -6, + display: "block" + }); + } else { + plot._timeplot.placeDiv(plot._valueFlagPole, { + left: x, + bottom: th - 5, + height: y - th + 6, + display: "block" + }); + plot._timeplot.placeDiv(plot._timeFlag,{ + left: tx - tdw, + bottom: -6, + display: "block" + }); + } + + if (x + vw + 14 > c.width && y + vh + 4 > c.height) { + plot._valueFlagLineLeft.style.display = "none"; + plot._timeplot.placeDiv(plot._valueFlagLineRight,{ + left: x - 14, + bottom: y - 14, + display: "block" + }); + plot._timeplot.placeDiv(plot._valueFlag,{ + left: x - vw - 13, + bottom: y - vh - 13, + display: "block" + }); + } else if (x + vw + 14 > c.width && y + vh + 4 < c.height) { + plot._valueFlagLineRight.style.display = "none"; + plot._timeplot.placeDiv(plot._valueFlagLineLeft,{ + left: x - 14, + bottom: y, + display: "block" + }); + plot._timeplot.placeDiv(plot._valueFlag,{ + left: x - vw - 13, + bottom: y + 13, + display: "block" + }); + } else if (x + vw + 14 < c.width && y + vh + 4 > c.height) { + plot._valueFlagLineRight.style.display = "none"; + plot._timeplot.placeDiv(plot._valueFlagLineLeft,{ + left: x, + bottom: y - 13, + display: "block" + }); + plot._timeplot.placeDiv(plot._valueFlag,{ + left: x + 13, + bottom: y - 13, + display: "block" + }); + } else { + plot._valueFlagLineLeft.style.display = "none"; + plot._timeplot.placeDiv(plot._valueFlagLineRight,{ + left: x, + bottom: y, + display: "block" + }); + plot._timeplot.placeDiv(plot._valueFlag,{ + left: x + 13, + bottom: y + 13, + display: "block" + }); + } + } + } + + var timeplotElement = this._timeplot.getElement(); + SimileAjax.DOM.registerEvent(timeplotElement, "mouseover", mouseOverHandler); + SimileAjax.DOM.registerEvent(timeplotElement, "mousemove", mouseMoveHandler); + } + }, + + /** + * Dispose the plot layer and all the data sources and listeners associated to it + */ + dispose: function() { + if (this._dataSource) { + this._dataSource.removeListener(this._paintingListener); + this._paintingListener = null; + this._dataSource.dispose(); + this._dataSource = null; + } + }, + + /** + * Hide the values + */ + hideValues: function() { + if (this._valueFlag) this._valueFlag.style.display = "none"; + if (this._timeFlag) this._timeFlag.style.display = "none"; + if (this._valueFlagLineLeft) this._valueFlagLineLeft.style.display = "none"; + if (this._valueFlagLineRight) this._valueFlagLineRight.style.display = "none"; + if (this._valueFlagPole) this._valueFlagPole.style.display = "none"; + }, + + /** + * Return the data source of this plot layer (it could be either a DataSource or an EventSource) + */ + getDataSource: function() { + return (this._dataSource) ? this._dataSource : this._eventSource; + }, + + /** + * Return the time geometry associated with this plot layer + */ + getTimeGeometry: function() { + return this._timeGeometry; + }, + + /** + * Return the value geometry associated with this plot layer + */ + getValueGeometry: function() { + return this._valueGeometry; + }, + + /** + * Paint this plot layer + */ + paint: function() { + var ctx = this._canvas.getContext('2d'); + + ctx.lineWidth = this._plotInfo.lineWidth; + ctx.lineJoin = 'miter'; + + if (this._dataSource) { + if (this._plotInfo.fillColor) { + if (this._plotInfo.fillGradient) { + var gradient = ctx.createLinearGradient(0,this._canvas.height,0,0); + gradient.addColorStop(0,this._plotInfo.fillColor.toString()); + gradient.addColorStop(0.5,this._plotInfo.fillColor.toString()); + gradient.addColorStop(1, 'rgba(255,255,255,0)'); + + ctx.fillStyle = gradient; + } else { + ctx.fillStyle = this._plotInfo.fillColor.toString(); + } + + ctx.beginPath(); + ctx.moveTo(0,0); + this._plot(function(x,y) { + ctx.lineTo(x,y); + }); + if (this._plotInfo.fillFrom == Number.NEGATIVE_INFINITY) { + ctx.lineTo(this._canvas.width, 0); + } else if (this._plotInfo.fillFrom == Number.POSITIVE_INFINITY) { + ctx.lineTo(this._canvas.width, this._canvas.height); + ctx.lineTo(0, this._canvas.height); + } else { + ctx.lineTo(this._canvas.width, this._valueGeometry.toScreen(this._plotInfo.fillFrom)); + ctx.lineTo(0, this._valueGeometry.toScreen(this._plotInfo.fillFrom)); + } + ctx.fill(); + } + + if (this._plotInfo.lineColor) { + ctx.strokeStyle = this._plotInfo.lineColor.toString(); + ctx.beginPath(); + var first = true; + this._plot(function(x,y) { + if (first) { + first = false; + ctx.moveTo(x,y); + } + ctx.lineTo(x,y); + }); + ctx.stroke(); + } + + if (this._plotInfo.dotColor) { + ctx.fillStyle = this._plotInfo.dotColor.toString(); + var r = this._plotInfo.dotRadius; + this._plot(function(x,y) { + ctx.beginPath(); + ctx.arc(x,y,r,0,2*Math.PI,true); + ctx.fill(); + }); + } + } + + if (this._eventSource) { + var gradient = ctx.createLinearGradient(0,0,0,this._canvas.height); + gradient.addColorStop(1, 'rgba(255,255,255,0)'); + + ctx.strokeStyle = gradient; + ctx.fillStyle = gradient; + ctx.lineWidth = this._plotInfo.eventLineWidth; + ctx.lineJoin = 'miter'; + + var i = this._eventSource.getAllEventIterator(); + while (i.hasNext()) { + var event = i.next(); + var color = event.getColor(); + color = (color) ? new Timeplot.Color(color) : this._plotInfo.lineColor; + var eventStart = event.getStart().getTime(); + var eventEnd = event.getEnd().getTime(); + if (eventStart == eventEnd) { + var c = color.toString(); + gradient.addColorStop(0, c); + var start = this._timeGeometry.toScreen(eventStart); + start = Math.floor(start) + 0.5; // center it between two pixels (makes the rendering nicer) + var end = start; + ctx.beginPath(); + ctx.moveTo(start,0); + ctx.lineTo(start,this._canvas.height); + ctx.stroke(); + var x = start - 4; + var w = 7; + } else { + var c = color.toString(0.5); + gradient.addColorStop(0, c); + var start = this._timeGeometry.toScreen(eventStart); + start = Math.floor(start) + 0.5; // center it between two pixels (makes the rendering nicer) + var end = this._timeGeometry.toScreen(eventEnd); + end = Math.floor(end) + 0.5; // center it between two pixels (makes the rendering nicer) + ctx.fillRect(start,0,end - start, this._canvas.height); + var x = start; + var w = end - start - 1; + } + + var div = this._timeplot.putDiv(event.getID(),"timeplot-event-box",{ + left: Math.round(x), + width: Math.round(w), + top: 0, + height: this._canvas.height - 1 + }); + + var plot = this; + var clickHandler = function(event) { + return function(elmt, evt, target) { + var doc = plot._timeplot.getDocument(); + plot._closeBubble(); + var coords = SimileAjax.DOM.getEventPageCoordinates(evt); + var elmtCoords = SimileAjax.DOM.getPageCoordinates(elmt); + plot._bubble = SimileAjax.Graphics.createBubbleForPoint(coords.x, elmtCoords.top + plot._canvas.height, plot._plotInfo.bubbleWidth, plot._plotInfo.bubbleHeight, "bottom"); + event.fillInfoBubble(plot._bubble.content, plot._theme, plot._timeGeometry.getLabeler()); + } + }; + var mouseOverHandler = function(elmt, evt, target) { + elmt.oldClass = elmt.className; + elmt.className = elmt.className + " timeplot-event-box-highlight"; + }; + var mouseOutHandler = function(elmt, evt, target) { + elmt.className = elmt.oldClass; + elmt.oldClass = null; + } + + if (!div.instrumented) { + SimileAjax.DOM.registerEvent(div, "click" , clickHandler(event)); + SimileAjax.DOM.registerEvent(div, "mouseover", mouseOverHandler); + SimileAjax.DOM.registerEvent(div, "mouseout" , mouseOutHandler); + div.instrumented = true; + } + } + } + }, + + _plot: function(f) { + var data = this._dataSource.getData(); + if (data) { + var times = data.times; + var values = data.values; + var T = times.length; + for (var t = 0; t < T; t++) { + var x = this._timeGeometry.toScreen(times[t]); + var y = this._valueGeometry.toScreen(values[t]); + f(x, y); + } + } + }, + + _closeBubble: function() { + if (this._bubble != null) { + this._bubble.close(); + this._bubble = null; + } + } + +} +/** + * Sources + * + * @fileOverview Sources + * @name Sources + */ + +/** + * Timeplot.DefaultEventSource is an extension of Timeline.DefaultEventSource + * and therefore reuses the exact same event loading subsystem that + * Timeline uses. + * + * @constructor + */ +Timeplot.DefaultEventSource = function(eventIndex) { + Timeline.DefaultEventSource.apply(this, arguments); +}; + +Object.extend(Timeplot.DefaultEventSource.prototype, Timeline.DefaultEventSource.prototype); + +/** + * Function used by Timeplot to load time series data from a text file. + */ +Timeplot.DefaultEventSource.prototype.loadText = function(text, separator, url, filter, format) { + + if (text == null) { + return; + } + + this._events.maxValues = new Array(); + var base = this._getBaseURL(url); + + if (!format) format = 'iso8601'; + var parseDateTimeFunction = this._events.getUnit().getParser(format); + + var data = this._parseText(text, separator); + + var added = false; + + if (filter) { + data = filter(data); + } + + if (data) { + for (var i = 0; i < data.length; i++){ + var row = data[i]; + if (row.length > 1) { + var dateStr = SimileAjax.jQuery.trim(row[0]); + var date = parseDateTimeFunction(dateStr); + if (date) { + var evt = new Timeplot.DefaultEventSource.NumericEvent(date,row.slice(1)); + this._events.add(evt); + added = true; + } + } + } + } + + if (added) { + this._fire("onAddMany", []); + } +} + +/* + * Parse the data file. + * + * Adapted from http://www.kawa.net/works/js/jkl/js/jkl-parsexml.js by Yusuke Kawasaki + */ +Timeplot.DefaultEventSource.prototype._parseText = function (text, separator) { + text = text.replace( /\r\n?/g, "\n" ); // normalize newlines + var pos = 0; + var len = text.length; + var table = []; + while (pos < len) { + var line = []; + if (text.charAt(pos) != '#') { // if it's not a comment, process + while (pos < len) { + if (text.charAt(pos) == '"') { // "..." quoted column + var nextquote = text.indexOf('"', pos+1 ); + while (nextquote -1) { + if (text.charAt(nextquote+1) != '"') { + break; // end of column + } + nextquote = text.indexOf('"', nextquote + 2); + } + if ( nextquote < 0 ) { + // unclosed quote + } else if (text.charAt(nextquote + 1) == separator) { // end of column + var quoted = text.substr(pos + 1, nextquote-pos - 1); + quoted = quoted.replace(/""/g,'"'); + line[line.length] = quoted; + pos = nextquote + 2; + continue; + } else if (text.charAt(nextquote + 1) == "\n" || // end of line + len == nextquote + 1 ) { // end of file + var quoted = text.substr(pos + 1, nextquote-pos - 1); + quoted = quoted.replace(/""/g,'"'); + line[line.length] = quoted; + pos = nextquote + 2; + break; + } else { + // invalid column + } + } + var nextseparator = text.indexOf(separator, pos); + var nextnline = text.indexOf("\n", pos); + if (nextnline < 0) nextnline = len; + if (nextseparator > -1 && nextseparator < nextnline) { + line[line.length] = text.substr(pos, nextseparator-pos); + pos = nextseparator + 1; + } else { // end of line + line[line.length] = text.substr(pos, nextnline-pos); + pos = nextnline + 1; + break; + } + } + } else { // if it's a comment, ignore + var nextnline = text.indexOf("\n", pos); + pos = (nextnline > -1) ? nextnline + 1 : cur; + } + if (line.length > 0) { + table[table.length] = line; // push line + } + } + if (table.length < 0) return; // null data + return table; +} + +/** + * Return the range of the loaded data + */ +Timeplot.DefaultEventSource.prototype.getRange = function() { + var earliestDate = this.getEarliestDate(); + var latestDate = this.getLatestDate(); + return { + earliestDate: (earliestDate) ? earliestDate : null, + latestDate: (latestDate) ? latestDate : null, + min: 0, + max: 0 + }; +} + +// ----------------------------------------------------------------------- + +/** + * A NumericEvent is an Event that also contains an array of values, + * one for each columns in the loaded data file. + * + * @constructor + */ +Timeplot.DefaultEventSource.NumericEvent = function(time, values) { + this._id = "e" + Math.round(Math.random() * 1000000); + this._time = time; + this._values = values; +}; + +Timeplot.DefaultEventSource.NumericEvent.prototype = { + getID: function() { return this._id; }, + getTime: function() { return this._time; }, + getValues: function() { return this._values; }, + + // these are required by the EventSource + getStart: function() { return this._time; }, + getEnd: function() { return this._time; } +}; + +// ----------------------------------------------------------------------- + +/** + * A DataSource represent an abstract class that represents a monodimensional time series. + * + * @constructor + */ +Timeplot.DataSource = function(eventSource) { + this._eventSource = eventSource; + var source = this; + this._processingListener = { + onAddMany: function() { source._process(); }, + onClear: function() { source._clear(); } + } + this.addListener(this._processingListener); + this._listeners = []; + this._data = null; + this._range = null; +}; + +Timeplot.DataSource.prototype = { + + _clear: function() { + this._data = null; + this._range = null; + }, + + _process: function() { + this._data = { + times: new Array(), + values: new Array() + }; + this._range = { + earliestDate: null, + latestDate: null, + min: 0, + max: 0 + }; + }, + + /** + * Return the range of this data source + */ + getRange: function() { + return this._range; + }, + + /** + * Return the actual data that this data source represents. + * NOTE: _data = { times: [], values: [] } + */ + getData: function() { + return this._data; + }, + + /** + * Return the value associated with the given time in this time series + */ + getValue: function(t) { + if (this._data) { + for (var i = 0; i < this._data.times.length; i++) { + var l = this._data.times[i]; + if (l >= t) { + return this._data.values[i]; + } + } + } + return 0; + }, + + /** + * Return the time of the data point closest to the given time. + */ + getClosestValidTime: function(t) { + if (this._data) { + for (var i = 0; i < this._data.times.length; i++) { + var currentTime = this._data.times[i]; + if (currentTime >= t) { + if (i <= 0) { + return currentTime; + } else { + var lastTime = this._data.times[i - 1]; + // t must be between currentTime and lastTime. + // Find the closest one. + if (t - lastTime < currentTime - t) { + return lastTime; + } else { + return currentTime; + } + } + } + } + } + return 0; + }, + + /** + * Add a listener to the underlying event source + */ + addListener: function(listener) { + this._eventSource.addListener(listener); + }, + + /** + * Remove a listener from the underlying event source + */ + removeListener: function(listener) { + this._eventSource.removeListener(listener); + }, + + /** + * Replace a listener from the underlying event source + */ + replaceListener: function(oldListener, newListener) { + this.removeListener(oldListener); + this.addListener(newListener); + } + +} + +// ----------------------------------------------------------------------- + +/** + * Implementation of a DataSource that extracts the time series out of a + * single column from the events + * + * @constructor + */ +Timeplot.ColumnSource = function(eventSource, column) { + Timeplot.DataSource.apply(this, arguments); + this._column = column - 1; +}; + +Object.extend(Timeplot.ColumnSource.prototype,Timeplot.DataSource.prototype); + +Timeplot.ColumnSource.prototype.dispose = function() { + this.removeListener(this._processingListener); + this._clear(); +} + +Timeplot.ColumnSource.prototype._process = function() { + var count = this._eventSource.getCount(); + var times = new Array(count); + var values = new Array(count); + var min = Number.MAX_VALUE; + var max = Number.MIN_VALUE; + var i = 0; + + var iterator = this._eventSource.getAllEventIterator(); + while (iterator.hasNext()) { + var event = iterator.next(); + var time = event.getTime(); + times[i] = time; + var value = this._getValue(event); + if (!isNaN(value)) { + if (value < min) { + min = value; + } + if (value > max) { + max = value; + } + values[i] = value; + } + i++; + } + + this._data = { + times: times, + values: values + }; + + if (max == Number.MIN_VALUE) max = 1; + + this._range = { + earliestDate: this._eventSource.getEarliestDate(), + latestDate: this._eventSource.getLatestDate(), + min: min, + max: max + }; +} + +Timeplot.ColumnSource.prototype._getValue = function(event) { + return parseFloat(event.getValues()[this._column]); +} + +// --------------------------------------------------------------- + +/** + * Data Source that generates the time series out of the difference + * between the first and the second column + * + * @constructor + */ +Timeplot.ColumnDiffSource = function(eventSource, column1, column2) { + Timeplot.ColumnSource.apply(this, arguments); + this._column2 = column2 - 1; +}; + +Object.extend(Timeplot.ColumnDiffSource.prototype,Timeplot.ColumnSource.prototype); + +Timeplot.ColumnDiffSource.prototype._getValue = function(event) { + var a = parseFloat(event.getValues()[this._column]); + var b = parseFloat(event.getValues()[this._column2]); + return a - b; +} +/** + * Geometries + * + * @fileOverview Geometries + * @name Geometries + */ + +/** + * This is the constructor for the default value geometry. + * A value geometry is what regulates mapping of the plot values to the screen y coordinate. + * If two plots share the same value geometry, they will be drawn using the same scale. + * If "min" and "max" parameters are not set, the geometry will stretch itself automatically + * so that the entire plot will be drawn without overflowing. The stretching happens also + * when a geometry is shared between multiple plots, the one with the biggest range will + * win over the others. + * + * @constructor + */ +Timeplot.DefaultValueGeometry = function(params) { + if (!params) params = {}; + this._id = ("id" in params) ? params.id : "g" + Math.round(Math.random() * 1000000); + this._axisColor = ("axisColor" in params) ? ((typeof params.axisColor == "string") ? new Timeplot.Color(params.axisColor) : params.axisColor) : new Timeplot.Color("#606060"), + this._gridColor = ("gridColor" in params) ? ((typeof params.gridColor == "string") ? new Timeplot.Color(params.gridColor) : params.gridColor) : null, + this._gridLineWidth = ("gridLineWidth" in params) ? params.gridLineWidth : 0.5; + this._axisLabelsPlacement = ("axisLabelsPlacement" in params) ? params.axisLabelsPlacement : "right"; + this._gridSpacing = ("gridSpacing" in params) ? params.gridStep : 50; + this._gridType = ("gridType" in params) ? params.gridType : "short"; + this._gridShortSize = ("gridShortSize" in params) ? params.gridShortSize : 10; + this._minValue = ("min" in params) ? params.min : null; + this._maxValue = ("max" in params) ? params.max : null; + this._linMap = { + direct: function(v) { + return v; + }, + inverse: function(y) { + return y; + } + } + this._map = this._linMap; + this._labels = []; + this._grid = []; +} + +Timeplot.DefaultValueGeometry.prototype = { + + /** + * Since geometries can be reused across timeplots, we need to call this function + * before we can paint using this geometry. + */ + setTimeplot: function(timeplot) { + this._timeplot = timeplot; + this._canvas = timeplot.getCanvas(); + this.reset(); + }, + + /** + * Called by all the plot layers this geometry is associated with + * to update the value range. Unless min/max values are specified + * in the parameters, the biggest value range will be used. + */ + setRange: function(range) { + if ((this._minValue == null) || ((this._minValue != null) && (range.min < this._minValue))) { + this._minValue = range.min; + } + if ((this._maxValue == null) || ((this._maxValue != null) && (range.max * 1.05 > this._maxValue))) { + this._maxValue = range.max * 1.05; // get a little more head room to avoid hitting the ceiling + } + + this._updateMappedValues(); + + if (!(this._minValue == 0 && this._maxValue == 0)) { + this._grid = this._calculateGrid(); + } + }, + + /** + * Called after changing ranges or canvas size to reset the grid values + */ + reset: function() { + this._clearLabels(); + this._updateMappedValues(); + this._grid = this._calculateGrid(); + }, + + /** + * Map the given value to a y screen coordinate. + */ + toScreen: function(value) { + if (this._canvas && this._maxValue) { + var v = value - this._minValue; + return this._canvas.height * (this._map.direct(v)) / this._mappedRange; + } else { + return -50; + } + }, + + /** + * Map the given y screen coordinate to a value + */ + fromScreen: function(y) { + if (this._canvas) { + return this._map.inverse(this._mappedRange * y / this._canvas.height) + this._minValue; + } else { + return 0; + } + }, + + /** + * Each geometry is also a painter and paints the value grid and grid labels. + */ + paint: function() { + if (this._timeplot) { + var ctx = this._canvas.getContext('2d'); + + ctx.lineJoin = 'miter'; + + // paint grid + if (this._gridColor) { + var gridGradient = ctx.createLinearGradient(0,0,0,this._canvas.height); + gridGradient.addColorStop(0, this._gridColor.toHexString()); + gridGradient.addColorStop(0.3, this._gridColor.toHexString()); + gridGradient.addColorStop(1, "rgba(255,255,255,0.5)"); + + ctx.lineWidth = this._gridLineWidth; + ctx.strokeStyle = gridGradient; + + for (var i = 0; i < this._grid.length; i++) { + var tick = this._grid[i]; + var y = Math.floor(tick.y) + 0.5; + if (typeof tick.label != "undefined") { + if (this._axisLabelsPlacement == "left") { + var div = this._timeplot.putText(this._id + "-" + i, tick.label,"timeplot-grid-label",{ + left: 4, + bottom: y + 2, + color: this._gridColor.toHexString(), + visibility: "hidden" + }); + this._labels.push(div); + } else if (this._axisLabelsPlacement == "right") { + var div = this._timeplot.putText(this._id + "-" + i, tick.label, "timeplot-grid-label",{ + right: 4, + bottom: y + 2, + color: this._gridColor.toHexString(), + visibility: "hidden" + }); + this._labels.push(div); + } + if (y + div.clientHeight < this._canvas.height + 10) { + div.style.visibility = "visible"; // avoid the labels that would overflow + } + } + + // draw grid + ctx.beginPath(); + if (this._gridType == "long" || tick.label == 0) { + ctx.moveTo(0, y); + ctx.lineTo(this._canvas.width, y); + } else if (this._gridType == "short") { + if (this._axisLabelsPlacement == "left") { + ctx.moveTo(0, y); + ctx.lineTo(this._gridShortSize, y); + } else if (this._axisLabelsPlacement == "right") { + ctx.moveTo(this._canvas.width, y); + ctx.lineTo(this._canvas.width - this._gridShortSize, y); + } + } + ctx.stroke(); + } + } + + // paint axis + var axisGradient = ctx.createLinearGradient(0,0,0,this._canvas.height); + axisGradient.addColorStop(0, this._axisColor.toString()); + axisGradient.addColorStop(0.5, this._axisColor.toString()); + axisGradient.addColorStop(1, "rgba(255,255,255,0.5)"); + + ctx.lineWidth = 1; + ctx.strokeStyle = axisGradient; + + // left axis + ctx.beginPath(); + ctx.moveTo(0,this._canvas.height); + ctx.lineTo(0,0); + ctx.stroke(); + + // right axis + ctx.beginPath(); + ctx.moveTo(this._canvas.width,0); + ctx.lineTo(this._canvas.width,this._canvas.height); + ctx.stroke(); + } + }, + + /** + * Removes all the labels that were added by this geometry + */ + _clearLabels: function() { + for (var i = 0; i < this._labels.length; i++) { + var l = this._labels[i]; + var parent = l.parentNode; + if (parent) parent.removeChild(l); + } + }, + + /* + * This function calculates the grid spacing that it will be used + * by this geometry to draw the grid in order to reduce clutter. + */ + _calculateGrid: function() { + var grid = []; + + if (!this._canvas || this._valueRange == 0) return grid; + + var power = 0; + if (this._valueRange > 1) { + while (Math.pow(10,power) < this._valueRange) { + power++; + } + power--; + } else { + while (Math.pow(10,power) > this._valueRange) { + power--; + } + } + + var unit = Math.pow(10,power); + var inc = unit; + while (true) { + var dy = this.toScreen(this._minValue + inc); + + while (dy < this._gridSpacing) { + inc += unit; + dy = this.toScreen(this._minValue + inc); + } + + if (dy > 2 * this._gridSpacing) { // grids are too spaced out + unit /= 10; + inc = unit; + } else { + break; + } + } + + var v = 0; + var y = this.toScreen(v); + if (this._minValue >= 0) { + while (y < this._canvas.height) { + if (y > 0) { + grid.push({ y: y, label: v }); + } + v += inc; + y = this.toScreen(v); + } + } else if (this._maxValue <= 0) { + while (y > 0) { + if (y < this._canvas.height) { + grid.push({ y: y, label: v }); + } + v -= inc; + y = this.toScreen(v); + } + } else { + while (y < this._canvas.height) { + if (y > 0) { + grid.push({ y: y, label: v }); + } + v += inc; + y = this.toScreen(v); + } + v = -inc; + y = this.toScreen(v); + while (y > 0) { + if (y < this._canvas.height) { + grid.push({ y: y, label: v }); + } + v -= inc; + y = this.toScreen(v); + } + } + + return grid; + }, + + /* + * Update the values that are used by the paint function so that + * we don't have to calculate them at every repaint. + */ + _updateMappedValues: function() { + this._valueRange = Math.abs(this._maxValue - this._minValue); + this._mappedRange = this._map.direct(this._valueRange); + } + +} + +// -------------------------------------------------- + +/** + * This is the constructor for a Logarithmic value geometry, which + * is useful when plots have values in different magnitudes but + * exhibit similar trends and such trends want to be shown on the same + * plot (here a cartesian geometry would make the small magnitudes + * disappear). + * + * NOTE: this class extends Timeplot.DefaultValueGeometry and inherits + * all of the methods of that class. So refer to that class. + * + * @constructor + */ +Timeplot.LogarithmicValueGeometry = function(params) { + Timeplot.DefaultValueGeometry.apply(this, arguments); + this._logMap = { + direct: function(v) { + return Math.log(v + 1) / Math.log(10); + }, + inverse: function(y) { + return Math.exp(Math.log(10) * y) - 1; + } + } + this._mode = "log"; + this._map = this._logMap; + this._calculateGrid = this._logarithmicCalculateGrid; +}; + +Timeplot.LogarithmicValueGeometry.prototype._linearCalculateGrid = Timeplot.DefaultValueGeometry.prototype._calculateGrid; + +Object.extend(Timeplot.LogarithmicValueGeometry.prototype,Timeplot.DefaultValueGeometry.prototype); + +/* + * This function calculates the grid spacing that it will be used + * by this geometry to draw the grid in order to reduce clutter. + */ +Timeplot.LogarithmicValueGeometry.prototype._logarithmicCalculateGrid = function() { + var grid = []; + + if (!this._canvas || this._valueRange == 0) return grid; + + var v = 1; + var y = this.toScreen(v); + while (y < this._canvas.height || isNaN(y)) { + if (y > 0) { + grid.push({ y: y, label: v }); + } + v *= 10; + y = this.toScreen(v); + } + + return grid; +}; + +/** + * Turn the logarithmic scaling off. + */ +Timeplot.LogarithmicValueGeometry.prototype.actLinear = function() { + this._mode = "lin"; + this._map = this._linMap; + this._calculateGrid = this._linearCalculateGrid; + this.reset(); +} + +/** + * Turn the logarithmic scaling on. + */ +Timeplot.LogarithmicValueGeometry.prototype.actLogarithmic = function() { + this._mode = "log"; + this._map = this._logMap; + this._calculateGrid = this._logarithmicCalculateGrid; + this.reset(); +} + +/** + * Toggle logarithmic scaling seeting it to on if off and viceversa. + */ +Timeplot.LogarithmicValueGeometry.prototype.toggle = function() { + if (this._mode == "log") { + this.actLinear(); + } else { + this.actLogarithmic(); + } +} + +// ----------------------------------------------------- + +/** + * This is the constructor for the default time geometry. + * + * @constructor + */ +Timeplot.DefaultTimeGeometry = function(params) { + if (!params) params = {}; + this._id = ("id" in params) ? params.id : "g" + Math.round(Math.random() * 1000000); + this._locale = ("locale" in params) ? params.locale : "en"; + this._timeZone = ("timeZone" in params) ? params.timeZone : SimileAjax.DateTime.getTimezone(); + this._labeler = ("labeller" in params) ? params.labeller : null; + this._axisColor = ("axisColor" in params) ? ((params.axisColor == "string") ? new Timeplot.Color(params.axisColor) : params.axisColor) : new Timeplot.Color("#606060"), + this._gridColor = ("gridColor" in params) ? ((params.gridColor == "string") ? new Timeplot.Color(params.gridColor) : params.gridColor) : null, + this._gridLineWidth = ("gridLineWidth" in params) ? params.gridLineWidth : 0.5; + this._axisLabelsPlacement = ("axisLabelsPlacement" in params) ? params.axisLabelsPlacement : "bottom"; + this._gridStep = ("gridStep" in params) ? params.gridStep : 100; + this._gridStepRange = ("gridStepRange" in params) ? params.gridStepRange : 20; + this._min = ("min" in params) ? params.min : null; + this._max = ("max" in params) ? params.max : null; + this._timeValuePosition =("timeValuePosition" in params) ? params.timeValuePosition : "bottom"; + this._unit = ("unit" in params) ? params.unit : Timeline.NativeDateUnit; + this._linMap = { + direct: function(t) { + return t; + }, + inverse: function(x) { + return x; + } + } + this._map = this._linMap; + if (!this._labeler) + this._labeler = this._unit.createLabeller(this._locale, this._timeZone); + var dateParser = this._unit.getParser("iso8601"); + if (this._min && !this._min.getTime) { + this._min = dateParser(this._min); + } + if (this._max && !this._max.getTime) { + this._max = dateParser(this._max); + } + this._labels = []; + this._grid = []; +} + +Timeplot.DefaultTimeGeometry.prototype = { + + /** + * Since geometries can be reused across timeplots, we need to call this function + * before we can paint using this geometry. + */ + setTimeplot: function(timeplot) { + this._timeplot = timeplot; + this._canvas = timeplot.getCanvas(); + this.reset(); + }, + + /** + * Called by all the plot layers this geometry is associated with + * to update the time range. Unless min/max values are specified + * in the parameters, the biggest range will be used. + */ + setRange: function(range) { + if (this._min) { + this._earliestDate = this._min; + } else if (range.earliestDate && ((this._earliestDate == null) || ((this._earliestDate != null) && (range.earliestDate.getTime() < this._earliestDate.getTime())))) { + this._earliestDate = range.earliestDate; + } + + if (this._max) { + this._latestDate = this._max; + } else if (range.latestDate && ((this._latestDate == null) || ((this._latestDate != null) && (range.latestDate.getTime() > this._latestDate.getTime())))) { + this._latestDate = range.latestDate; + } + + if (!this._earliestDate && !this._latestDate) { + this._grid = []; + } else { + this.reset(); + } + }, + + /** + * Called after changing ranges or canvas size to reset the grid values + */ + reset: function() { + this._updateMappedValues(); + if (this._canvas) this._grid = this._calculateGrid(); + }, + + /** + * Map the given date to a x screen coordinate. + */ + toScreen: function(time) { + if (this._canvas && this._latestDate) { + var t = time - this._earliestDate.getTime(); + var fraction = (this._mappedPeriod > 0) ? this._map.direct(t) / this._mappedPeriod : 0; + return this._canvas.width * fraction; + } else { + return -50; + } + }, + + /** + * Map the given x screen coordinate to a date. + */ + fromScreen: function(x) { + if (this._canvas) { + return this._map.inverse(this._mappedPeriod * x / this._canvas.width) + this._earliestDate.getTime(); + } else { + return 0; + } + }, + + /** + * Get a period (in milliseconds) this time geometry spans. + */ + getPeriod: function() { + return this._period; + }, + + /** + * Return the labeler that has been associated with this time geometry + */ + getLabeler: function() { + return this._labeler; + }, + + /** + * Return the time unit associated with this time geometry + */ + getUnit: function() { + return this._unit; + }, + + /** + * Each geometry is also a painter and paints the value grid and grid labels. + */ + paint: function() { + if (this._canvas) { + var unit = this._unit; + var ctx = this._canvas.getContext('2d'); + + var gradient = ctx.createLinearGradient(0,0,0,this._canvas.height); + + ctx.strokeStyle = gradient; + ctx.lineWidth = this._gridLineWidth; + ctx.lineJoin = 'miter'; + + // paint grid + if (this._gridColor) { + gradient.addColorStop(0, this._gridColor.toString()); + gradient.addColorStop(1, "rgba(255,255,255,0.9)"); + + for (var i = 0; i < this._grid.length; i++) { + var tick = this._grid[i]; + var x = Math.floor(tick.x) + 0.5; + if (this._axisLabelsPlacement == "top") { + var div = this._timeplot.putText(this._id + "-" + i, tick.label,"timeplot-grid-label",{ + left: x + 4, + top: 2, + visibility: "hidden" + }); + this._labels.push(div); + } else if (this._axisLabelsPlacement == "bottom") { + var div = this._timeplot.putText(this._id + "-" + i, tick.label, "timeplot-grid-label",{ + left: x + 4, + bottom: 2, + visibility: "hidden" + }); + this._labels.push(div); + } + if (x + div.clientWidth < this._canvas.width + 10) { + div.style.visibility = "visible"; // avoid the labels that would overflow + } + + // draw separator + ctx.beginPath(); + ctx.moveTo(x,0); + ctx.lineTo(x,this._canvas.height); + ctx.stroke(); + } + } + + // paint axis + gradient.addColorStop(0, this._axisColor.toString()); + gradient.addColorStop(1, "rgba(255,255,255,0.5)"); + + ctx.lineWidth = 1; + gradient.addColorStop(0, this._axisColor.toString()); + + ctx.beginPath(); + ctx.moveTo(0,0); + ctx.lineTo(this._canvas.width,0); + ctx.stroke(); + } + }, + + /* + * This function calculates the grid spacing that it will be used + * by this geometry to draw the grid in order to reduce clutter. + */ + _calculateGrid: function() { + var grid = []; + + var time = SimileAjax.DateTime; + var u = this._unit; + var p = this._period; + + if (p == 0) return grid; + + // find the time units nearest to the time period + if (p > time.gregorianUnitLengths[time.MILLENNIUM]) { + unit = time.MILLENNIUM; + } else { + for (var unit = time.MILLENNIUM; unit > 0; unit--) { + if (time.gregorianUnitLengths[unit-1] <= p && p < time.gregorianUnitLengths[unit]) { + unit--; + break; + } + } + } + + var t = u.cloneValue(this._earliestDate); + + do { + time.roundDownToInterval(t, unit, this._timeZone, 1, 0); + var x = this.toScreen(u.toNumber(t)); + switch (unit) { + case time.SECOND: + var l = t.toLocaleTimeString(); + break; + case time.MINUTE: + var m = t.getMinutes(); + var l = t.getHours() + ":" + ((m < 10) ? "0" : "") + m; + break; + case time.HOUR: + var l = t.getHours() + ":00"; + break; + case time.DAY: + case time.WEEK: + case time.MONTH: + var l = t.toLocaleDateString(); + break; + case time.YEAR: + case time.DECADE: + case time.CENTURY: + case time.MILLENNIUM: + var l = t.getUTCFullYear(); + break; + } + if (x > 0) { + grid.push({ x: x, label: l }); + } + time.incrementByInterval(t, unit, this._timeZone); + } while (t.getTime() < this._latestDate.getTime()); + + return grid; + }, + + /* + * Clear labels generated by this time geometry. + */ + _clearLabels: function() { + for (var i = 0; i < this._labels.length; i++) { + var l = this._labels[i]; + var parent = l.parentNode; + if (parent) parent.removeChild(l); + } + }, + + /* + * Update the values that are used by the paint function so that + * we don't have to calculate them at every repaint. + */ + _updateMappedValues: function() { + if (this._latestDate && this._earliestDate) { + this._period = this._latestDate.getTime() - this._earliestDate.getTime(); + this._mappedPeriod = this._map.direct(this._period); + } else { + this._period = 0; + this._mappedPeriod = 0; + } + } + +} + +// -------------------------------------------------------------- + +/** + * This is the constructor for the magnifying time geometry. + * Users can interact with this geometry and 'magnify' certain areas of the + * plot to see the plot enlarged and resolve details that would otherwise + * get lost or cluttered with a linear time geometry. + * + * @constructor + */ +Timeplot.MagnifyingTimeGeometry = function(params) { + Timeplot.DefaultTimeGeometry.apply(this, arguments); + + var g = this; + this._MagnifyingMap = { + direct: function(t) { + if (t < g._leftTimeMargin) { + var x = t * g._leftRate; + } else if ( g._leftTimeMargin < t && t < g._rightTimeMargin ) { + var x = t * g._expandedRate + g._expandedTimeTranslation; + } else { + var x = t * g._rightRate + g._rightTimeTranslation; + } + return x; + }, + inverse: function(x) { + if (x < g._leftScreenMargin) { + var t = x / g._leftRate; + } else if ( g._leftScreenMargin < x && x < g._rightScreenMargin ) { + var t = x / g._expandedRate + g._expandedScreenTranslation; + } else { + var t = x / g._rightRate + g._rightScreenTranslation; + } + return t; + } + } + + this._mode = "lin"; + this._map = this._linMap; +}; + +Object.extend(Timeplot.MagnifyingTimeGeometry.prototype,Timeplot.DefaultTimeGeometry.prototype); + +/** + * Initialize this geometry associating it with the given timeplot and + * register the geometry event handlers to the timeplot so that it can + * interact with the user. + */ +Timeplot.MagnifyingTimeGeometry.prototype.initialize = function(timeplot) { + Timeplot.DefaultTimeGeometry.prototype.initialize.apply(this, arguments); + + if (!this._lens) { + this._lens = this._timeplot.putDiv("lens","timeplot-lens"); + } + + var period = 1000 * 60 * 60 * 24 * 30; // a month in the magnifying lens + + var geometry = this; + + var magnifyWith = function(lens) { + var aperture = lens.clientWidth; + var loc = geometry._timeplot.locate(lens); + geometry.setMagnifyingParams(loc.x + aperture / 2, aperture, period); + geometry.actMagnifying(); + geometry._timeplot.paint(); + } + + var canvasMouseDown = function(elmt, evt, target) { + geometry._canvas.startCoords = SimileAjax.DOM.getEventRelativeCoordinates(evt,elmt); + geometry._canvas.pressed = true; + } + + var canvasMouseUp = function(elmt, evt, target) { + geometry._canvas.pressed = false; + var coords = SimileAjax.DOM.getEventRelativeCoordinates(evt,elmt); + if (Timeplot.Math.isClose(coords,geometry._canvas.startCoords,5)) { + geometry._lens.style.display = "none"; + geometry.actLinear(); + geometry._timeplot.paint(); + } else { + geometry._lens.style.cursor = "move"; + magnifyWith(geometry._lens); + } + } + + var canvasMouseMove = function(elmt, evt, target) { + if (geometry._canvas.pressed) { + var coords = SimileAjax.DOM.getEventRelativeCoordinates(evt,elmt); + if (coords.x < 0) coords.x = 0; + if (coords.x > geometry._canvas.width) coords.x = geometry._canvas.width; + geometry._timeplot.placeDiv(geometry._lens, { + left: geometry._canvas.startCoords.x, + width: coords.x - geometry._canvas.startCoords.x, + bottom: 0, + height: geometry._canvas.height, + display: "block" + }); + } + } + + var lensMouseDown = function(elmt, evt, target) { + geometry._lens.startCoords = SimileAjax.DOM.getEventRelativeCoordinates(evt,elmt);; + geometry._lens.pressed = true; + } + + var lensMouseUp = function(elmt, evt, target) { + geometry._lens.pressed = false; + } + + var lensMouseMove = function(elmt, evt, target) { + if (geometry._lens.pressed) { + var coords = SimileAjax.DOM.getEventRelativeCoordinates(evt,elmt); + var lens = geometry._lens; + var left = lens.offsetLeft + coords.x - lens.startCoords.x; + if (left < geometry._timeplot._paddingX) left = geometry._timeplot._paddingX; + if (left + lens.clientWidth > geometry._canvas.width - geometry._timeplot._paddingX) left = geometry._canvas.width - lens.clientWidth + geometry._timeplot._paddingX; + lens.style.left = left; + magnifyWith(lens); + } + } + + if (!this._canvas.instrumented) { + SimileAjax.DOM.registerEvent(this._canvas, "mousedown", canvasMouseDown); + SimileAjax.DOM.registerEvent(this._canvas, "mousemove", canvasMouseMove); + SimileAjax.DOM.registerEvent(this._canvas, "mouseup" , canvasMouseUp); + SimileAjax.DOM.registerEvent(this._canvas, "mouseup" , lensMouseUp); + this._canvas.instrumented = true; + } + + if (!this._lens.instrumented) { + SimileAjax.DOM.registerEvent(this._lens, "mousedown", lensMouseDown); + SimileAjax.DOM.registerEvent(this._lens, "mousemove", lensMouseMove); + SimileAjax.DOM.registerEvent(this._lens, "mouseup" , lensMouseUp); + SimileAjax.DOM.registerEvent(this._lens, "mouseup" , canvasMouseUp); + this._lens.instrumented = true; + } +} + +/** + * Set the Magnifying parameters. c is the location in pixels where the Magnifying + * center should be located in the timeplot, a is the aperture in pixel of + * the Magnifying and b is the time period in milliseconds that the Magnifying + * should span. + */ +Timeplot.MagnifyingTimeGeometry.prototype.setMagnifyingParams = function(c,a,b) { + a = a / 2; + b = b / 2; + + var w = this._canvas.width; + var d = this._period; + + if (c < 0) c = 0; + if (c > w) c = w; + + if (c - a < 0) a = c; + if (c + a > w) a = w - c; + + var ct = this.fromScreen(c) - this._earliestDate.getTime(); + if (ct - b < 0) b = ct; + if (ct + b > d) b = d - ct; + + this._centerX = c; + this._centerTime = ct; + this._aperture = a; + this._aperturePeriod = b; + + this._leftScreenMargin = this._centerX - this._aperture; + this._rightScreenMargin = this._centerX + this._aperture; + this._leftTimeMargin = this._centerTime - this._aperturePeriod; + this._rightTimeMargin = this._centerTime + this._aperturePeriod; + + this._leftRate = (c - a) / (ct - b); + this._expandedRate = a / b; + this._rightRate = (w - c - a) / (d - ct - b); + + this._expandedTimeTranslation = this._centerX - this._centerTime * this._expandedRate; + this._expandedScreenTranslation = this._centerTime - this._centerX / this._expandedRate; + this._rightTimeTranslation = (c + a) - (ct + b) * this._rightRate; + this._rightScreenTranslation = (ct + b) - (c + a) / this._rightRate; + + this._updateMappedValues(); +} + +/* + * Turn magnification off. + */ +Timeplot.MagnifyingTimeGeometry.prototype.actLinear = function() { + this._mode = "lin"; + this._map = this._linMap; + this.reset(); +} + +/* + * Turn magnification on. + */ +Timeplot.MagnifyingTimeGeometry.prototype.actMagnifying = function() { + this._mode = "Magnifying"; + this._map = this._MagnifyingMap; + this.reset(); +} + +/* + * Toggle magnification. + */ +Timeplot.MagnifyingTimeGeometry.prototype.toggle = function() { + if (this._mode == "Magnifying") { + this.actLinear(); + } else { + this.actMagnifying(); + } +} + +/** + * Color + * + * @fileOverview Color + * @name Color + */ + +/* + * Inspired by Plotr + * Copyright 2007 (c) Bas Wenneker + * For use under the BSD license. + */ + +/** + * Create a Color object that can be used to manipulate colors programmatically. + */ +Timeplot.Color = function(color) { + this._fromHex(color); +}; + +Timeplot.Color.prototype = { + + /** + * Sets the RGB values of this coor + * + * @param {Number} r,g,b Red green and blue values (between 0 and 255) + */ + set: function (r,g,b,a) { + this.r = r; + this.g = g; + this.b = b; + this.a = (a) ? a : 1.0; + return this.check(); + }, + + /** + * Set the color transparency + * + * @param {float} a Transparency value, between 0.0 (fully transparent) and 1.0 (fully opaque). + */ + transparency: function(a) { + this.a = a; + return this.check(); + }, + + /** + * Lightens the color. + * + * @param {integer} level Level to lighten the color with. + */ + lighten: function(level) { + var color = new Timeplot.Color(); + return color.set( + this.r += parseInt(level, 10), + this.g += parseInt(level, 10), + this.b += parseInt(level, 10) + ); + }, + + /** + * Darkens the color. + * + * @param {integer} level Level to darken the color with. + */ + darken: function(level){ + var color = new Timeplot.Color(); + return color.set( + this.r -= parseInt(level, 10), + this.g -= parseInt(level, 10), + this.b -= parseInt(level, 10) + ); + }, + + /** + * Checks and validates if the hex values r, g and b are + * between 0 and 255. + */ + check: function() { + if (this.r > 255) { + this.r = 255; + } else if (this.r < 0){ + this.r = 0; + } + if (this.g > 255) { + this.g = 255; + } else if (this.g < 0) { + this.g = 0; + } + if (this.b > 255){ + this.b = 255; + } else if (this.b < 0){ + this.b = 0; + } + if (this.a > 1.0){ + this.a = 1.0; + } else if (this.a < 0.0){ + this.a = 0.0; + } + return this; + }, + + /** + * Returns a string representation of this color. + * + * @param {float} alpha (optional) Transparency value, between 0.0 (fully transparent) and 1.0 (fully opaque). + */ + toString: function(alpha) { + var a = (alpha) ? alpha : ((this.a) ? this.a : 1.0); + return 'rgba(' + this.r + ',' + this.g + ',' + this.b + ',' + a + ')'; + }, + + /** + * Returns the hexadecimal representation of this color (without the alpha channel as hex colors don't support it) + */ + toHexString: function() { + return "#" + this._toHex(this.r) + this._toHex(this.g) + this._toHex(this.b); + }, + + /* + * Parses and stores the hex values of the input color string. + * + * @param {String} color Hex or rgb() css string. + */ + _fromHex: function(color) { + if(/^#?([\da-f]{3}|[\da-f]{6})$/i.test(color)){ + color = color.replace(/^#/, '').replace(/^([\da-f])([\da-f])([\da-f])$/i, "$1$1$2$2$3$3"); + this.r = parseInt(color.substr(0,2), 16); + this.g = parseInt(color.substr(2,2), 16); + this.b = parseInt(color.substr(4,2), 16); + } else if(/^rgb *\( *\d{0,3} *, *\d{0,3} *, *\d{0,3} *\)$/i.test(color)){ + color = color.match(/^rgb *\( *(\d{0,3}) *, *(\d{0,3}) *, *(\d{0,3}) *\)$/i); + this.r = parseInt(color[1], 10); + this.g = parseInt(color[2], 10); + this.b = parseInt(color[3], 10); + } + this.a = 1.0; + return this.check(); + }, + + /* + * Returns an hexadecimal representation of a 8 bit integer + */ + _toHex: function(dec) { + var hex = "0123456789ABCDEF" + if (dec < 0) return "00"; + if (dec > 255) return "FF"; + var i = Math.floor(dec / 16); + var j = dec % 16; + return hex.charAt(i) + hex.charAt(j); + } + +}; +/** + * Math Utility functions + * + * @fileOverview Math Utility functions + * @name Math + */ + +Timeplot.Math = { + + /** + * Evaluates the range (min and max values) of the given array + */ + range: function(f) { + var F = f.length; + var min = Number.MAX_VALUE; + var max = Number.MIN_VALUE; + + for (var t = 0; t < F; t++) { + var value = f[t]; + if (value < min) { + min = value; + } + if (value > max) { + max = value; + } + } + + return { + min: min, + max: max + } + }, + + /** + * Evaluates the windows average of a given array based on the + * given window size + */ + movingAverage: function(f, size) { + var F = f.length; + var g = new Array(F); + for (var n = 0; n < F; n++) { + var value = 0; + for (var m = n - size; m < n + size; m++) { + if (m < 0) { + var v = f[0]; + } else if (m >= F) { + var v = g[n-1]; + } else { + var v = f[m]; + } + value += v; + } + g[n] = value / (2 * size); + } + return g; + }, + + /** + * Returns an array with the integral of the given array + */ + integral: function(f) { + var F = f.length; + + var g = new Array(F); + var sum = 0; + + for (var t = 0; t < F; t++) { + sum += f[t]; + g[t] = sum; + } + + return g; + }, + + /** + * Normalizes an array so that its complete integral is 1. + * This is useful to obtain arrays that preserve the overall + * integral of a convolution. + */ + normalize: function(f) { + var F = f.length; + var sum = 0.0; + + for (var t = 0; t < F; t++) { + sum += f[t]; + } + + for (var t = 0; t < F; t++) { + f[t] /= sum; + } + + return f; + }, + + /** + * Calculates the convolution between two arrays + */ + convolution: function(f,g) { + var F = f.length; + var G = g.length; + + var c = new Array(F); + + for (var m = 0; m < F; m++) { + var r = 0; + var end = (m + G < F) ? m + G : F; + for (var n = m; n < end; n++) { + var a = f[n - G]; + var b = g[n - m]; + r += a * b; + } + c[m] = r; + } + + return c; + }, + + // ------ Array generators ------------------------------------------------- + // Functions that generate arrays based on mathematical functions + // Normally these are used to produce operators by convolving them with the input array + // The returned arrays have the property of having + + /** + * Generate the heavyside step function of given size + */ + heavyside: function(size) { + var f = new Array(size); + var value = 1 / size; + for (var t = 0; t < size; t++) { + f[t] = value; + } + return f; + }, + + /** + * Generate the gaussian function so that at the given 'size' it has value 'threshold' + * and make sure its integral is one. + */ + gaussian: function(size, threshold) { + with (Math) { + var radius = size / 2; + var variance = radius * radius / log(threshold); + var g = new Array(size); + for (var t = 0; t < size; t++) { + var l = t - radius; + g[t] = exp(-variance * l * l); + } + } + + return this.normalize(g); + }, + + // ---- Utility Methods -------------------------------------------------- + + /** + * Return x with n significant figures + */ + round: function(x,n) { + with (Math) { + if (abs(x) > 1) { + var l = floor(log(x)/log(10)); + var d = round(exp((l-n+1)*log(10))); + var y = round(round(x / d) * d); + return y; + } else { + log("FIXME(SM): still to implement for 0 < abs(x) < 1"); + return x; + } + } + }, + + /** + * Return the hyperbolic tangent of x + */ + tanh: function(x) { + if (x > 5) { + return 1; + } else if (x < 5) { + return -1; + } else { + var expx2 = Math.exp(2 * x); + return (expx2 - 1) / (expx2 + 1); + } + }, + + /** + * Returns true if |a.x - b.x| < value && | a.y - b.y | < value + */ + isClose: function(a,b,value) { + return (a && b && Math.abs(a.x - b.x) < value && Math.abs(a.y - b.y) < value); + } + +} +/** + * Processing Data Source + * + * @fileOverview Processing Data Source and Operators + * @name Processor + */ + +/* ----------------------------------------------------------------------------- + * Operators + * + * These are functions that can be used directly as Timeplot.Processor operators + * ----------------------------------------------------------------------------- */ + +Timeplot.Operator = { + + /** + * This is the operator used when you want to draw the cumulative sum + * of a time series and not, for example, their daily values. + */ + sum: function(data, params) { + return Timeplot.Math.integral(data.values); + }, + + /** + * This is the operator that is used to 'smooth' a given time series + * by taking the average value of a moving window centered around + * each value. The size of the moving window is influenced by the 'size' + * parameters in the params map. + */ + average: function(data, params) { + var size = ("size" in params) ? params.size : 30; + var result = Timeplot.Math.movingAverage(data.values, size); + return result; + } +} + +/*================================================== + * Processing Data Source + *==================================================*/ + +/** + * A Processor is a special DataSource that can apply an Operator + * to the DataSource values and thus return a different one. + * + * @constructor + */ +Timeplot.Processor = function(dataSource, operator, params) { + this._dataSource = dataSource; + this._operator = operator; + this._params = params; + + this._data = { + times: new Array(), + values: new Array() + }; + + this._range = { + earliestDate: null, + latestDate: null, + min: 0, + max: 0 + }; + + var processor = this; + this._processingListener = { + onAddMany: function() { processor._process(); }, + onClear: function() { processor._clear(); } + } + this.addListener(this._processingListener); +}; + +Timeplot.Processor.prototype = { + + _clear: function() { + this.removeListener(this._processingListener); + this._dataSource._clear(); + }, + + _process: function() { + // this method requires the dataSource._process() method to be + // called first as to setup the data and range used below + // this should be guaranteed by the order of the listener registration + + var data = this._dataSource.getData(); + var range = this._dataSource.getRange(); + + var newValues = this._operator(data, this._params); + var newValueRange = Timeplot.Math.range(newValues); + + this._data = { + times: data.times, + values: newValues + }; + + this._range = { + earliestDate: range.earliestDate, + latestDate: range.latestDate, + min: newValueRange.min, + max: newValueRange.max + }; + }, + + getRange: function() { + return this._range; + }, + + getData: function() { + return this._data; + }, + + getValue: Timeplot.DataSource.prototype.getValue, + + getClosestValidTime: Timeplot.DataSource.prototype.getClosestValidTime, + + addListener: function(listener) { + this._dataSource.addListener(listener); + }, + + removeListener: function(listener) { + this._dataSource.removeListener(listener); + } +} +/*----------------------------------------------------------------------------\ +| Range Class | +|-----------------------------------------------------------------------------| +| Created by Erik Arvidsson | +| (http://webfx.eae.net/contact.html#erik) | +| For WebFX (http://webfx.eae.net/) | +|-----------------------------------------------------------------------------| +| Used to model the data used when working with sliders, scrollbars and | +| progress bars. Based on the ideas of the javax.swing.BoundedRangeModel | +| interface defined by Sun for Java; http://java.sun.com/products/jfc/ | +| swingdoc-api-1.0.3/com/sun/java/swing/BoundedRangeModel.html | +|-----------------------------------------------------------------------------| +| Copyright (c) 2002, 2005, 2006 Erik Arvidsson | +|-----------------------------------------------------------------------------| +| Licensed under the Apache License, Version 2.0 (the "License"); you may not | +| use this file except in compliance with the License. You may obtain a copy | +| of the License at http://www.apache.org/licenses/LICENSE-2.0 | +| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | +| Unless required by applicable law or agreed to in writing, software | +| distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | +| WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | +| License for the specific language governing permissions and limitations | +| under the License. | +|-----------------------------------------------------------------------------| +| 2002-10-14 | Original version released | +| 2005-10-27 | Use Math.round instead of Math.floor | +| 2006-05-28 | Changed license to Apache Software License 2.0. | +|-----------------------------------------------------------------------------| +| Created 2002-10-14 | All changes are in the log above. | Updated 2006-05-28 | +\----------------------------------------------------------------------------*/ + + +function Range() { + this._value = 0; + this._minimum = 0; + this._maximum = 100; + this._extent = 0; + + this._isChanging = false; +} + +Range.prototype.setValue = function (value) { + value = Math.round(parseFloat(value)); + if (isNaN(value)) return; + if (this._value != value) { + if (value + this._extent > this._maximum) + this._value = this._maximum - this._extent; + else if (value < this._minimum) + this._value = this._minimum; + else + this._value = value; + if (!this._isChanging && typeof this.onchange == "function") + this.onchange(); + } +}; + +Range.prototype.getValue = function () { + return this._value; +}; + +Range.prototype.setExtent = function (extent) { + if (this._extent != extent) { + if (extent < 0) + this._extent = 0; + else if (this._value + extent > this._maximum) + this._extent = this._maximum - this._value; + else + this._extent = extent; + if (!this._isChanging && typeof this.onchange == "function") + this.onchange(); + } +}; + +Range.prototype.getExtent = function () { + return this._extent; +}; + +Range.prototype.setMinimum = function (minimum) { + if (this._minimum != minimum) { + var oldIsChanging = this._isChanging; + this._isChanging = true; + + this._minimum = minimum; + + if (minimum > this._value) + this.setValue(minimum); + if (minimum > this._maximum) { + this._extent = 0; + this.setMaximum(minimum); + this.setValue(minimum) + } + if (minimum + this._extent > this._maximum) + this._extent = this._maximum - this._minimum; + + this._isChanging = oldIsChanging; + if (!this._isChanging && typeof this.onchange == "function") + this.onchange(); + } +}; + +Range.prototype.getMinimum = function () { + return this._minimum; +}; + +Range.prototype.setMaximum = function (maximum) { + if (this._maximum != maximum) { + var oldIsChanging = this._isChanging; + this._isChanging = true; + + this._maximum = maximum; + + if (maximum < this._value) + this.setValue(maximum - this._extent); + if (maximum < this._minimum) { + this._extent = 0; + this.setMinimum(maximum); + this.setValue(this._maximum); + } + if (maximum < this._minimum + this._extent) + this._extent = this._maximum - this._minimum; + if (maximum < this._value + this._extent) + this._extent = this._maximum - this._value; + + this._isChanging = oldIsChanging; + if (!this._isChanging && typeof this.onchange == "function") + this.onchange(); + } +}; + +Range.prototype.getMaximum = function () { + return this._maximum; +}; +/*----------------------------------------------------------------------------\ +| Slider 1.02 | +|-----------------------------------------------------------------------------| +| Created by Erik Arvidsson | +| (http://webfx.eae.net/contact.html#erik) | +| For WebFX (http://webfx.eae.net/) | +|-----------------------------------------------------------------------------| +| A slider control that degrades to an input control for non supported | +| browsers. | +|-----------------------------------------------------------------------------| +| Copyright (c) 2002, 2003, 2006 Erik Arvidsson | +|-----------------------------------------------------------------------------| +| Licensed under the Apache License, Version 2.0 (the "License"); you may not | +| use this file except in compliance with the License. You may obtain a copy | +| of the License at http://www.apache.org/licenses/LICENSE-2.0 | +| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | +| Unless required by applicable law or agreed to in writing, software | +| distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | +| WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | +| License for the specific language governing permissions and limitations | +| under the License. | +|-----------------------------------------------------------------------------| +| Dependencies: timer.js - an OO abstraction of timers | +| range.js - provides the data model for the slider | +| winclassic.css or any other css file describing the look | +|-----------------------------------------------------------------------------| +| 2002-10-14 | Original version released | +| 2003-03-27 | Added a test in the constructor for missing oElement arg | +| 2003-11-27 | Only use mousewheel when focused | +| 2006-05-28 | Changed license to Apache Software License 2.0. | +|-----------------------------------------------------------------------------| +| Created 2002-10-14 | All changes are in the log above. | Updated 2006-05-28 | +\----------------------------------------------------------------------------*/ + +Slider.isSupported = typeof document.createElement != "undefined" && + typeof document.documentElement != "undefined" && + typeof document.documentElement.offsetWidth == "number"; + + +function Slider(oElement, oInput, sOrientation) { + if (!oElement) return; + this._orientation = sOrientation || "horizontal"; + this._range = new Range(); + this._range.setExtent(0); + this._blockIncrement = 10; + this._unitIncrement = 1; + this._timer = new Timer(100); + + + if (Slider.isSupported && oElement) { + + this.document = oElement.ownerDocument || oElement.document; + + this.element = oElement; + this.element.slider = this; + this.element.unselectable = "on"; + + // add class name tag to class name + this.element.className = this._orientation + " " + this.classNameTag + " " + this.element.className; + + // create line + this.line = this.document.createElement("DIV"); + this.line.className = "line"; + this.line.unselectable = "on"; + this.line.appendChild(this.document.createElement("DIV")); + this.element.appendChild(this.line); + + // create handle + this.handle = this.document.createElement("DIV"); + this.handle.className = "handle"; + this.handle.unselectable = "on"; + this.handle.appendChild(this.document.createElement("DIV")); + this.handle.firstChild.appendChild( + this.document.createTextNode(String.fromCharCode(160))); + this.element.appendChild(this.handle); + } + + this.input = oInput; + + // events + var oThis = this; + this._range.onchange = function () { + oThis.recalculate(); + if (typeof oThis.onchange == "function") + oThis.onchange(); + }; + + if (Slider.isSupported && oElement) { + this.element.onfocus = Slider.eventHandlers.onfocus; + this.element.onblur = Slider.eventHandlers.onblur; + this.element.onmousedown = Slider.eventHandlers.onmousedown; + this.element.onmouseover = Slider.eventHandlers.onmouseover; + this.element.onmouseout = Slider.eventHandlers.onmouseout; + this.element.onkeydown = Slider.eventHandlers.onkeydown; + this.element.onkeypress = Slider.eventHandlers.onkeypress; + this.element.onmousewheel = Slider.eventHandlers.onmousewheel; + this.handle.onselectstart = + this.element.onselectstart = function () { return false; }; + + this._timer.ontimer = function () { + oThis.ontimer(); + }; + + // extra recalculate for ie + window.setTimeout(function() { + oThis.recalculate(); + }, 1); + } + else { + this.input.onchange = function (e) { + oThis.setValue(oThis.input.value); + }; + } +} + +Slider.eventHandlers = { + + // helpers to make events a bit easier + getEvent: function (e, el) { + if (!e) { + if (el) + e = el.document.parentWindow.event; + else + e = window.event; + } + if (!e.srcElement) { + var el = e.target; + while (el != null && el.nodeType != 1) + el = el.parentNode; + e.srcElement = el; + } + if (typeof e.offsetX == "undefined") { + e.offsetX = e.layerX; + e.offsetY = e.layerY; + } + + return e; + }, + + getDocument: function (e) { + if (e.target) + return e.target.ownerDocument; + return e.srcElement.document; + }, + + getSlider: function (e) { + var el = e.target || e.srcElement; + while (el != null && el.slider == null) { + el = el.parentNode; + } + if (el) + return el.slider; + return null; + }, + + getLine: function (e) { + var el = e.target || e.srcElement; + while (el != null && el.className != "line") { + el = el.parentNode; + } + return el; + }, + + getHandle: function (e) { + var el = e.target || e.srcElement; + var re = /handle/; + while (el != null && !re.test(el.className)) { + el = el.parentNode; + } + return el; + }, + // end helpers + + onfocus: function (e) { + var s = this.slider; + s._focused = true; + s.handle.className = "handle hover"; + }, + + onblur: function (e) { + var s = this.slider + s._focused = false; + s.handle.className = "handle"; + }, + + onmouseover: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + var s = this.slider; + if (e.srcElement == s.handle) + s.handle.className = "handle hover"; + }, + + onmouseout: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + var s = this.slider; + if (e.srcElement == s.handle && !s._focused) + s.handle.className = "handle"; + }, + + onmousedown: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + var s = this.slider; + if (s.element.focus) + s.element.focus(); + + Slider._currentInstance = s; + var doc = s.document; + + if (doc.addEventListener) { + doc.addEventListener("mousemove", Slider.eventHandlers.onmousemove, true); + doc.addEventListener("mouseup", Slider.eventHandlers.onmouseup, true); + } + else if (doc.attachEvent) { + doc.attachEvent("onmousemove", Slider.eventHandlers.onmousemove); + doc.attachEvent("onmouseup", Slider.eventHandlers.onmouseup); + doc.attachEvent("onlosecapture", Slider.eventHandlers.onmouseup); + s.element.setCapture(); + } + + if (Slider.eventHandlers.getHandle(e)) { // start drag + Slider._sliderDragData = { + screenX: e.screenX, + screenY: e.screenY, + dx: e.screenX - s.handle.offsetLeft, + dy: e.screenY - s.handle.offsetTop, + startValue: s.getValue(), + slider: s + }; + } + else { + return; + var lineEl = Slider.eventHandlers.getLine(e); + s._mouseX = e.offsetX + (lineEl ? s.line.offsetLeft : 0); + s._mouseY = e.offsetY + (lineEl ? s.line.offsetTop : 0); + s._increasing = null; + s.ontimer(); + } + }, + + onmousemove: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + + if (Slider._sliderDragData) { // drag + var s = Slider._sliderDragData.slider; + + var boundSize = s.getMaximum() - s.getMinimum(); + var size, pos, reset; + + if (s._orientation == "horizontal") { + size = s.element.offsetWidth - s.handle.offsetWidth; + pos = e.screenX - Slider._sliderDragData.dx; + reset = Math.abs(e.screenY - Slider._sliderDragData.screenY) > 100; + } + else { + size = s.element.offsetHeight - s.handle.offsetHeight; + pos = s.element.offsetHeight - s.handle.offsetHeight - + (e.screenY - Slider._sliderDragData.dy); + reset = Math.abs(e.screenX - Slider._sliderDragData.screenX) > 100; + } + s.setValue(reset ? Slider._sliderDragData.startValue : + s.getMinimum() + boundSize * pos / size); + return false; + } + else { + return; + var s = Slider._currentInstance; + if (s != null) { + var lineEl = Slider.eventHandlers.getLine(e); + s._mouseX = e.offsetX + (lineEl ? s.line.offsetLeft : 0); + s._mouseY = e.offsetY + (lineEl ? s.line.offsetTop : 0); + } + } + + }, + + onmouseup: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + var s = Slider._currentInstance; + var doc = s.document; + if (doc.removeEventListener) { + doc.removeEventListener("mousemove", Slider.eventHandlers.onmousemove, true); + doc.removeEventListener("mouseup", Slider.eventHandlers.onmouseup, true); + } + else if (doc.detachEvent) { + doc.detachEvent("onmousemove", Slider.eventHandlers.onmousemove); + doc.detachEvent("onmouseup", Slider.eventHandlers.onmouseup); + doc.detachEvent("onlosecapture", Slider.eventHandlers.onmouseup); + s.element.releaseCapture(); + } + + if (Slider._sliderDragData) { // end drag + Slider._sliderDragData = null; + } + else { + return; + s._timer.stop(); + s._increasing = null; + } + Slider._currentInstance = null; + }, + + onkeydown: function (e) { + return; + e = Slider.eventHandlers.getEvent(e, this); + //var s = Slider.eventHandlers.getSlider(e); + var s = this.slider; + var kc = e.keyCode; + switch (kc) { + case 33: // page up + s.setValue(s.getValue() + s.getBlockIncrement()); + break; + case 34: // page down + s.setValue(s.getValue() - s.getBlockIncrement()); + break; + case 35: // end + s.setValue(s.getOrientation() == "horizontal" ? + s.getMaximum() : + s.getMinimum()); + break; + case 36: // home + s.setValue(s.getOrientation() == "horizontal" ? + s.getMinimum() : + s.getMaximum()); + break; + case 38: // up + case 39: // right + s.setValue(s.getValue() + s.getUnitIncrement()); + break; + + case 37: // left + case 40: // down + s.setValue(s.getValue() - s.getUnitIncrement()); + break; + } + + if (kc >= 33 && kc <= 40) { + return false; + } + }, + + onkeypress: function (e) { + return; + e = Slider.eventHandlers.getEvent(e, this); + var kc = e.keyCode; + if (kc >= 33 && kc <= 40) { + return false; + } + }, + + onmousewheel: function (e) { + return; + e = Slider.eventHandlers.getEvent(e, this); + var s = this.slider; + if (s._focused) { + s.setValue(s.getValue() + e.wheelDelta / 120 * s.getUnitIncrement()); + // windows inverts this on horizontal sliders. That does not + // make sense to me + return false; + } + } +}; + + + +Slider.prototype.classNameTag = "dynamic-slider-control", + +Slider.prototype.setValue = function (v) { + this._range.setValue(v); + this.input.value = this.getValue(); +}; + +Slider.prototype.getValue = function () { + return this._range.getValue(); +}; + +Slider.prototype.setMinimum = function (v) { + this._range.setMinimum(v); + this.input.value = this.getValue(); +}; + +Slider.prototype.getMinimum = function () { + return this._range.getMinimum(); +}; + +Slider.prototype.setMaximum = function (v) { + this._range.setMaximum(v); + this.input.value = this.getValue(); +}; + +Slider.prototype.getMaximum = function () { + return this._range.getMaximum(); +}; + +Slider.prototype.setUnitIncrement = function (v) { + this._unitIncrement = v; +}; + +Slider.prototype.getUnitIncrement = function () { + return this._unitIncrement; +}; + +Slider.prototype.setBlockIncrement = function (v) { + this._blockIncrement = v; +}; + +Slider.prototype.getBlockIncrement = function () { + return this._blockIncrement; +}; + +Slider.prototype.getOrientation = function () { + return this._orientation; +}; + +Slider.prototype.setOrientation = function (sOrientation) { + if (sOrientation != this._orientation) { + if (Slider.isSupported && this.element) { + // add class name tag to class name + this.element.className = this.element.className.replace(this._orientation, + sOrientation); + } + this._orientation = sOrientation; + this.recalculate(); + + } +}; + +Slider.prototype.recalculate = function() { + if (!Slider.isSupported || !this.element) return; + + var w = this.element.offsetWidth; + var h = this.element.offsetHeight; + var hw = this.handle.offsetWidth; + var hh = this.handle.offsetHeight; + var lw = this.line.offsetWidth; + var lh = this.line.offsetHeight; + + // this assumes a border-box layout + + if (this._orientation == "horizontal") { + this.handle.style.left = (w - hw) * (this.getValue() - this.getMinimum()) / + (this.getMaximum() - this.getMinimum()) + "px"; + this.handle.style.top = (h - hh) / 2 + "px"; + + this.line.style.top = (h - lh) / 2 + "px"; + this.line.style.left = hw / 2 + "px"; + //this.line.style.right = hw / 2 + "px"; + this.line.style.width = Math.max(0, w - hw - 2)+ "px"; + this.line.firstChild.style.width = Math.max(0, w - hw - 4)+ "px"; + } + else { + this.handle.style.left = (w - hw) / 2 + "px"; + this.handle.style.top = h - hh - (h - hh) * (this.getValue() - this.getMinimum()) / + (this.getMaximum() - this.getMinimum()) + "px"; + + this.line.style.left = (w - lw) / 2 + "px"; + this.line.style.top = hh / 2 + "px"; + this.line.style.height = Math.max(0, h - hh - 2) + "px"; //hard coded border width + //this.line.style.bottom = hh / 2 + "px"; + this.line.firstChild.style.height = Math.max(0, h - hh - 4) + "px"; //hard coded border width + } +}; + +Slider.prototype.ontimer = function () { + var hw = this.handle.offsetWidth; + var hh = this.handle.offsetHeight; + var hl = this.handle.offsetLeft; + var ht = this.handle.offsetTop; + + if (this._orientation == "horizontal") { + if (this._mouseX > hl + hw && + (this._increasing == null || this._increasing)) { + this.setValue(this.getValue() + this.getBlockIncrement()); + this._increasing = true; + } + else if (this._mouseX < hl && + (this._increasing == null || !this._increasing)) { + this.setValue(this.getValue() - this.getBlockIncrement()); + this._increasing = false; + } + } + else { + if (this._mouseY > ht + hh && + (this._increasing == null || !this._increasing)) { + this.setValue(this.getValue() - this.getBlockIncrement()); + this._increasing = false; + } + else if (this._mouseY < ht && + (this._increasing == null || this._increasing)) { + this.setValue(this.getValue() + this.getBlockIncrement()); + this._increasing = true; + } + } + + this._timer.start(); +}; +/*----------------------------------------------------------------------------\ +| Timer Class | +|-----------------------------------------------------------------------------| +| Created by Erik Arvidsson | +| (http://webfx.eae.net/contact.html#erik) | +| For WebFX (http://webfx.eae.net/) | +|-----------------------------------------------------------------------------| +| Object Oriented Encapsulation of setTimeout fires ontimer when the timer | +| is triggered. Does not work in IE 5.00 | +|-----------------------------------------------------------------------------| +| Copyright (c) 2002, 2006 Erik Arvidsson | +|-----------------------------------------------------------------------------| +| Licensed under the Apache License, Version 2.0 (the "License"); you may not | +| use this file except in compliance with the License. You may obtain a copy | +| of the License at http://www.apache.org/licenses/LICENSE-2.0 | +| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | +| Unless required by applicable law or agreed to in writing, software | +| distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | +| WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | +| License for the specific language governing permissions and limitations | +| under the License. | +|-----------------------------------------------------------------------------| +| 2002-10-14 | Original version released | +| 2006-05-28 | Changed license to Apache Software License 2.0. | +|-----------------------------------------------------------------------------| +| Created 2002-10-14 | All changes are in the log above. | Updated 2006-05-28 | +\----------------------------------------------------------------------------*/ + +function Timer(nPauseTime) { + this._pauseTime = typeof nPauseTime == "undefined" ? 1000 : nPauseTime; + this._timer = null; + this._isStarted = false; +} + +Timer.prototype.start = function () { + if (this.isStarted()) + this.stop(); + var oThis = this; + this._timer = window.setTimeout(function () { + if (typeof oThis.ontimer == "function") + oThis.ontimer(); + }, this._pauseTime); + this._isStarted = false; +}; + +Timer.prototype.stop = function () { + if (this._timer != null) + window.clearTimeout(this._timer); + this._isStarted = false; +}; + +Timer.prototype.isStarted = function () { + return this._isStarted; +}; + +Timer.prototype.getPauseTime = function () { + return this._pauseTime; +}; + +Timer.prototype.setPauseTime = function (nPauseTime) { + this._pauseTime = nPauseTime; +}; +/* +* SimileTimeplotModify.js +* +* Copyright (c) 2012, Stefan Jänicke. All rights reserved. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; either +* version 3 of the License, or (at your option) any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +* MA 02110-1301 USA +*/ + +/** + * Modified (overwritten) Simile Timeplot Functions + * @author Stefan Jänicke (stjaenicke@informatik.uni-leipzig.de) + * @release 1.0 + * @release date: 2012-07-25 + * @version date: 2012-07-25 + */ +SimileAjax.DateTime.MILLISECOND = 0; +SimileAjax.DateTime.SECOND = 1; +SimileAjax.DateTime.MINUTE = 2; +SimileAjax.DateTime.HOUR = 3; +SimileAjax.DateTime.DAY = 4; +SimileAjax.DateTime.WEEK = 5; +SimileAjax.DateTime.MONTH = 6; +SimileAjax.DateTime.QUARTER = 7; +SimileAjax.DateTime.SEMESTER = 8; +SimileAjax.DateTime.YEAR = 9; +SimileAjax.DateTime.LUSTRUM = 10; +SimileAjax.DateTime.DECADE = 11; +SimileAjax.DateTime.HALFCENTURY = 12; +SimileAjax.DateTime.CENTURY = 13; +SimileAjax.DateTime.HALFMILLENNIUM = 14; +SimileAjax.DateTime.MILLENNIUM = 15; + +SimileAjax.DateTime.Strings = { + "en" : ["milliseconds", "seconds", "minutes", "hours", "days", "weeks", "months", "quarters", "semester", "years", "5 years", "decades", "50 years", "centuries", "500 years", "millenniums"], + "de" : ["Millisekunden", "Sekunden", "Minuten", "Stunden", "Tage", "Wochen", "Monate", "Quartale", "Semester", "Jahre", "5 Jahre", "Dekaden", "50 Jahre", "Jahrhunderte", "500 Jahre", "Jahrtausende"] +}; + +SimileAjax.DateTime.gregorianUnitLengths = []; +(function() { + var d = SimileAjax.DateTime; + var a = d.gregorianUnitLengths; + + a[d.MILLISECOND] = 1; + a[d.SECOND] = 1000; + a[d.MINUTE] = a[d.SECOND] * 60; + a[d.HOUR] = a[d.MINUTE] * 60; + a[d.DAY] = a[d.HOUR] * 24; + a[d.WEEK] = a[d.DAY] * 7; + a[d.MONTH] = a[d.DAY] * 31; + a[d.QUARTER] = a[d.DAY] * 91; + a[d.SEMESTER] = a[d.DAY] * 182; + a[d.YEAR] = a[d.DAY] * 365; + a[d.LUSTRUM] = a[d.YEAR] * 5; + a[d.DECADE] = a[d.YEAR] * 10; + a[d.HALFCENTURY] = a[d.YEAR] * 50; + a[d.CENTURY] = a[d.YEAR] * 100; + a[d.HALFMILLENNIUM] = a[d.YEAR] * 500; + a[d.MILLENNIUM] = a[d.YEAR] * 1000; +})(); + +SimileAjax.DateTime.roundDownToInterval = function(date, intervalUnit, timeZone, multiple, firstDayOfWeek) { + timeZone = ( typeof timeZone == 'undefined') ? 0 : timeZone; + var timeShift = timeZone * SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR]; + + var date2 = new Date(date.getTime() + timeShift); + var clearInDay = function(d) { + d.setUTCMilliseconds(0); + d.setUTCSeconds(0); + d.setUTCMinutes(0); + d.setUTCHours(0); + }; + var clearInWeek = function(d) { + clearInDay(d); + var day = d.getDay(); + var millies = d.getTime(); + millies -= day * 1000 * 60 * 60 * 24; + d.setTime(millies); + }; + var clearInYear = function(d) { + clearInDay(d); + d.setUTCDate(1); + d.setUTCMonth(0); + }; + + switch (intervalUnit) { + case SimileAjax.DateTime.MILLISECOND: + var x = date2.getUTCMilliseconds(); + date2.setUTCMilliseconds(x - (x % multiple)); + break; + case SimileAjax.DateTime.SECOND: + date2.setUTCMilliseconds(0); + var x = date2.getUTCSeconds(); + date2.setUTCSeconds(x - (x % multiple)); + break; + case SimileAjax.DateTime.MINUTE: + date2.setUTCMilliseconds(0); + date2.setUTCSeconds(0); + var x = date2.getUTCMinutes(); + date2.setTime(date2.getTime() - (x % multiple) * SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.MINUTE]); + break; + case SimileAjax.DateTime.HOUR: + date2.setUTCMilliseconds(0); + date2.setUTCSeconds(0); + date2.setUTCMinutes(0); + var x = date2.getUTCHours(); + date2.setUTCHours(x - (x % multiple)); + break; + case SimileAjax.DateTime.DAY: + clearInDay(date2); + break; + case SimileAjax.DateTime.WEEK: + clearInWeek(date2); + break; + case SimileAjax.DateTime.MONTH: + clearInDay(date2); + date2.setUTCDate(1); + var x = date2.getUTCMonth(); + date2.setUTCMonth(x - (x % multiple)); + break; + case SimileAjax.DateTime.QUARTER: + clearInDay(date2); + date2.setUTCDate(1); + var x = date2.getUTCMonth(); + date2.setUTCMonth(x - (x % 3)); + break; + case SimileAjax.DateTime.SEMESTER: + clearInDay(date2); + date2.setUTCDate(1); + var x = date2.getUTCMonth(); + date2.setUTCMonth(x - (x % 6)); + break; + case SimileAjax.DateTime.YEAR: + clearInYear(date2); + var x = date2.getUTCFullYear(); + date2.setUTCFullYear(x - (x % multiple)); + break; + case SimileAjax.DateTime.LUSTRUM: + clearInYear(date2); + date2.setUTCFullYear(Math.floor(date2.getUTCFullYear() / 5) * 5); + break; + case SimileAjax.DateTime.DECADE: + clearInYear(date2); + date2.setUTCFullYear(Math.floor(date2.getUTCFullYear() / 10) * 10); + break; + case SimileAjax.DateTime.HALFCENTURY: + clearInYear(date2); + date2.setUTCFullYear(Math.floor(date2.getUTCFullYear() / 50) * 50); + break; + case SimileAjax.DateTime.CENTURY: + clearInYear(date2); + date2.setUTCFullYear(Math.floor(date2.getUTCFullYear() / 100) * 100); + break; + case SimileAjax.DateTime.HALFMILLENNIUM: + clearInYear(date2); + date2.setUTCFullYear(Math.floor(date2.getUTCFullYear() / 500) * 500); + break; + case SimileAjax.DateTime.MILLENNIUM: + clearInYear(date2); + date2.setUTCFullYear(Math.floor(date2.getUTCFullYear() / 1000) * 1000); + break; + } + + date.setTime(date2.getTime() - timeShift); +}; + +SimileAjax.DateTime.incrementByInterval = function(date, intervalUnit, timeZone) { + timeZone = ( typeof timeZone == 'undefined') ? 0 : timeZone; + + var timeShift = timeZone * SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR]; + + var date2 = new Date(date.getTime() + timeShift); + + switch (intervalUnit) { + case SimileAjax.DateTime.MILLISECOND: + date2.setTime(date2.getTime() + 1) + break; + case SimileAjax.DateTime.SECOND: + date2.setTime(date2.getTime() + 1000); + break; + case SimileAjax.DateTime.MINUTE: + date2.setTime(date2.getTime() + SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.MINUTE]); + break; + case SimileAjax.DateTime.HOUR: + date2.setTime(date2.getTime() + SimileAjax.DateTime.gregorianUnitLengths[SimileAjax.DateTime.HOUR]); + break; + case SimileAjax.DateTime.DAY: + date2.setUTCDate(date2.getUTCDate() + 1); + break; + case SimileAjax.DateTime.WEEK: + date2.setUTCDate(date2.getUTCDate() + 7); + break; + case SimileAjax.DateTime.MONTH: + date2.setUTCMonth(date2.getUTCMonth() + 1); + break; + case SimileAjax.DateTime.QUARTER: + date2.setUTCMonth(date2.getUTCMonth() + 3); + break; + case SimileAjax.DateTime.SEMESTER: + date2.setUTCMonth(date2.getUTCMonth() + 6); + break; + case SimileAjax.DateTime.YEAR: + date2.setUTCFullYear(date2.getUTCFullYear() + 1); + break; + case SimileAjax.DateTime.LUSTRUM: + date2.setUTCFullYear(date2.getUTCFullYear() + 5); + break; + case SimileAjax.DateTime.DECADE: + date2.setUTCFullYear(date2.getUTCFullYear() + 10); + break; + case SimileAjax.DateTime.HALFCENTURY: + date2.setUTCFullYear(date2.getUTCFullYear() + 50); + break; + case SimileAjax.DateTime.CENTURY: + date2.setUTCFullYear(date2.getUTCFullYear() + 100); + break; + case SimileAjax.DateTime.HALFMILLENNIUM: + date2.setUTCFullYear(date2.getUTCFullYear() + 500); + break; + case SimileAjax.DateTime.MILLENNIUM: + date2.setUTCFullYear(date2.getUTCFullYear() + 1000); + break; + } + date.setTime(date2.getTime() - timeShift); +}; + +SimileAjax.DateTime.getTimeLabel = function(unit, t) { + var time = SimileAjax.DateTime; + var second = t.getUTCSeconds(); + var minute = t.getUTCMinutes(); + var hour = t.getUTCHours(); + var day = t.getUTCDate(); + var month = t.getUTCMonth() + 1; + var year = t.getUTCFullYear(); + switch(unit) { + case time.SECOND: + return hour + ":" + ((minute < 10) ? "0" : "") + minute + ":" + ((second < 10) ? "0" : "") + second; + case time.MINUTE: + return hour + ":" + ((minute < 10) ? "0" : "") + minute; + case time.HOUR: + return hour + ":00"; + case time.DAY: + case time.WEEK: + case time.MONTH: + case time.QUARTER: + case time.SEMESTER: + return year + "-" + ((month < 10) ? "0" : "") + month + "-" + ((day < 10) ? "0" : "") + day; + case time.YEAR: + case time.LUSTRUM: + case time.DECADE: + case time.HALFCENTURY: + case time.CENTURY: + case time.HALFMILLENNIUM: + case time.MILLENNIUM: + return year; + } +}; + +SimileAjax.DateTime.getTimeString = function(unit, t) { + var time = SimileAjax.DateTime; + switch(unit) { + case time.MILLISECOND: + case time.SECOND: + case time.MINUTE: + case time.HOUR: + var m = t.getUTCMonth() + 1; + var d = t.getUTCDate(); + var h = t.getUTCHours(); + var min = t.getUTCMinutes(); + var s = t.getUTCSeconds(); + return t.getUTCFullYear() + "-" + ((m < 10) ? "0" : "") + m + "-" + ((d < 10) ? "0" : "") + d + " " + ((h < 10) ? "0" : "") + h + ":" + ((min < 10) ? "0" : "") + min + ":" + ((s < 10) ? "0" : "") + s; + case time.DAY: + case time.WEEK: + case time.MONTH: + case time.QUARTER: + case time.SEMESTER: + var m = t.getUTCMonth() + 1; + var d = t.getUTCDate(); + return t.getUTCFullYear() + "-" + ((m < 10) ? "0" : "") + m + "-" + ((d < 10) ? "0" : "") + d; + case time.YEAR: + case time.LUSTRUM: + case time.DECADE: + case time.HALFCENTURY: + case time.CENTURY: + case time.HALFMILLENNIUM: + case time.MILLENNIUM: + return t.getUTCFullYear(); + } +}; + +Timeplot.DefaultEventSource.prototype.loadData = function(events) { + + this._events.maxValues = new Array(); + this._events.removeAll(); + for (var i = 0; i < events.length; i++) { + var event = events[i]; + var numericEvent = new Timeplot.DefaultEventSource.NumericEvent(event.date, event.value); + this._events.add(numericEvent); + } + this._fire("onAddMany", []); + +}; + +Timeplot._Impl.prototype.resetPlots = function(plotInfos) { + + this._plotInfos = plotInfos; + this._painters = { + background : [], + foreground : [] + }; + this._painter = null; + + var timeplot = this; + var painter = { + onAddMany : function() { + timeplot.update(); + }, + onClear : function() { + timeplot.update(); + } + } + + for ( i = this._plots.length; i > 0; i--) { + this._plots[i - 1].opacityPlot.removeChild(this._plots[i - 1]._opacityCanvas); + this._plots[i - 1].dispose(); + if (document.addEventListener) { + this._containerDiv.removeEventListener("mousemove", this._plots[i - 1].mousemove, false); + this._containerDiv.removeEventListener("mouseover", this._plots[i - 1].mouseover, false); + } else if (document.attachEvent) { + this._containerDiv.detachEvent("onmousemove", this._plots[i - 1].mousemove); + this._containerDiv.detachEvent("onmouseover", this._plots[i - 1].mouseover); + } + delete this._plots[i - 1]; + } + + this._plots = []; + + for ( i = 0; i < this._plotInfos.length; i++) { + var plot = new Timeplot.Plot(this, this._plotInfos[i]); + var dataSource = plot.getDataSource(); + if (dataSource) { + dataSource.addListener(painter); + } + this.addPainter("background", { + context : plot.getTimeGeometry(), + action : plot.getTimeGeometry().paint + }); + this.addPainter("background", { + context : plot.getValueGeometry(), + action : plot.getValueGeometry().paint + }); + this.addPainter("foreground", { + context : plot, + action : plot.paint + }); + this._plots.push(plot); + plot.initialize(); + } + +}; + +Timeplot.DefaultTimeGeometry.prototype._calculateGrid = function() { + var grid = []; + + var time = SimileAjax.DateTime; + var u = this._unit; + var p = this._period; + + if (p == 0) + return grid; + + var periodUnit = -1; + do { + periodUnit++; + } while (time.gregorianUnitLengths[periodUnit] < p); + + periodUnit--; + + var unit; + if (periodUnit < time.DAY) { + unit = time.HOUR; + } else if (periodUnit < time.WEEK) { + unit = time.DAY; + } else if (periodUnit < time.QUARTER) { + unit = time.WEEK; + } else if (periodUnit < time.YEAR) { + unit = time.MONTH; + } else if (periodUnit < time.DECADE) { + unit = time.YEAR; + } else if (periodUnit < time.CENTURY) { + unit = time.DECADE; + } else { + unit = time.CENTURY; + } + + if (unit < this._granularity) { + unit = this._granularity; + } + + var t = u.cloneValue(this._earliestDate); + var timeZone; + do { + time.roundDownToInterval(t, unit, timeZone, 1, 0); + var x = this.toScreen(u.toNumber(t)); + var l = SimileAjax.DateTime.getTimeLabel(unit, t); + if (x > 0) { + grid.push({ + x : x, + label : l + }); + } + time.incrementByInterval(t, unit, timeZone); + } while (t.getTime() < this._latestDate.getTime()); + + return grid; + +}; + +//modified function to prevent from drawing left and right axis +Timeplot.DefaultValueGeometry.prototype.paint = function() { + if (this._timeplot) { + var ctx = this._canvas.getContext('2d'); + + ctx.lineJoin = 'miter'; + + // paint grid + if (this._gridColor) { + var gridGradient = ctx.createLinearGradient(0, 0, 0, this._canvas.height); + gridGradient.addColorStop(0, this._gridColor.toHexString()); + gridGradient.addColorStop(0.3, this._gridColor.toHexString()); + gridGradient.addColorStop(1, "rgba(255,255,255,0.5)"); + + ctx.lineWidth = this._gridLineWidth; + ctx.strokeStyle = gridGradient; + + for (var i = 0; i < this._grid.length; i++) { + var tick = this._grid[i]; + var y = Math.floor(tick.y) + 0.5; + if ( typeof tick.label != "undefined") { + if (this._axisLabelsPlacement == "left") { + var div = this._timeplot.putText(this._id + "-" + i, tick.label, "timeplot-grid-label", { + left : 4, + bottom : y + 2, + color : this._gridColor.toHexString(), + visibility : "hidden" + }); + this._labels.push(div); + } else if (this._axisLabelsPlacement == "right") { + var div = this._timeplot.putText(this._id + "-" + i, tick.label, "timeplot-grid-label", { + right : 4, + bottom : y + 2, + color : this._gridColor.toHexString(), + visibility : "hidden" + }); + this._labels.push(div); + } + if (y + div.clientHeight < this._canvas.height + 10) { + div.style.visibility = "visible"; + // avoid the labels that would overflow + } + } + + // draw grid + ctx.beginPath(); + if (this._gridType == "long" || tick.label == 0) { + ctx.moveTo(0, y); + ctx.lineTo(this._canvas.width, y); + } else if (this._gridType == "short") { + if (this._axisLabelsPlacement == "left") { + ctx.moveTo(0, y); + ctx.lineTo(this._gridShortSize, y); + } else if (this._axisLabelsPlacement == "right") { + ctx.moveTo(this._canvas.width, y); + ctx.lineTo(this._canvas.width - this._gridShortSize, y); + } + } + ctx.stroke(); + } + } + } +}; + +//modified function to prevent from drawing hidden labels +Timeplot.DefaultTimeGeometry.prototype.paint = function() { + if (this._canvas) { + var unit = this._unit; + var ctx = this._canvas.getContext('2d'); + + var gradient = ctx.createLinearGradient(0, 0, 0, this._canvas.height); + + ctx.strokeStyle = gradient; + ctx.lineWidth = this._gridLineWidth; + ctx.lineJoin = 'miter'; + + // paint grid + if (this._gridColor) { + gradient.addColorStop(0, this._gridColor.toString()); + gradient.addColorStop(1, "rgba(255,255,255,0.9)"); + for (var i = 0; i < this._grid.length; i++) { + var tick = this._grid[i]; + var x = Math.floor(tick.x) + 0.5; + if (this._axisLabelsPlacement == "top") { + var div = this._timeplot.putText(this._id + "-" + i, tick.label, "timeplot-grid-label", { + left : x + 4, + top : 2, + visibility : "hidden" + }); + this._labels.push(div); + } else if (this._axisLabelsPlacement == "bottom") { + var div = this._timeplot.putText(this._id + "-" + i, tick.label, "timeplot-grid-label", { + left : x + 4, + bottom : 2, + visibility : "hidden" + }); + this._labels.push(div); + } + if (!this._hideLabels && x + div.clientWidth < this._canvas.width + 10) { + div.style.visibility = "visible"; + // avoid the labels that would overflow + } + + // draw separator + ctx.beginPath(); + ctx.moveTo(x, 0); + ctx.lineTo(x, this._canvas.height); + ctx.stroke(); + } + } + } +}; + +Timeplot.Plot.prototype.getSliceNumber = function() { + return this._dataSource.getData().times.length; +}; + +Timeplot.Plot.prototype.getSliceId = function(time) { + var data = this._dataSource.getData(); + for (var k = 0; k < data.times.length; k++) { + if (data.times[k].getTime() == time.getTime()) { + return k; + } + } + return null; +}; + +Timeplot.Plot.prototype.getSliceTime = function(index) { + var data = this._dataSource.getData(); + if (0 <= index && index < data.times.length) { + return data.times[index]; + } + return null; +}; + +Timeplot.Plot.prototype.initialize = function() { + if (this._dataSource && this._dataSource.getValue) { + this._timeFlag = this._timeplot.putDiv("timeflag", "timeplot-timeflag"); + this._valueFlag = this._timeplot.putDiv(this._id + "valueflag", "timeplot-valueflag"); + this._pinValueFlag = this._timeplot.putDiv(this._id + "pinvalueflag", "timeplot-valueflag"); + var pin = document.getElementById(this._timeplot._id + "-" + this._id + "pinvalueflag"); + if (SimileAjax.Platform.browser.isIE && SimileAjax.Platform.browser.majorVersion < 9) { + var cssText = "border: 1px solid " + this._plotInfo.lineColor.toString() + "; background-color: " + this._plotInfo.fillColor.toString() + ";"; + cssText = cssText.replace(/rgba\((\s*\d{1,3}),(\s*\d{1,3}),(\s*\d{1,3}),(\s*\d{1}|\s*\d{1}\.\d+)\)/g, 'rgb($1,$2,$3)'); + pin.style.setAttribute("cssText", cssText); + } else { + pin.style.border = "1px solid " + this._plotInfo.lineColor.toString(); + pin.style.backgroundColor = this._plotInfo.fillColor.toString(); + } + this._valueFlagLineLeft = this._timeplot.putDiv(this._id + "valueflagLineLeft", "timeplot-valueflag-line"); + this._valueFlagLineRight = this._timeplot.putDiv(this._id + "valueflagLineRight", "timeplot-valueflag-line"); + this._pinValueFlagLineLeft = this._timeplot.putDiv(this._id + "pinValueflagLineLeft", "timeplot-valueflag-line"); + this._pinValueFlagLineRight = this._timeplot.putDiv(this._id + "pinValueflagLineRight", "timeplot-valueflag-line"); + if (!this._valueFlagLineLeft.firstChild) { + this._valueFlagLineLeft.appendChild(SimileAjax.Graphics.createTranslucentImage(Timeplot.urlPrefix + "images/line_left.png")); + this._valueFlagLineRight.appendChild(SimileAjax.Graphics.createTranslucentImage(Timeplot.urlPrefix + "images/line_right.png")); + } + if (!this._pinValueFlagLineLeft.firstChild) { + this._pinValueFlagLineLeft.appendChild(SimileAjax.Graphics.createTranslucentImage(GeoTemConfig.path + "plot-line_left.png")); + this._pinValueFlagLineRight.appendChild(SimileAjax.Graphics.createTranslucentImage(GeoTemConfig.path + "plot-line_right.png")); + } + this._valueFlagPole = this._timeplot.putDiv(this._id + "valuepole", "timeplot-valueflag-pole"); + + var opacity = this._plotInfo.valuesOpacity; + + SimileAjax.Graphics.setOpacity(this._timeFlag, opacity); + SimileAjax.Graphics.setOpacity(this._valueFlag, opacity); + SimileAjax.Graphics.setOpacity(this._pinValueFlag, opacity); + SimileAjax.Graphics.setOpacity(this._valueFlagLineLeft, opacity); + SimileAjax.Graphics.setOpacity(this._valueFlagLineRight, opacity); + SimileAjax.Graphics.setOpacity(this._pinValueFlagLineLeft, opacity); + SimileAjax.Graphics.setOpacity(this._pinValueFlagLineRight, opacity); + SimileAjax.Graphics.setOpacity(this._valueFlagPole, opacity); + + var plot = this; + + var mouseOverHandler = function(elmt, evt, target) { + plot._timeFlag.style.visibility = "visible"; + plot._valueFlag.style.visibility = "visible"; + plot._pinValueFlag.style.visibility = "visible"; + plot._valueFlagLineLeft.style.visibility = "visible"; + plot._valueFlagLineRight.style.visibility = "visible"; + plot._pinValueFlagLineLeft.style.visibility = "visible"; + plot._pinValueFlagLineRight.style.visibility = "visible"; + plot._valueFlagPole.style.visibility = "visible"; + if (plot._plotInfo.showValues) { + plot._valueFlag.style.display = "block"; + mouseMoveHandler(elmt, evt, target); + } + } + var mouseOutHandler = function(elmt, evt, target) { + plot._timeFlag.style.visibility = "hidden"; + plot._valueFlag.style.visibility = "hidden"; + plot._pinValueFlag.style.visibility = "hidden"; + plot._valueFlagLineLeft.style.visibility = "hidden"; + plot._valueFlagLineRight.style.visibility = "hidden"; + plot._pinValueFlagLineLeft.style.visibility = "hidden"; + plot._pinValueFlagLineRight.style.visibility = "hidden"; + plot._valueFlagPole.style.visibility = "hidden"; + } + var day = 24 * 60 * 60 * 1000; + var month = 30 * day; + + var mouseMoveHandler = function(elmt, evt, target) { + if ( typeof SimileAjax != "undefined" && plot._plotInfo.showValues) { + var c = plot._canvas; + var x = Math.round(SimileAjax.DOM.getEventRelativeCoordinates(evt, plot._canvas).x); + if (x > c.width) + x = c.width; + if (isNaN(x) || x < 0) + x = 0; + var t = plot._timeGeometry.fromScreen(x); + if (t == 0) {// something is wrong + plot._valueFlag.style.display = "none"; + return; + } + + var v, validTime; + if (plot.style == 'bars') { + var time1 = plot._dataSource.getClosestValidTime(t); + var x1 = plot._timeGeometry.toScreen(time1); + var index_x1 = plot.getSliceId(time1); + var time2; + if (x < x1 && index_x1 > 0 || x >= x1 && index_x1 == plot.getSliceNumber() - 1) { + time2 = plot.getSliceTime(index_x1 - 1); + } else { + time2 = plot.getSliceTime(index_x1 + 1); + } + var x2 = plot._timeGeometry.toScreen(time2); + + var t1 = new Date(time1); + var t2 = new Date(time2); + var unit = plot._timeGeometry.extendedDataSource.unit; + var l; + if (x1 < x2) { + l = SimileAjax.DateTime.getTimeLabel(unit, t1) + '-' + SimileAjax.DateTime.getTimeLabel(unit, t2); + validTime = time1; + } else { + l = SimileAjax.DateTime.getTimeLabel(unit, t2) + '-' + SimileAjax.DateTime.getTimeLabel(unit, t1); + validTime = time2; + } + v = plot._dataSource.getValue(validTime); + if (plot._plotInfo.roundValues) + v = Math.round(v); + plot._valueFlag.innerHTML = v; + plot._timeFlag.innerHTML = l; + x = (x1 + x2 ) / 2; + } else if (plot.style == 'graph') { + validTime = plot._dataSource.getClosestValidTime(t); + x = plot._timeGeometry.toScreen(validTime); + v = plot._dataSource.getValue(validTime); + if (plot._plotInfo.roundValues) + v = Math.round(v); + plot._valueFlag.innerHTML = v; + var t = new Date(validTime); + var unit = plot._timeGeometry.extendedDataSource.unit; + var l = SimileAjax.DateTime.getTimeLabel(unit, t); + plot._timeFlag.innerHTML = l; + } + + var tw = plot._timeFlag.clientWidth; + var th = plot._timeFlag.clientHeight; + var tdw = Math.round(tw / 2); + var vw = plot._valueFlag.clientWidth; + var vh = plot._valueFlag.clientHeight; + var y = plot._valueGeometry.toScreen(v); + + if (x + tdw > c.width) { + var tx = c.width - tdw; + } else if (x - tdw < 0) { + var tx = tdw; + } else { + var tx = x; + } + + plot._timeplot.placeDiv(plot._valueFlagPole, { + left : x, + top : 0, + height : c.height, + display : "block" + }); + plot._timeplot.placeDiv(plot._timeFlag, { + left : tx - tdw, + top : 0, + display : "block" + }); + + var sliceId = plot.getSliceId(validTime); + var pvw, pvh = 0, pinY; + if (plot.pins[sliceId].count > 0) { + plot._pinValueFlag.innerHTML = plot.pins[sliceId].count; + pvw = plot._pinValueFlag.clientWidth; + pvh = plot._pinValueFlag.clientHeight; + pinY = plot.pins[sliceId].height; + } + var rightOverflow = x + vw + 14 > c.width; + var leftOverflow = false; + if (plot.pins[sliceId].count > 0) { + if (x - pvw - 14 < 0) { + leftOverflow = true; + } + } + var shiftV, shiftP; + if (plot.pins[sliceId].count > 0) { + var cut = y - pinY < vh / 2 + pvh / 2; + if ((leftOverflow || rightOverflow ) && cut) { + shiftV = 0; + shiftP = pvh; + } else { + shiftV = vh / 2; + shiftP = pvh / 2; + } + } else { + shiftV = vh / 2; + } + + if (x + vw + 14 > c.width && y + vh / 2 + 4 > c.height) { + plot._valueFlagLineLeft.style.display = "none"; + plot._timeplot.placeDiv(plot._valueFlagLineRight, { + left : x - 14, + bottom : y - 14, + display : "block" + }); + plot._timeplot.placeDiv(plot._valueFlag, { + left : x - vw - 13, + bottom : y - 13 - shiftV, + display : "block" + }); + } else if (x + vw + 14 > c.width && y + vh / 2 + 4 < c.height) { + plot._valueFlagLineRight.style.display = "none"; + plot._timeplot.placeDiv(plot._valueFlagLineLeft, { + left : x - 14, + bottom : y, + display : "block" + }); + plot._timeplot.placeDiv(plot._valueFlag, { + left : x - vw - 13, + bottom : y + 13 - shiftV, + display : "block" + }); + } else if (x + vw + 14 < c.width && y + vh / 2 + 4 > c.height) { + plot._valueFlagLineRight.style.display = "none"; + plot._timeplot.placeDiv(plot._valueFlagLineLeft, { + left : x, + bottom : y - 13, + display : "block" + }); + plot._timeplot.placeDiv(plot._valueFlag, { + left : x + 13, + bottom : y - 13 - shiftV, + display : "block" + }); + } else { + plot._valueFlagLineLeft.style.display = "none"; + plot._timeplot.placeDiv(plot._valueFlagLineRight, { + left : x, + bottom : y, + display : "block" + }); + plot._timeplot.placeDiv(plot._valueFlag, { + left : x + 13, + bottom : y + 13 - shiftV, + display : "block" + }); + } + + if (plot.pins[sliceId].count > 0) { + if (x - pvw - 14 < 0 && pinY + pvh + 4 > c.height) { + plot._pinValueFlagLineLeft.style.display = "none"; + plot._timeplot.placeDiv(plot._pinValueFlagLineRight, { + left : x, + bottom : pinY, + display : "block" + }); + plot._timeplot.placeDiv(plot._pinValueFlag, { + left : x + 13, + bottom : pinY - 13 - shiftP, + display : "block" + }); + } else if (x - pvw - 14 < 0 && pinY + pvh + 4 < c.height) { + plot._pinValueFlagLineLeft.style.display = "none"; + plot._timeplot.placeDiv(plot._pinValueFlagLineRight, { + left : x, + bottom : pinY, + display : "block" + }); + plot._timeplot.placeDiv(plot._pinValueFlag, { + left : x + 13, + bottom : pinY + 13 - shiftP, + display : "block" + }); + } else if (x - pvw - 14 >= 0 && pinY + pvh + 4 > c.height) { + plot._pinValueFlagLineLeft.style.display = "none"; + plot._timeplot.placeDiv(plot._pinValueFlagLineRight, { + left : x - 13, + bottom : pinY - 13, + display : "block" + }); + plot._timeplot.placeDiv(plot._pinValueFlag, { + left : x - 15 - pvw, + bottom : pinY - 13 - shiftP, + display : "block" + }); + } else { + plot._pinValueFlagLineRight.style.display = "none"; + plot._timeplot.placeDiv(plot._pinValueFlagLineLeft, { + left : x - 14, + bottom : pinY, + display : "block" + }); + plot._timeplot.placeDiv(plot._pinValueFlag, { + left : x - pvw - 15, + bottom : pinY + 13 - shiftP, + display : "block" + }); + } + } else { + plot._pinValueFlagLineLeft.style.display = "none"; + plot._pinValueFlagLineRight.style.display = "none"; + plot._pinValueFlag.style.display = "none"; + } + + } + + } + var timeplotElement = this._timeplot.getElement(); + this.mouseover = SimileAjax.DOM.registerPlotEvent(timeplotElement, "mouseover", mouseOverHandler); + this.mouseout = SimileAjax.DOM.registerPlotEvent(timeplotElement, "mouseout", mouseOutHandler); + this.mousemove = SimileAjax.DOM.registerPlotEvent(timeplotElement, "mousemove", mouseMoveHandler); + + this.opacityPlot = this._timeplot.putDiv("opacityPlot" + this._timeplot._plots.length, "opacityPlot"); + SimileAjax.Graphics.setOpacity(this.opacityPlot, 50); + // this.opacityPlot.style.zIndex = this._timeplot._plots.length; + this._timeplot.placeDiv(this.opacityPlot, { + left : 0, + bottom : 0, + width : this._canvas.width, + height : this._canvas.height + }); + this._opacityCanvas = document.createElement("canvas"); + this.opacityPlot.appendChild(this._opacityCanvas); + if (!this._opacityCanvas.getContext && G_vmlCanvasManager) + this._opacityCanvas = G_vmlCanvasManager.initElement(this._opacityCanvas); + this._opacityCanvas.width = this._canvas.width; + this._opacityCanvas.height = this._canvas.height; + this._opacityCanvas.style.position = 'absolute'; + this._opacityCanvas.style.left = '0px'; + this.opacityPlot.style.visibility = "hidden"; + + } +}; + +SimileAjax.DOM.registerPlotEvent = function(elmt, eventName, handler) { + var handler2 = function(evt) { + evt = (evt) ? evt : ((event) ? event : null); + if (evt) { + var target = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); + if (target) { + target = (target.nodeType == 1 || target.nodeType == 9) ? target : target.parentNode; + } + + return handler(elmt, evt, target); + } + return true; + } + if (SimileAjax.Platform.browser.isIE) { + elmt.attachEvent("on" + eventName, handler2); + } else { + elmt.addEventListener(eventName, handler2, false); + } + + return handler2; +}; + +SimileAjax.DOM.getEventRelativeCoordinates = function(evt, elmt) { + if (SimileAjax.Platform.browser.isIE) { + var coords = SimileAjax.DOM.getPageCoordinates(elmt); + return { + x : evt.clientX - coords.left, + y : evt.clientY - coords.top + }; + } else { + var coords = SimileAjax.DOM.getPageCoordinates(elmt); + + if ((evt.type == "DOMMouseScroll") && SimileAjax.Platform.browser.isFirefox && (SimileAjax.Platform.browser.majorVersion == 2)) { + // Due to: https://bugzilla.mozilla.org/show_bug.cgi?id=352179 + + return { + x : evt.screenX - coords.left, + y : evt.screenY - coords.top + }; + } else { + return { + x : evt.pageX - coords.left, + y : evt.pageY - coords.top + }; + } + } +}; + +SimileAjax.Graphics.setOpacity = function(elmt, opacity) { + if (SimileAjax.Platform.browser.isIE) { + elmt.style.filter = "alpha(opacity = " + opacity + ")"; + } else { + var o = (opacity / 100).toString(); + elmt.style.opacity = o; + elmt.style.MozOpacity = o; + } +}; + +Timeplot.Plot.prototype.fullOpacityPlot = function(left, right, lp, rp, c) { + + var ctx = this._opacityCanvas.getContext('2d'); + + ctx.clearRect(0, 0, this._canvas.width, this._canvas.height); + ctx.lineWidth = this._plotInfo.lineWidth; + ctx.lineJoin = 'miter'; + + var h = this._canvas.height; + ctx.fillStyle = this._plotInfo.lineColor.toString(); + + var data = this._dataSource.getData(); + var times = data.times; + var values = data.values; + + var first = true; + ctx.beginPath(); + ctx.fillStyle = this._plotInfo.lineColor.toString(); + var lastX = 0, lastY = 0; + for (var t = 0; t < times.length; t++) { + if (!(times[t].getTime() < left.getTime() || times[t].getTime() > right.getTime())) { + var x = this._timeGeometry.toScreen(times[t]); + var y = this._valueGeometry.toScreen(values[t]); + if (first) { + ctx.moveTo(x, h); + first = false; + } + if (this.style == 'bars') { + ctx.lineTo(x, h - lastY); + } + ctx.lineTo(x, h - y); + if (times[t].getTime() == right.getTime() || t == times.length - 1) + ctx.lineTo(x, h); + lastX = x; + lastY = y; + } + } + ctx.fill(); + +}; + +Timeplot._Impl.prototype.regularGrid = function() { + + var canvas = this.getCanvas(); + var ctx = canvas.getContext('2d'); + var gradient = ctx.createLinearGradient(0, 0, 0, canvas.height); + gradient.addColorStop(0, "rgb(0,0,0)"); + gradient.addColorStop(1, "rgba(255,255,255,0.9)"); + ctx.strokeStyle = gradient; + ctx.lineWidth = 0.5; + ctx.lineJoin = 'miter'; + + var xDist = canvas.width / 9; + var positions = []; + for (var i = 1; i < 9; i++) { + var x = i * xDist; + ctx.beginPath(); + ctx.moveTo(x, 0); + ctx.lineTo(x, canvas.height); + + ctx.stroke(); + positions.push({ + label : '', + x : x + }); + } + return positions; + +}; + +Timeplot.Plot.prototype._plot = function() { + var ctx = this._canvas.getContext('2d'); + var data = this._dataSource.getData(); + if (data) { + var times = data.times; + var values = data.values; + var T = times.length; + ctx.moveTo(0, 0); + var lastX = 0, lastY = 0; + for (var t = 0; t < T; t++) { + var x = this._timeGeometry.toScreen(times[t]); + var y = this._valueGeometry.toScreen(values[t]); + if (t > 0 && (values[t - 1] > 0 || values[t] > 0 )) { + if (this.style == 'graph') { + ctx.lineTo(x, y); + } + if (this.style == 'bars') { + if (values[t - 1] > 0) { + ctx.lineTo(x, lastY); + } else { + ctx.moveTo(x, lastY); + } + ctx.lineTo(x, y); + } + } else { + ctx.moveTo(x, y); + } + lastX = x; + lastY = y; + } + } +}; + +SimileAjax.DOM.registerEvent = function(elmt, eventName, handler) { + var handler2 = function(evt) { + evt = (evt) ? evt : ((event) ? event : null); + if (evt) { + var target = (evt.target) ? evt.target : ((evt.srcElement) ? evt.srcElement : null); + if (target) { + target = (target.nodeType == 1 || target.nodeType == 9) ? target : target.parentNode; + } + + return handler(elmt, evt, target); + } + return true; + } + if (SimileAjax.Platform.browser.isIE) { + elmt.attachEvent("on" + eventName, handler2); + } else { + if (eventName == "mousewheel") { + eventName = "DOMMouseScroll"; + } + elmt.addEventListener(eventName, handler2, false); + } +}; + +Timeplot._Impl.prototype._setUpright = function(ctx, canvas) { + // excanvas+IE requires this to be done only once, ever; actual canvas + // implementations reset and require this for each call to re-layout + // modified: problem does not exist for IE9 + if (!SimileAjax.Platform.browser.isIE) + this._upright = false; + else if (SimileAjax.Platform.browser.majorVersion > 8) + this._upright = false; + if (!this._upright) { + this._upright = true; + ctx.translate(0, canvas.height); + ctx.scale(1, -1); + } +}; + +Timeplot._Impl.prototype._resizeCanvas = function() { + var canvas = this.getCanvas(); + if (canvas.firstChild) { + canvas.firstChild.style.width = canvas.clientWidth + 'px'; + canvas.firstChild.style.height = canvas.clientHeight + 'px'; + } + for (var i = 0; i < this._plots.length; i++) { + var opacityCanvas = this._plots[i]._opacityCanvas; + if (opacityCanvas.firstChild) { + opacityCanvas.firstChild.style.width = opacityCanvas.clientWidth + 'px'; + opacityCanvas.firstChild.style.height = opacityCanvas.clientHeight + 'px'; + } + } +}; + +Timeplot._Impl.prototype.getWidth = function() { + var canvas = this.getCanvas(); + if ( typeof canvas.width != 'undefined' && this._containerDiv.clientWidth == 0) { + return canvas.width; + } + return this._containerDiv.clientWidth; +}; + +Timeplot._Impl.prototype.getHeight = function() { + var canvas = this.getCanvas(); + if ( typeof canvas.height != 'undefined' && this._containerDiv.clientHeight == 0) { + return canvas.height; + } + return this._containerDiv.clientHeight; +}; + +Timeplot._Impl.prototype._prepareCanvas = function() { + var canvas = this.getCanvas(); + + // using jQuery. note we calculate the average padding; if your + // padding settings are not symmetrical, the labels will be off + // since they expect to be centered on the canvas. + var con = SimileAjax.jQuery(this._containerDiv); + this._paddingX = (parseInt(con.css('paddingLeft')) + parseInt(con.css('paddingRight'))) / 2; + this._paddingY = (parseInt(con.css('paddingTop')) + parseInt(con.css('paddingBottom'))) / 2; + + if (isNaN(this._paddingX)) { + this._paddingX = 0; + } + if (isNaN(this._paddingY)) { + this._paddingY = 0; + } + + canvas.width = this.getWidth() - (this._paddingX * 2); + canvas.height = this.getHeight() - (this._paddingY * 2); + + var ctx = canvas.getContext('2d'); + this._setUpright(ctx, canvas); + ctx.globalCompositeOperation = 'source-over'; +}; +/* + + OpenLayers.js -- OpenLayers Map Viewer Library + + Copyright (c) 2006-2012 by OpenLayers Contributors + Published under the 2-clause BSD license. + See http://openlayers.org/dev/license.txt for the full text of the license, and http://openlayers.org/dev/authors.txt for full list of contributors. + + Includes compressed code under the following licenses: + + (For uncompressed versions of the code used, please see the + OpenLayers Github repository: ) + +*/ + +/** + * Contains XMLHttpRequest.js + * Copyright 2007 Sergey Ilinsky (http://www.ilinsky.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +/** + * OpenLayers.Util.pagePosition is based on Yahoo's getXY method, which is + * Copyright (c) 2006, Yahoo! Inc. + * All rights reserved. + * + * Redistribution and use of this software in source and binary forms, with or + * without modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * Neither the name of Yahoo! Inc. nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission of Yahoo! Inc. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +var OpenLayers={VERSION_NUMBER:"Release 2.12",singleFile:!0,_getScriptLocation:function(){for(var a=/(^|(.*?\/))(OpenLayers[^\/]*?\.js)(\?|$)/,b=document.getElementsByTagName("script"),c,d="",e=0,f=b.length;ethis.right)this.right=b.right;if(null==this.top||b.top>this.top)this.top=b.top}}},containsLonLat:function(a,b){"boolean"===typeof b&&(b={inclusive:b});var b=b||{},c=this.contains(a.lon,a.lat,b.inclusive),d=b.worldBounds;d&&!c&&(c=d.getWidth(),d=Math.round((a.lon-(d.left+d.right)/2)/c),c=this.containsLonLat({lon:a.lon-d*c,lat:a.lat},{inclusive:b.inclusive}));return c},containsPixel:function(a,b){return this.contains(a.x, +a.y,b)},contains:function(a,b,c){null==c&&(c=!0);if(null==a||null==b)return!1;var a=OpenLayers.Util.toFloat(a),b=OpenLayers.Util.toFloat(b),d=!1;return d=c?a>=this.left&&a<=this.right&&b>=this.bottom&&b<=this.top:a>this.left&&athis.bottom&&b=c.bottom&&a.top<=c.top||c.top>a.bottom&&c.top=c.left&&a.left<=c.right||c.left>=a.left&&c.left<=a.right,f=a.right>=c.left&&a.right<=c.right||c.right>=a.left&&c.right<=a.right,d=(a.bottom>=c.bottom&&a.bottom<=c.top||c.bottom>=a.bottom&&c.bottom<=a.top||d)&&(e||f);if(b.worldBounds&&!d){var g=b.worldBounds,e=g.getWidth(),f=!g.containsBounds(c),g=!g.containsBounds(a);f&&!g?(a=a.add(-e,0),d=c.intersectsBounds(a, +{inclusive:b.inclusive})):g&&!f&&(c=c.add(-e,0),d=a.intersectsBounds(c,{inclusive:b.inclusive}))}return d},containsBounds:function(a,b,c){null==b&&(b=!1);null==c&&(c=!0);var d=this.contains(a.left,a.bottom,c),e=this.contains(a.right,a.bottom,c),f=this.contains(a.left,a.top,c),a=this.contains(a.right,a.top,c);return b?d||e||f||a:d&&e&&f&&a},determineQuadrant:function(a){var b="",c=this.getCenterLonLat(),b=b+(a.lat=a.right&&e.right>a.right;)e=e.add(-f,0);c=e.left+c;ca.left&&e.right-d>a.right)&&(e=e.add(-f,0))}return e},CLASS_NAME:"OpenLayers.Bounds"});OpenLayers.Bounds.fromString=function(a,b){var c=a.split(",");return OpenLayers.Bounds.fromArray(c,b)};OpenLayers.Bounds.fromArray=function(a,b){return!0===b?new OpenLayers.Bounds(a[1],a[0],a[3],a[2]):new OpenLayers.Bounds(a[0],a[1],a[2],a[3])}; +OpenLayers.Bounds.fromSize=function(a){return new OpenLayers.Bounds(0,a.h,a.w,0)};OpenLayers.Bounds.oppositeQuadrant=function(a){var b;b=""+("t"==a.charAt(0)?"b":"t");return b+="l"==a.charAt(1)?"r":"l"};OpenLayers.Element={visible:function(a){return"none"!=OpenLayers.Util.getElement(a).style.display},toggle:function(){for(var a=0,b=arguments.length;aa.right;)b.lon-=a.getWidth()}return b},CLASS_NAME:"OpenLayers.LonLat"}); +OpenLayers.LonLat.fromString=function(a){a=a.split(",");return new OpenLayers.LonLat(a[0],a[1])};OpenLayers.LonLat.fromArray=function(a){var b=OpenLayers.Util.isArray(a);return new OpenLayers.LonLat(b&&a[0],b&&a[1])};OpenLayers.Pixel=OpenLayers.Class({x:0,y:0,initialize:function(a,b){this.x=parseFloat(a);this.y=parseFloat(b)},toString:function(){return"x="+this.x+",y="+this.y},clone:function(){return new OpenLayers.Pixel(this.x,this.y)},equals:function(a){var b=!1;null!=a&&(b=this.x==a.x&&this.y==a.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(a.x)&&isNaN(a.y));return b},distanceTo:function(a){return Math.sqrt(Math.pow(this.x-a.x,2)+Math.pow(this.y-a.y,2))},add:function(a,b){if(null==a||null==b)throw new TypeError("Pixel.add cannot receive null values"); +return new OpenLayers.Pixel(this.x+a,this.y+b)},offset:function(a){var b=this.clone();a&&(b=this.add(a.x,a.y));return b},CLASS_NAME:"OpenLayers.Pixel"});OpenLayers.Size=OpenLayers.Class({w:0,h:0,initialize:function(a,b){this.w=parseFloat(a);this.h=parseFloat(b)},toString:function(){return"w="+this.w+",h="+this.h},clone:function(){return new OpenLayers.Size(this.w,this.h)},equals:function(a){var b=!1;null!=a&&(b=this.w==a.w&&this.h==a.h||isNaN(this.w)&&isNaN(this.h)&&isNaN(a.w)&&isNaN(a.h));return b},CLASS_NAME:"OpenLayers.Size"});OpenLayers.Console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){},userError:function(a){alert(a)},assert:function(){},dir:function(){},dirxml:function(){},trace:function(){},group:function(){},groupEnd:function(){},time:function(){},timeEnd:function(){},profile:function(){},profileEnd:function(){},count:function(){},CLASS_NAME:"OpenLayers.Console"}; +(function(){for(var a=document.getElementsByTagName("script"),b=0,c=a.length;b=0;c--)a[c]==b&&a.splice(c,1);return a};OpenLayers.Util.indexOf=function(a,b){if(typeof a.indexOf=="function")return a.indexOf(b);for(var c=0,d=a.length;c=0&&parseFloat(h)<1){a.style.filter="alpha(opacity="+h*100+")";a.style.opacity=h}else if(parseFloat(h)==1){a.style.filter="";a.style.opacity=""}}; +OpenLayers.Util.createDiv=function(a,b,c,d,e,f,g,h){var i=document.createElement("div");if(d)i.style.backgroundImage="url("+d+")";a||(a=OpenLayers.Util.createUniqueID("OpenLayersDiv"));e||(e="absolute");OpenLayers.Util.modifyDOMElement(i,a,b,c,e,f,g,h);return i}; +OpenLayers.Util.createImage=function(a,b,c,d,e,f,g,h){var i=document.createElement("img");a||(a=OpenLayers.Util.createUniqueID("OpenLayersDiv"));e||(e="relative");OpenLayers.Util.modifyDOMElement(i,a,b,c,e,f,null,g);if(h){i.style.display="none";b=function(){i.style.display="";OpenLayers.Event.stopObservingElement(i)};OpenLayers.Event.observe(i,"load",b);OpenLayers.Event.observe(i,"error",b)}i.style.alt=a;i.galleryImg="no";if(d)i.src=d;return i};OpenLayers.IMAGE_RELOAD_ATTEMPTS=0; +OpenLayers.Util.alphaHackNeeded=null;OpenLayers.Util.alphaHack=function(){if(OpenLayers.Util.alphaHackNeeded==null){var a=navigator.appVersion.split("MSIE"),a=parseFloat(a[1]),b=false;try{b=!!document.body.filters}catch(c){}OpenLayers.Util.alphaHackNeeded=b&&a>=5.5&&a<7}return OpenLayers.Util.alphaHackNeeded}; +OpenLayers.Util.modifyAlphaImageDiv=function(a,b,c,d,e,f,g,h,i){OpenLayers.Util.modifyDOMElement(a,b,c,d,f,null,null,i);b=a.childNodes[0];if(e)b.src=e;OpenLayers.Util.modifyDOMElement(b,a.id+"_innerImage",null,d,"relative",g);if(OpenLayers.Util.alphaHack()){if(a.style.display!="none")a.style.display="inline-block";h==null&&(h="scale");a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b.src+"', sizingMethod='"+h+"')";if(parseFloat(a.style.opacity)>=0&&parseFloat(a.style.opacity)< +1)a.style.filter=a.style.filter+(" alpha(opacity="+a.style.opacity*100+")");b.style.filter="alpha(opacity=0)"}};OpenLayers.Util.createAlphaImageDiv=function(a,b,c,d,e,f,g,h,i){var j=OpenLayers.Util.createDiv(),i=OpenLayers.Util.createImage(null,null,null,null,null,null,null,i);i.className="olAlphaImg";j.appendChild(i);OpenLayers.Util.modifyAlphaImageDiv(j,a,b,c,d,e,f,g,h);return j};OpenLayers.Util.upperCaseObject=function(a){var b={},c;for(c in a)b[c.toUpperCase()]=a[c];return b}; +OpenLayers.Util.applyDefaults=function(a,b){var a=a||{},c=typeof window.Event=="function"&&b instanceof window.Event,d;for(d in b)if(a[d]===void 0||!c&&b.hasOwnProperty&&b.hasOwnProperty(d)&&!a.hasOwnProperty(d))a[d]=b[d];if(!c&&b&&b.hasOwnProperty&&b.hasOwnProperty("toString")&&!a.hasOwnProperty("toString"))a.toString=b.toString;return a}; +OpenLayers.Util.getParameterString=function(a){var b=[],c;for(c in a){var d=a[c];if(d!=null&&typeof d!="function"){if(typeof d=="object"&&d.constructor==Array){for(var e=[],f,g=0,h=d.length;g1.0E-12&&--m>0;){var n=Math.sin(k),o=Math.cos(k),p=Math.sqrt(h*n*h*n+(g*j-i*h*o)*(g*j-i*h*o));if(p==0)return 0;var o=i*j+g*h*o,q=Math.atan2(p,o),r=Math.asin(g* +h*n/p),s=Math.cos(r)*Math.cos(r),n=o-2*i*j/s,t=c/16*s*(4+c*(4-3*s)),l=k,k=f+(1-t)*c*Math.sin(r)*(q+t*p*(n+t*o*(-1+2*n*n)))}if(m==0)return NaN;d=s*(d*d-e*e)/(e*e);c=d/1024*(256+d*(-128+d*(74-47*d)));return(e*(1+d/16384*(4096+d*(-768+d*(320-175*d))))*(q-c*p*(n+c/4*(o*(-1+2*n*n)-c/6*n*(-3+4*p*p)*(-3+4*n*n))))).toFixed(3)/1E3}; +OpenLayers.Util.destinationVincenty=function(a,b,c){for(var d=OpenLayers.Util,e=d.VincentyConstants,f=e.a,g=e.b,h=e.f,e=a.lon,a=a.lat,i=d.rad(b),b=Math.sin(i),i=Math.cos(i),a=(1-h)*Math.tan(d.rad(a)),j=1/Math.sqrt(1+a*a),k=a*j,l=Math.atan2(a,i),a=j*b,m=1-a*a,f=m*(f*f-g*g)/(g*g),n=1+f/16384*(4096+f*(-768+f*(320-175*f))),o=f/1024*(256+f*(-128+f*(74-47*f))),f=c/(g*n),p=2*Math.PI;Math.abs(f-p)>1.0E-12;)var q=Math.cos(2*l+f),r=Math.sin(f),s=Math.cos(f),t=o*r*(q+o/4*(s*(-1+2*q*q)-o/6*q*(-3+4*r*r)*(-3+4* +q*q))),p=f,f=c/(g*n)+t;c=k*r-j*s*i;g=Math.atan2(k*s+j*r*i,(1-h)*Math.sqrt(a*a+c*c));b=Math.atan2(r*b,j*s-k*r*i);i=h/16*m*(4+h*(4-3*m));q=b-(1-i)*h*a*(f+i*r*(q+i*s*(-1+2*q*q)));Math.atan2(a,-c);return new OpenLayers.LonLat(e+d.deg(q),d.deg(g))}; +OpenLayers.Util.getParameters=function(a){var a=a===null||a===void 0?window.location.href:a,b="";if(OpenLayers.String.contains(a,"?"))var b=a.indexOf("?")+1,c=OpenLayers.String.contains(a,"#")?a.indexOf("#"):a.length,b=a.substring(b,c);for(var a={},b=b.split(/[&;]/),c=0,d=b.length;c1?1/a:a};OpenLayers.Util.getResolutionFromScale=function(a,b){var c;if(a){b==null&&(b="degrees");c=1/(OpenLayers.Util.normalizeScale(a)*OpenLayers.INCHES_PER_UNIT[b]*OpenLayers.DOTS_PER_INCH)}return c}; +OpenLayers.Util.getScaleFromResolution=function(a,b){b==null&&(b="degrees");return a*OpenLayers.INCHES_PER_UNIT[b]*OpenLayers.DOTS_PER_INCH}; +OpenLayers.Util.pagePosition=function(a){var b=[0,0],c=OpenLayers.Util.getViewportElement();if(!a||a==window||a==c)return b;var d=OpenLayers.IS_GECKO&&document.getBoxObjectFor&&OpenLayers.Element.getStyle(a,"position")=="absolute"&&(a.style.top==""||a.style.left==""),e=null;if(a.getBoundingClientRect){a=a.getBoundingClientRect();e=c.scrollTop;b[0]=a.left+c.scrollLeft;b[1]=a.top+e}else if(document.getBoxObjectFor&&!d){a=document.getBoxObjectFor(a);c=document.getBoxObjectFor(c);b[0]=a.screenX-c.screenX; +b[1]=a.screenY-c.screenY}else{b[0]=a.offsetLeft;b[1]=a.offsetTop;e=a.offsetParent;if(e!=a)for(;e;){b[0]=b[0]+e.offsetLeft;b[1]=b[1]+e.offsetTop;e=e.offsetParent}c=OpenLayers.BROWSER_NAME;if(c=="opera"||c=="safari"&&OpenLayers.Element.getStyle(a,"position")=="absolute")b[1]=b[1]-document.body.offsetTop;for(e=a.offsetParent;e&&e!=document.body;){b[0]=b[0]-e.scrollLeft;if(c!="opera"||e.tagName!="TR")b[1]=b[1]-e.scrollTop;e=e.offsetParent}}return b}; +OpenLayers.Util.getViewportElement=function(){var a=arguments.callee.viewportElement;if(a==void 0){a=OpenLayers.BROWSER_NAME=="msie"&&document.compatMode!="CSS1Compat"?document.body:document.documentElement;arguments.callee.viewportElement=a}return a}; +OpenLayers.Util.isEquivalentUrl=function(a,b,c){c=c||{};OpenLayers.Util.applyDefaults(c,{ignoreCase:true,ignorePort80:true,ignoreHash:true});var a=OpenLayers.Util.createUrlObject(a,c),b=OpenLayers.Util.createUrlObject(b,c),d;for(d in a)if(d!=="args"&&a[d]!=b[d])return false;for(d in a.args){if(a.args[d]!=b.args[d])return false;delete b.args[d]}for(d in b.args)return false;return true}; +OpenLayers.Util.createUrlObject=function(a,b){b=b||{};if(!/^\w+:\/\//.test(a)){var c=window.location,d=c.port?":"+c.port:"",d=c.protocol+"//"+c.host.split(":").shift()+d;if(a.indexOf("/")===0)a=d+a;else{c=c.pathname.split("/");c.pop();a=d+c.join("/")+"/"+a}}b.ignoreCase&&(a=a.toLowerCase());c=document.createElement("a");c.href=a;d={};d.host=c.host.split(":").shift();d.protocol=c.protocol;d.port=b.ignorePort80?c.port=="80"||c.port=="0"?"":c.port:c.port==""||c.port=="0"?"80":c.port;d.hash=b.ignoreHash|| +c.hash==="#"?"":c.hash;var e=c.search;if(!e){e=a.indexOf("?");e=e!=-1?a.substr(e):""}d.args=OpenLayers.Util.getParameters(e);d.pathname=c.pathname.charAt(0)=="/"?c.pathname:"/"+c.pathname;return d};OpenLayers.Util.removeTail=function(a){var b=null,b=a.indexOf("?"),c=a.indexOf("#");return b=b==-1?c!=-1?a.substr(0,c):a:c!=-1?a.substr(0,Math.min(b,c)):a.substr(0,b)};OpenLayers.IS_GECKO=function(){var a=navigator.userAgent.toLowerCase();return a.indexOf("webkit")==-1&&a.indexOf("gecko")!=-1}(); +OpenLayers.CANVAS_SUPPORTED=function(){var a=document.createElement("canvas");return!(!a.getContext||!a.getContext("2d"))}();OpenLayers.BROWSER_NAME=function(){var a="",b=navigator.userAgent.toLowerCase();b.indexOf("opera")!=-1?a="opera":b.indexOf("msie")!=-1?a="msie":b.indexOf("safari")!=-1?a="safari":b.indexOf("mozilla")!=-1&&(a=b.indexOf("firefox")!=-1?"firefox":"mozilla");return a}();OpenLayers.Util.getBrowserName=function(){return OpenLayers.BROWSER_NAME}; +OpenLayers.Util.getRenderedDimensions=function(a,b,c){var d,e,f=document.createElement("div");f.style.visibility="hidden";for(var g=c&&c.containerElement?c.containerElement:document.body,h=false,i=null,j=g;j&&j.tagName.toLowerCase()!="body";){var k=OpenLayers.Element.getStyle(j,"position");if(k=="absolute"){h=true;break}else if(k&&k!="static")break;j=j.parentNode}if(h&&(g.clientHeight===0||g.clientWidth===0)){i=document.createElement("div");i.style.visibility="hidden";i.style.position="absolute"; +i.style.overflow="visible";i.style.width=document.body.clientWidth+"px";i.style.height=document.body.clientHeight+"px";i.appendChild(f)}f.style.position="absolute";if(b)if(b.w){d=b.w;f.style.width=d+"px"}else if(b.h){e=b.h;f.style.height=e+"px"}if(c&&c.displayClass)f.className=c.displayClass;b=document.createElement("div");b.innerHTML=a;b.style.overflow="visible";if(b.childNodes){a=0;for(c=b.childNodes.length;a=60){f=f-60;d=d+1;if(d>=60){d=d-60;e=e+1}}e<10&&(e="0"+e);e=e+"\u00b0";if(c.indexOf("dm")>=0){d<10&&(d="0"+d);e=e+(d+"'");if(c.indexOf("dms")>=0){f<10&&(f="0"+f);e=e+(f+'"')}}return e=b=="lon"?e+(a<0?OpenLayers.i18n("W"):OpenLayers.i18n("E")):e+(a<0?OpenLayers.i18n("S"):OpenLayers.i18n("N"))};OpenLayers.Format=OpenLayers.Class({options:null,externalProjection:null,internalProjection:null,data:null,keepData:!1,initialize:function(a){OpenLayers.Util.extend(this,a);this.options=a},destroy:function(){},read:function(){throw Error("Read not implemented.");},write:function(){throw Error("Write not implemented.");},CLASS_NAME:"OpenLayers.Format"});OpenLayers.Format.CSWGetRecords=function(a){var a=OpenLayers.Util.applyDefaults(a,OpenLayers.Format.CSWGetRecords.DEFAULTS),b=OpenLayers.Format.CSWGetRecords["v"+a.version.replace(/\./g,"_")];if(!b)throw"Unsupported CSWGetRecords version: "+a.version;return new b(a)};OpenLayers.Format.CSWGetRecords.DEFAULTS={version:"2.0.2"};OpenLayers.Control=OpenLayers.Class({id:null,map:null,div:null,type:null,allowSelection:!1,displayClass:"",title:"",autoActivate:!1,active:null,handler:null,eventListeners:null,events:null,initialize:function(a){this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(/\./g,"");OpenLayers.Util.extend(this,a);this.events=new OpenLayers.Events(this);if(this.eventListeners instanceof Object)this.events.on(this.eventListeners);null==this.id&&(this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+ +"_"))},destroy:function(){this.events&&(this.eventListeners&&this.events.un(this.eventListeners),this.events.destroy(),this.events=null);this.eventListeners=null;this.handler&&(this.handler.destroy(),this.handler=null);if(this.handlers){for(var a in this.handlers)this.handlers.hasOwnProperty(a)&&"function"==typeof this.handlers[a].destroy&&this.handlers[a].destroy();this.handlers=null}this.map&&(this.map.removeControl(this),this.map=null);this.div=null},setMap:function(a){this.map=a;this.handler&& +this.handler.setMap(a)},draw:function(a){if(null==this.div&&(this.div=OpenLayers.Util.createDiv(this.id),this.div.className=this.displayClass,this.allowSelection||(this.div.className+=" olControlNoSelect",this.div.setAttribute("unselectable","on",0),this.div.onselectstart=OpenLayers.Function.False),""!=this.title))this.div.title=this.title;null!=a&&(this.position=a.clone());this.moveTo(this.position);return this.div},moveTo:function(a){null!=a&&null!=this.div&&(this.div.style.left=a.x+"px",this.div.style.top= +a.y+"px")},activate:function(){if(this.active)return!1;this.handler&&this.handler.activate();this.active=!0;this.map&&OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active");this.events.triggerEvent("activate");return!0},deactivate:function(){return this.active?(this.handler&&this.handler.deactivate(),this.active=!1,this.map&&OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active"),this.events.triggerEvent("deactivate"), +!0):!1},CLASS_NAME:"OpenLayers.Control"});OpenLayers.Control.TYPE_BUTTON=1;OpenLayers.Control.TYPE_TOGGLE=2;OpenLayers.Control.TYPE_TOOL=3;OpenLayers.Event={observers:!1,KEY_SPACE:32,KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(a){return a.target||a.srcElement},isSingleTouch:function(a){return a.touches&&1==a.touches.length},isMultiTouch:function(a){return a.touches&&1this.minRatio&&b<=this.maxRatio&&this.ovmap.getExtent().containsBounds(a)},updateOverview:function(){var a=this.map.getResolution(),b=this.ovmap.getResolution(),c=b/a;c>this.maxRatio? +b=this.minRatio*a:c<=this.minRatio&&(b=this.maxRatio*a);this.ovmap.getProjection()!=this.map.getProjection()?(a=this.map.center.clone(),a.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())):a=this.map.center;this.ovmap.setCenter(a,this.ovmap.getZoomForResolution(b*this.resolutionFactor));this.updateRectToMap()},createMap:function(){var a=OpenLayers.Util.extend({controls:[],maxResolution:"auto",fallThrough:!1},this.mapOptions);this.ovmap=new OpenLayers.Map(this.mapDiv,a);this.ovmap.viewPortDiv.appendChild(this.extentRectangle); +OpenLayers.Event.stopObserving(window,"unload",this.ovmap.unloadDestroy);this.ovmap.addLayers(this.layers);this.ovmap.zoomToMaxExtent();this.wComp=(this.wComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-right-width")))?this.wComp:2;this.hComp=(this.hComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-bottom-width")))? +this.hComp:2;this.handlers.drag=new OpenLayers.Handler.Drag(this,{move:this.rectDrag,done:this.updateMapToRect},{map:this.ovmap});this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.mapDivClick},{single:!0,"double":!1,stopSingle:!0,stopDouble:!0,pixelTolerance:1,map:this.ovmap});this.handlers.click.activate();this.rectEvents=new OpenLayers.Events(this,this.extentRectangle,null,!0);this.rectEvents.register("mouseover",this,function(){!this.handlers.drag.active&&!this.map.dragging&&this.handlers.drag.activate()}); +this.rectEvents.register("mouseout",this,function(){this.handlers.drag.dragging||this.handlers.drag.deactivate()});if(this.ovmap.getProjection()!=this.map.getProjection()){var a=this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units,b=this.ovmap.getProjectionObject().getUnits()||this.ovmap.units||this.ovmap.baseLayer.units;this.resolutionFactor=a&&b?OpenLayers.INCHES_PER_UNIT[a]/OpenLayers.INCHES_PER_UNIT[b]:1}},updateRectToMap:function(){var a=this.getRectBoundsFromMapBounds(this.ovmap.getProjection()!= +this.map.getProjection()?this.map.getExtent().transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject()):this.map.getExtent());a&&this.setRectPxBounds(a)},updateMapToRect:function(){var a=this.getMapBoundsFromRectBounds(this.rectPxBounds);this.ovmap.getProjection()!=this.map.getProjection()&&(a=a.transform(this.ovmap.getProjectionObject(),this.map.getProjectionObject()));this.map.panTo(a.getCenterLonLat())},setRectPxBounds:function(a){var b=Math.max(a.top,0),c=Math.max(a.left,0),d= +Math.min(a.top+Math.abs(a.getHeight()),this.ovmap.size.h-this.hComp),a=Math.min(a.left+a.getWidth(),this.ovmap.size.w-this.wComp),e=Math.max(a-c,0),f=Math.max(d-b,0);ethis.duration&&this.stop()},CLASS_NAME:"OpenLayers.Tween"});OpenLayers.Easing={CLASS_NAME:"OpenLayers.Easing"};OpenLayers.Easing.Linear={easeIn:function(a,b,c,d){return c*a/d+b},easeOut:function(a,b,c,d){return c*a/d+b},easeInOut:function(a,b,c,d){return c*a/d+b},CLASS_NAME:"OpenLayers.Easing.Linear"}; +OpenLayers.Easing.Expo={easeIn:function(a,b,c,d){return 0==a?b:c*Math.pow(2,10*(a/d-1))+b},easeOut:function(a,b,c,d){return a==d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b},easeInOut:function(a,b,c,d){return 0==a?b:a==d?b+c:1>(a/=d/2)?c/2*Math.pow(2,10*(a-1))+b:c/2*(-Math.pow(2,-10*--a)+2)+b},CLASS_NAME:"OpenLayers.Easing.Expo"}; +OpenLayers.Easing.Quad={easeIn:function(a,b,c,d){return c*(a/=d)*a+b},easeOut:function(a,b,c,d){return-c*(a/=d)*(a-2)+b},easeInOut:function(a,b,c,d){return 1>(a/=d/2)?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b},CLASS_NAME:"OpenLayers.Easing.Quad"};OpenLayers.Projection=OpenLayers.Class({proj:null,projCode:null,titleRegEx:/\+title=[^\+]*/,initialize:function(a,b){OpenLayers.Util.extend(this,b);this.projCode=a;window.Proj4js&&(this.proj=new Proj4js.Proj(a))},getCode:function(){return this.proj?this.proj.srsCode:this.projCode},getUnits:function(){return this.proj?this.proj.units:null},toString:function(){return this.getCode()},equals:function(a){var b=!1;a&&(a instanceof OpenLayers.Projection||(a=new OpenLayers.Projection(a)),window.Proj4js&& +this.proj.defData&&a.proj.defData?b=this.proj.defData.replace(this.titleRegEx,"")==a.proj.defData.replace(this.titleRegEx,""):a.getCode&&(b=this.getCode(),a=a.getCode(),b=b==a||!!OpenLayers.Projection.transforms[b]&&OpenLayers.Projection.transforms[b][a]===OpenLayers.Projection.nullTransform));return b},destroy:function(){delete this.proj;delete this.projCode},CLASS_NAME:"OpenLayers.Projection"});OpenLayers.Projection.transforms={}; +OpenLayers.Projection.defaults={"EPSG:4326":{units:"degrees",maxExtent:[-180,-90,180,90],yx:!0},"CRS:84":{units:"degrees",maxExtent:[-180,-90,180,90]},"EPSG:900913":{units:"m",maxExtent:[-2.003750834E7,-2.003750834E7,2.003750834E7,2.003750834E7]}}; +OpenLayers.Projection.addTransform=function(a,b,c){if(c===OpenLayers.Projection.nullTransform){var d=OpenLayers.Projection.defaults[a];d&&!OpenLayers.Projection.defaults[b]&&(OpenLayers.Projection.defaults[b]=d)}OpenLayers.Projection.transforms[a]||(OpenLayers.Projection.transforms[a]={});OpenLayers.Projection.transforms[a][b]=c}; +OpenLayers.Projection.transform=function(a,b,c){if(b&&c)if(b instanceof OpenLayers.Projection||(b=new OpenLayers.Projection(b)),c instanceof OpenLayers.Projection||(c=new OpenLayers.Projection(c)),b.proj&&c.proj)a=Proj4js.transform(b.proj,c.proj,a);else{var b=b.getCode(),c=c.getCode(),d=OpenLayers.Projection.transforms;if(d[b]&&d[b][c])d[b][c](a)}return a};OpenLayers.Projection.nullTransform=function(a){return a}; +(function(){function a(a){a.x=180*a.x/d;a.y=180/Math.PI*(2*Math.atan(Math.exp(a.y/d*Math.PI))-Math.PI/2);return a}function b(a){a.x=a.x*d/180;a.y=Math.log(Math.tan((90+a.y)*Math.PI/360))/Math.PI*d;return a}function c(c,d){var e=OpenLayers.Projection.addTransform,f=OpenLayers.Projection.nullTransform,g,m,n,o,p;g=0;for(m=d.length;gparseFloat(navigator.appVersion.split("MSIE")[1])?this.events.register("resize",this,this.updateSize):(this.updateSizeDestroy=OpenLayers.Function.bind(this.updateSize,this),OpenLayers.Event.observe(window,"resize",this.updateSizeDestroy));if(this.theme){for(var c=!0,d=document.getElementsByTagName("link"), +e=0,f=d.length;eb?b=0:b>this.layers.length&&(b=this.layers.length);if(c!=b){this.layers.splice(c,1);this.layers.splice(b,0,a);for(var c=0,d=this.layers.length;c=this.minPx.x+h?Math.round(a):0;b=f<=this.maxPx.y-i&&f>=this.minPx.y+i?Math.round(b):0;if(a||b){this.dragging||(this.dragging= +!0,this.events.triggerEvent("movestart"));this.center=null;a&&(this.layerContainerDiv.style.left=parseInt(this.layerContainerDiv.style.left)-a+"px",this.minPx.x-=a,this.maxPx.x-=a);b&&(this.layerContainerDiv.style.top=parseInt(this.layerContainerDiv.style.top)-b+"px",this.minPx.y-=b,this.maxPx.y-=b);d=0;for(e=this.layers.length;dc)for(var d=a|0,e=b.length;dthis.restrictedExtent.getWidth()?a=new OpenLayers.LonLat(g.lon,a.lat):f.leftthis.restrictedExtent.right&& +(a=a.add(this.restrictedExtent.right-f.right,0));f.getHeight()>this.restrictedExtent.getHeight()?a=new OpenLayers.LonLat(a.lon,g.lat):f.bottomthis.restrictedExtent.top&&(a=a.add(0,this.restrictedExtent.top-f.top))}}e=e||this.isValidZoomLevel(b)&&b!=this.getZoom();f=this.isValidLonLat(a)&&!a.equals(this.center);if(e||f||d){d||this.events.triggerEvent("movestart");f&&(!e&&this.center&&this.centerLayerContainer(a),this.center= +a.clone());a=e?this.getResolutionForZoom(b):this.getResolution();if(e||null==this.layerContainerOrigin){this.layerContainerOrigin=this.getCachedCenter();this.layerContainerDiv.style.left="0px";this.layerContainerDiv.style.top="0px";var f=this.getMaxExtent({restricted:!0}),h=f.getCenterLonLat(),g=this.center.lon-h.lon,h=h.lat-this.center.lat,i=Math.round(f.getWidth()/a),j=Math.round(f.getHeight()/a);this.minPx={x:(this.size.w-i)/2-g/a,y:(this.size.h-j)/2-h/a};this.maxPx={x:this.minPx.x+Math.round(f.getWidth()/ +a),y:this.minPx.y+Math.round(f.getHeight()/a)}}e&&(this.zoom=b,this.resolution=a);a=this.getExtent();this.baseLayer.visibility&&(this.baseLayer.moveTo(a,e,c.dragging),c.dragging||this.baseLayer.events.triggerEvent("moveend",{zoomChanged:e}));a=this.baseLayer.getExtent();for(b=this.layers.length-1;0<=b;--b)if(f=this.layers[b],f!==this.baseLayer&&!f.isBaseLayer&&(g=f.calculateInRange(),f.inRange!=g&&((f.inRange=g)||f.display(!1),this.events.triggerEvent("changelayer",{layer:f,property:"visibility"})), +g&&f.visibility))f.moveTo(a,e,c.dragging),c.dragging||f.events.triggerEvent("moveend",{zoomChanged:e});this.events.triggerEvent("move");d||this.events.triggerEvent("moveend");if(e){b=0;for(c=this.popups.length;b=this.minResolution&&a<=this.maxResolution);return a},setIsBaseLayer:function(a){a!=this.isBaseLayer&&(this.isBaseLayer=a,null!=this.map&&this.map.events.triggerEvent("changebaselayer",{layer:this}))},initResolutions:function(){var a, +b,c,d={},e=!0;a=0;for(b=this.RESOLUTION_PROPERTIES.length;a=a||"number"!==typeof d&&"number"!==typeof c)){b=Array(a);var e=2;"number"==typeof c&&"number"==typeof d&&(e=Math.pow(d/c,1/(a-1)));var f;if("number"===typeof d)for(f=0;f=a&&(f=h,e=c),h<=a){g=h;break}c=f-g;c=0f)break;f=e}else if(this.resolutions[c]=a.count&& +this.removeGMapElements()}OpenLayers.Layer.EventPane.prototype.destroy.apply(this,arguments)},removeGMapElements:function(){var a=OpenLayers.Layer.Google.cache[this.map.id];if(a){var b=this.mapObject&&this.getMapContainer();b&&b.parentNode&&b.parentNode.removeChild(b);(b=a.termsOfUse)&&b.parentNode&&b.parentNode.removeChild(b);(a=a.poweredBy)&&a.parentNode&&a.parentNode.removeChild(a)}},removeMap:function(a){this.visibility&&this.mapObject&&this.setGMapVisibility(!1);var b=OpenLayers.Layer.Google.cache[a.id]; +b&&(1>=b.count?(this.removeGMapElements(),delete OpenLayers.Layer.Google.cache[a.id]):--b.count);delete this.termsOfUse;delete this.poweredBy;delete this.mapObject;delete this.dragObject;OpenLayers.Layer.EventPane.prototype.removeMap.apply(this,arguments)},getOLBoundsFromMapObjectBounds:function(a){var b=null;null!=a&&(b=a.getSouthWest(),a=a.getNorthEast(),this.sphericalMercator?(b=this.forwardMercator(b.lng(),b.lat()),a=this.forwardMercator(a.lng(),a.lat())):(b=new OpenLayers.LonLat(b.lng(),b.lat()), +a=new OpenLayers.LonLat(a.lng(),a.lat())),b=new OpenLayers.Bounds(b.lon,b.lat,a.lon,a.lat));return b},getWarningHTML:function(){return OpenLayers.i18n("googleWarning")},getMapObjectCenter:function(){return this.mapObject.getCenter()},getMapObjectZoom:function(){return this.mapObject.getZoom()},getLongitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.lng(),a.lat()).lon:a.lng()},getLatitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.lng(), +a.lat()).lat:a.lat()},getXFromMapObjectPixel:function(a){return a.x},getYFromMapObjectPixel:function(a){return a.y},CLASS_NAME:"OpenLayers.Layer.Google"});OpenLayers.Layer.Google.cache={}; +OpenLayers.Layer.Google.v2={termsOfUse:null,poweredBy:null,dragObject:null,loadMapObject:function(){this.type||(this.type=G_NORMAL_MAP);var a,b,c,d=OpenLayers.Layer.Google.cache[this.map.id];if(d)a=d.mapObject,b=d.termsOfUse,c=d.poweredBy,++d.count;else{var d=this.map.viewPortDiv,e=document.createElement("div");e.id=this.map.id+"_GMap2Container";e.style.position="absolute";e.style.width="100%";e.style.height="100%";d.appendChild(e);try{a=new GMap2(e),b=e.lastChild,d.appendChild(b),b.style.zIndex= +"1100",b.style.right="",b.style.bottom="",b.className="olLayerGoogleCopyright",c=e.lastChild,d.appendChild(c),c.style.zIndex="1100",c.style.right="",c.style.bottom="",c.className="olLayerGooglePoweredBy gmnoprint"}catch(f){throw f;}OpenLayers.Layer.Google.cache[this.map.id]={mapObject:a,termsOfUse:b,poweredBy:c,count:1}}this.mapObject=a;this.termsOfUse=b;this.poweredBy=c;-1===OpenLayers.Util.indexOf(this.mapObject.getMapTypes(),this.type)&&this.mapObject.addMapType(this.type);"function"==typeof a.getDragObject? +this.dragObject=a.getDragObject():this.dragPanMapObject=null;!1===this.isBaseLayer&&this.setGMapVisibility("none"!==this.div.style.display)},onMapResize:function(){if(this.visibility&&this.mapObject.isLoaded())this.mapObject.checkResize();else{if(!this._resized)var a=this,b=GEvent.addListener(this.mapObject,"load",function(){GEvent.removeListener(b);delete a._resized;a.mapObject.checkResize();a.moveTo(a.map.getCenter(),a.map.getZoom())});this._resized=!0}},setGMapVisibility:function(a){var b=OpenLayers.Layer.Google.cache[this.map.id]; +if(b){var c=this.mapObject.getContainer();!0===a?(this.mapObject.setMapType(this.type),c.style.display="",this.termsOfUse.style.left="",this.termsOfUse.style.display="",this.poweredBy.style.display="",b.displayed=this.id):(b.displayed===this.id&&delete b.displayed,b.displayed||(c.style.display="none",this.termsOfUse.style.display="none",this.termsOfUse.style.left="-9999px",this.poweredBy.style.display="none"))}},getMapContainer:function(){return this.mapObject.getContainer()},getMapObjectBoundsFromOLBounds:function(a){var b= +null;null!=a&&(b=this.sphericalMercator?this.inverseMercator(a.bottom,a.left):new OpenLayers.LonLat(a.bottom,a.left),a=this.sphericalMercator?this.inverseMercator(a.top,a.right):new OpenLayers.LonLat(a.top,a.right),b=new GLatLngBounds(new GLatLng(b.lat,b.lon),new GLatLng(a.lat,a.lon)));return b},setMapObjectCenter:function(a,b){this.mapObject.setCenter(a,b)},dragPanMapObject:function(a,b){this.dragObject.moveBy(new GSize(-a,b))},getMapObjectLonLatFromMapObjectPixel:function(a){return this.mapObject.fromContainerPixelToLatLng(a)}, +getMapObjectPixelFromMapObjectLonLat:function(a){return this.mapObject.fromLatLngToContainerPixel(a)},getMapObjectZoomFromMapObjectBounds:function(a){return this.mapObject.getBoundsZoomLevel(a)},getMapObjectLonLatFromLonLat:function(a,b){var c;this.sphericalMercator?(c=this.inverseMercator(a,b),c=new GLatLng(c.lat,c.lon)):c=new GLatLng(b,a);return c},getMapObjectPixelFromXY:function(a,b){return new GPoint(a,b)}};OpenLayers.Format.XML=OpenLayers.Class(OpenLayers.Format,{namespaces:null,namespaceAlias:null,defaultPrefix:null,readers:{},writers:{},xmldom:null,initialize:function(a){window.ActiveXObject&&(this.xmldom=new ActiveXObject("Microsoft.XMLDOM"));OpenLayers.Format.prototype.initialize.apply(this,[a]);this.namespaces=OpenLayers.Util.extend({},this.namespaces);this.namespaceAlias={};for(var b in this.namespaces)this.namespaceAlias[this.namespaces[b]]=b},destroy:function(){this.xmldom=null;OpenLayers.Format.prototype.destroy.apply(this, +arguments)},setNamespace:function(a,b){this.namespaces[a]=b;this.namespaceAlias[b]=a},read:function(a){var b=a.indexOf("<");0this.value;break;case OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:b=a<=this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:b= +a>=this.value;break;case OpenLayers.Filter.Comparison.BETWEEN:b=a>=this.lowerBoundary&&a<=this.upperBoundary;break;case OpenLayers.Filter.Comparison.LIKE:b=RegExp(this.value,"gi").test(a)}return b},value2regex:function(a,b,c){if("."==a)throw Error("'.' is an unsupported wildCard character for OpenLayers.Filter.Comparison");a=a?a:"*";b=b?b:".";this.value=this.value.replace(RegExp("\\"+(c?c:"!")+"(.|$)","g"),"\\$1");this.value=this.value.replace(RegExp("\\"+b,"g"),".");this.value=this.value.replace(RegExp("\\"+ +a,"g"),".*");this.value=this.value.replace(RegExp("\\\\.\\*","g"),"\\"+a);return this.value=this.value.replace(RegExp("\\\\\\.","g"),"\\"+b)},regex2value:function(){var a=this.value,a=a.replace(/!/g,"!!"),a=a.replace(/(\\)?\\\./g,function(a,c){return c?a:"!."}),a=a.replace(/(\\)?\\\*/g,function(a,c){return c?a:"!*"}),a=a.replace(/\\\\/g,"\\");return a=a.replace(/\.\*/g,"*")},clone:function(){return OpenLayers.Util.extend(new OpenLayers.Filter.Comparison,this)},CLASS_NAME:"OpenLayers.Filter.Comparison"}); +OpenLayers.Filter.Comparison.EQUAL_TO="==";OpenLayers.Filter.Comparison.NOT_EQUAL_TO="!=";OpenLayers.Filter.Comparison.LESS_THAN="<";OpenLayers.Filter.Comparison.GREATER_THAN=">";OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO="<=";OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO=">=";OpenLayers.Filter.Comparison.BETWEEN="..";OpenLayers.Filter.Comparison.LIKE="~";OpenLayers.Format.Filter=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",CLASS_NAME:"OpenLayers.Format.Filter"});OpenLayers.Filter.Function=OpenLayers.Class(OpenLayers.Filter,{name:null,params:null,CLASS_NAME:"OpenLayers.Filter.Function"});OpenLayers.Format.Filter.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ogc:"http://www.opengis.net/ogc",gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"ogc",schemaLocation:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(a){var b={};this.readers.ogc.Filter.apply(this,[a,b]);return b.filter},readers:{ogc:{_expression:function(a){for(var b="",c=a.firstChild;c;c= +c.nextSibling)switch(c.nodeType){case 1:a=this.readNode(c);a.property?b+="${"+a.property+"}":void 0!==a.value&&(b+=a.value);break;case 3:case 4:b+=c.nodeValue}return b},Filter:function(a,b){var c={fids:[],filters:[]};this.readChildNodes(a,c);0":"PropertyIsGreaterThan", +"<=":"PropertyIsLessThanOrEqualTo",">=":"PropertyIsGreaterThanOrEqualTo","..":"PropertyIsBetween","~":"PropertyIsLike",BBOX:"BBOX",DWITHIN:"DWITHIN",WITHIN:"WITHIN",CONTAINS:"CONTAINS",INTERSECTS:"INTERSECTS",FID:"FeatureId"},CLASS_NAME:"OpenLayers.Format.Filter.v1"});OpenLayers.Geometry=OpenLayers.Class({id:null,parent:null,bounds:null,initialize:function(){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){this.bounds=this.id=null},clone:function(){return new OpenLayers.Geometry},setBounds:function(a){a&&(this.bounds=a.clone())},clearBounds:function(){this.bounds=null;this.parent&&this.parent.clearBounds()},extendBounds:function(a){this.getBounds()?this.bounds.extend(a):this.setBounds(a)},getBounds:function(){null==this.bounds&&this.calculateBounds(); +return this.bounds},calculateBounds:function(){},distanceTo:function(){},getVertices:function(){},atPoint:function(a,b,c){var d=!1;null!=this.getBounds()&&null!=a&&(b=null!=b?b:0,c=null!=c?c:0,d=(new OpenLayers.Bounds(this.bounds.left-b,this.bounds.bottom-c,this.bounds.right+b,this.bounds.top+c)).containsLonLat(a));return d},getLength:function(){return 0},getArea:function(){return 0},getCentroid:function(){return null},toString:function(){return OpenLayers.Format&&OpenLayers.Format.WKT?OpenLayers.Format.WKT.prototype.write(new OpenLayers.Feature.Vector(this)): +Object.prototype.toString.call(this)},CLASS_NAME:"OpenLayers.Geometry"});OpenLayers.Geometry.fromWKT=function(a){var b;if(OpenLayers.Format&&OpenLayers.Format.WKT){var c=OpenLayers.Geometry.fromWKT.format;c||(c=new OpenLayers.Format.WKT,OpenLayers.Geometry.fromWKT.format=c);a=c.read(a);if(a instanceof OpenLayers.Feature.Vector)b=a.geometry;else if(OpenLayers.Util.isArray(a)){b=a.length;for(var c=Array(b),d=0;d=f&&0<=l&&1>=l)&&(d?(h=a.x1+f*h,l=a.y1+f*i,e=new OpenLayers.Geometry.Point(h,l)):e=!0));if(c)if(e){if(d){a=[a,b];b=0;a:for(;2>b;++b){f=a[b];for(i=1;3>i;++i)if(h=f["x"+i],l=f["y"+i],d=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(l-e.y,2)),db;++b){h=a[b];l=a[(b+1)%2];for(i=1;3>i;++i)if(f={x:h["x"+i],y:h["y"+i]},g=OpenLayers.Geometry.distanceToSegment(f,l),g.distance=k||(1<=k?(e=g,f=h):(e+=k*i,f+=k*j));return{distance:Math.sqrt(Math.pow(e-c,2)+Math.pow(f-d,2)),x:e,y:f}};OpenLayers.Geometry.Point=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,initialize:function(a,b){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.x=parseFloat(a);this.y=parseFloat(b)},clone:function(a){null==a&&(a=new OpenLayers.Geometry.Point(this.x,this.y));OpenLayers.Util.applyDefaults(a,this);return a},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x,this.y)},distanceTo:function(a,b){var c=!(b&&!1===b.edge)&&b&&b.details,d,e,f,g,h;a instanceof +OpenLayers.Geometry.Point?(e=this.x,f=this.y,g=a.x,h=a.y,d=Math.sqrt(Math.pow(e-g,2)+Math.pow(f-h,2)),d=!c?d:{x0:e,y0:f,x1:g,y1:h,distance:d}):(d=a.distanceTo(this,b),c&&(d={x0:d.x1,y0:d.y1,x1:d.x0,y1:d.y0,distance:d.distance}));return d},equals:function(a){var b=!1;null!=a&&(b=this.x==a.x&&this.y==a.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(a.x)&&isNaN(a.y));return b},toShortString:function(){return this.x+", "+this.y},move:function(a,b){this.x+=a;this.y+=b;this.clearBounds()},rotate:function(a,b){var a= +a*(Math.PI/180),c=this.distanceTo(b),d=a+Math.atan2(this.y-b.y,this.x-b.x);this.x=b.x+c*Math.cos(d);this.y=b.y+c*Math.sin(d);this.clearBounds()},getCentroid:function(){return new OpenLayers.Geometry.Point(this.x,this.y)},resize:function(a,b,c){this.x=b.x+a*(void 0==c?1:c)*(this.x-b.x);this.y=b.y+a*(this.y-b.y);this.clearBounds();return this},intersects:function(a){var b=!1;return b="OpenLayers.Geometry.Point"==a.CLASS_NAME?this.equals(a):a.intersects(this)},transform:function(a,b){a&&b&&(OpenLayers.Projection.transform(this, +a,b),this.bounds=null);return this},getVertices:function(){return[this]},CLASS_NAME:"OpenLayers.Geometry.Point"});OpenLayers.Geometry.Collection=OpenLayers.Class(OpenLayers.Geometry,{components:null,componentTypes:null,initialize:function(a){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.components=[];null!=a&&this.addComponents(a)},destroy:function(){this.components.length=0;this.components=null;OpenLayers.Geometry.prototype.destroy.apply(this,arguments)},clone:function(){for(var a=eval("new "+this.CLASS_NAME+"()"),b=0,c=this.components.length;bf)break;if(!(i.x2Math.max(g,h))&&!(Math.max(j,k)h&&(i>j.y1&&ij.y2))break;e=c?{distance:e.distance,x0:e.x,y0:e.y,x1:h,y1:i}:e.distance}else if(a instanceof OpenLayers.Geometry.LineString){var g=this.getSortedSegments(),h=a.getSortedSegments(),m,n,o=h.length,p={point:!0},k=0,l=g.length;a:for(;kb.length)return this;var c=function(a,b,d,i){for(var j=0,k=0,l=b,m;lj&&(j=m,k=l)}j>i&&k!=b&&(e.push(k),c(a,b,k,i),c(a,k,d,i))},d=b.length-1,e=[];e.push(0);for(e.push(d);b[0].equals(b[d]);)d--,e.push(d);c(b,0,d,a);a=[];e.sort(function(a,b){return a-b});for(d=0;d=g&&c<=h||g>=h&&c<=g&&c>=h)){j=-1;break}}else{i=b((a-f)*((h-g)/(f-e))+h,14);if(i==c&&(e=e&&a<=f||e>f&&a<=e&&a>=f)){j=-1;break}i<=c||g!=h&&(iMath.max(g,h))||(e=e&&af&&a=f)&&++j}return-1==j?1:!!(j&1)},intersects:function(a){var b=!1;if("OpenLayers.Geometry.Point"== +a.CLASS_NAME)b=this.containsPoint(a);else if("OpenLayers.Geometry.LineString"==a.CLASS_NAME)b=a.intersects(this);else if("OpenLayers.Geometry.LinearRing"==a.CLASS_NAME)b=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[a]);else for(var c=0,d=a.components.length;c0)b.bounds=c.components[0]},Point:function(a, +b){var c={points:[]};this.readChildNodes(a,c);if(!b.components)b.components=[];b.components.push(c.points[0])},coordinates:function(a,b){for(var c=this.getChildValue(a).replace(this.regExes.trimSpace,""),c=c.replace(this.regExes.trimComma,","),c=c.split(this.regExes.splitSpace),d,e=c.length,f=Array(e),g=0;ga?"0"+a:a}return'"'+a.getFullYear()+"-"+ +b(a.getMonth()+1)+"-"+b(a.getDate())+"T"+b(a.getHours())+":"+b(a.getMinutes())+":"+b(a.getSeconds())+'"'}},CLASS_NAME:"OpenLayers.Format.JSON"});OpenLayers.Format.GeoJSON=OpenLayers.Class(OpenLayers.Format.JSON,{ignoreExtraDims:!1,read:function(a,b,c){var b=b?b:"FeatureCollection",d=null,e=null;if(e="string"==typeof a?OpenLayers.Format.JSON.prototype.read.apply(this,[a,c]):a)if("string"!=typeof e.type)OpenLayers.Console.error("Bad GeoJSON - no type: "+a);else{if(this.isValidType(e,b))switch(b){case "Geometry":try{d=this.parseGeometry(e)}catch(f){OpenLayers.Console.error(f)}break;case "Feature":try{d=this.parseFeature(e),d.type="Feature"}catch(g){OpenLayers.Console.error(g)}break; +case "FeatureCollection":switch(d=[],e.type){case "Feature":try{d.push(this.parseFeature(e))}catch(h){d=null,OpenLayers.Console.error(h)}break;case "FeatureCollection":a=0;for(b=e.features.length;athis.layer.opacity&&(a.filter="alpha(opacity="+ +100*this.layer.opacity+")");a.position="absolute";this.layerAlphaHack&&(a.paddingTop=a.height,a.height="0",a.width="100%");this.frame&&this.frame.appendChild(this.imgDiv)}return this.imgDiv},initImage:function(){this.events.triggerEvent(this._loadEvent);var a=this.getImage();if(this.url&&a.getAttribute("src")==this.url)this.onImageLoad();else{var b=OpenLayers.Function.bind(function(){OpenLayers.Event.stopObservingElement(a);OpenLayers.Event.observe(a,"load",OpenLayers.Function.bind(this.onImageLoad, +this));OpenLayers.Event.observe(a,"error",OpenLayers.Function.bind(this.onImageError,this));this.imageReloadAttempts=0;this.setImgSrc(this.url)},this);a.getAttribute("src")==this.blankImageUrl?b():(OpenLayers.Event.observe(a,"load",b),OpenLayers.Event.observe(a,"error",b),this.crossOriginKeyword&&a.removeAttribute("crossorigin"),a.src=this.blankImageUrl)}},setImgSrc:function(a){var b=this.imgDiv;b.style.visibility="hidden";b.style.opacity=0;a&&(this.crossOriginKeyword&&("data:"!==a.substr(0,5)?b.setAttribute("crossorigin", +this.crossOriginKeyword):b.removeAttribute("crossorigin")),b.src=a)},getTile:function(){return this.frame?this.frame:this.getImage()},createBackBuffer:function(){if(this.imgDiv&&!this.isLoading){var a;this.frame?(a=this.frame.cloneNode(!1),a.appendChild(this.imgDiv)):a=this.imgDiv;this.imgDiv=null;return a}},onImageLoad:function(){var a=this.imgDiv;OpenLayers.Event.stopObservingElement(a);a.style.visibility="inherit";a.style.opacity=this.layer.opacity;this.isLoading=!1;this.canvasContext=null;this.events.triggerEvent("loadend"); +if(7>parseFloat(navigator.appVersion.split("MSIE")[1])&&this.layer&&this.layer.div){var b=document.createElement("span");b.style.display="none";var c=this.layer.div;c.appendChild(b);window.setTimeout(function(){b.parentNode===c&&b.parentNode.removeChild(b)},0)}!0===this.layerAlphaHack&&(a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a.src+"', sizingMethod='scale')")},onImageError:function(){var a=this.imgDiv;null!=a.src&&(this.imageReloadAttempts++,this.imageReloadAttempts<= +OpenLayers.IMAGE_RELOAD_ATTEMPTS?this.setImgSrc(this.layer.getURL(this.bounds)):(OpenLayers.Element.addClass(a,"olImageLoadError"),this.events.triggerEvent("loaderror"),this.onImageLoad()))},getCanvasContext:function(){if(OpenLayers.CANVAS_SUPPORTED&&this.imgDiv&&!this.isLoading){if(!this.canvasContext){var a=document.createElement("canvas");a.width=this.size.w;a.height=this.size.h;this.canvasContext=a.getContext("2d");this.canvasContext.drawImage(this.imgDiv,0,0)}return this.canvasContext}},CLASS_NAME:"OpenLayers.Tile.Image"});OpenLayers.Layer.Grid=OpenLayers.Class(OpenLayers.Layer.HTTPRequest,{tileSize:null,tileOriginCorner:"bl",tileOrigin:null,tileOptions:null,tileClass:OpenLayers.Tile.Image,grid:null,singleTile:!1,ratio:1.5,buffer:0,transitionEffect:null,numLoadingTiles:0,tileLoadingDelay:85,serverResolutions:null,moveTimerId:null,deferMoveGriddedTiles:null,tileQueueId:null,tileQueue:null,loading:!1,backBuffer:null,gridResolution:null,backBufferResolution:null,backBufferLonLat:null,backBufferTimerId:null,removeBackBufferDelay:null, +className:null,initialize:function(a,b,c,d){OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,arguments);this.grid=[];this.tileQueue=[];null===this.removeBackBufferDelay&&(this.removeBackBufferDelay=this.singleTile?0:2500);null===this.className&&(this.className=this.singleTile?"olLayerGridSingleTile":"olLayerGrid");OpenLayers.Animation.isNative||(this.deferMoveGriddedTiles=OpenLayers.Function.bind(function(){this.moveGriddedTiles(true);this.moveTimerId=null},this))},setMap:function(a){OpenLayers.Layer.HTTPRequest.prototype.setMap.call(this, +a);OpenLayers.Element.addClass(this.div,this.className)},removeMap:function(){null!==this.moveTimerId&&(window.clearTimeout(this.moveTimerId),this.moveTimerId=null);this.clearTileQueue();null!==this.backBufferTimerId&&(window.clearTimeout(this.backBufferTimerId),this.backBufferTimerId=null)},destroy:function(){this.removeBackBuffer();this.clearGrid();this.tileSize=this.grid=null;OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this,arguments)},clearGrid:function(){this.clearTileQueue();if(this.grid){for(var a= +0,b=this.grid.length;aa){a=c;break}if(-1===b)throw"no appropriate resolution in serverResolutions";}return a},getServerZoom:function(){var a=this.getServerResolution();return this.serverResolutions?OpenLayers.Util.indexOf(this.serverResolutions,a):this.map.getZoomForResolution(a)+(this.zoomOffset||0)},transformDiv:function(a){this.div.style.width=100*a+"%";this.div.style.height=100*a+"%";var b=this.map.getSize(),c=parseInt(this.map.layerContainerDiv.style.left,10),d=(parseInt(this.map.layerContainerDiv.style.top, +10)-b.h/2)*(a-1);this.div.style.left=(c-b.w/2)*(a-1)+"%";this.div.style.top=d+"%"},getResolutionScale:function(){return parseInt(this.div.style.width,10)/100},applyBackBuffer:function(a){null!==this.backBufferTimerId&&this.removeBackBuffer();var b=this.backBuffer;if(!b){b=this.createBackBuffer();if(!b)return;this.div.insertBefore(b,this.div.firstChild);this.backBuffer=b;var c=this.grid[0][0].bounds;this.backBufferLonLat={lon:c.left,lat:c.top};this.backBufferResolution=this.gridResolution}var c=b.style, +d=this.backBufferResolution/a;c.width=100*d+"%";c.height=100*d+"%";a=this.getViewPortPxFromLonLat(this.backBufferLonLat,a);c=parseInt(this.map.layerContainerDiv.style.left,10);d=parseInt(this.map.layerContainerDiv.style.top,10);b.style.left=Math.round(a.x-c)+"%";b.style.top=Math.round(a.y-d)+"%"},createBackBuffer:function(){var a;if(0=a.bottom-j*this.buffer||m-e*(a-1))this.shiftColumn(!0);else if(c<-e*a)this.shiftColumn(!1);else if(d>-f*(a-1))this.shiftRow(!0);else if(d<-f*a)this.shiftRow(!1);else break}},shiftRow:function(a){for(var b=this.grid,c=b[a?0:this.grid.length-1],d=this.getServerResolution(),e=a?-this.tileSize.h:this.tileSize.h,d=d*-e,f=a? +b.pop():b.shift(),g=0,h=c.length;ga;){var e=this.grid.pop();c=0;for(d=e.length;cb;)e=this.grid[c],f=e.pop(),this.destroyTile(f)},onMapResize:function(){this.singleTile&&(this.clearGrid(),this.setTileSize())},getTileBounds:function(a){var b=this.maxExtent,c=this.getResolution(),d=c*this.tileSize.w,c=c*this.tileSize.h,e=this.getLonLatFromViewPortPx(a),a=b.left+d*Math.floor((e.lon-b.left)/d),b=b.bottom+ +c*Math.floor((e.lat-b.bottom)/c);return new OpenLayers.Bounds(a,b,a+d,b+c)},CLASS_NAME:"OpenLayers.Layer.Grid"});OpenLayers.Format.ArcXML=OpenLayers.Class(OpenLayers.Format.XML,{fontStyleKeys:"antialiasing blockout font fontcolor fontsize fontstyle glowing interval outline printmode shadow transparency".split(" "),request:null,response:null,initialize:function(a){this.request=new OpenLayers.Format.ArcXML.Request;this.response=new OpenLayers.Format.ArcXML.Response;if(a)if("feature"==a.requesttype){this.request.get_image=null;var b=this.request.get_feature.query;this.addCoordSys(b.featurecoordsys,a.featureCoordSys); +this.addCoordSys(b.filtercoordsys,a.filterCoordSys);a.polygon?(b.isspatial=!0,b.spatialfilter.polygon=a.polygon):a.envelope&&(b.isspatial=!0,b.spatialfilter.envelope={minx:0,miny:0,maxx:0,maxy:0},this.parseEnvelope(b.spatialfilter.envelope,a.envelope))}else"image"==a.requesttype?(this.request.get_feature=null,b=this.request.get_image.properties,this.parseEnvelope(b.envelope,a.envelope),this.addLayers(b.layerlist,a.layers),this.addImageSize(b.imagesize,a.tileSize),this.addCoordSys(b.featurecoordsys, +a.featureCoordSys),this.addCoordSys(b.filtercoordsys,a.filterCoordSys)):this.request=null;OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},parseEnvelope:function(a,b){b&&4==b.length&&(a.minx=b[0],a.miny=b[1],a.maxx=b[2],a.maxy=b[3])},addLayers:function(a,b){for(var c=0,d=b.length;cg.where.length)continue;var h=null,h="boolean"==typeof g.spatialfilter&&g.spatialfilter?this.createElementNS("","SPATIALQUERY"):this.createElementNS("","QUERY");h.setAttribute("where",g.where);"number"==typeof g.accuracy&&0g.featurelimit&&h.setAttribute("featurelimit", +g.featurelimit);"string"==typeof g.subfields&&"#ALL#"!=g.subfields&&h.setAttribute("subfields",g.subfields);"string"==typeof g.joinexpression&&0b.status)this.events.triggerEvent("success",a),e&&e(b); +if(b.status&&(200>b.status||300<=b.status))this.events.triggerEvent("failure",a),f&&f(b)},GET:function(a){a=OpenLayers.Util.extend(a,{method:"GET"});return OpenLayers.Request.issue(a)},POST:function(a){a=OpenLayers.Util.extend(a,{method:"POST"});a.headers=a.headers?a.headers:{};"CONTENT-TYPE"in OpenLayers.Util.upperCaseObject(a.headers)||(a.headers["Content-Type"]="application/xml");return OpenLayers.Request.issue(a)},PUT:function(a){a=OpenLayers.Util.extend(a,{method:"PUT"});a.headers=a.headers? +a.headers:{};"CONTENT-TYPE"in OpenLayers.Util.upperCaseObject(a.headers)||(a.headers["Content-Type"]="application/xml");return OpenLayers.Request.issue(a)},DELETE:function(a){a=OpenLayers.Util.extend(a,{method:"DELETE"});return OpenLayers.Request.issue(a)},HEAD:function(a){a=OpenLayers.Util.extend(a,{method:"HEAD"});return OpenLayers.Request.issue(a)},OPTIONS:function(a){a=OpenLayers.Util.extend(a,{method:"OPTIONS"});return OpenLayers.Request.issue(a)}};OpenLayers.Layer.ArcIMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{ClientVersion:"9.2",ServiceName:""},featureCoordSys:"4326",filterCoordSys:"4326",layers:null,async:!0,name:"ArcIMS",isBaseLayer:!0,DEFAULT_OPTIONS:{tileSize:new OpenLayers.Size(512,512),featureCoordSys:"4326",filterCoordSys:"4326",layers:null,isBaseLayer:!0,async:!0,name:"ArcIMS"},initialize:function(a,b,c){this.tileSize=new OpenLayers.Size(512,512);this.params=OpenLayers.Util.applyDefaults({ServiceName:c.serviceName}, +this.DEFAULT_PARAMS);this.options=OpenLayers.Util.applyDefaults(c,this.DEFAULT_OPTIONS);OpenLayers.Layer.Grid.prototype.initialize.apply(this,[a,b,this.params,c]);if(this.transparent&&(this.isBaseLayer||(this.isBaseLayer=!1),"image/jpeg"==this.format))this.format=OpenLayers.Util.alphaHack()?"image/gif":"image/png";null===this.options.layers&&(this.options.layers=[])},getURL:function(a){var b="",a=this.adjustBounds(a),a=new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options,{requesttype:"image", +envelope:a.toArray(),tileSize:this.tileSize})),a=new OpenLayers.Request.POST({url:this.getFullRequestString(),data:a.write(),async:!1});if(null!=a){b=a.responseXML;if(!b||!b.documentElement)b=a.responseText;b=this.getUrlOrImage((new OpenLayers.Format.ArcXML).read(b).image.output)}return b},getURLasync:function(a,b,c){a=this.adjustBounds(a);a=new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options,{requesttype:"image",envelope:a.toArray(),tileSize:this.tileSize}));OpenLayers.Request.POST({url:this.getFullRequestString(), +async:!0,data:a.write(),callback:function(a){var e=a.responseXML;if(!e||!e.documentElement)e=a.responseText;a=(new OpenLayers.Format.ArcXML).read(e);b.call(c,this.getUrlOrImage(a.image.output))},scope:this})},getUrlOrImage:function(a){var b="";a.url?b=a.url:a.data&&(b="data:image/"+a.type+";base64,"+a.data);return b},setLayerQuery:function(a,b){for(var c=0;cOpenStreetMap",sphericalMercator:!0,wrapDateLine:!0,tileOptions:null,initialize:function(a,b,c){OpenLayers.Layer.XYZ.prototype.initialize.apply(this,arguments);this.tileOptions=OpenLayers.Util.extend({crossOriginKeyword:"anonymous"}, +this.options&&this.options.tileOptions)},clone:function(a){null==a&&(a=new OpenLayers.Layer.OSM(this.name,this.url,this.getOptions()));return a=OpenLayers.Layer.XYZ.prototype.clone.apply(this,[a])},CLASS_NAME:"OpenLayers.Layer.OSM"});OpenLayers.Renderer=OpenLayers.Class({container:null,root:null,extent:null,locked:!1,size:null,resolution:null,map:null,featureDx:0,initialize:function(a,b){this.container=OpenLayers.Util.getElement(a);OpenLayers.Util.extend(this,b)},destroy:function(){this.map=this.resolution=this.size=this.extent=this.container=null},supported:function(){return!1},setExtent:function(a,b){this.extent=a.clone();if(this.map.baseLayer&&this.map.baseLayer.wrapDateLine){var c=a.getWidth()/this.map.getExtent().getWidth(), +a=a.scale(1/c);this.extent=a.wrapDateLine(this.map.getMaxExtent()).scale(c)}b&&(this.resolution=null);return!0},setSize:function(a){this.size=a.clone();this.resolution=null},getResolution:function(){return this.resolution=this.resolution||this.map.getResolution()},drawFeature:function(a,b){null==b&&(b=a.style);if(a.geometry){var c=a.geometry.getBounds();if(c){var d;this.map.baseLayer&&this.map.baseLayer.wrapDateLine&&(d=this.map.getMaxExtent());c.intersectsBounds(this.extent,{worldBounds:d})?this.calculateFeatureDx(c, +d):b={display:"none"};c=this.drawGeometry(a.geometry,b,a.id);if("none"!=b.display&&b.label&&!1!==c){d=a.geometry.getCentroid();if(b.labelXOffset||b.labelYOffset){var e=isNaN(b.labelXOffset)?0:b.labelXOffset,f=isNaN(b.labelYOffset)?0:b.labelYOffset,g=this.getResolution();d.move(e*g,f*g)}this.drawText(a.id,b,d)}else this.removeText(a.id);return c}}},calculateFeatureDx:function(a,b){this.featureDx=0;if(b){var c=b.getWidth();this.featureDx=Math.round(((a.left+a.right)/2-(this.extent.left+this.extent.right)/ +2)/c)*c}},drawGeometry:function(){},drawText:function(){},removeText:function(){},clear:function(){},getFeatureIdFromEvent:function(){},eraseFeatures:function(a){OpenLayers.Util.isArray(a)||(a=[a]);for(var b=0,c=a.length;bh.length)&&(a=this.getLocalXY(a),e=a[0],g=a[1],!isNaN(e)&&!isNaN(g))){this.canvas.lineCap="round";this.canvas.lineJoin="round";this.hitDetection&&(this.hitContext.lineCap="round",this.hitContext.lineJoin="round");if(b.graphicName in this.cachedSymbolBounds)d=this.cachedSymbolBounds[b.graphicName];else{d=new OpenLayers.Bounds;for(a=0;a=this.map.Z_INDEX_BASE.Feature?this.layer.setZIndex(a):this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))},CLASS_NAME:"OpenLayers.Handler.Feature"});OpenLayers.Control.DragFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,onStart:function(){},onDrag:function(){},onComplete:function(){},onEnter:function(){},onLeave:function(){},documentDrag:!1,layer:null,feature:null,dragCallbacks:{},featureCallbacks:{},lastPixel:null,initialize:function(a,b){OpenLayers.Control.prototype.initialize.apply(this,[b]);this.layer=a;this.handlers={drag:new OpenLayers.Handler.Drag(this,OpenLayers.Util.extend({down:this.downFeature,move:this.moveFeature, +up:this.upFeature,out:this.cancel,done:this.doneDragging},this.dragCallbacks),{documentDrag:this.documentDrag}),feature:new OpenLayers.Handler.Feature(this,this.layer,OpenLayers.Util.extend({click:this.clickFeature,clickout:this.clickoutFeature,over:this.overFeature,out:this.outFeature},this.featureCallbacks),{geometryTypes:this.geometryTypes})}},clickFeature:function(a){this.handlers.feature.touch&&(!this.over&&this.overFeature(a))&&(this.handlers.drag.dragstart(this.handlers.feature.evt),this.handlers.drag.stopDown= +!1)},clickoutFeature:function(a){this.handlers.feature.touch&&this.over&&(this.outFeature(a),this.handlers.drag.stopDown=!0)},destroy:function(){this.layer=null;OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){return this.handlers.feature.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){this.handlers.drag.deactivate();this.handlers.feature.deactivate();this.feature=null;this.dragging=!1;this.lastPixel=null;OpenLayers.Element.removeClass(this.map.viewPortDiv, +this.displayClass+"Over");return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},overFeature:function(a){var b=!1;this.handlers.drag.dragging?this.over=this.feature.id==a.id?!0:!1:(this.feature=a,this.handlers.drag.activate(),this.over=b=!0,OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass+"Over"),this.onEnter(a));return b},downFeature:function(a){this.lastPixel=a;this.onStart(this.feature,a)},moveFeature:function(a){var b=this.map.getResolution();this.feature.geometry.move(b* +(a.x-this.lastPixel.x),b*(this.lastPixel.y-a.y));this.layer.drawFeature(this.feature);this.lastPixel=a;this.onDrag(this.feature,a)},upFeature:function(){this.over||this.handlers.drag.deactivate()},doneDragging:function(a){this.onComplete(this.feature,a)},outFeature:function(a){this.handlers.drag.dragging?this.feature.id==a.id&&(this.over=!1):(this.over=!1,this.handlers.drag.deactivate(),OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over"),this.onLeave(a),this.feature=null)}, +cancel:function(){this.handlers.drag.deactivate();this.over=!1},setMap:function(a){this.handlers.drag.setMap(a);this.handlers.feature.setMap(a);OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.DragFeature"});OpenLayers.StyleMap=OpenLayers.Class({styles:null,extendDefault:!0,initialize:function(a,b){this.styles={"default":new OpenLayers.Style(OpenLayers.Feature.Vector.style["default"]),select:new OpenLayers.Style(OpenLayers.Feature.Vector.style.select),temporary:new OpenLayers.Style(OpenLayers.Feature.Vector.style.temporary),"delete":new OpenLayers.Style(OpenLayers.Feature.Vector.style["delete"])};if(a instanceof OpenLayers.Style)this.styles["default"]=a,this.styles.select=a,this.styles.temporary=a,this.styles["delete"]= +a;else if("object"==typeof a)for(var c in a)if(a[c]instanceof OpenLayers.Style)this.styles[c]=a[c];else if("object"==typeof a[c])this.styles[c]=new OpenLayers.Style(a[c]);else{this.styles["default"]=new OpenLayers.Style(a);this.styles.select=new OpenLayers.Style(a);this.styles.temporary=new OpenLayers.Style(a);this.styles["delete"]=new OpenLayers.Style(a);break}OpenLayers.Util.extend(this,b)},destroy:function(){for(var a in this.styles)this.styles[a].destroy();this.styles=null},createSymbolizer:function(a, +b){a||(a=new OpenLayers.Feature.Vector);this.styles[b]||(b="default");a.renderIntent=b;var c={};this.extendDefault&&"default"!=b&&(c=this.styles["default"].createSymbolizer(a));return OpenLayers.Util.extend(c,this.styles[b].createSymbolizer(a))},addUniqueValueRules:function(a,b,c,d){var e=[],f;for(f in c)e.push(new OpenLayers.Rule({symbolizer:c[f],context:d,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:b,value:f})}));this.styles[a].addRules(e)},CLASS_NAME:"OpenLayers.StyleMap"});OpenLayers.Layer.Vector=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:!1,isFixed:!1,features:null,filter:null,selectedFeatures:null,unrenderedFeatures:null,reportError:!0,style:null,styleMap:null,strategies:null,protocol:null,renderers:["SVG","VML","Canvas"],renderer:null,rendererOptions:null,geometryType:null,drawn:!1,ratio:1,initialize:function(a,b){OpenLayers.Layer.prototype.initialize.apply(this,arguments);(!this.renderer||!this.renderer.supported())&&this.assignRenderer();if(!this.renderer|| +!this.renderer.supported())this.renderer=null,this.displayError();this.styleMap||(this.styleMap=new OpenLayers.StyleMap);this.features=[];this.selectedFeatures=[];this.unrenderedFeatures={};if(this.strategies)for(var c=0,d=this.strategies.length;c
${copyrights}Terms of Use', +metadata:null,type:"Road",culture:"en-US",metadataParams:null,tileOptions:null,initialize:function(a){a=OpenLayers.Util.applyDefaults({sphericalMercator:!0},a);OpenLayers.Layer.XYZ.prototype.initialize.apply(this,[a.name||"Bing "+(a.type||this.type),null,a]);this.tileOptions=OpenLayers.Util.extend({crossOriginKeyword:"anonymous"},this.options.tileOptions);this.loadMetadata()},loadMetadata:function(){this._callbackId="_callback_"+this.id.replace(/\./g,"_");window[this._callbackId]=OpenLayers.Function.bind(OpenLayers.Layer.Bing.processMetadata, +this);var a=OpenLayers.Util.applyDefaults({key:this.key,jsonp:this._callbackId,include:"ImageryProviders"},this.metadataParams),a="http://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+this.type+"?"+OpenLayers.Util.getParameterString(a),b=document.createElement("script");b.type="text/javascript";b.src=a;b.id=this._callbackId;document.getElementsByTagName("head")[0].appendChild(b)},initLayer:function(){var a=this.metadata.resourceSets[0].resources[0],b=a.imageUrl.replace("{quadkey}","${quadkey}"), +b=b.replace("{culture}",this.culture);this.url=[];for(var c=0;c=l.zoomMin)&&(e+=f.attribution+" ")}this.attribution=OpenLayers.String.format(this.attributionTemplate,{type:this.type.toLowerCase(),logo:a.brandLogoUri,copyrights:e});this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"attribution"})}},setMap:function(){OpenLayers.Layer.XYZ.prototype.setMap.apply(this,arguments);this.updateAttribution();this.map.events.register("moveend", +this,this.updateAttribution)},clone:function(a){null==a&&(a=new OpenLayers.Layer.Bing(this.options));return a=OpenLayers.Layer.XYZ.prototype.clone.apply(this,[a])},destroy:function(){this.map&&this.map.events.unregister("moveend",this,this.updateAttribution);OpenLayers.Layer.XYZ.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Layer.Bing"}); +OpenLayers.Layer.Bing.processMetadata=function(a){this.metadata=a;this.initLayer();a=document.getElementById(this._callbackId);a.parentNode.removeChild(a);window[this._callbackId]=void 0;delete this._callbackId};OpenLayers.Layer.PointGrid=OpenLayers.Class(OpenLayers.Layer.Vector,{dx:null,dy:null,ratio:1.5,maxFeatures:250,rotation:0,origin:null,gridBounds:null,initialize:function(a){a=a||{};OpenLayers.Layer.Vector.prototype.initialize.apply(this,[a.name,a])},setMap:function(a){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments);a.events.register("moveend",this,this.onMoveEnd)},removeMap:function(a){a.events.unregister("moveend",this,this.onMoveEnd);OpenLayers.Layer.Vector.prototype.removeMap.apply(this, +arguments)},setRatio:function(a){this.ratio=a;this.updateGrid(!0)},setMaxFeatures:function(a){this.maxFeatures=a;this.updateGrid(!0)},setSpacing:function(a,b){this.dx=a;this.dy=b||a;this.updateGrid(!0)},setOrigin:function(a){this.origin=a;this.updateGrid(!0)},getOrigin:function(){this.origin||(this.origin=this.map.getExtent().getCenterLonLat());return this.origin},setRotation:function(a){this.rotation=a;this.updateGrid(!0)},onMoveEnd:function(){this.updateGrid()},getViewBounds:function(){var a=this.map.getExtent(); +if(this.rotation){var b=this.getOrigin(),b=new OpenLayers.Geometry.Point(b.lon,b.lat),a=a.toGeometry();a.rotate(-this.rotation,b);a=a.getBounds()}return a},updateGrid:function(a){if(a||this.invalidBounds()){var b=this.getViewBounds(),c=this.getOrigin(),a=new OpenLayers.Geometry.Point(c.lon,c.lat),d=b.getWidth(),e=b.getHeight(),f=d/e,g=Math.sqrt(this.dx*this.dy*this.maxFeatures/f),d=Math.min(d*this.ratio,g*f),e=Math.min(e*this.ratio,g),b=b.getCenterLonLat();this.gridBounds=new OpenLayers.Bounds(b.lon- +d/2,b.lat-e/2,b.lon+d/2,b.lat+e/2);for(var b=Math.floor(e/this.dy),d=Math.floor(d/this.dx),e=c.lon+this.dx*Math.ceil((this.gridBounds.left-c.lon)/this.dx),c=c.lat+this.dy*Math.ceil((this.gridBounds.bottom-c.lat)/this.dy),g=Array(b*d),h,i=0;iwindow.opera.version()&&(b=-b)):a.detail&&(b=-a.detail/ +3),this.delta+=b,this.interval)?(window.clearTimeout(this._timeoutId),this._timeoutId=window.setTimeout(OpenLayers.Function.bind(function(){this.wheelZoom(a)},this),this.interval)):this.wheelZoom(a)),OpenLayers.Event.stop(a))}},wheelZoom:function(a){var b=this.delta;this.delta=0;b&&(this.mousePosition&&(a.xy=this.mousePosition),a.xy||(a.xy=this.map.getPixelFromLonLat(this.map.getCenter())),0>b?this.callback("down",[a,this.cumulative?b:-1]):this.callback("up",[a,this.cumulative?b:1]))},mousemove:function(a){this.mousePosition= +a.xy},activate:function(a){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var b=this.wheelListener;OpenLayers.Event.observe(window,"DOMMouseScroll",b);OpenLayers.Event.observe(window,"mousewheel",b);OpenLayers.Event.observe(document,"mousewheel",b);return!0}return!1},deactivate:function(a){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){var b=this.wheelListener;OpenLayers.Event.stopObserving(window,"DOMMouseScroll",b);OpenLayers.Event.stopObserving(window,"mousewheel", +b);OpenLayers.Event.stopObserving(document,"mousewheel",b);return!0}return!1},CLASS_NAME:"OpenLayers.Handler.MouseWheel"});OpenLayers.Symbolizer=OpenLayers.Class({zIndex:0,initialize:function(a){OpenLayers.Util.extend(this,a)},clone:function(){return new (eval(this.CLASS_NAME))(OpenLayers.Util.extend({},this))},CLASS_NAME:"OpenLayers.Symbolizer"});OpenLayers.Symbolizer.Raster=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(a){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Raster"});OpenLayers.Rule=OpenLayers.Class({id:null,name:null,title:null,description:null,context:null,filter:null,elseFilter:!1,symbolizer:null,symbolizers:null,minScaleDenominator:null,maxScaleDenominator:null,initialize:function(a){this.symbolizer={};OpenLayers.Util.extend(this,a);this.symbolizers&&delete this.symbolizer;this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var a in this.symbolizer)this.symbolizer[a]=null;this.symbolizer=null;delete this.symbolizers},evaluate:function(a){var b= +this.getContext(a),c=!0;if(this.minScaleDenominator||this.maxScaleDenominator)var d=a.layer.map.getScale();this.minScaleDenominator&&(c=d>=OpenLayers.Style.createLiteral(this.minScaleDenominator,b));c&&this.maxScaleDenominator&&(c=dthis.maxZIndex&&(this.maxZIndex=b)},getNextElement:function(a){a+=1;if(aa.left&&f.righta.left&&f.lefta.length)throw Error("At least two point features have to be added to create a line from");for(var c=Array(a.length-1),d,e,f,g=0,h=a.length;gthis.opacity&&a.setOpacity(this.opacity);this.map&&this.map.getExtent()&&(a.map=this.map,this.drawMarker(a))},removeMarker:function(a){this.markers&&this.markers.length&&(OpenLayers.Util.removeItem(this.markers,a),a.erase())},clearMarkers:function(){if(null!=this.markers)for(;0=a.maxResolution)return null;for(var c= +{node:this.getGeoTolerance(a.nodeTolerance,c),vertex:this.getGeoTolerance(a.vertexTolerance,c),edge:this.getGeoTolerance(a.edgeTolerance,c)},d=Math.max(c.node,c.vertex,c.edge),e={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY},f=!1,g=a.layer.features,h,i,j,k,l,m,n=this.precedence.length,o=new OpenLayers.LonLat(b.x,b.y),p=0,q=g.length;p4?this._object.open(a,f,i,m,n):arguments.length>3?this._object.open(a,f,i,m):this._object.open(a,f,i);this.readyState=b.OPENED;c(this);this._object.onreadystatechange=function(){if(!g||i){o.readyState=o._object.readyState;d(o);if(o._aborted)o.readyState=b.UNSENT;else{if(o.readyState==b.DONE){delete o._data;e(o);h&&i&&window.detachEvent("onunload", +q)}p!=o.readyState&&c(o);p=o.readyState}}}};b.prototype.send=function(a){b.onsend&&b.onsend.apply(this,arguments);arguments.length||(a=null);if(a&&a.nodeType){a=window.XMLSerializer?(new window.XMLSerializer).serializeToString(a):a.xml;this._headers["Content-Type"]||this._object.setRequestHeader("Content-Type","application/xml")}this._data=a;a:{this._object.send(this._data);if(g&&!this._async){this.readyState=b.OPENED;for(d(this);this.readyStateb.UNSENT)this._aborted=true;this._object.abort();e(this);this.readyState=b.UNSENT;delete this._data};b.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()};b.prototype.getResponseHeader=function(a){return this._object.getResponseHeader(a)};b.prototype.setRequestHeader=function(a,b){if(!this._headers)this._headers={};this._headers[a]=b;return this._object.setRequestHeader(a, +b)};b.prototype.addEventListener=function(a,b,c){for(var d=0,e;e=this._listeners[d];d++)if(e[0]==a&&e[1]==b&&e[2]==c)return;this._listeners.push([a,b,c])};b.prototype.removeEventListener=function(a,b,c){for(var d=0,e;e=this._listeners[d];d++)if(e[0]==a&&e[1]==b&&e[2]==c)break;e&&this._listeners.splice(d,1)};b.prototype.dispatchEvent=function(a){a={type:a.type,target:this,currentTarget:this,eventPhase:2,bubbles:a.bubbles,cancelable:a.cancelable,timeStamp:a.timeStamp,stopPropagation:function(){},preventDefault:function(){}, +initEvent:function(){}};a.type=="readystatechange"&&this.onreadystatechange&&(this.onreadystatechange.handleEvent||this.onreadystatechange).apply(this,[a]);for(var b=0,c;c=this._listeners[b];b++)c[0]==a.type&&!c[2]&&(c[1].handleEvent||c[1]).apply(this,[a])};b.prototype.toString=function(){return"[object XMLHttpRequest]"};b.toString=function(){return"[XMLHttpRequest]"};window.Function.prototype.apply||(window.Function.prototype.apply=function(a,b){b||(b=[]);a.__func=this;a.__func(b[0],b[1],b[2],b[3], +b[4]);delete a.__func});OpenLayers.Request.XMLHttpRequest=b})();OpenLayers.Format.KML=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{kml:"http://www.opengis.net/kml/2.2",gx:"http://www.google.com/kml/ext/2.2"},kmlns:"http://earth.google.com/kml/2.0",placemarksDesc:"No description available",foldersName:"OpenLayers export",foldersDesc:"Exported on "+new Date,extractAttributes:!0,kvpAttributes:!1,extractStyles:!1,extractTracks:!1,trackAttributes:null,internalns:null,features:null,styles:null,styleBaseUrl:"",fetched:null,maxDepth:0,initialize:function(a){this.regExes= +{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g,kmlColor:/(\w{2})(\w{2})(\w{2})(\w{2})/,kmlIconPalette:/root:\/\/icons\/palette-(\d+)(\.\w+)/,straightBracket:/\$\[(.*?)\]/g};this.externalProjection=new OpenLayers.Projection("EPSG:4326");OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(a){this.features=[];this.styles={};this.fetched={};return this.parseData(a,{depth:0,styleBaseUrl:this.styleBaseUrl})},parseData:function(a,b){"string"==typeof a&& +(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));for(var c=["Link","NetworkLink","Style","StyleMap","Placemark"],d=0,e=c.length;d=this.maxDepth)return!1;var c=OpenLayers.Util.extend({},b);c.depth++;for(var d=0,e=a.length;d=e.length)){switch(e.length){case 1:f=e[0];break;case 2:f=e[0];e=e[1];f=3==f.nodeType||4==f.nodeType?f:e;break;default:f=e[1]}if(3==f.nodeType||4==f.nodeType)if(d=d.prefix?d.nodeName.split(":")[1]:d.nodeName,f=OpenLayers.Util.getXmlNodeValue(f))f=f.replace(this.regExes.trimSpace,""),b[d]=f}return b},parseExtendedData:function(a){var b={},c,d,e,f,g=a.getElementsByTagName("Data");c=0;for(d=g.length;c"+this.contentDiv.innerHTML+"",b=this.map?this.map.div:document.body,c=OpenLayers.Util.getRenderedDimensions(a, +null,{displayClass:this.displayClass,containerElement:b}),d=this.getSafeContentSize(c),e=null;d.equals(c)?e=c:(c={w:d.wa.w-this.map.paddingForPopups.right&&(c.x=a.w-this.map.paddingForPopups.right-this.size.w); +b.ya.h-this.map.paddingForPopups.bottom&&(c.y=a.h-this.map.paddingForPopups.bottom-this.size.h);this.map.pan(b.x-c.x,b.y-c.y)},registerEvents:function(){this.events=new OpenLayers.Events(this,this.div,null,!0);this.events.on({mousedown:this.onmousedown,mousemove:this.onmousemove,mouseup:this.onmouseup,click:this.onclick,mouseout:this.onmouseout,dblclick:this.ondblclick,touchstart:function(a){OpenLayers.Event.stop(a,!0)}, +scope:this})},onmousedown:function(a){this.mousedown=!0;OpenLayers.Event.stop(a,!0)},onmousemove:function(a){this.mousedown&&OpenLayers.Event.stop(a,!0)},onmouseup:function(a){this.mousedown&&(this.mousedown=!1,OpenLayers.Event.stop(a,!0))},onclick:function(a){OpenLayers.Event.stop(a,!0)},onmouseout:function(){this.mousedown=!1},ondblclick:function(a){OpenLayers.Event.stop(a,!0)},CLASS_NAME:"OpenLayers.Popup"});OpenLayers.Popup.WIDTH=200;OpenLayers.Popup.HEIGHT=200;OpenLayers.Popup.COLOR="white"; +OpenLayers.Popup.OPACITY=1;OpenLayers.Popup.BORDER="0px";OpenLayers.Popup.Anchored=OpenLayers.Class(OpenLayers.Popup,{relativePosition:null,keepInMap:!0,anchor:null,initialize:function(a,b,c,d,e,f,g){OpenLayers.Popup.prototype.initialize.apply(this,[a,b,c,d,f,g]);this.anchor=null!=e?e:{size:new OpenLayers.Size(0,0),offset:new OpenLayers.Pixel(0,0)}},destroy:function(){this.relativePosition=this.anchor=null;OpenLayers.Popup.prototype.destroy.apply(this,arguments)},show:function(){this.updatePosition();OpenLayers.Popup.prototype.show.apply(this,arguments)}, +moveTo:function(a){var b=this.relativePosition;this.relativePosition=this.calculateRelativePosition(a);a=this.calculateNewPx(a);OpenLayers.Popup.prototype.moveTo.apply(this,Array(a));this.relativePosition!=b&&this.updateRelativePosition()},setSize:function(a){OpenLayers.Popup.prototype.setSize.apply(this,arguments);this.lonlat&&this.map&&this.moveTo(this.map.getLayerPxFromLonLat(this.lonlat))},calculateRelativePosition:function(a){a=this.map.getLonLatFromLayerPx(a);a=this.map.getExtent().determineQuadrant(a); +return OpenLayers.Bounds.oppositeQuadrant(a)},updateRelativePosition:function(){},calculateNewPx:function(a){var a=a.offset(this.anchor.offset),b=this.size||this.contentSize,c="t"==this.relativePosition.charAt(0);a.y+=c?-b.h:this.anchor.size.h;c="l"==this.relativePosition.charAt(1);a.x+=c?-b.w:this.anchor.size.w;return a},CLASS_NAME:"OpenLayers.Popup.Anchored"});/* + Apache 2 + + Contains portions of Rico + + Copyright 2005 Sabre Airline Solutions + + Licensed under the Apache License, Version 2.0 (the "License"); you + may not use this file except in compliance with the License. You + may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. See the License for the specific language governing + permissions and limitations under the License. +*/ +OpenLayers.Console.warn("OpenLayers.Rico is deprecated");OpenLayers.Rico=OpenLayers.Rico||{}; +OpenLayers.Rico.Color=OpenLayers.Class({initialize:function(a,b,c){this.rgb={r:a,g:b,b:c}},setRed:function(a){this.rgb.r=a},setGreen:function(a){this.rgb.g=a},setBlue:function(a){this.rgb.b=a},setHue:function(a){var b=this.asHSB();b.h=a;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(b.h,b.s,b.b)},setSaturation:function(a){var b=this.asHSB();b.s=a;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(b.h,b.s,b.b)},setBrightness:function(a){var b=this.asHSB();b.b=a;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(b.h,b.s,b.b)}, +darken:function(a){var b=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(b.h,b.s,Math.max(b.b-a,0))},brighten:function(a){var b=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(b.h,b.s,Math.min(b.b+a,1))},blend:function(a){this.rgb.r=Math.floor((this.rgb.r+a.rgb.r)/2);this.rgb.g=Math.floor((this.rgb.g+a.rgb.g)/2);this.rgb.b=Math.floor((this.rgb.b+a.rgb.b)/2)},isBright:function(){this.asHSB();return 0.5c;c++)a+=b.charAt(c)+b.charAt(c);0==a.indexOf("#")&&(a=a.substring(1));b=a.substring(0,2);c=a.substring(2,4);a=a.substring(4,6);return new OpenLayers.Rico.Color(parseInt(b,16),parseInt(c,16),parseInt(a,16))}; +OpenLayers.Rico.Color.createColorFromBackground=function(a){var b=OpenLayers.Element.getStyle(OpenLayers.Util.getElement(a),"backgroundColor");return"transparent"==b&&a.parentNode?OpenLayers.Rico.Color.createColorFromBackground(a.parentNode):null==b?new OpenLayers.Rico.Color(255,255,255):0==b.indexOf("rgb(")?(a=b.substring(4,b.length-1).split(","),new OpenLayers.Rico.Color(parseInt(a[0]),parseInt(a[1]),parseInt(a[2]))):0==b.indexOf("#")?OpenLayers.Rico.Color.createFromHex(b):new OpenLayers.Rico.Color(255, +255,255)}; +OpenLayers.Rico.Color.HSBtoRGB=function(a,b,c){var d=0,e=0,f=0;if(0==b)f=e=d=parseInt(255*c+0.5);else{var a=6*(a-Math.floor(a)),g=a-Math.floor(a),h=c*(1-b),i=c*(1-b*g),b=c*(1-b*(1-g));switch(parseInt(a)){case 0:d=255*c+0.5;e=255*b+0.5;f=255*h+0.5;break;case 1:d=255*i+0.5;e=255*c+0.5;f=255*h+0.5;break;case 2:d=255*h+0.5;e=255*c+0.5;f=255*b+0.5;break;case 3:d=255*h+0.5;e=255*i+0.5;f=255*c+0.5;break;case 4:d=255*b+0.5;e=255*h+0.5;f=255*c+0.5;break;case 5:d=255*c+0.5,e=255*h+0.5,f=255*i+0.5}}return{r:parseInt(d),g:parseInt(e), +b:parseInt(f)}};OpenLayers.Rico.Color.RGBtoHSB=function(a,b,c){var d,e=a>b?a:b;c>e&&(e=c);var f=aa&&(a+=1)}return{h:a,s:d,b:e/255}};OpenLayers.Console.warn("OpenLayers.Rico is deprecated");OpenLayers.Rico=OpenLayers.Rico||{}; +OpenLayers.Rico.Corner={round:function(a,b){a=OpenLayers.Util.getElement(a);this._setOptions(b);var c=this.options.color;"fromElement"==this.options.color&&(c=this._background(a));var d=this.options.bgColor;"fromParent"==this.options.bgColor&&(d=this._background(a.offsetParent));this._roundCornersImpl(a,c,d)},changeColor:function(a,b){a.style.backgroundColor=b;for(var c=a.parentNode.getElementsByTagName("span"),d=0;d"+a.innerHTML+""},_roundTopCorners:function(a,b,c){for(var d=this._createCorner(c),e=0;ec.status?(c=this.parseResponse(c,b.readOptions))&&!1!==c.success?(b.readOptions&&"object"==b.readOptions.output?OpenLayers.Util.extend(a,c):a.features=c,a.code=OpenLayers.Protocol.Response.SUCCESS):(a.code=OpenLayers.Protocol.Response.FAILURE,a.error=c):a.code=OpenLayers.Protocol.Response.FAILURE;b.callback.call(b.scope,a)}},parseResponse:function(a,b){var c=a.responseXML;if(!c||!c.documentElement)c=a.responseText;if(!c||0>=c.length)return null;c=null!==this.readFormat?this.readFormat.read(c): +this.format.read(c,b);if(!this.featureNS){var d=this.readFormat||this.format;this.featureNS=d.featureNS;d.autoConfig=!1;this.geometryName||this.setGeometryName(d.geometryName)}return c},commit:function(a,b){b=OpenLayers.Util.extend({},b);OpenLayers.Util.applyDefaults(b,this.options);var c=new OpenLayers.Protocol.Response({requestType:"commit",reqFeatures:a});c.priv=OpenLayers.Request.POST({url:b.url,headers:b.headers,data:this.format.write(a,b),callback:this.createCallback(this.handleCommit,c,b)}); +return c},handleCommit:function(a,b){if(b.callback){var c=a.priv,d=c.responseXML;if(!d||!d.documentElement)d=c.responseText;c=this.format.read(d)||{};a.insertIds=c.insertIds||[];c.success?a.code=OpenLayers.Protocol.Response.SUCCESS:(a.code=OpenLayers.Protocol.Response.FAILURE,a.error=c);b.callback.call(b.scope,a)}},filterDelete:function(a,b){b=OpenLayers.Util.extend({},b);OpenLayers.Util.applyDefaults(b,this.options);new OpenLayers.Protocol.Response({requestType:"commit"});var c=this.format.createElementNSPlus("wfs:Transaction", +{attributes:{service:"WFS",version:this.version}}),d=this.format.createElementNSPlus("wfs:Delete",{attributes:{typeName:(b.featureNS?this.featurePrefix+":":"")+b.featureType}});b.featureNS&&d.setAttribute("xmlns:"+this.featurePrefix,b.featureNS);var e=this.format.writeNode("ogc:Filter",a);d.appendChild(e);c.appendChild(d);c=OpenLayers.Format.XML.prototype.write.apply(this.format,[c]);return OpenLayers.Request.POST({url:this.url,callback:b.callback||function(){},data:c})},abort:function(a){a&&a.priv.abort()}, +CLASS_NAME:"OpenLayers.Protocol.WFS.v1"});OpenLayers.Handler.Point=OpenLayers.Class(OpenLayers.Handler,{point:null,layer:null,multi:!1,citeCompliant:!1,mouseDown:!1,stoppedDown:null,lastDown:null,lastUp:null,persist:!1,stopDown:!1,stopUp:!1,layerOptions:null,pixelTolerance:5,touch:!1,lastTouchPx:null,initialize:function(a,b,c){if(!c||!c.layerOptions||!c.layerOptions.styleMap)this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{});OpenLayers.Handler.prototype.initialize.apply(this,arguments)},activate:function(){if(!OpenLayers.Handler.prototype.activate.apply(this, +arguments))return!1;var a=OpenLayers.Util.extend({displayInLayerSwitcher:!1,calculateInRange:OpenLayers.Function.True,wrapDateLine:this.citeCompliant},this.layerOptions);this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,a);this.map.addLayer(this.layer);return!0},createFeature:function(a){a=this.layer.getLonLatFromViewPortPx(a);a=new OpenLayers.Geometry.Point(a.lon,a.lat);this.point=new OpenLayers.Feature.Vector(a);this.callback("create",[this.point.geometry,this.point]);this.point.geometry.clearBounds(); +this.layer.addFeatures([this.point],{silent:!0})},deactivate:function(){if(!OpenLayers.Handler.prototype.deactivate.apply(this,arguments))return!1;this.cancel();null!=this.layer.map&&(this.destroyFeature(!0),this.layer.destroy(!1));this.layer=null;this.touch=!1;return!0},destroyFeature:function(a){this.layer&&(a||!this.persist)&&this.layer.destroyFeatures();this.point=null},destroyPersistedFeature:function(){var a=this.layer;a&&1c&&(d=!1);return d},CLASS_NAME:"OpenLayers.Handler.Point"});OpenLayers.Handler.Path=OpenLayers.Class(OpenLayers.Handler.Point,{line:null,maxVertices:null,doubleTouchTolerance:20,freehand:!1,freehandToggle:"shiftKey",timerId:null,redoStack:null,createFeature:function(a){a=this.layer.getLonLatFromViewPortPx(a);a=new OpenLayers.Geometry.Point(a.lon,a.lat);this.point=new OpenLayers.Feature.Vector(a);this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString([this.point.geometry]));this.callback("create",[this.point.geometry,this.getSketch()]); +this.point.geometry.clearBounds();this.layer.addFeatures([this.line,this.point],{silent:!0})},destroyFeature:function(a){OpenLayers.Handler.Point.prototype.destroyFeature.call(this,a);this.line=null},destroyPersistedFeature:function(){var a=this.layer;a&&2this.nbPoints&&this.points.pop()},end:function(a){for(var b,c=(new Date).getTime(),d=0,e=this.points.length,f;dthis.delay)break;b=f}if(b&&(d=(new Date).getTime()-b.tick,c=Math.sqrt(Math.pow(a.x-b.xy.x,2)+Math.pow(a.y-b.xy.y,2)),d=c/d,!(0==d||d=-this.deceleration*a+c&&(OpenLayers.Animation.stop(this.timerId),this.timerId=null,l=!0);a=k-g;m=j-h;g=k;h=j;b(a,m,l)}},this))},CLASS_NAME:"OpenLayers.Kinetic"});OpenLayers.Layer.GeoRSS=OpenLayers.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:null,icon:null,popupSize:null,useFeedTitle:!0,initialize:function(a,b,c){OpenLayers.Layer.Markers.prototype.initialize.apply(this,[a,c]);this.location=b;this.features=[]},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);this.clearFeatures();this.features=null},loadRSS:function(){this.loaded||(this.events.triggerEvent("loadstart"),OpenLayers.Request.GET({url:this.location, +success:this.parseData,scope:this}),this.loaded=!0)},moveTo:function(a,b,c){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments);this.visibility&&!this.loaded&&this.loadRSS()},parseData:function(a){var b=a.responseXML;if(!b||!b.documentElement)b=OpenLayers.Format.XML.prototype.read(a.responseText);if(this.useFeedTitle){a=null;try{a=b.getElementsByTagNameNS("*","title")[0].firstChild.nodeValue}catch(c){a=b.getElementsByTagName("title")[0].firstChild.nodeValue}a&&this.setName(a)}a={};OpenLayers.Util.extend(a, +this.formatOptions);this.map&&!this.projection.equals(this.map.getProjectionObject())&&(a.externalProjection=this.projection,a.internalProjection=this.map.getProjectionObject());for(var b=(new OpenLayers.Format.GeoRSS(a)).read(b),a=0,d=b.length;a';i&&(j+='');j+=g;i&&(j+="");j+="";j+='
';j+=h;j+="
";e.popupContentHTML=j}f=new OpenLayers.Feature(this,f,e);this.features.push(f); +e=f.createMarker();e.events.register("click",f,this.markerClick);this.addMarker(e)}}this.events.triggerEvent("loadend")},markerClick:function(a){var b=this==this.layer.selectedFeature;this.layer.selectedFeature=!b?this:null;for(var c=0,d=this.layer.map.popups.length;c1/3&&e<2/3?d="c":e>=2/3&&(d="r");f<=1/3?d+="b":f>1/3&&f<2/3?d+="m":f>=2/3&&(d+="t");c.labelAlign=d;OpenLayers.Util.applyDefaults(b,c)},AnchorPoint:function(a,b){this.readChildNodes(a,b)},AnchorPointX:function(a,b){var c=this.readers.ogc._expression.call(this,a);c&&(b.labelAnchorPointX=c)},AnchorPointY:function(a,b){var c=this.readers.ogc._expression.call(this,a);c&&(b.labelAnchorPointY=c)},Displacement:function(a, +b){this.readChildNodes(a,b)},DisplacementX:function(a,b){var c=this.readers.ogc._expression.call(this,a);c&&(b.labelXOffset=c)},DisplacementY:function(a,b){var c=this.readers.ogc._expression.call(this,a);c&&(b.labelYOffset=c)},LinePlacement:function(a,b){this.readChildNodes(a,b)},PerpendicularOffset:function(a,b){var c=this.readers.ogc._expression.call(this,a);c&&(b.labelPerpendicularOffset=c)},Label:function(a,b){var c=this.readers.ogc._expression.call(this,a);c&&(b.label=c)},Font:function(a,b){this.readChildNodes(a, +b)},Halo:function(a,b){var c={};this.readChildNodes(a,c);b.haloRadius=c.haloRadius;b.haloColor=c.fillColor;b.haloOpacity=c.fillOpacity},Radius:function(a,b){var c=this.readers.ogc._expression.call(this,a);null!=c&&(b.haloRadius=c)},RasterSymbolizer:function(a,b){var c={};this.readChildNodes(a,c);this.multipleSymbolizers?(c.zIndex=this.featureTypeCounter,b.symbolizers.push(new OpenLayers.Symbolizer.Raster(c))):b.symbolizer.Raster=OpenLayers.Util.applyDefaults(c,b.symbolizer.Raster)},Geometry:function(a, +b){b.geometry={};this.readChildNodes(a,b.geometry)},ColorMap:function(a,b){b.colorMap=[];this.readChildNodes(a,b.colorMap)},ColorMapEntry:function(a,b){var c=a.getAttribute("quantity"),d=a.getAttribute("opacity");b.push({color:a.getAttribute("color"),quantity:null!==c?parseFloat(c):void 0,label:a.getAttribute("label")||void 0,opacity:null!==d?parseFloat(d):void 0})},LineSymbolizer:function(a,b){var c={};this.readChildNodes(a,c);this.multipleSymbolizers?(c.zIndex=this.featureTypeCounter,b.symbolizers.push(new OpenLayers.Symbolizer.Line(c))): +b.symbolizer.Line=OpenLayers.Util.applyDefaults(c,b.symbolizer.Line)},PolygonSymbolizer:function(a,b){var c={fill:!1,stroke:!1};this.multipleSymbolizers||(c=b.symbolizer.Polygon||c);this.readChildNodes(a,c);this.multipleSymbolizers?(c.zIndex=this.featureTypeCounter,b.symbolizers.push(new OpenLayers.Symbolizer.Polygon(c))):b.symbolizer.Polygon=c},PointSymbolizer:function(a,b){var c={fill:!1,stroke:!1,graphic:!1};this.multipleSymbolizers||(c=b.symbolizer.Point||c);this.readChildNodes(a,c);this.multipleSymbolizers? +(c.zIndex=this.featureTypeCounter,b.symbolizers.push(new OpenLayers.Symbolizer.Point(c))):b.symbolizer.Point=c},Stroke:function(a,b){b.stroke=!0;this.readChildNodes(a,b)},Fill:function(a,b){b.fill=!0;this.readChildNodes(a,b)},CssParameter:function(a,b){var c=a.getAttribute("name"),d=this.cssMap[c];b.label&&("fill"===c?d="fontColor":"fill-opacity"===c&&(d="fontOpacity"));d&&(c=this.readers.ogc._expression.call(this,a))&&(b[d]=c)},Graphic:function(a,b){b.graphic=!0;var c={};this.readChildNodes(a,c); +for(var d="stroke strokeColor strokeWidth strokeOpacity strokeLinecap fill fillColor fillOpacity graphicName rotation graphicFormat".split(" "),e,f,g=0,h=d.length;g=-this.MAX_PIXEL&&a<=this.MAX_PIXEL&&b>=-this.MAX_PIXEL&&b<=this.MAX_PIXEL},setExtent:function(a,b){var c=OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments),d=this.getResolution(),e=-a.left/d,d=a.top/d;if(b)return this.left=e,this.top=d,this.rendererRoot.setAttributeNS(null, +"viewBox","0 0 "+this.size.w+" "+this.size.h),this.translate(this.xOffset,0),!0;(e=this.translate(e-this.left+this.xOffset,d-this.top))||this.setExtent(a,!0);return c&&e},translate:function(a,b){if(this.inValidRange(a,b,!0)){var c="";if(a||b)c="translate("+a+","+b+")";this.root.setAttributeNS(null,"transform",c);this.translationParameters={x:a,y:b};return!0}return!1},setSize:function(a){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);this.rendererRoot.setAttributeNS(null,"width",this.size.w); +this.rendererRoot.setAttributeNS(null,"height",this.size.h)},getNodeType:function(a,b){var c=null;switch(a.CLASS_NAME){case "OpenLayers.Geometry.Point":c=b.externalGraphic?"image":this.isComplexSymbol(b.graphicName)?"svg":"circle";break;case "OpenLayers.Geometry.Rectangle":c="rect";break;case "OpenLayers.Geometry.LineString":c="polyline";break;case "OpenLayers.Geometry.LinearRing":c="polygon";break;case "OpenLayers.Geometry.Polygon":case "OpenLayers.Geometry.Curve":c="path"}return c},setStyle:function(a, +b,c){var b=b||a._style,c=c||a._options,d=parseFloat(a.getAttributeNS(null,"r")),e=1,f;if("OpenLayers.Geometry.Point"==a._geometryClass&&d){a.style.visibility="";if(!1===b.graphic)a.style.visibility="hidden";else if(b.externalGraphic){f=this.getPosition(a);b.graphicTitle&&(a.setAttributeNS(null,"title",b.graphicTitle),d=a.getElementsByTagName("title"),0i;)f.removeChild(f.lastChild);for(var j=0;jd)i=(c-g)/(h-f),h=0>h?-d:d,c=g+(h-f)*i;if(c<-e||c>e)i=(h-f)/(c-g),c=0>c?-e:e,h=f+(c-g)*i;return h+","+c},getShortString:function(a){var b=this.getResolution(),c=(a.x-this.featureDx)/b+this.left,a=this.top-a.y/b;return this.inValidRange(c,a)?c+","+a:!1},getPosition:function(a){return{x:parseFloat(a.getAttributeNS(null, +"cx")),y:parseFloat(a.getAttributeNS(null,"cy"))}},importSymbol:function(a){this.defs||(this.defs=this.createDefs());var b=this.container.id+"-"+a,c=document.getElementById(b);if(null!=c)return c;var d=OpenLayers.Renderer.symbol[a];if(!d)throw Error(a+" is not a valid symbol name");var a=this.nodeFactory(b,"symbol"),e=this.nodeFactory(null,"polygon");a.appendChild(e);for(var c=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0),f=[],g,h,i=0;iMath.abs(l)?1:j/l,h=(1.0E-5>Math.abs(k)?1:i/k)/j):(k=Math.sqrt(k*k+l*l),j=Math.sqrt(i*i+j*j)/k);a._moving=!0;a.box.geometry.rotate(-a.rotation,f);delete a._moving;a.box.geometry.resize(j,f,h);a.box.geometry.rotate(a.rotation,f);a.transformFeature({scale:j, +ratio:h});a.irregular&&!a._setfeature&&(i=f.clone(),i.x+=1.0E-5>Math.abs(d-f.x)?0:this.x-d,i.y+=1.0E-5>Math.abs(e-f.y)?0:this.y-e,a.box.geometry.move(this.x-d,this.y-e),a.transformFeature({center:i}))}},f=function(b,c){var d=this.x,e=this.y;OpenLayers.Geometry.Point.prototype.move.call(this,b,c);if(!a._moving){var f=a.dragControl.handlers.drag.evt,f=f&&f.shiftKey?45:1,g=a.center,h=this.x-g.x,i=this.y-g.y;this.x=d;this.y=e;d=Math.atan2(i-c,h-b);d=Math.atan2(i,h)-d;d*=180/Math.PI;a._angle=(a._angle+ +d)%360;d=a.rotation%f;if(Math.abs(a._angle)>=f||0!==d)d=Math.round(a._angle/f)*f-d,a._angle=0,a.box.geometry.rotate(d,g),a.transformFeature({rotation:d})}},g=Array(8),h=Array(4),i,j,k,l="sw s se e ne n nw w".split(" "),m=0;8>m;++m)i=this.box.geometry.components[m],j=new OpenLayers.Feature.Vector(i.clone(),{role:l[m]+"-resize"},"string"==typeof this.renderIntent?null:this.renderIntent),0==m%2&&(k=new OpenLayers.Feature.Vector(i.clone(),{role:l[m]+"-rotate"},"string"==typeof this.rotationHandleSymbolizer? +null:this.rotationHandleSymbolizer),k.geometry.move=f,i._rotationHandle=k,h[m/2]=k),i.move=b,i.resize=c,i.rotate=d,j.geometry.move=e,i._handle=j,g[m]=j;this.rotationHandles=h;this.handles=g},createControl:function(){var a=this;this.dragControl=new OpenLayers.Control.DragFeature(this.layer,{documentDrag:!0,moveFeature:function(b){this.feature===a.feature&&(this.feature=a.box);OpenLayers.Control.DragFeature.prototype.moveFeature.apply(this,arguments)},onDrag:function(b){b===a.box&&a.transformFeature({center:a.center})}, +onStart:function(b){var c=!a.geometryTypes||-1!==OpenLayers.Util.indexOf(a.geometryTypes,b.geometry.CLASS_NAME),d=OpenLayers.Util.indexOf(a.handles,b),d=d+OpenLayers.Util.indexOf(a.rotationHandles,b);b!==a.feature&&(b!==a.box&&-2==d&&c)&&a.setFeature(b)},onComplete:function(){a.events.triggerEvent("transformcomplete",{feature:a.feature})}})},drawHandles:function(){for(var a=this.layer,b=0;8>b;++b)this.rotate&&0===b%2&&a.drawFeature(this.rotationHandles[b/2],this.rotationHandleSymbolizer),a.drawFeature(this.handles[b], +this.renderIntent)},transformFeature:function(a){if(!this._setfeature){this.scale*=a.scale||1;this.ratio*=a.ratio||1;var b=this.rotation;this.rotation=(this.rotation+(a.rotation||0))%360;if(!1!==this.events.triggerEvent("beforetransform",a)){var c=this.feature,d=c.geometry,e=this.center;d.rotate(-b,e);a.scale||a.ratio?d.resize(a.scale,e,a.ratio):a.center&&c.move(a.center.getBounds().getCenterLonLat());d.rotate(this.rotation,e);this.layer.drawFeature(c);c.toState(OpenLayers.State.UPDATE);this.events.triggerEvent("transform", +a)}}this.layer.drawFeature(this.box,this.renderIntent);this.drawHandles()},destroy:function(){for(var a,b=0;8>b;++b)a=this.box.geometry.components[b],a._handle.destroy(),a._handle=null,a._rotationHandle&&a._rotationHandle.destroy(),a._rotationHandle=null;this.rotationHandles=this.rotationHandleSymbolizer=this.handles=this.feature=this.center=null;this.box.destroy();this.layer=this.box=null;this.dragControl.destroy();this.dragControl=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)}, +CLASS_NAME:"OpenLayers.Control.TransformFeature"});OpenLayers.Handler.Box=OpenLayers.Class(OpenLayers.Handler,{dragHandler:null,boxDivClassName:"olHandlerBoxZoomBox",boxOffsets:null,initialize:function(a,b,c){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.dragHandler=new OpenLayers.Handler.Drag(this,{down:this.startBox,move:this.moveBox,out:this.removeBox,up:this.endBox},{keyMask:this.keyMask})},destroy:function(){OpenLayers.Handler.prototype.destroy.apply(this,arguments);this.dragHandler&&(this.dragHandler.destroy(),this.dragHandler= +null)},setMap:function(a){OpenLayers.Handler.prototype.setMap.apply(this,arguments);this.dragHandler&&this.dragHandler.setMap(a)},startBox:function(){this.callback("start",[]);this.zoomBox=OpenLayers.Util.createDiv("zoomBox",{x:-9999,y:-9999});this.zoomBox.className=this.boxDivClassName;this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.viewPortDiv.appendChild(this.zoomBox);OpenLayers.Element.addClass(this.map.viewPortDiv,"olDrawBox")},moveBox:function(a){var b=this.dragHandler.start.x, +c=this.dragHandler.start.y,d=Math.abs(b-a.x),e=Math.abs(c-a.y),f=this.getBoxOffsets();this.zoomBox.style.width=d+f.width+1+"px";this.zoomBox.style.height=e+f.height+1+"px";this.zoomBox.style.left=(a.x=this.down.xy.distanceTo(a.xy))&&this.touch&&this.down.touches.length===this.last.touches.length)for(var a=0,c=this.down.touches.length;athis.pixelTolerance){b= +!1;break}return b},getTouchDistance:function(a,b){return Math.sqrt(Math.pow(a.clientX-b.clientX,2)+Math.pow(a.clientY-b.clientY,2))},passesDblclickTolerance:function(){var a=!0;this.down&&this.first&&(a=this.down.xy.distanceTo(this.first.xy)<=this.dblclickTolerance);return a},clearTimer:function(){null!=this.timerId&&(window.clearTimeout(this.timerId),this.timerId=null);null!=this.rightclickTimerId&&(window.clearTimeout(this.rightclickTimerId),this.rightclickTimerId=null)},delayedCall:function(a){this.timerId= +null;a&&this.callback("click",[a])},getEventInfo:function(a){var b;if(a.touches){var c=a.touches.length;b=Array(c);for(var d,e=0;e=this.resFactor||a<=1/this.resFactor);return a},calculateBounds:function(a){a||(a=this.getMapBounds());var b=a.getCenterLonLat(),c=a.getWidth()*this.ratio,a=a.getHeight()*this.ratio;this.bounds=new OpenLayers.Bounds(b.lon-c/2,b.lat-a/2,b.lon+c/2,b.lat+a/2)},triggerRead:function(a){this.response&&!(a&&!0===a.noAbort)&& +(this.layer.protocol.abort(this.response),this.layer.events.triggerEvent("loadend"));this.layer.events.triggerEvent("loadstart");this.response=this.layer.protocol.read(OpenLayers.Util.applyDefaults({filter:this.createFilter(),callback:this.merge,scope:this},a))},createFilter:function(){var a=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:this.bounds,projection:this.layer.projection});this.layer.filter&&(a=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND, +filters:[this.layer.filter,a]}));return a},merge:function(a){this.layer.destroyFeatures();if((a=a.features)&&0a.childNodes.length)return this.repositionTimer=window.setTimeout(OpenLayers.Function.bind(this.repositionMapElements,this),250),!1;for(var b=OpenLayers.Layer.Google.cache[this.map.id],c=this.map.viewPortDiv,d=a.children.length-1;0<=d;--d){if(1000001==a.children[d].style.zIndex){var e=a.children[d];c.appendChild(e);e.style.zIndex="1100";e.style.bottom="";e.className="olLayerGoogleCopyright olLayerGoogleV3";e.style.display="";b.termsOfUse= +e}1E6==a.children[d].style.zIndex&&(e=a.children[d],c.appendChild(e),e.style.zIndex="1100",e.style.bottom="",e.className="olLayerGooglePoweredBy olLayerGoogleV3 gmnoprint",e.style.display="",b.poweredBy=e);10000002==a.children[d].style.zIndex&&c.appendChild(a.children[d])}this.setGMapVisibility(this.visibility)},onMapResize:function(){if(this.visibility)google.maps.event.trigger(this.mapObject,"resize");else{var a=OpenLayers.Layer.Google.cache[this.map.id];if(!a.resized){var b=this;google.maps.event.addListenerOnce(this.mapObject, +"tilesloaded",function(){google.maps.event.trigger(b.mapObject,"resize");b.moveTo(b.map.getCenter(),b.map.getZoom());delete a.resized})}a.resized=!0}},setGMapVisibility:function(a){var b=OpenLayers.Layer.Google.cache[this.map.id];if(b){for(var c=this.type,d=this.map.layers,e,f=d.length-1;0<=f;--f)if(e=d[f],e instanceof OpenLayers.Layer.Google&&!0===e.visibility&&!0===e.inRange){c=e.type;a=!0;break}d=this.mapObject.getDiv();!0===a?(this.mapObject.setMapTypeId(c),d.style.left="",b.termsOfUse&&b.termsOfUse.style&& +(b.termsOfUse.style.left="",b.termsOfUse.style.display="",b.poweredBy.style.display=""),b.displayed=this.id):(delete b.displayed,d.style.left="-9999px",b.termsOfUse&&b.termsOfUse.style&&(b.termsOfUse.style.display="none",b.termsOfUse.style.left="-9999px",b.poweredBy.style.display="none"))}},getMapContainer:function(){return this.mapObject.getDiv()},getMapObjectBoundsFromOLBounds:function(a){var b=null;null!=a&&(b=this.sphericalMercator?this.inverseMercator(a.bottom,a.left):new OpenLayers.LonLat(a.bottom, +a.left),a=this.sphericalMercator?this.inverseMercator(a.top,a.right):new OpenLayers.LonLat(a.top,a.right),b=new google.maps.LatLngBounds(new google.maps.LatLng(b.lat,b.lon),new google.maps.LatLng(a.lat,a.lon)));return b},getMapObjectLonLatFromMapObjectPixel:function(a){var b=this.map.getSize(),c=this.getLongitudeFromMapObjectLonLat(this.mapObject.center),d=this.getLatitudeFromMapObjectLonLat(this.mapObject.center),e=this.map.getResolution(),a=new OpenLayers.LonLat(c+(a.x-b.w/2)*e,d-(a.y-b.h/2)*e); +this.wrapDateLine&&(a=a.wrapDateLine(this.maxExtent));return this.getMapObjectLonLatFromLonLat(a.lon,a.lat)},getMapObjectPixelFromMapObjectLonLat:function(a){var b=this.getLongitudeFromMapObjectLonLat(a),a=this.getLatitudeFromMapObjectLonLat(a),c=this.map.getResolution(),d=this.map.getExtent();return this.getMapObjectPixelFromXY(1/c*(b-d.left),1/c*(d.top-a))},setMapObjectCenter:function(a,b){if(!1===this.animationEnabled&&b!=this.mapObject.zoom){var c=this.getMapContainer();google.maps.event.addListenerOnce(this.mapObject, +"idle",function(){c.style.visibility=""});c.style.visibility="hidden"}this.mapObject.setOptions({center:a,zoom:b})},getMapObjectZoomFromMapObjectBounds:function(a){return this.mapObject.getBoundsZoomLevel(a)},getMapObjectLonLatFromLonLat:function(a,b){var c;this.sphericalMercator?(c=this.inverseMercator(a,b),c=new google.maps.LatLng(c.lat,c.lon)):c=new google.maps.LatLng(b,a);return c},getMapObjectPixelFromXY:function(a,b){return new google.maps.Point(a,b)},destroy:function(){this.repositionListener&& +google.maps.event.removeListener(this.repositionListener);this.repositionTimer&&window.clearTimeout(this.repositionTimer);OpenLayers.Layer.Google.prototype.destroy.apply(this,arguments)}};OpenLayers.Format.WPSDescribeProcess=OpenLayers.Class(OpenLayers.Format.XML,{VERSION:"1.0.0",namespaces:{wps:"http://www.opengis.net/wps/1.0.0",ows:"http://www.opengis.net/ows/1.1",xsi:"http://www.w3.org/2001/XMLSchema-instance"},schemaLocation:"http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd",defaultPrefix:"wps",regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this, +[a]));a&&9==a.nodeType&&(a=a.documentElement);var b={};this.readNode(a,b);return b},readers:{wps:{ProcessDescriptions:function(a,b){b.processDescriptions={};this.readChildNodes(a,b.processDescriptions)},ProcessDescription:function(a,b){var c={processVersion:this.getAttributeNS(a,this.namespaces.wps,"processVersion"),statusSupported:"true"===a.getAttribute("statusSupported"),storeSupported:"true"===a.getAttribute("storeSupported")};this.readChildNodes(a,c);b[c.identifier]=c},DataInputs:function(a, +b){b.dataInputs=[];this.readChildNodes(a,b.dataInputs)},ProcessOutputs:function(a,b){b.processOutputs=[];this.readChildNodes(a,b.processOutputs)},Output:function(a,b){var c={};this.readChildNodes(a,c);b.push(c)},ComplexOutput:function(a,b){b.complexOutput={};this.readChildNodes(a,b.complexOutput)},Input:function(a,b){var c={maxOccurs:parseInt(a.getAttribute("maxOccurs")),minOccurs:parseInt(a.getAttribute("minOccurs"))};this.readChildNodes(a,c);b.push(c)},BoundingBoxData:function(a,b){b.boundingBoxData= +{};this.readChildNodes(a,b.boundingBoxData)},CRS:function(a,b){b.CRSs||(b.CRSs={});b.CRSs[this.getChildValue(a)]=!0},LiteralData:function(a,b){b.literalData={};this.readChildNodes(a,b.literalData)},ComplexData:function(a,b){b.complexData={};this.readChildNodes(a,b.complexData)},Default:function(a,b){b["default"]={};this.readChildNodes(a,b["default"])},Supported:function(a,b){b.supported={};this.readChildNodes(a,b.supported)},Format:function(a,b){var c={};this.readChildNodes(a,c);b.formats||(b.formats= +{});b.formats[c.mimeType]=!0},MimeType:function(a,b){b.mimeType=this.getChildValue(a)}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WPSDescribeProcess"});OpenLayers.Format.CSWGetRecords.v2_0_2=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{csw:"http://www.opengis.net/cat/csw/2.0.2",dc:"http://purl.org/dc/elements/1.1/",dct:"http://purl.org/dc/terms/",gmd:"http://www.isotc211.org/2005/gmd",geonet:"http://www.fao.org/geonetwork",ogc:"http://www.opengis.net/ogc",ows:"http://www.opengis.net/ows",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"csw",version:"2.0.2",schemaLocation:"http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd", +requestId:null,resultType:null,outputFormat:null,outputSchema:null,startPosition:null,maxRecords:null,DistributedSearch:null,ResponseHandler:null,Query:null,regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));a&&9==a.nodeType&&(a=a.documentElement);var b={};this.readNode(a,b);return b}, +readers:{csw:{GetRecordsResponse:function(a,b){b.records=[];this.readChildNodes(a,b);var c=this.getAttributeNS(a,"","version");""!=c&&(b.version=c)},RequestId:function(a,b){b.RequestId=this.getChildValue(a)},SearchStatus:function(a,b){b.SearchStatus={};var c=this.getAttributeNS(a,"","timestamp");""!=c&&(b.SearchStatus.timestamp=c)},SearchResults:function(a,b){this.readChildNodes(a,b);for(var c=a.attributes,d={},e=0,f=c.length;e"+e.attributes.title+"

"+e.attributes.description+"

");d.overflow=e.attributes.overflow||"auto";d=new OpenLayers.Feature(this,f,d);this.features.push(d);f=d.createMarker();null!=e.attributes.title&&null!=e.attributes.description&&f.events.register("click",d,this.markerClick);this.addMarker(f)}this.events.triggerEvent("loadend")},markerClick:function(a){var b=this==this.layer.selectedFeature; +this.layer.selectedFeature=!b?this:null;for(var c=0,d=this.layer.map.popups.length;c=a?Math.round(a/1E3)+"K":95E4<=a?Math.round(a/1E6)+"M":Math.round(a),this.element.innerHTML=OpenLayers.i18n("Scale = 1 : ${scaleDenom}",{scaleDenom:a}))},CLASS_NAME:"OpenLayers.Control.Scale"});OpenLayers.Control.Button=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){},CLASS_NAME:"OpenLayers.Control.Button"});OpenLayers.Layer.MapGuide=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,useHttpTile:!1,singleTile:!1,useOverlay:!1,useAsyncOverlay:!0,TILE_PARAMS:{operation:"GETTILEIMAGE",version:"1.2.0"},SINGLE_TILE_PARAMS:{operation:"GETMAPIMAGE",format:"PNG",locale:"en",clip:"1",version:"1.0.0"},OVERLAY_PARAMS:{operation:"GETDYNAMICMAPOVERLAYIMAGE",format:"PNG",locale:"en",clip:"1",version:"2.0.0"},FOLDER_PARAMS:{tileColumnsPerFolder:30,tileRowsPerFolder:30,format:"png",querystring:null},defaultSize:new OpenLayers.Size(300, +300),tileOriginCorner:"tl",initialize:function(a,b,c,d){OpenLayers.Layer.Grid.prototype.initialize.apply(this,arguments);if(null==d||null==d.isBaseLayer)this.isBaseLayer="true"!=this.transparent&&!0!=this.transparent;d&&null!=d.useOverlay&&(this.useOverlay=d.useOverlay);this.singleTile?this.useOverlay?(OpenLayers.Util.applyDefaults(this.params,this.OVERLAY_PARAMS),this.useAsyncOverlay||(this.params.version="1.0.0")):OpenLayers.Util.applyDefaults(this.params,this.SINGLE_TILE_PARAMS):(this.useHttpTile? +OpenLayers.Util.applyDefaults(this.params,this.FOLDER_PARAMS):OpenLayers.Util.applyDefaults(this.params,this.TILE_PARAMS),this.setTileSize(this.defaultSize))},clone:function(a){null==a&&(a=new OpenLayers.Layer.MapGuide(this.name,this.url,this.params,this.getOptions()));return a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a])},getURL:function(a){var b;b=a.getCenterLonLat();var c=this.map.getSize();this.singleTile?(a={setdisplaydpi:OpenLayers.DOTS_PER_INCH,setdisplayheight:c.h*this.ratio,setdisplaywidth:c.w* +this.ratio,setviewcenterx:b.lon,setviewcentery:b.lat,setviewscale:this.map.getScale()},this.useOverlay&&!this.useAsyncOverlay&&(b={},b=OpenLayers.Util.extend(b,a),b.operation="GETVISIBLEMAPEXTENT",b.version="1.0.0",b.session=this.params.session,b.mapName=this.params.mapName,b.format="text/xml",b=this.getFullRequestString(b),OpenLayers.Request.GET({url:b,async:!1})),b=this.getFullRequestString(a)):(c=this.map.getResolution(),b=Math.floor((a.left-this.maxExtent.left)/c),b=Math.round(b/this.tileSize.w), +a=Math.floor((this.maxExtent.top-a.top)/c),a=Math.round(a/this.tileSize.h),b=this.useHttpTile?this.getImageFilePath({tilecol:b,tilerow:a,scaleindex:this.resolutions.length-this.map.zoom-1}):this.getFullRequestString({tilecol:b,tilerow:a,scaleindex:this.resolutions.length-this.map.zoom-1}));return b},getFullRequestString:function(a,b){var c=null==b?this.url:b;"object"==typeof c&&(c=c[Math.floor(Math.random()*c.length)]);var d=c,e=OpenLayers.Util.extend({},this.params),e=OpenLayers.Util.extend(e,a), +f=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(c)),g;for(g in e)g.toUpperCase()in f&&delete e[g];e=OpenLayers.Util.getParameterString(e);e=e.replace(/,/g,"+");""!=e&&(f=c.charAt(c.length-1),d="&"==f||"?"==f?d+e:-1==c.indexOf("?")?d+("?"+e):d+("&"+e));return d},getImageFilePath:function(a,b){var c=null==b?this.url:b;"object"==typeof c&&(c=c[Math.floor(Math.random()*c.length)]);var d="",e="";0>a.tilerow&&(d="-");d=0==a.tilerow?d+"0":d+Math.floor(Math.abs(a.tilerow/this.params.tileRowsPerFolder))* +this.params.tileRowsPerFolder;0>a.tilecol&&(e="-");e=0==a.tilecol?e+"0":e+Math.floor(Math.abs(a.tilecol/this.params.tileColumnsPerFolder))*this.params.tileColumnsPerFolder;d="/S"+Math.floor(a.scaleindex)+"/"+this.params.basemaplayergroupname+"/R"+d+"/C"+e+"/"+a.tilerow%this.params.tileRowsPerFolder+"_"+a.tilecol%this.params.tileColumnsPerFolder+"."+this.params.format;this.params.querystring&&(d+="?"+this.params.querystring);return c+d},calculateGridLayout:function(a,b,c){var d=c*this.tileSize.w,c= +c*this.tileSize.h,e=a.left-b.lon,f=Math.floor(e/d)-this.buffer,a=b.lat-a.top+c,g=Math.floor(a/c)-this.buffer;return{tilelon:d,tilelat:c,tileoffsetlon:b.lon+f*d,tileoffsetlat:b.lat-c*g,tileoffsetx:-(e/d-f)*this.tileSize.w,tileoffsety:(g-a/c)*this.tileSize.h}},CLASS_NAME:"OpenLayers.Layer.MapGuide"});OpenLayers.Control.Measure=OpenLayers.Class(OpenLayers.Control,{handlerOptions:null,callbacks:null,displaySystem:"metric",geodesic:!1,displaySystemUnits:{geographic:["dd"],english:["mi","ft","in"],metric:["km","m"]},partialDelay:300,delayedTrigger:null,persist:!1,immediate:!1,initialize:function(a,b){OpenLayers.Control.prototype.initialize.apply(this,[b]);var c={done:this.measureComplete,point:this.measurePartial};this.immediate&&(c.modify=this.measureImmediate);this.callbacks=OpenLayers.Util.extend(c, +this.callbacks);this.handlerOptions=OpenLayers.Util.extend({persist:this.persist},this.handlerOptions);this.handler=new a(this,this.callbacks,this.handlerOptions)},deactivate:function(){this.cancelDelay();return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},cancel:function(){this.cancelDelay();this.handler.cancel()},setImmediate:function(a){(this.immediate=a)?this.callbacks.modify=this.measureImmediate:delete this.callbacks.modify},updateHandler:function(a,b){var c=this.active;c&& +this.deactivate();this.handler=new a(this,this.callbacks,b);c&&this.activate()},measureComplete:function(a){this.cancelDelay();this.measure(a,"measure")},measurePartial:function(a,b){this.cancelDelay();b=b.clone();this.handler.freehandMode(this.handler.evt)?this.measure(b,"measurepartial"):this.delayedTrigger=window.setTimeout(OpenLayers.Function.bind(function(){this.delayedTrigger=null;this.measure(b,"measurepartial")},this),this.partialDelay)},measureImmediate:function(a,b,c){c&&!this.handler.freehandMode(this.handler.evt)&& +(this.cancelDelay(),this.measure(b.geometry,"measurepartial"))},cancelDelay:function(){null!==this.delayedTrigger&&(window.clearTimeout(this.delayedTrigger),this.delayedTrigger=null)},measure:function(a,b){var c,d;-1i?0:i)+"px";d.div.style.height=(0>j?0:j)+"px";d.div.style.left=null!=e?e+"px":"";d.div.style.bottom=null!=f?f+"px":"";d.div.style.right=null!=g?g+"px":"";d.div.style.top=null!=h?h+"px":"";d.image.style.left=c.position.x+"px";d.image.style.top=c.position.y+"px"}this.contentDiv.style.left=this.padding.left+"px";this.contentDiv.style.top=this.padding.top+"px"}},CLASS_NAME:"OpenLayers.Popup.Framed"});OpenLayers.Popup.FramedCloud=OpenLayers.Class(OpenLayers.Popup.Framed,{contentDisplayClass:"olFramedCloudPopupContent",autoSize:!0,panMapIfOutOfView:!0,imageSize:new OpenLayers.Size(1276,736),isAlphaImage:!1,fixedRelativePosition:!1,positionBlocks:{tl:{offset:new OpenLayers.Pixel(44,0),padding:new OpenLayers.Bounds(8,40,8,9),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null, +50,0,0),position:new OpenLayers.Pixel(-1238,0)},{size:new OpenLayers.Size("auto",19),anchor:new OpenLayers.Bounds(0,32,22,null),position:new OpenLayers.Pixel(0,-631)},{size:new OpenLayers.Size(22,18),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-1238,-632)},{size:new OpenLayers.Size(81,35),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(0,-688)}]},tr:{offset:new OpenLayers.Pixel(-45,0),padding:new OpenLayers.Bounds(8,40,8,9),blocks:[{size:new OpenLayers.Size("auto", +"auto"),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-1238,0)},{size:new OpenLayers.Size("auto",19),anchor:new OpenLayers.Bounds(0,32,22,null),position:new OpenLayers.Pixel(0,-631)},{size:new OpenLayers.Size(22,19),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-1238,-631)},{size:new OpenLayers.Size(81,35),anchor:new OpenLayers.Bounds(0, +0,null,null),position:new OpenLayers.Pixel(-215,-687)}]},bl:{offset:new OpenLayers.Pixel(45,0),padding:new OpenLayers.Bounds(8,9,8,40),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-1238,0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22, +21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-1238,-629)},{size:new OpenLayers.Size(81,33),anchor:new OpenLayers.Bounds(null,null,0,0),position:new OpenLayers.Pixel(-101,-674)}]},br:{offset:new OpenLayers.Pixel(-44,0),padding:new OpenLayers.Bounds(8,9,8,40),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-1238, +0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-1238,-629)},{size:new OpenLayers.Size(81,33),anchor:new OpenLayers.Bounds(0,null,null,0),position:new OpenLayers.Pixel(-311,-674)}]}},minSize:new OpenLayers.Size(105,10),maxSize:new OpenLayers.Size(1200,660),initialize:function(a,b,c,d,e,f,g){this.imageSrc=OpenLayers.Util.getImageLocation("cloud-popup-relative.png"); +OpenLayers.Popup.Framed.prototype.initialize.apply(this,arguments);this.contentDiv.className=this.contentDisplayClass},CLASS_NAME:"OpenLayers.Popup.FramedCloud"});OpenLayers.Tile.Image.IFrame={useIFrame:null,draw:function(){if(OpenLayers.Tile.Image.prototype.shouldDraw.call(this)){var a=this.layer.getURL(this.bounds),b=this.useIFrame;this.useIFrame=null!==this.maxGetUrlLength&&!this.layer.async&&a.length>this.maxGetUrlLength;a=b&&!this.useIFrame;b=!b&&this.useIFrame;if(a||b)this.imgDiv&&this.imgDiv.parentNode===this.frame&&this.frame.removeChild(this.imgDiv),this.imgDiv=null,a?(this.blankImageUrl=this._blankImageUrl,this.frame.removeChild(this.frame.firstChild)): +(this._blankImageUrl=this.blankImageUrl,this.blankImageUrl="about:blank")}return OpenLayers.Tile.Image.prototype.draw.apply(this,arguments)},getImage:function(){if(!0===this.useIFrame){if(!this.frame.childNodes.length){var a=document.createElement("div"),b=a.style;b.position="absolute";b.width="100%";b.height="100%";b.zIndex=1;b.backgroundImage="url("+this._blankImageUrl+")";this.frame.appendChild(a)}a=this.id+"_iFrame";9>parseFloat(navigator.appVersion.split("MSIE")[1])?(b=document.createElement('
+Color:  

+ + + + + diff --git a/lib/slider/implementation.html b/lib/slider/implementation.html new file mode 100644 index 0000000..25eb4ed --- /dev/null +++ b/lib/slider/implementation.html @@ -0,0 +1,119 @@ + + + + +Slider (WebFX) + + + + + + + + + + + + +
+ + +

Implementation

+ +

The slider implementation mostly consists of lots of event handlers that +sets the value depending on the event arguments.

+ +

Range

+ +

The data model is handled by a class called Range (also known as BoundedRangeModel). +This class has a few properties that fits perfectly with sliders, scrollbars and +progress bars. A range has a minimum value, a value, an extent and a maximum value. +The following is always true for a range object.

+ +
+minimum < value < value + extent < maximum
+
+ +

In the case of a slider the extent is always zero. Using a range for the data +model allows the implementation of the slider to concentrate on other things than +ensuring that the data model is valid.

+ +

Timer

+ +

For this implementation of the slider I decided to use an object oriented +abstraction of window.setTimeout. A timer from the Timer +class can be started and stopped and it fires a pseudo event called ontimer +a certain amount of milliseconds after the timer is started.

+ +
+Timer.prototype.start = function () {
+   if (this.isStarted())
+      this.stop();
+   var oThis = this;
+   this._timer = window.setTimeout(function () {
+      if (typeof oThis.ontimer == "function")
+         oThis.ontimer();
+   }, this._pauseTime);
+   this._isStarted = false;
+};
+
+Timer.prototype.stop = function () {
+   if (this._timer != null)
+      window.clearTimeout(this._timer);
+   this._isStarted = false;
+};
+
+ +

Slider

+ +

The slider consists of a line element and a handle element. The line is only +there for the visual effect. The handle on the other hand can be dragged and +thereby changing the value. When dragging the handle the position of the mouse +is used to calculate a new value for the data model. Once the value is changed +the layout for the slider is recalculated.

+ +

When the user holds down the mouse on the slider, but not on the handle, a +timer is started and every time the timer triggers the timer event +the value is changed by the blockIncrement towards the mouse +pointer.

+ +

The slider also allows the user to use the keyboard to change the value. This +is done by listening to the keydown (and keypress) +events. In the keydown handler the key is checked and the value for +the data model is updated accordingly. The reason for the keypress +handler is to disable the default actions in the browser.

+ +

+Slider
+Implementation
+API
+Demo
+Download +

+ +

Author: Erik Arvidsson

+ + +
+ + + diff --git a/lib/slider/js/range.js b/lib/slider/js/range.js new file mode 100644 index 0000000..54f9a48 --- /dev/null +++ b/lib/slider/js/range.js @@ -0,0 +1,132 @@ +/*----------------------------------------------------------------------------\ +| Range Class | +|-----------------------------------------------------------------------------| +| Created by Erik Arvidsson | +| (http://webfx.eae.net/contact.html#erik) | +| For WebFX (http://webfx.eae.net/) | +|-----------------------------------------------------------------------------| +| Used to model the data used when working with sliders, scrollbars and | +| progress bars. Based on the ideas of the javax.swing.BoundedRangeModel | +| interface defined by Sun for Java; http://java.sun.com/products/jfc/ | +| swingdoc-api-1.0.3/com/sun/java/swing/BoundedRangeModel.html | +|-----------------------------------------------------------------------------| +| Copyright (c) 2002, 2005, 2006 Erik Arvidsson | +|-----------------------------------------------------------------------------| +| Licensed under the Apache License, Version 2.0 (the "License"); you may not | +| use this file except in compliance with the License. You may obtain a copy | +| of the License at http://www.apache.org/licenses/LICENSE-2.0 | +| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | +| Unless required by applicable law or agreed to in writing, software | +| distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | +| WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | +| License for the specific language governing permissions and limitations | +| under the License. | +|-----------------------------------------------------------------------------| +| 2002-10-14 | Original version released | +| 2005-10-27 | Use Math.round instead of Math.floor | +| 2006-05-28 | Changed license to Apache Software License 2.0. | +|-----------------------------------------------------------------------------| +| Created 2002-10-14 | All changes are in the log above. | Updated 2006-05-28 | +\----------------------------------------------------------------------------*/ + + +function Range() { + this._value = 0; + this._minimum = 0; + this._maximum = 100; + this._extent = 0; + + this._isChanging = false; +} + +Range.prototype.setValue = function (value) { + value = Math.round(parseFloat(value)); + if (isNaN(value)) return; + if (this._value != value) { + if (value + this._extent > this._maximum) + this._value = this._maximum - this._extent; + else if (value < this._minimum) + this._value = this._minimum; + else + this._value = value; + if (!this._isChanging && typeof this.onchange == "function") + this.onchange(); + } +}; + +Range.prototype.getValue = function () { + return this._value; +}; + +Range.prototype.setExtent = function (extent) { + if (this._extent != extent) { + if (extent < 0) + this._extent = 0; + else if (this._value + extent > this._maximum) + this._extent = this._maximum - this._value; + else + this._extent = extent; + if (!this._isChanging && typeof this.onchange == "function") + this.onchange(); + } +}; + +Range.prototype.getExtent = function () { + return this._extent; +}; + +Range.prototype.setMinimum = function (minimum) { + if (this._minimum != minimum) { + var oldIsChanging = this._isChanging; + this._isChanging = true; + + this._minimum = minimum; + + if (minimum > this._value) + this.setValue(minimum); + if (minimum > this._maximum) { + this._extent = 0; + this.setMaximum(minimum); + this.setValue(minimum) + } + if (minimum + this._extent > this._maximum) + this._extent = this._maximum - this._minimum; + + this._isChanging = oldIsChanging; + if (!this._isChanging && typeof this.onchange == "function") + this.onchange(); + } +}; + +Range.prototype.getMinimum = function () { + return this._minimum; +}; + +Range.prototype.setMaximum = function (maximum) { + if (this._maximum != maximum) { + var oldIsChanging = this._isChanging; + this._isChanging = true; + + this._maximum = maximum; + + if (maximum < this._value) + this.setValue(maximum - this._extent); + if (maximum < this._minimum) { + this._extent = 0; + this.setMinimum(maximum); + this.setValue(this._maximum); + } + if (maximum < this._minimum + this._extent) + this._extent = this._maximum - this._minimum; + if (maximum < this._value + this._extent) + this._extent = this._maximum - this._value; + + this._isChanging = oldIsChanging; + if (!this._isChanging && typeof this.onchange == "function") + this.onchange(); + } +}; + +Range.prototype.getMaximum = function () { + return this._maximum; +}; diff --git a/lib/slider/js/slider.js b/lib/slider/js/slider.js new file mode 100644 index 0000000..3f65f48 --- /dev/null +++ b/lib/slider/js/slider.js @@ -0,0 +1,495 @@ +/*----------------------------------------------------------------------------\ +| Slider 1.02 | +|-----------------------------------------------------------------------------| +| Created by Erik Arvidsson | +| (http://webfx.eae.net/contact.html#erik) | +| For WebFX (http://webfx.eae.net/) | +|-----------------------------------------------------------------------------| +| A slider control that degrades to an input control for non supported | +| browsers. | +|-----------------------------------------------------------------------------| +| Copyright (c) 2002, 2003, 2006 Erik Arvidsson | +|-----------------------------------------------------------------------------| +| Licensed under the Apache License, Version 2.0 (the "License"); you may not | +| use this file except in compliance with the License. You may obtain a copy | +| of the License at http://www.apache.org/licenses/LICENSE-2.0 | +| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | +| Unless required by applicable law or agreed to in writing, software | +| distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | +| WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | +| License for the specific language governing permissions and limitations | +| under the License. | +|-----------------------------------------------------------------------------| +| Dependencies: timer.js - an OO abstraction of timers | +| range.js - provides the data model for the slider | +| winclassic.css or any other css file describing the look | +|-----------------------------------------------------------------------------| +| 2002-10-14 | Original version released | +| 2003-03-27 | Added a test in the constructor for missing oElement arg | +| 2003-11-27 | Only use mousewheel when focused | +| 2006-05-28 | Changed license to Apache Software License 2.0. | +|-----------------------------------------------------------------------------| +| Created 2002-10-14 | All changes are in the log above. | Updated 2006-05-28 | +\----------------------------------------------------------------------------*/ + +Slider.isSupported = typeof document.createElement != "undefined" && + typeof document.documentElement != "undefined" && + typeof document.documentElement.offsetWidth == "number"; + + +function Slider(oElement, oInput, sOrientation) { + if (!oElement) return; + this._orientation = sOrientation || "horizontal"; + this._range = new Range(); + this._range.setExtent(0); + this._blockIncrement = 10; + this._unitIncrement = 1; + this._timer = new Timer(100); + + + if (Slider.isSupported && oElement) { + + this.document = oElement.ownerDocument || oElement.document; + + this.element = oElement; + this.element.slider = this; + this.element.unselectable = "on"; + + // add class name tag to class name + this.element.className = this._orientation + " " + this.classNameTag + " " + this.element.className; + + // create line + this.line = this.document.createElement("DIV"); + this.line.className = "line"; + this.line.unselectable = "on"; + this.line.appendChild(this.document.createElement("DIV")); + this.element.appendChild(this.line); + + // create handle + this.handle = this.document.createElement("DIV"); + this.handle.className = "handle"; + this.handle.unselectable = "on"; + this.handle.appendChild(this.document.createElement("DIV")); + this.handle.firstChild.appendChild( + this.document.createTextNode(String.fromCharCode(160))); + this.element.appendChild(this.handle); + } + + this.input = oInput; + + // events + var oThis = this; + this._range.onchange = function () { + oThis.recalculate(); + if (typeof oThis.onchange == "function") + oThis.onchange(); + }; + + if (Slider.isSupported && oElement) { + this.element.onfocus = Slider.eventHandlers.onfocus; + this.element.onblur = Slider.eventHandlers.onblur; + this.element.onmousedown = Slider.eventHandlers.onmousedown; + this.element.onmouseover = Slider.eventHandlers.onmouseover; + this.element.onmouseout = Slider.eventHandlers.onmouseout; + this.element.onkeydown = Slider.eventHandlers.onkeydown; + this.element.onkeypress = Slider.eventHandlers.onkeypress; + this.element.onmousewheel = Slider.eventHandlers.onmousewheel; + this.handle.onselectstart = + this.element.onselectstart = function () { return false; }; + + this._timer.ontimer = function () { + oThis.ontimer(); + }; + + // extra recalculate for ie + window.setTimeout(function() { + oThis.recalculate(); + }, 1); + } + else { + this.input.onchange = function (e) { + oThis.setValue(oThis.input.value); + }; + } +} + +Slider.eventHandlers = { + + // helpers to make events a bit easier + getEvent: function (e, el) { + if (!e) { + if (el) + e = el.document.parentWindow.event; + else + e = window.event; + } + if (!e.srcElement) { + var el = e.target; + while (el != null && el.nodeType != 1) + el = el.parentNode; + e.srcElement = el; + } + if (typeof e.offsetX == "undefined") { + e.offsetX = e.layerX; + e.offsetY = e.layerY; + } + + return e; + }, + + getDocument: function (e) { + if (e.target) + return e.target.ownerDocument; + return e.srcElement.document; + }, + + getSlider: function (e) { + var el = e.target || e.srcElement; + while (el != null && el.slider == null) { + el = el.parentNode; + } + if (el) + return el.slider; + return null; + }, + + getLine: function (e) { + var el = e.target || e.srcElement; + while (el != null && el.className != "line") { + el = el.parentNode; + } + return el; + }, + + getHandle: function (e) { + var el = e.target || e.srcElement; + var re = /handle/; + while (el != null && !re.test(el.className)) { + el = el.parentNode; + } + return el; + }, + // end helpers + + onfocus: function (e) { + var s = this.slider; + s._focused = true; + s.handle.className = "handle hover"; + }, + + onblur: function (e) { + var s = this.slider + s._focused = false; + s.handle.className = "handle"; + }, + + onmouseover: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + var s = this.slider; + if (e.srcElement == s.handle) + s.handle.className = "handle hover"; + }, + + onmouseout: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + var s = this.slider; + if (e.srcElement == s.handle && !s._focused) + s.handle.className = "handle"; + }, + + onmousedown: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + var s = this.slider; + if (s.element.focus) + s.element.focus(); + + Slider._currentInstance = s; + var doc = s.document; + + if (doc.addEventListener) { + doc.addEventListener("mousemove", Slider.eventHandlers.onmousemove, true); + doc.addEventListener("mouseup", Slider.eventHandlers.onmouseup, true); + } + else if (doc.attachEvent) { + doc.attachEvent("onmousemove", Slider.eventHandlers.onmousemove); + doc.attachEvent("onmouseup", Slider.eventHandlers.onmouseup); + doc.attachEvent("onlosecapture", Slider.eventHandlers.onmouseup); + s.element.setCapture(); + } + + if (Slider.eventHandlers.getHandle(e)) { // start drag + Slider._sliderDragData = { + screenX: e.screenX, + screenY: e.screenY, + dx: e.screenX - s.handle.offsetLeft, + dy: e.screenY - s.handle.offsetTop, + startValue: s.getValue(), + slider: s + }; + } + else { + return; + var lineEl = Slider.eventHandlers.getLine(e); + s._mouseX = e.offsetX + (lineEl ? s.line.offsetLeft : 0); + s._mouseY = e.offsetY + (lineEl ? s.line.offsetTop : 0); + s._increasing = null; + s.ontimer(); + } + }, + + onmousemove: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + + if (Slider._sliderDragData) { // drag + var s = Slider._sliderDragData.slider; + + var boundSize = s.getMaximum() - s.getMinimum(); + var size, pos, reset; + + if (s._orientation == "horizontal") { + size = s.element.offsetWidth - s.handle.offsetWidth; + pos = e.screenX - Slider._sliderDragData.dx; + reset = Math.abs(e.screenY - Slider._sliderDragData.screenY) > 100; + } + else { + size = s.element.offsetHeight - s.handle.offsetHeight; + pos = s.element.offsetHeight - s.handle.offsetHeight - + (e.screenY - Slider._sliderDragData.dy); + reset = Math.abs(e.screenX - Slider._sliderDragData.screenX) > 100; + } + s.setValue(reset ? Slider._sliderDragData.startValue : + s.getMinimum() + boundSize * pos / size); + return false; + } + else { + return; + var s = Slider._currentInstance; + if (s != null) { + var lineEl = Slider.eventHandlers.getLine(e); + s._mouseX = e.offsetX + (lineEl ? s.line.offsetLeft : 0); + s._mouseY = e.offsetY + (lineEl ? s.line.offsetTop : 0); + } + } + + }, + + onmouseup: function (e) { + e = Slider.eventHandlers.getEvent(e, this); + var s = Slider._currentInstance; + var doc = s.document; + if (doc.removeEventListener) { + doc.removeEventListener("mousemove", Slider.eventHandlers.onmousemove, true); + doc.removeEventListener("mouseup", Slider.eventHandlers.onmouseup, true); + } + else if (doc.detachEvent) { + doc.detachEvent("onmousemove", Slider.eventHandlers.onmousemove); + doc.detachEvent("onmouseup", Slider.eventHandlers.onmouseup); + doc.detachEvent("onlosecapture", Slider.eventHandlers.onmouseup); + s.element.releaseCapture(); + } + + if (Slider._sliderDragData) { // end drag + Slider._sliderDragData = null; + } + else { + return; + s._timer.stop(); + s._increasing = null; + } + Slider._currentInstance = null; + }, + + onkeydown: function (e) { + return; + e = Slider.eventHandlers.getEvent(e, this); + //var s = Slider.eventHandlers.getSlider(e); + var s = this.slider; + var kc = e.keyCode; + switch (kc) { + case 33: // page up + s.setValue(s.getValue() + s.getBlockIncrement()); + break; + case 34: // page down + s.setValue(s.getValue() - s.getBlockIncrement()); + break; + case 35: // end + s.setValue(s.getOrientation() == "horizontal" ? + s.getMaximum() : + s.getMinimum()); + break; + case 36: // home + s.setValue(s.getOrientation() == "horizontal" ? + s.getMinimum() : + s.getMaximum()); + break; + case 38: // up + case 39: // right + s.setValue(s.getValue() + s.getUnitIncrement()); + break; + + case 37: // left + case 40: // down + s.setValue(s.getValue() - s.getUnitIncrement()); + break; + } + + if (kc >= 33 && kc <= 40) { + return false; + } + }, + + onkeypress: function (e) { + return; + e = Slider.eventHandlers.getEvent(e, this); + var kc = e.keyCode; + if (kc >= 33 && kc <= 40) { + return false; + } + }, + + onmousewheel: function (e) { + return; + e = Slider.eventHandlers.getEvent(e, this); + var s = this.slider; + if (s._focused) { + s.setValue(s.getValue() + e.wheelDelta / 120 * s.getUnitIncrement()); + // windows inverts this on horizontal sliders. That does not + // make sense to me + return false; + } + } +}; + + + +Slider.prototype.classNameTag = "dynamic-slider-control", + +Slider.prototype.setValue = function (v) { + this._range.setValue(v); + this.input.value = this.getValue(); +}; + +Slider.prototype.getValue = function () { + return this._range.getValue(); +}; + +Slider.prototype.setMinimum = function (v) { + this._range.setMinimum(v); + this.input.value = this.getValue(); +}; + +Slider.prototype.getMinimum = function () { + return this._range.getMinimum(); +}; + +Slider.prototype.setMaximum = function (v) { + this._range.setMaximum(v); + this.input.value = this.getValue(); +}; + +Slider.prototype.getMaximum = function () { + return this._range.getMaximum(); +}; + +Slider.prototype.setUnitIncrement = function (v) { + this._unitIncrement = v; +}; + +Slider.prototype.getUnitIncrement = function () { + return this._unitIncrement; +}; + +Slider.prototype.setBlockIncrement = function (v) { + this._blockIncrement = v; +}; + +Slider.prototype.getBlockIncrement = function () { + return this._blockIncrement; +}; + +Slider.prototype.getOrientation = function () { + return this._orientation; +}; + +Slider.prototype.setOrientation = function (sOrientation) { + if (sOrientation != this._orientation) { + if (Slider.isSupported && this.element) { + // add class name tag to class name + this.element.className = this.element.className.replace(this._orientation, + sOrientation); + } + this._orientation = sOrientation; + this.recalculate(); + + } +}; + +Slider.prototype.recalculate = function() { + if (!Slider.isSupported || !this.element) return; + + var w = this.element.offsetWidth; + var h = this.element.offsetHeight; + var hw = this.handle.offsetWidth; + var hh = this.handle.offsetHeight; + var lw = this.line.offsetWidth; + var lh = this.line.offsetHeight; + + // this assumes a border-box layout + + if (this._orientation == "horizontal") { + this.handle.style.left = (w - hw) * (this.getValue() - this.getMinimum()) / + (this.getMaximum() - this.getMinimum()) + "px"; + this.handle.style.top = (h - hh) / 2 + "px"; + + this.line.style.top = (h - lh) / 2 + "px"; + this.line.style.left = hw / 2 + "px"; + //this.line.style.right = hw / 2 + "px"; + this.line.style.width = Math.max(0, w - hw - 2)+ "px"; + this.line.firstChild.style.width = Math.max(0, w - hw - 4)+ "px"; + } + else { + this.handle.style.left = (w - hw) / 2 + "px"; + this.handle.style.top = h - hh - (h - hh) * (this.getValue() - this.getMinimum()) / + (this.getMaximum() - this.getMinimum()) + "px"; + + this.line.style.left = (w - lw) / 2 + "px"; + this.line.style.top = hh / 2 + "px"; + this.line.style.height = Math.max(0, h - hh - 2) + "px"; //hard coded border width + //this.line.style.bottom = hh / 2 + "px"; + this.line.firstChild.style.height = Math.max(0, h - hh - 4) + "px"; //hard coded border width + } +}; + +Slider.prototype.ontimer = function () { + var hw = this.handle.offsetWidth; + var hh = this.handle.offsetHeight; + var hl = this.handle.offsetLeft; + var ht = this.handle.offsetTop; + + if (this._orientation == "horizontal") { + if (this._mouseX > hl + hw && + (this._increasing == null || this._increasing)) { + this.setValue(this.getValue() + this.getBlockIncrement()); + this._increasing = true; + } + else if (this._mouseX < hl && + (this._increasing == null || !this._increasing)) { + this.setValue(this.getValue() - this.getBlockIncrement()); + this._increasing = false; + } + } + else { + if (this._mouseY > ht + hh && + (this._increasing == null || !this._increasing)) { + this.setValue(this.getValue() - this.getBlockIncrement()); + this._increasing = false; + } + else if (this._mouseY < ht && + (this._increasing == null || this._increasing)) { + this.setValue(this.getValue() + this.getBlockIncrement()); + this._increasing = true; + } + } + + this._timer.start(); +}; diff --git a/lib/slider/js/timer.js b/lib/slider/js/timer.js new file mode 100644 index 0000000..e96fe19 --- /dev/null +++ b/lib/slider/js/timer.js @@ -0,0 +1,62 @@ +/*----------------------------------------------------------------------------\ +| Timer Class | +|-----------------------------------------------------------------------------| +| Created by Erik Arvidsson | +| (http://webfx.eae.net/contact.html#erik) | +| For WebFX (http://webfx.eae.net/) | +|-----------------------------------------------------------------------------| +| Object Oriented Encapsulation of setTimeout fires ontimer when the timer | +| is triggered. Does not work in IE 5.00 | +|-----------------------------------------------------------------------------| +| Copyright (c) 2002, 2006 Erik Arvidsson | +|-----------------------------------------------------------------------------| +| Licensed under the Apache License, Version 2.0 (the "License"); you may not | +| use this file except in compliance with the License. You may obtain a copy | +| of the License at http://www.apache.org/licenses/LICENSE-2.0 | +| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | +| Unless required by applicable law or agreed to in writing, software | +| distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | +| WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | +| License for the specific language governing permissions and limitations | +| under the License. | +|-----------------------------------------------------------------------------| +| 2002-10-14 | Original version released | +| 2006-05-28 | Changed license to Apache Software License 2.0. | +|-----------------------------------------------------------------------------| +| Created 2002-10-14 | All changes are in the log above. | Updated 2006-05-28 | +\----------------------------------------------------------------------------*/ + +function Timer(nPauseTime) { + this._pauseTime = typeof nPauseTime == "undefined" ? 1000 : nPauseTime; + this._timer = null; + this._isStarted = false; +} + +Timer.prototype.start = function () { + if (this.isStarted()) + this.stop(); + var oThis = this; + this._timer = window.setTimeout(function () { + if (typeof oThis.ontimer == "function") + oThis.ontimer(); + }, this._pauseTime); + this._isStarted = false; +}; + +Timer.prototype.stop = function () { + if (this._timer != null) + window.clearTimeout(this._timer); + this._isStarted = false; +}; + +Timer.prototype.isStarted = function () { + return this._isStarted; +}; + +Timer.prototype.getPauseTime = function () { + return this._pauseTime; +}; + +Timer.prototype.setPauseTime = function (nPauseTime) { + this._pauseTime = nPauseTime; +}; \ No newline at end of file diff --git a/lib/slider/license.txt b/lib/slider/license.txt new file mode 100644 index 0000000..75b5248 --- /dev/null +++ b/lib/slider/license.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/lib/slider/local/helptip.css b/lib/slider/local/helptip.css new file mode 100644 index 0000000..6bfe52d --- /dev/null +++ b/lib/slider/local/helptip.css @@ -0,0 +1,36 @@ +/* + Notice that IE has a display problem if the help link is on + the last line of a container with no padding. If this is the + case increase the padding bottom to at least 1px +*/ + +a.helpLink { + color: Green; + text-decoration: none; + border-bottom: 1px dashed Green; +} + +a.helpLink:hover { + color: Red; + text-decoration: none; + border-bottom: 1px dashed Red; +} + +.help-tooltip { + position: absolute; + width: 250px; + border: 1px Solid WindowFrame; + background: Infobackground; + color: InfoText; + font: StatusBar; + font: Status-Bar; + padding: 3px; + filter: progid:DXImageTransform.Microsoft.Shadow(color="#777777", Direction=135, Strength=3); z-index: 10000; +} + + +.help-tooltip a, +.help-tooltip a:hover { + color: blue !important; + background: none; +} diff --git a/lib/slider/local/helptip.js b/lib/slider/local/helptip.js new file mode 100644 index 0000000..f0f83cf --- /dev/null +++ b/lib/slider/local/helptip.js @@ -0,0 +1,91 @@ +/* + * This script was created by Erik Arvidsson (erik(at)eae.net) + * for WebFX (http://webfx.eae.net) + * Copyright 2001 + * + * For usage see license at http://webfx.eae.net/license.html + * + * Version: 1.0 + * Created: 2001-09-27 * Updated: 2001-11-25 Added a resize to the tooltip if the document width is too small + * + * Dependencies: helptip.css (To set up the CSS of the help-tooltip class) + * + * Usage: + * + * + * + * + * Help + * + */ + +function showHelpTip(e, s) { + // find anchor element + var el = e.target ? e.target : e.srcElement; + while (el.tagName != "A") + el = el.parentNode; + + // is there already a tooltip? If so, remove it + if (el._helpTip) { + document.body.removeChild(el._helpTip); + el._helpTip = null; + el.onblur = null; + return; + } + + // create element and insert last into the body + var d = document.createElement("DIV"); + d.className = "help-tooltip"; + document.body.appendChild(d); + d.innerHTML = s; + + // Allow clicks on A elements inside tooltip + d.onmousedown = function (e) { + if (!e) e = event; + var t = e.target ? e.target : e.srcElement; + while (t.tagName != "A" && t != d) + t = t.parentNode; + if (t == d) return; + + el._onblur = el.onblur; + el.onblur = null; + }; + d.onmouseup = function () { + el.onblur = el._onblur; + el.focus(); + }; + + // position tooltip + var dw = document.width ? document.width : document.documentElement.offsetWidth - 25; + if (d.offsetWidth >= dw) + d.style.width = dw - 10 + "px"; else + d.style.width = ""; + var scroll = getScroll(); + if (e.clientX > dw - d.offsetWidth) + d.style.left = dw - d.offsetWidth + scroll.x + "px"; + else + d.style.left = e.clientX - 2 + scroll.x + "px"; + d.style.top = e.clientY + 18 + scroll.y + "px"; + + // add a listener to the blur event. When blurred remove tooltip and restore anchor + el.onblur = function () { + document.body.removeChild(d); + el.onblur = null; + el._helpTip = null; + }; + + // store a reference to the tooltip div + el._helpTip = d; +} + +// returns the scroll left and top for the browser viewport. +function getScroll() { + if (document.all && document.body.scrollTop != undefined) { // IE model + var ieBox = document.compatMode != "CSS1Compat"; + var cont = ieBox ? document.body : document.documentElement; + return {x : cont.scrollLeft, y : cont.scrollTop}; + } + else { + return {x : window.pageXOffset, y : window.pageYOffset}; + } +} \ No newline at end of file diff --git a/lib/slider/local/howto.txt b/lib/slider/local/howto.txt new file mode 100644 index 0000000..43be171 --- /dev/null +++ b/lib/slider/local/howto.txt @@ -0,0 +1,3 @@ +Creata a sub folder in the zip directory and copy all these files to that dir. +Replace the include statements of webfxlayout.js and webfxapi.js to point at local/webfxlayout.js and +local/webfxapi.js \ No newline at end of file diff --git a/lib/slider/local/title-background.png b/lib/slider/local/title-background.png new file mode 100644 index 0000000..39487d5 Binary files /dev/null and b/lib/slider/local/title-background.png differ diff --git a/lib/slider/local/webfxapi.css b/lib/slider/local/webfxapi.css new file mode 100644 index 0000000..990145e --- /dev/null +++ b/lib/slider/local/webfxapi.css @@ -0,0 +1,47 @@ +/* This style sheet is used for WebFX Api pages */ a.helpLink, +a.helpLink:hover { + color: rgb(0,66,174); + border-bottom-color:rgb(0,66,174); +} + +.help-tooltip { + width: auto; +} + +.help-tooltip h4, +.help-tooltip table, +.help-tooltip p { + width: auto; +} + +.methodContainer { + display: none; +} + +.methodInfo h4, +.methodInfo thead td { + font-size: 13px; + background: none; + border-bottom: 0; +} + +.methodInfo h4, +.methodInfo p, +.methodInfo table { + margin: 5px; + padding: 0; +} + +td { + vertical-align: top; +} + +td code { + white-space: nowrap; +} + +code a:visited, +code a:hover { + color: rgb(0,66,174); + background: transparent; +} \ No newline at end of file diff --git a/lib/slider/local/webfxapi.js b/lib/slider/local/webfxapi.js new file mode 100644 index 0000000..2623473 --- /dev/null +++ b/lib/slider/local/webfxapi.js @@ -0,0 +1,20 @@ +/* + * This script is used for WebFX Api pages + * + * It defines one funtion and includes helptip.js, helptip.css and webfxapi.css + */ + +document.write( " + + + + + +
+++++ + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+
+ +
+
+ + + + + + + + + + + + + diff --git a/lib/slider/slider.html b/lib/slider/slider.html new file mode 100644 index 0000000..220a5f4 --- /dev/null +++ b/lib/slider/slider.html @@ -0,0 +1,162 @@ + + + + +Slider (WebFX) + + + + + + + + + + + + +
+ + +

+ 2002-10-07: First public version released
+ 2006-05-28: Changed license to Apache Software License 2.0.
+

+ +

Introduction

+ +

Sliders are useful controls for choosing a value in a range of values. +Common uses are volume controls, seekers for movie and sound files as well +as color pickers. A few people have asked for an update to the old +Slidebar +component to make it work in Mozilla and work better in IE. But since the +original control was very basic and was not very usable I decided to +create a new one.

+ +
+
+ +
+
+ + + +

When starting with the new slider a few main features where kept in mind:

+ +
    +
  • Degrade gracefully for browser without the needed DOM support. This is + achieved by using a basic text input as the base for the control. In case + the browser does not support the needed features then the input can be used + in the normal way.
  • +
  • Full mouse support. Lots of slider controls does not support anything beyond dragging + the handle. The goal was to allow the user to be able to both drag the handle + and hold down the mouse anywhere on the slider to move the handle towards the + mouse.
  • +
  • Full keyboard support. Once the slider is focused the arrow keys and Page Up / + Page Down can be used to change the value.
  • +
  • Mouse wheel support where available.
  • +
  • Skinable using different CSS files.
  • +
+ +

Requirements

+ +

The slider works in any browser but the GUI component works in +browsers with simple DOM level 1 support with one IE extended proprietary property. +That property is offsetWidth (and offsetHeight) and this is +known to be supported by IE5+, Mozilla 1.0+, Konqueror 3+ and it is assumed other future +browsers will support this as well because it has become a de facto standard.

+ +

Usage

+ +

To use the slider we have to include a few JS files and a CSS file.

+ +
+<script type="text/javascript" src="js/range.js"></script>
+<script type="text/javascript" src="js/timer.js"></script>
+<script type="text/javascript" src="js/slider.js"></script>
+<link type="text/css" rel="StyleSheet" href="css/winclassic.css" />
+
+ +

Then we need to define the HTML to use for the slider. Something like this:

+ +
+<div class="slider" id="slider-1" tabIndex="1">
+   <input class="slider-input" id="slider-input-1"
+      name="slider-input-1"/>
+</div>
+
+ +

After this we have to create the JS object that handles the logic. If we only +plan to use this in pages and applications that you know will support the dynamic +slider control we can use the following script block. This should be placed directly +after the slider div.

+ +
+<script type="text/javascript">
+
+var s = new Slider(document.getElementById("slider-1"),
+                   document.getElementById("slider-input-1"));
+
+</script>
+
+ +

If we however cannot guarantee that all user uses browsers that support +document.getElementById we should use document.forms +to find the input and test whether document.getElementById is +defined.

+ +
+<script type="text/javascript">
+
+var sliderEl = document.getElementById ?
+                  document.getElementById("slider-1") : null;
+var inputEl = document.forms[0]["slider-input-1"];
+var s = new Slider(sliderEl, inputEl);
+
+</script>
+
+ +

+Slider
+Implementation
+API
+Demo
+Download +

+ +

Author: Erik Arvidsson

+ + +
+ + + diff --git a/lib/yuicompressor-2.4.2.jar b/lib/yuicompressor-2.4.2.jar new file mode 100644 index 0000000..c29470b Binary files /dev/null and b/lib/yuicompressor-2.4.2.jar differ diff --git a/loader.html b/loader.html new file mode 100644 index 0000000..554031b --- /dev/null +++ b/loader.html @@ -0,0 +1,70 @@ + + + + + + GeoTemCo + + + + + + + + + +
+
+
+ + + + + + diff --git a/manual.pdf b/manual.pdf new file mode 100644 index 0000000..d130d76 Binary files /dev/null and b/manual.pdf differ diff --git a/minifier.html b/minifier.html new file mode 100644 index 0000000..f7bb167 --- /dev/null +++ b/minifier.html @@ -0,0 +1,69 @@ + + + + + + GeoTemCo + + + + + + + + +
+
+
+
+
+ + + + + +