remove legacy codes : jquery-geo
authorKoeun Choi <koeun.choi@samsung.com>
Mon, 21 Jan 2013 04:07:16 +0000 (13:07 +0900)
committerYoumin Ha <youmin.ha@samsung.com>
Tue, 22 Jan 2013 05:26:04 +0000 (14:26 +0900)
Change-Id: I063edb5bc7fd8bc567896e30003dcd79fdd3c0a2

199 files changed:
COPYING
libs/js/jquery-geo-1.0b2/.gitignore [deleted file]
libs/js/jquery-geo-1.0b2/LICENSE-GPL [deleted file]
libs/js/jquery-geo-1.0b2/LICENSE-MIT [deleted file]
libs/js/jquery-geo-1.0b2/README.md [deleted file]
libs/js/jquery-geo-1.0b2/apple-touch-icon.png [deleted file]
libs/js/jquery-geo-1.0b2/dev-journal-ryan.txt [deleted file]
libs/js/jquery-geo-1.0b2/docs/404.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/css/handheld.css [deleted file]
libs/js/jquery-geo-1.0b2/docs/css/style.css [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/all-shingled.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/all-tiled.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/append.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/appendservice.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/basemaps.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/bbox.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/bostock.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/census.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/center.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/css/style.css [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/defer.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/destroy.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/drag.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/draw.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/drawStyle.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/empty.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/emptyservice.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/events.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/find.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/findservice.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/geo-geometry.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/geometry.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/hurricane.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/image.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/img/ajax-loader.gif [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/img/boat.png [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/img/jsfiddle.png [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/img/marker.png [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/inset.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/insetmap.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/isGeodetic.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/jqm.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/js/all-shingled.js [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/js/all-tiled.js [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/js/iecors.js [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/js/json2.min.js [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/kml.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/label.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/labelservice.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/logo.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/marker.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/markers.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/measure.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/mobile.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/mode-zoom.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/opacity.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/panscroll.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/proj.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/refresh.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/remove.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/removeservice.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/services.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/shapeStyle.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/shapeStyleservice.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/shingled.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/simplest.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/spocode.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/static.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/stringsrc.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/template.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/tiger.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/tiledservices.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/tilingScheme.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/tracking.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/twheat/css/style.css [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/twheat/img/$.geo-logo-small.png [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/twheat/img/ajax-loader.gif [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/twheat/index.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/twheat/js/twheat.js [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/twitter-heat.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/usastates.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/utah/apple-touch-icon.png [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/utah/css/style.css [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/utah/favicon.ico [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/utah/img/BaseMapSelectorSprite-v1.1.png [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/utah/index.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/utah/js/libs/jquery.watermark.min.js [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/utah/js/libs/modernizr-1.7.min.js [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/utah/js/script.js [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/voting.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/wkt.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/xkcd.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/examples/zoom.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geo/area.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geo/bbox.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geo/center.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geo/centroid.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geo/contains.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geo/distance.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geo/expandBy.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geo/height.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geo/include.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geo/index.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geo/length.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geo/pointAlong.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geo/polygonize.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geo/proj.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geo/reaspect.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geo/recenter.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geo/scaleBy.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geo/width.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geographics/index.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/append.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/axisLayout.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/bbox.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/bboxMax.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/center.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/cursors.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/destroy.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/drawStyle.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/empty.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/find.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/geomapbbox.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/geomapclick.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/geomapdblclick.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/geomaploadend.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/geomaploadstart.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/geomapmove.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/geomapshape.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/images/map.png [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/index.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/measureLabels.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/mode.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/opacity.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/pannable.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/pixelSize.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/refresh.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/remove.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/resize.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/scroll.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/services.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/shapeStyle.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/shift.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/tilingScheme.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/toMap.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/toPixel.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/toggle.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/zoom.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/zoomMax.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/zoomMethod.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/geomap/zoomMin.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/html/index.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/images/$.geo-logo-large.png [deleted file]
libs/js/jquery-geo-1.0b2/docs/images/$.geo-logo-small.png [deleted file]
libs/js/jquery-geo-1.0b2/docs/images/$.geo-logo.png [deleted file]
libs/js/jquery-geo-1.0b2/docs/images/bostonbuilt.png [deleted file]
libs/js/jquery-geo-1.0b2/docs/images/map.png [deleted file]
libs/js/jquery-geo-1.0b2/docs/index.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/internals/index.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0a3.js [deleted file]
libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0a3.min.js [deleted file]
libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0a4.js [deleted file]
libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0a4.min.js [deleted file]
libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0b1.1.js [deleted file]
libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0b1.1.min.js [deleted file]
libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0b1.js [deleted file]
libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0b1.min.js [deleted file]
libs/js/jquery-geo-1.0b2/docs/jquery.geo-test.js [deleted file]
libs/js/jquery-geo-1.0b2/docs/jquery.geo-test.min.js [deleted file]
libs/js/jquery-geo-1.0b2/docs/js/plugins.js [deleted file]
libs/js/jquery-geo-1.0b2/docs/js/rainbow-custom.min.js [deleted file]
libs/js/jquery-geo-1.0b2/docs/js/script.js [deleted file]
libs/js/jquery-geo-1.0b2/docs/quickstart/index.html [deleted file]
libs/js/jquery-geo-1.0b2/docs/what/index.html [deleted file]
libs/js/jquery-geo-1.0b2/favicon.ico [deleted file]
libs/js/jquery-geo-1.0b2/grunt.js [deleted file]
libs/js/jquery-geo-1.0b2/index-full.html [deleted file]
libs/js/jquery-geo-1.0b2/index.html [deleted file]
libs/js/jquery-geo-1.0b2/js/excanvas.js [deleted file]
libs/js/jquery-geo-1.0b2/js/excanvas.min.js [deleted file]
libs/js/jquery-geo-1.0b2/js/jquery-1.7.2.js [deleted file]
libs/js/jquery-geo-1.0b2/js/jquery.geo.core.js [deleted file]
libs/js/jquery-geo-1.0b2/js/jquery.geo.geographics.js [deleted file]
libs/js/jquery-geo-1.0b2/js/jquery.geo.geomap.js [deleted file]
libs/js/jquery-geo-1.0b2/js/jquery.geo.head.js [deleted file]
libs/js/jquery-geo-1.0b2/js/jquery.geo.shingled.js [deleted file]
libs/js/jquery-geo-1.0b2/js/jquery.geo.tiled.js [deleted file]
libs/js/jquery-geo-1.0b2/js/jquery.mousewheel.js [deleted file]
libs/js/jquery-geo-1.0b2/js/jquery.mousewheel.min.js [deleted file]
libs/js/jquery-geo-1.0b2/js/jquery.ui.widget.js [deleted file]
libs/js/jquery-geo-1.0b2/js/jquery.ui.widget.min.js [deleted file]
libs/js/jquery-geo-1.0b2/js/jsrender.js [deleted file]
libs/js/jquery-geo-1.0b2/js/jsrender.min.js [deleted file]
libs/js/jquery-geo-1.0b2/libs/jquery/jquery.js [deleted file]
libs/js/jquery-geo-1.0b2/libs/qunit/qunit.css [deleted file]
libs/js/jquery-geo-1.0b2/libs/qunit/qunit.js [deleted file]
libs/js/jquery-geo-1.0b2/package.json [deleted file]
libs/js/jquery-geo-1.0b2/test/jquery.geo.html [deleted file]
libs/js/jquery-geo-1.0b2/test/jquery.geo_test.js [deleted file]

diff --git a/COPYING b/COPYING
index f5edf2f..6343b2c 100755 (executable)
--- a/COPYING
+++ b/COPYING
@@ -33,11 +33,6 @@ widgets/jquery.mobile.groupindex/
        including theme files (removed php files which required some changes), demo html, js, and also the
        jquery.mobile.scrollview.{js/css} in the common directories (already copied as part of datetimepicker).
 
-widgets/jquery.mobile.maps/
-       initial version taken from :
-       svn checkout http://jquery-ui-map.googlecode.com/svn/trunk/ jquery-ui-map-read-only
-       Checked out revision 254.
-
 jQuery UI (http://jqueryui.com/) [MIT license]
 JQM-DateBox (https://github.com/jtsage/jquery-mobile-datebox) [CC 3.0 Attribution]
 developed by JTSage (http://dev.jtsage.com/blog/)
diff --git a/libs/js/jquery-geo-1.0b2/.gitignore b/libs/js/jquery-geo-1.0b2/.gitignore
deleted file mode 100755 (executable)
index 7fb648e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-
-/sandbox
-/web.config
-/update.bat
-*.swp
diff --git a/libs/js/jquery-geo-1.0b2/LICENSE-GPL b/libs/js/jquery-geo-1.0b2/LICENSE-GPL
deleted file mode 100755 (executable)
index 11dddd0..0000000
+++ /dev/null
@@ -1,278 +0,0 @@
-        GNU GENERAL PUBLIC LICENSE
-           Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-          Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Lesser General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-
-        GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the 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 Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-          NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
diff --git a/libs/js/jquery-geo-1.0b2/LICENSE-MIT b/libs/js/jquery-geo-1.0b2/LICENSE-MIT
deleted file mode 100755 (executable)
index 2c50669..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright (c) 2012 Ryan Westphal
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
diff --git a/libs/js/jquery-geo-1.0b2/README.md b/libs/js/jquery-geo-1.0b2/README.md
deleted file mode 100755 (executable)
index 71577b0..0000000
+++ /dev/null
@@ -1,324 +0,0 @@
-# jQuery Geo
-
-After years of internal development, we are pleased to bring our JavaScript map widget and spatial analysis tools to the open-source world in the form of a jQuery plugin.
-
-## Getting Started
-Using jQuery Geo requires adding one element, including one script (apart from jQuery itself) and calling one function. The following copy-and-paste snippet will help you get started.
-
-```html
-<div id="map" style="height: 320px;"></div>
-<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-<script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-<script>
-  $(function() {
-    $( "#map" ).geomap( ); // you've got a map!
-  });
-</script>
-```
-
-You can also download the latest release as a [minified JavaScript file][min] or a [full, uncompressed one][max].
-
-[min]: http://code.jquerygeo.com/jquery.geo-1.0b1.min.js
-[max]: http://code.jquerygeo.com/jquery.geo-1.0b1.js
-
-
-## Documentation
-The latest docs are hosted at: http://docs.jquerygeo.com
-
-Release and other announcements via @jQueryGeo on Twitter: https://twitter.com/jQueryGeo
-
-News and smaller updates via @ryanttb on Twitter: https://twitter.com/ryanttb
-
-## Contributing
-In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [grunt](https://github.com/cowboy/grunt).
-
-## Release History
-
-### 1.0b2
-* examples - drawing markers
-* geomap - ie8 - [bug] graphics do not resize with window
-* examples - kml points
-* docs - geomap - default action for shift option should be dragBox in dragBox mode
-* geomap - default action for shift option should be dragBox in dragBox mode
-* geomap - don't empty graphics on map interaction
-* geographics - build labels in background, replace html once
-* geomap - [bug] sometimes interaction with other elements doesn't work right on a page with a map
-* geographics - don't empty labels on map interaction
-
-### 1.0b1.1 (2012-08-24)
-* geomap - [bug] shingled deferred services lose img elements when changing scales slowly
-* geomap - [bug] shapes don't render on smaller windows when zoomed in
-* geomap - [bug] changing the zoom & center options at the same time does not zoom to the correct location
-
-### 1.0b1 (2012-07-30)
-* geographics - use canvas compositing for Polygons with holes
-* geographics - [bug] on polygons with holes, stroke draws a line from exterior ring to interior one
-* docs - geomap - trigger a shape event when a user finishes measuring
-* geomap - trigger a shape event when a user finishes measuring
-* geomap - [bug] elements inside the map div lose their position setting
-* geomap - trigger bboxchange when we update the map size after the window resizes
-* geomap - [bug] multiple map widgets share the same compiled measureLabels template names and overwrite each other
-* examples - inset map/multiple maps example
-* geomap - [bug] in zoom mode, dragging from bottom-right to top-left draws box but doesn't zoom
-* geomap - [bug] any mouse down triggers refresh, even without pan
-* cdn - fix caching
-** Cache-Control header max-age set to 5 years
-** remove Expires header
-* geomap - upgrade to jsrender 1.0pre
-* deploy - build releases using grunt
-* deploy - make a package for new jQuery plugin directory
-** https://github.com/jquery/plugins.jquery.com/blob/master/docs/package.md
-* deploy - lint JavaScript files
-* docs - geomap - dragBbox mode
-* docs - geo - polygonize function for bbox
-* geo - polygonize function for bbox
-* geomap - dragBbox mode
-* docs - geomap - shift option (default, zoom, dragBbox, off)
-* geomap - shift option (default, zoom, dragBbox, off)
-* docs - geomap - loadstart, loadend events
-* docs - geomap - allow append to take an array of shapes
-* docs - geomap - allow remove to take an array of shapes
-* docs - geomap - improve services option documentation
-* geomap - clamp measure labels to [0, 0]
-* geo - clamp centroid to bbox
-* geomap - measure label for polygon should be in centroid
-* geomap - merge interactive pan and zoom into one, faster system (pan/zoom rewrite)
-* geomap - [bug] iOS - panning is visually jumpy but settles on the correct bbox in the end
-* geomap - pinch-zoom doesn't follow user's fingers close enough when scaling
-* geomap - [bug] pinch zoom on iPad 2 (iOS 5) doesn't refresh tiles when zooming out
-* geomap - request new image in shingled service during interactive pan
-* geomap - [bug] zoom in more than once with zoom method moves tiles to the wrong spot
-* geomap - [bug] only services that have finished refreshing move when the user pans
-* geomap - [bug] map panning is jumpy, appears to be related to shapes and/or drawing context
-* geomap - [bug] pan sometimes lags on first drag
-* geomap - tiled data-scaleOrigin should be stored as an array
-* geomap - android - [bug] cannot always pan map after appending shapes
-* geomap - android - browser stops pan/zoom after 7 logos on logo demo
-* geomap - [bug] mouse wheel on bad or missing tile doesn't zoom out on first rotate
-* geomap - increase mobile performance by 9000
-* docs - geomap - add argument to refresh to force reload of images for dynamic data
-* docs - geomap - allow service-level refresh
-* docs - geomap - zoomMax option (tiled & shingled)
-* docs - geo - include method for bbox
-* geomap - bboxMax should reset center & pixelSize
-* geomap - [bug] initializing center, zoom, & bbox doesn't set all properties
-* geo - [bug] polygonize doesn't return valid polygon when using geodetic coordinates
-* geomap - [bug] dragBbox doesn't include the bbox property in the shape
-* geomap - dragBbox should send a Point (with bbox) for single clicks
-* docs - geomap - dragCircle mode
-* geo - include method for bbox
-* geomap - dragCircle mode
-* geomap - [regression] refresh & toggle methods no longer keep original service objects in sync
-* geomap - [bug] when a singled image hasn't loaded after pan and you double click on empty space, the zoomed bbox seems wrong
-* geomap - allow service-level refresh
-* geographics - remove the blit canvas from the DOM, i.e., don't attach
-* geomap - don't initialze service-level geographics until they're used
-* geomap - add argument to refresh to force reload of images (in case of dynamic data)
-* geomap - loadstart, loadend events
-* geomap - allow append to take an array of shapes
-* geomap - allow remove to take an array of shapes
-* geomap - zoomMax option
-* geomap - [bug] cannot interact with other elements on the page on iOS after panning the map (#71)
-* geomap - iOS - [bug] after one finger is removed, stop processing as if multitouch is still on
-* geomap - dumb high-precision mice down on tiled maps
-** otherwise, the high precision rounds down to zero change in zoom
-* geomap - use linear distance for pinch zoom calculation
-* docs - geomap - zoomMin option
-* geomap - zoomMin option
-* docs - geomap - use MapQuest Open by default; can't deny that it looks much nicer
-* geomap - use MapQuest Open by default; can't deny that it looks much nicer
-* docs - geomap - rename dragBbox to dragBox
-* geomap - rename dragBbox to dragBox
-* geomap - [bug] error using tiled deferred services
-
-### 1.0a4 (2012-02-19)
-* geomap - [bug] changing the tilingScheme doesn't update pixelSize, maxPixelSize, center or centerMax
-* geomap - [bug] shingled services throw exception during resize
-* docs - geomap - axisLayout option
-* geomap - axisLayout option
-* docs - upgrade to jQuery Mobile rc3
-* docs - allow page refreshing
-* docs - geomap - more modes: measureDistance, measureArea, static
-* docs - geomap - append label argument
-* docs - geomap - toPixel/toMap should take all coordinate dimensions like the proj functions
-* geomap - toPixel/toMap should take all coordinate dimensions like the proj functions
-* geomap - move the drawing container instead of individual points during pan
-* geomap - [bug] drawStyle resets after window resize
-* geomap - append label argument
-* docs - geomap - measureLabels option
-* geomap - measureLabels option
-* geomap - measureDistance mode
-* geomap - measureArea mode
-* docs - geomap - service-level shapeStyle
-* docs - geomap - getUrl string option
-* geomap - [bug] create doesn't clear drawing shapes
-* docs - geomap - service-level shapes
-* docs - geo - detect geodetic coordinates and call $.geo.proj automatically, don't require devs to set $.geo.proj to null
-* docs - geomap - add projection section explaining how bbox & center affect map unit type
-* docs - geomap - rename getUrl to src
-* docs - geomap - scroll option
-* docs - geomap - pannable option
-* geomap - src string option
-* examples - string service src
-* geomap - [bug] map tracks mouse when not panning if click on other elements
-* geomap - pannable option
-* geomap - scroll option
-* geomap - [bug] shapesContainer is being cleared twice during mouse wheel zoom
-* geomap - support pinch zoom on iOS
-* docs - geo - add recenter function for bbox
-* geomap - static mode
-* docs - geomap - allow Deferred or Promise as return value from src function
-* geomap - [bug] widget factory merges first service with default sometimes causing exceptions with shingled services
-* geomap - allow Deferred or Promise as return value from src function
-* geomap - [bug] resize event triggered too many times during resize
-* geomap - service-level shapes
-* geomap - service-level find
-* geographics - add a resize method, call from geomap.resize
-* geo - add recenter function for bbox
-* geomap - [bug] errors creating second un-tiled map after destroying a first on same element
-* geomap - refresh shouldn't request new images if the map element is hidden
-* geomap - [bug] delayed multitouch isn't nearly as smooth as true multitouch
-* geomap - [bug] tiled pinch zoom isn't smooth
-* geo - detect geodetic coordinates and call $.geo.proj automatically, don't require devs to set $.geo.proj to null
-* geomap - [bug] mouse wheel doesn't work with jQuery 1.7
-** upgrade to latest jquery.mousewheel plugin
-* geomap - service object visibility and opacity options should be moved to a style property
-* geomap - use currentServices in all functions unless we actually need to update the public options services object
-* geomap - don't change user's service objects in opacity/toggle
-* geomap - show attr text
-* docs - geomap - selector argument to find method
-* geomap - selector argument to find method
-* geomap - pan mode should use a hand cursor by default
-* geomap - [bug] only services that have finished refreshing move when the user pans
-** for a4: hide unfinished services
-* geomap - [bug] a user can mess with the center option, e.g., convert numbers to strings, and it can wreck havoc with map state
-* geomap - [bug] zoom option doesn't return proper values for shingled services
-* geomap - [bug] non-tiled maps can zoom out past zoom 0
-* geomap - don't request tiles that are -y index
-* geomap - [bug] initializing tiled map by non-geodetic bbox always causes zoom level 0
-* docs - geomap - empty string needed for label element
-* geomap - label divs should have class="geo-label" & style="position: absolute;"
-* geomap - [bug] double tap to end shapes adds two points before ending the shape, in different places
-* geomap - [bug] lifting fingers after pinch zoom in drawLineString or drawPolygon modes sometimes adds fake visual coordinate on touch point last lifted
-* docs - upgrade to jQuery 1.7.2
-* geomap - [bug] scroll=off doesn't zoom map but also doesn't allow document scroll
-* geomap - [bug] changing mode does not reset measure drawing
-* geomap - [bug] jQuery UI Widget Factory no longer passes pageX & pageY event properties during trigger when using jQuery 1.7
-** upgrade to Widget Factory 1.8.17
-* examples - all demo (shingled)
-* docs - geomap - custom modes
-* examples - all demo (tiled)
-
-### 1.0a3 (2011-11-01)
-* docs - geomap - more modes: zoom, drawPoint, drawLineString, drawPolygon
-* geomap - [bug] tiles do not show when pixel sizes are near or lower than 1.0
-* geo - cache bbox as geoBbox to match namespacing convention started by jQuery Mobile
-* docs - geo - initial bbox operations: center, height/width, expandBy, scaleBy & reaspect functions
-* docs - geo - initial geometry operations: bbox, distance, contains, centroid
-* docs - geomap - shape event
-* docs - geomap - refresh argument in append, remove & empty
-* docs - geomap - document the resize method
-* docs - launch jquerygeo.com
-* docs - upgrade to jQuery Mobile b3
-* docs - services - remove id property, explain the class property
-* docs - rename getPixelSize to just pixelSize
-* docs - services - change visible to visibility so it matches shapeStyle & CSS
-* docs - geomap - allow child selector syntax to target service elements with toggle & opacity methods
-* geomap - split servieTypes to different files
-* geomap - add data-geo-service to all service container elements, set to type of service
-* geomap - add data-geo-map to map divs initialized with geomap, remove on destroy
-* geomap - allow child selector syntax to target service elements with toggle & opacity methods
-* geomap - [bug] toggle does not refresh the map services being shown for the first time
-* geomap - [bug] destroy keeps window resize handler
-* geomap - [bug] destroy erases content originally inside map div
-* geomap - serviceType objects' destroy method isn't being called
-* geomap - [bug] destroyed geomaps remember appended shapes
-* docs - geomap - zoom method
-* geomap - zoom method
-* geo - calculate bbox in projected coordinates
-* docs - proj - mention that Geodetic methods can also do bbox
-* geo - geometry - bbox function
-* docs - geomap - destroy method
-* geo - bbox - center function
-* geo - bbox - height/width function
-* geo - bbox - expandBy function
-* geo - bbox - scaleBy function
-* geo - bbox - reaspect function
-* docs - geomap - drawStyle option
-* geomap - [bug] shapeStyle not maintained after resize
-* geomap - [bug] second drag while in inertial pan causes map to jump back
-* geomap - drawPoint mode
-* geomap - drawLineString mode
-* geomap - refreshShapes should check bbox cache before drawing
-* geomap - drawPolygon mode
-* geomap - port zoom mode
-* geomap - port shift-zoom mode for pan & draw modes
-* geo - geometry - distance function
-* examples - distance
-* geomap - rename getPixelSize to just pixelSize
-* geomap - [bug] zoom method doesn't work with shingled map
-* geomap - store service state data as jQuery data on serviceContainer element
-* geo - geometry - contains function
-* geomap - rename service.visible to visibility having either "visible" or "hidden" values
-* geo - geometry - centroid function
-* geomap - make service id property optional, add HTML id to serviceContainer if present
-* geomap - append should cache the shape's bbox (instead of the bbox function)
-* geomap - remove should remove the shape's bbox cache
-* geomap - empty should remove the bbox cache for all shapes
-* geomap - make the refresh argument in append public, add one to remove & empty
-* geomap - disable shape redraw during interactive zoom if more than 255 shapes
-* geomap - [bug] shape bbox culling hides shapes that are partially on screen & should be drawn
-* docs - geomap - make pixelSize a read-only option instead of a function
-* geomap - make pixelSize a read-only option instead of a function
-* docs - geomap - make shapeStyle an option
-* geomap - make shapeStyle an option
-* examples - rewrite shapeStyle example
-
-### 1.0a2.5 (2011-08-03)
-* geomap - find - [bug] does not handle GeoJSON features
-* geomap - find - allow for 0 pixel tolerance
-* geomap - find - check for bbox on non-Point geometries before getting too specific
-* geo - bbox - cache shape bboxes
-* docs - do not suggest that it's ok to change the geometry now that we're caching bbox
-* geomap - jsperf test of bbox query vs. geom query on point data
-* geographics - [bug] 0 opacity acts as full opacity
-* geomap - add opacity to service type objects & call from geomap's opacity method
-* geomap - add toggle to service type objects & call from geomap's toggle method
-* geo.proj - update bundled web mercator projection code (removed 150 lines of code)
-* geomap - auto-handle window resize events
-* docs/geomap - scale map according to cursor location instead of re-centering during double-click zoom
-* geomap - iOS - [bug] second tap can be anywhere & cause a zoom
-* geomap - shingled - [bug] map doesn't resize correctly
-* examples - geomap drawStyle option
-
-### 1.0a2 (2011-06-29)
-* geomap - Support dynamic map services
-* geomap - [BUG] geomap causes a script error if jQuery UI is already included
-* docs - Document shape methods
-* geomap - [BUG] Port of soft double-click does not work
-* geomap - [BUG] Cannot see dev-supplied inner content if not set to rel/abs position
-* geomap - Add mobile test page
-* geographics - Port graphic code from internal control
-* geomap - Implement append method
-* geographics - drawArc should use style's width and height and only take center as an argument
-* geomap - Document and implement the public refresh method
-* geomap - Implement shapeStyle method
-* geographics - Draw points as rounded rectangles via width, height & borderRadius properties on shapeStyle, drop oval functionality
-* geomap - Remove the pixels property from position events and add the type property to make the event argument a true GeoJSON Point
-* proj - support up to four dimentional array to convert MultiPolygon coordinates in one shot
-* proj - add functions to convert individual positions that developers can re-implement for their own projection
-* geomap - implement remove method
-* geomap - implement find method
-* geomap - [bug] toPixel should round pixel values
-* geomap - [bug] GeometryCollection shapes do not draw with their parent shape's style
-* geomap - implement empty method
-
-### 1.0a1 (2011-05-09)
-* docs - Document a new interface to our internal map control
-* geomap - Port interactive map widget base to jQuery UI widget factory
-* geomap - Support tiled map services
-
-## License
-Copyright (c) 2012 Applied Geographics, Inc.
-Project lead by Ryan Westphal
-Licensed under the MIT, GPL licenses.
diff --git a/libs/js/jquery-geo-1.0b2/apple-touch-icon.png b/libs/js/jquery-geo-1.0b2/apple-touch-icon.png
deleted file mode 100755 (executable)
index db2ecf1..0000000
Binary files a/libs/js/jquery-geo-1.0b2/apple-touch-icon.png and /dev/null differ
diff --git a/libs/js/jquery-geo-1.0b2/dev-journal-ryan.txt b/libs/js/jquery-geo-1.0b2/dev-journal-ryan.txt
deleted file mode 100755 (executable)
index 3014fed..0000000
+++ /dev/null
@@ -1,2184 +0,0 @@
-== to do ==
-
-=== b2 ===
-* geomap - delay refresh after append/remove/empty until some timeout; hook into interactiveTransform?
-* geomap - [bug] mouse wheel & mac touchpads zoom too quickly
-* geomap - [bug] setting zoom & then center on two lines does not zoom to the correct location
-** http://jsfiddle.net/dyTn9/11/
-* docs - geomap - click mode
-* geomap - click mode
-* geomap - [bug] removing a shape from one service that has been appended to two services causes an error in the second service
-* docs - geo - audit in-place geo calls, e.g., fromGeodetic
-* geo - audit in-place geo calls, e.g., fromGeodetic
-* geomap - convert MapQuest icon to data URI so we don't have to resolve developer.mapquest.com every time
-* geomap - support Windows 8 Store apps
-* test with zepto
-** zepto doesn't have Deferred, but we can drop support for Deferred services in zepto mode
-* geographics - ie8 - append vml to text and set innerHTML once during refresh
-* geomap - audit mousewheel timing & behavior vs. interactiveTransform
-* docs - geomap - geo-attr class
-* geomap - geo-attr class
-
-=== examples ===
-
-* examples - jQuery Mobile
-* examples - weather
-** http://openweathermap.org/example-json
-* examples - MBCR: http://www.mbta.com/rider_tools/developers/default.asp?id=21899
-* examples - drag shapes
-* examples - ie7 - [bug] floating info div doesn't show up, inputs are alone and on the left
-* examples - redo the jVectorMap demo page using jQuery Geo
-* examples - make OSM editing simple
-** http://www.maploser.com/2012/03/29/all-i-want-for-openstreetmap-is-simple/
-** http://jvectormap.owl-hollow.net/ ( found via http://www.moretechtips.net/2011/12/22-most-popular-jquery-plugins-of-2011.html )
-* examples - geomap resize method
-* examples - Codecademy course
-* examples - SVG & other neat elements/media in labels
-* examples - continent puzzle
-** http://stephanmendler.de/thinkmaps/puzzle/index_en.html
-
-=== future ===
-
-* geomap - map & map services type objects should refresh their own shapes after the map image (or tiles) has downloaded or after some timout
-** this could increase responsiveness in case the user interacts just slightly after it's time to refresh
-** it will also be required for plugin service objects
-* geomap - [bug] using shift-zoom during interactiveTransform doesn't zoom to correct location
-** tiled maps only
-** not as noticeable now that the refresh timeout is shorter
-* geomap - test changing shingled service URL to get updated images (in case of dynamic data)
-* geomap - [bug] touchmove events trigger geomap move events even when the event is on a div above the maps
-** makes other parts of the UI feel sluggish
-* geomap - stop using $.data to store bbox since it's only used for drawing; store on _graphicShapes instead
-* geomap - [bug] exception when calling destroy on uninitialized div
-* geomap - do not interactiveTransform non-tiled maps out past pixelSizeMax
-** pixelSizeMax is calculated by bboxMax on non-tiled maps
-* geomap - [bug] multiples of the same event trigger after creating more than one map on the same div, even after destroy
-** destroy should unbind all geomap events
-* geomap - [bug] there's an extra service.refresh call after a non-mousedown touchmove after a refresh
-** most noticeable on shingled services
-* geomap - [bug] if panning is false, mode is draw*, and user attempts to pan, the drawing begins (or another point is added) on the touchstop point
-** a failed pan shouldn't add a point to drawCoords
-* geomap - ie (8?) - [bug] ie highlights entire map div during shift-zoom
-** possibly only when axisLayout is image
-* geomap - [bug] first use of mouse/touch in any mode moves map by one pixel on mousedown/touch
-** possibly only when axisLayout is image
-* geomap - [bug] iPad 2 measureLength puts current length on second to last coord instead of last coord
-* geomap - iPad 2 - [bug] pointAlong doesn't take last point into account in all browsers
-** cannot reproduce; possibly axisLayout image only
-* geomap - include bboxMax in interactiveTransform engine
-* docs - geomap - add indexMax property to service object to limit the view.index number so it can be used in template src
-* geomap - add indexMax property to service object to limit the view.index number so it can be used in template src
-* geomap - [bug] page scroll effects zoom center on fixed position maps
-* geomap - clean up touch tracking
-* geomap - support high-precision mice better in tiled maps
-* geomap - don't repeat attr text if the same as one previously added
-* docs - geomap - zoomMin, zoomMax on service object
-** determines if service is visible but doesn't change map interaction, only map zoomMax/zoomMin options do that
-* geomap - zoomMin, zoomMax on service object
-* geomap - [bug] errors when setting src to empty string
-** "When I added services for my graphics layers with src set to an empty string I got very weird results -- I was seeing the single image from my inset map repeated over and over.  I had to set it to a function that returns an empty string for it to work."
-** possibly an object reference error when multiple maps are created
-* geomap - [bug] on two-finger scroll on some laptops, scroll zoom doesn't move much at first, then moves too fast
-* geomap - remove this-style state properties
-* geomap - add delegate handler for image load instead of one load handler per image
-* docs - geomap - services option on actual services should return an array of the services in the selector
-* geomap - services option on actual services should return an array of the services in the selector
-* geomap - [bug] cannot wheel zoom in dragCircle mode
-* geomap - users should be able to escape out of dragCircle
-* geomap - [bug] cannot wheel zoom in dragBbox mode
-* geomap - users should be able to escape out of dragBbox
-* geomap - remove "px" from .css calls
-* docs - geomap - bboxTiles option (the currently bounding tiles)
-* geomap - bboxTiles option
-* geo - use Array.push instead of $.merge where needed
-* docs - upgrade to jQuery Mobile 1.1.0
-* docs - non-mobile version via adaptive check
-* geomap - [bug] centroid is wrong (for labels?) at high tile levels (19+)
-** see MapGeo showtiles switch
-* geomap - [bug] changing services array (without changing all services) after initialization fails
-* geomap - if a service is not visible, detach it's container from the DOM
-* geomap - create _defaultState object, use for widget-local _widgetState property, reinit _widgetState on _createWidget
-* geographics - draw to img elements to include in interactiveTransform 
-* geographics - better support retna displays
-** http://mir.aculo.us/2012/06/26/flowchart-how-to-retinafy-your-website/
-* geomap - see what knowledge Gamecore.js has to offer
-** http://blog.getplaycraft.com/gamecore-js/
-* geomap - maybe throw an error when setting center to an invalid object, such as the first number in a coordinate array: coordinates[ 0 ] <== wrong!
-** oddly, iPod Touch 4 (iOS 4) is fine
-** might be related to the jQuery UI bug I found
-* geomap - implement service-level shape redrawing during interactive movement
-* geomap - use CSS transition or transform for smoother tiling
-* geomap - don't request tiles that > max possible y for scale
-* docs - geomap - view.service.row & view.service.column to string multiple services together or repeat horizontal tiles
-* geomap - Firefox - [bug] inertial pan is choppy post touchstop
-** post inertial pan rewrite
-* geomap - dragCircle must hook into _refreshDrawing so that the circle moves correctly when the user zooms; which means I have to store the center coordinate as well as pixel
-* geomap - [bug] on that note, I can't zoom in dragCircle mode
-* docs - better describe append/find connection and how to append data and use the click event to find it later
-** see email reply to Marc
-* docs - geomap - describe "graphic service" as shingled with src set to empty string or null
-* docs - warn users about potential CSS/JavaScript issues relating to generated elements
-** ul, li, div, span, img
-* geomap - compile shingled & tiled string src templates for re-use
-** be sure their template names are unique so they don't overwrite each other
-* geomap - don't redraw graphics if the map doesn't move during pan
-* geomap - replace data-geo attributes with classes
-* geomap - cache label coordinates (the labelPixel cannot be cached, it will change each refresh)
-* geomap - rotate label based on segment
-* geomap - use pointer-events: none where appropriate
-* docs - geomap - allow template for label argument to append
-* geomap - allow template for label argument to append
-* docs - geomap - allow template for properties on style argument to append
-* geomap - allow template for properties on style argument to append
-* docs - geomap - shapeLabel property
-** template for labels for all shapes added via append
-* geomap - tiled - retry failed requests once if status === 0 (failed)
-* geomap - shapeLabel property
-* docs - geomap - allow template for properties on shapeStyle option
-* geomap - allow template for properties on shapeStyle option
-* geomap - better integrate resize with interactiveTransform
-* geomap - determine if moz-transform improves speed in Firefox
-* geomap - [bug] once we detect a pan, disable the ability to go to multitouch
-* geomap - [bug] verify label clamping is correct in axisLayout=image maps
-* docs - geomap - pass the service id (if there is one) to the src callback as a view property
-* geomap - pass the service id (if there is one) to the src callback as a view property
-* docs - geomap - support dynamic map services that only work in geodetic coordinates (sr=4326)?
-** can be done with src function that uses $.geo.toGeodetic?
-* geomap - support dynamic map services that only work in geodetic coordinates (sr=4326)?
-* docs - geomap - pan events (pattern after HTML5 drag)
-** can cancel with preventDefault
-* docs - geomap - zoom events (pattern after HTML5 drag)
-** can cancel with preventDefault
-* docs - geomap - support two-finger vertical slide as zoom on mobile devices
-* geomap - create own .position function b/c $.position is doing too much
-** we don't have to worry about border or margin, all elements are within map div
-* geomap - pan events (pattern after HTML5 drag)
-* geomap - zoom events (pattern after HTML5 drag)
-* geomap - test jQuery widget call chaining when setting option values
-* geomap - when scroll is zoom, attempt to not zoom while user is scrolling the page anyway
-* docs - geomap - document the correct way to add/change a service after init
-* geomap - unbind keydown handler on destroy, it's on the document
-* geomap - use requestAnimationFrame instead of setTimeout when waiting to move the map during intractiveTransform
-* expose jQuery Geo as an AMD module so asynchronous loaders like RequireJS and curl.js can use it
-* cdn - test cache headers with http://redbot.org/ before release
-* docs - $.geo.WKT object
-* geo - $.geo.WKT object
-* geomap - panning cursor (closed hand, for when user is actually panning)
-* geomap - completely original cursor set for pan, zoom, draw, etc.
-* docs - geomap - replace method
-* geomap - replace method
-* geomap - draw shapes to img and integrate with interactiveTransform
-* docs & examples - settle on the word "option" in all text (instead of property) to match widget function
-* docs - make all map examples live
-* docs - explain the 96px scale bar, why 96?
-* docs - write a full page about GeoJSON and what each object type is to $.geo
-* docs - geomap - allow name as service object property
-** if a service has a name property, it will maintain a hidden input with the given name
-* docs - geo - support up to GeometryCollection in distance
-* geo - support up to GeometryCollection in distance
-* docs - geo - support up to GeometryCollection in contains
-* geo - support up to GeometryCollection in contains
-* docs - geo - support up to GeometryCollection in centroid
-* geo - support up to GeometryCollection in centroid
-* geomap - show a drawPoint style while the mouse is down, hide if toolPan or dbltap scale
-* geomap - audit allocations and reduce garbage
-** see http://www.scirra.com/blog/76/how-to-write-low-garbage-real-time-javascript
-* geomap - re-use services that have the same id as existing services
-* geomap - deep extend existing service objects when services property is set
-* geomap - cache point bbox if $.geo.proj is not null?
-* geomap - spatially index shapes when a tilingScheme is in place
-* geomap - internal - add _getVisibleTiles method and use it in tiled service and shapes spatial index
-* geomap - remove wheel plugin and use built-in mousewheel event
-* geomap - test how the comma selector works with the find method
-* geomap - compile service src templates, refresh when services changes
-* geomap - audit destroy and memory leaks (jQuery data values, JavaScript object references, etc.)
-* code - prefer $.data over $.fn.data
-* docs - internal - explain what projection is and which one we use by default (3395) and maybe why we call it web mercator & why we can't get to +/- 90 lat
-* docs - internal - document how geomap draws shapes, the geomapgraphics widget and the reason shapeStyle is a method
-* docs - demo - location based notes/to do list
-* geomap - find should check labels first
-* geo - geometry - implement JTS note: "The centroid is equal to the centroid of the set of component Geometries of highest dimension (since the lower-dimension geometries contribute zero "weight" to the centroid)"
-* geo - all bbox operations should be done in non-geodetic coordinates for accuracy
-* geo - support bbox in distance ( fix geomap.find )
-* geomap - perf test putting all containers that need to move with panning in a single super-container
-* docs - geomap - multiple labels
-* geomap - multiple labels
-* docs/geomap - store WKT input for each service
-* geographics - rename the generated style properties to something simple or get better control over closure compiler
-* geomap - document and implement find's callback syntax
-* geomap - custering demo/support
-* proj - take scale factor into account when calculating distance in web mercator
-* geographics - disable fill by setting style.fill to "" & stroke by style.stroke to ""
-* geographics - See Modernizr for comment on BB Storm & canvas detection
-* geographics - document graphics widget
-* geographics - support border, padding, and margin
-* geographics - undo manual outer div style changes
-* geomap - store a copy of shapes as WKT in a hidden input
-* geomap - only update WKT copy if shape is appended with refresh argument set to true
-* geomap - find - [maybe] after flatten, check more cached bboxes for non-Point geometrie
-* docs - geomap - support TMS
-* geomap - support TMS
-* docs - geomap - toDataURL method
-* geomap - toDataURL method
-* docs - geo - $.geo.guessLocation function
-* geo - $.geo.guessLocation function
-* docs - services - document the plugin architecture
-* docs - geomap - drawPush function
-** in the drawing modes, this function starts drawing or adds a point into the already-started shape at the given coordinate
-** immediately triggers the shape event if mode is drawPoint
-* geomap - drawPush function
-* docs - geomap - drawPop function
-** in the drawing modes, this function ends drawing or removes a point into the already-started shape at the given coordinate
-* geomap - drawPop function
-* docs - geomap - drawStop function
-** in the drawing modes, this function ends drawing and triggers the shape event with whatever coordinates have already been added to the shape
-* geomap - drawStop
-* geomap - use profiling to improve pan performance
-* geo - potentially add address cracking
-
-==2012-11-02==
-===shape functions===
-I'm going to head into the realm of delaying refresh during shape operations: append, remove, and empty.
-
-The issue is that users, including myself, forget to add the ", false" to append calls which makes the geographics widget refresh after every append. That needs to stop. It's a little better now with double buffering but not all devices (including Android) support that.
-
-I'm also not sure about hooking into interactiveTransform. This might require it's own timeout but if I can hook into interactiveTransform, I still think that's the preferred options.
-
-I certainly don't want to trigger interactiveTransform.
-
-==2012-11-01==
-===graphics===
-It feels very slow without the timeout in place. Also, I still get a graphics jump if I pan after the services refresh but before all images come in. Most likely due to the service div resetting position and the graphics div not.
-
-This isn't ready yet. I don't think attaching to the global "all images are done" is working how I wanted. I'm going to abandon it for now.
-
-===service type graphics===
-I need to better design more specifically how this will work.
-
-* Each service type's refresh method will get an array of graphics to draw.
-* The service objects will maintain their own geographics widget.
-
-I don't know, it's keeping up pretty well the way it was. I'm sure i can make the graphics rendering errors happen but I might be able to release this as b2.
-
-Also, it could have been worse because of all the console writing I was doing, and having the debugger open.
-
-===labels===
-It wasn't too hard to get labels moving again. % placement works well.
-
-===shape refresh===
-I would still like to fix the timing of refreshShapes so that it's not so jumpy with wheel zoom. I wonder what it's like during pinch zoom though.
-
-I could potentially do the refreshShapes inside the base interactive timeout. Then it can be canceled by more interaction.
-
-That works quite well. That's exactly what I've been trying to do.
-
-===mouseWheelFinish===
-It this function even used anymore? If so, why isn't it part of interactiveTransform?
-
-==2012-10-30==
-===graphics===
-Yes, more graphics talk. It might be too much to move refreshShapes to the service objects. I would want more planning. The most I can do now is not call _refreshShapes until all services have finished or some timeout has occurred.
-
-==2012-10-29==
-===jster===
-I added this project to jster.net. I think it looks nice on the list.
-
-==2012-10-28==
-===graphics===
-I'm going to change how service type objects and refreshShapes works. Service types will need to draw their own shapes. Here are some notes:
-
-  The refresh method of the service type objects will get an array of all the shapes.
-  
-  The service types will initialize their own geographics if they wish and draw the shapes themselves.
-  
-  This will duplicate some code in tiled & shingled but better allow for custom service types.
-  
-  Might want to have the service type objects allow for some sort of inheritance.
-  
-  When refreshing shapes, current services should wait for all pending images to avoid graphics swap errors. However, there should be a long timeout in case the images or a tile takes way too long.
-  
-  On interactive transform, they will call the same method on their geographic widget.
-
-I originally considered sending only view-relevent shapes to each service type but who is the map widget to decide?
-
-I would like to further note that the shapes array sent to each service type's refresh method is not just an array of GeoJSON objects, it's contains all the internal stuff we track like shape-specific style. If the service type want's the layer's shapeStyle, it will have to ask for it, I think. Maybe that will change later.
-
-This may or may not fix the flip issue. The map itself will have a special, fake shingled service (src is ""), that has all the map's graphics. They will not refresh until all images have completed downloading, user interaction is mostly done (time for a flip!) or a long timeout has been reached.
-
-All of this will need to be WELL-documented before I release info about adding custom service types.
-
-==2012-10-25==
-===geographics flicker===
-I am swapping buffers a little better now and I also have to force a swap if we get an interactiveTransform call after we've begun drawing the next scene.
-
-This is not quite ready for production but it's a lot better than it was before yesterday.
-
-===android browser===
-Android 2 doesn't have toDataURL so I have to disable doubleBuffer even if the option is set to true. I'm now feature testing for toDataURL.
-
-==2012-10-24==
-===graphics===
-I'm going to hide labels during interactiveTransform but keep shapes for now.
-
-I don't have to keep removing & creating the scene images, I can reuse them and swap. Double buffer FTW.
-
-The timeout is going to be part of all graphics drawing, even non-true canvas. I might roll labels into the code as well.
-
-===labels===
-I should build HTML apart from the labelsContainer and set the container's html once during _end. Wow. That's a lot faster. I can't believe I wasn't doing that before. I feel less worried about copying existing label elements at the moment.
-
-===flicker===
-There's now too much flicker, especially with measure & drawing tools. I do need some kind of immediate mode...doubleBuffer option?
-
-==2012-10-23==
-===touchstop===
-There is a serious issue with jQuery Geo and either iOS 6 and Android 4. I like to be the first one to say that jQuery Geo is far from perfect. But first, finish:
-
-===graphics===
-I'm close, I think in light of more serious issues, once I get graphics drawing working as planned, I'm going to ignore label updates until I fix the touchstop bug. So, shapes will remain during interactive movement but labels will disappear.
-
-===graphics jump===
-Similar to shingled, my graphics jump when I draw the new scene. I need to have an original /interactive/ image and a new final image. Currently, geographics DOM layout (in true canvas mode) is:
-
-div.geo-graphics
- |- img
- \- div.geo-labels-container
-
-Needs to be:
-
-div.geo-graphics
- |- img (back)
- |- img (front)
- \- div.geo-labels-container
-
-And later it will finally be:
-
-div.geo-graphics
- |- div.geo-graphics-scene-container (back)
- |   |- img
- |   \- div.geo-labels-container
- \- div.geo-graphics-scene-container (front)
-     |- img
-     \- div.geo-labels-container
-
-==2012-10-18==
-===graphics===
-I'm drawing graphics to the canvas internally now and copying to an image tag for later transform. That second part is going to be hard.
-
-==2012-10-16==
-===shift===
-There is still something wrong with the first "shift" drag. It's noticeable with the measure tools. If you set mode to "measureLength" and start measuring, your first shift-drag will pan instead. Your second shift-drag will create a marquee zoom box.
-
-And what about dragCircle? That always seems to dragCircle no matter what shift is. It must follow a different path.
-
-===graphics===
-I have to re-enable moving shapes and have two thoughts on how to change the graphics widget.
-
-1.
-
-- add public begin/end functions and leave it to geomap (or later, the developer) to call them
-- end will copy the current canvas data to an img which ...
-
-this is silly, I don't want to add more public methods than I have to. I need interactiveTransform but I think I want begin/end methods, but they should be private and happen behind the scenes. This leads me to my second option, internally calling end via a timer if we don't get another draw call within a requestAnimationFrame/timeout. It will call its internal end function. It will also call it if there's not image and the user calls interactiveTransform.
-
-==2012-10-15==
-===ie8 graphics===
-A client noticed our graphics don't resize with the window on IE8. Not a suprise.
-
-===shift option===
-It's silly to have mode change to zoom when the shift option is default and the mode is dragBox. It should stay on dragBbox unless the use purposefully sets the shift option to "zoom".
-
-==2012-10-11==
-===markers===
-I need to release this demo tonight. It's been too long. It's finally done. What's next? b2 issues I suppose.
-
-===b2===
-There are a few major issues I need to clean up. First, don't clear shapes while moving the map.
-
-==2012-10-09==
-===tiles===
-Chris asked if geo provides the current tiles in view. That's not part of the design but I might add it in the future. A counter part to tilingScheme and zoom options. Maybe named bboxTiles.
-
-==2012-10-05==
-===point shape labels===
-The width/height of the point shape style seems to change the position of the label. It shouldn't do that. Or, maybe it should. Why would a user want the label to be drawn over the shape when the shape is larger. If you're using point markers, you should know to use 0,0 width/height.
-
-==2012-10-04==
-===marker===
-Twheat! 2 is out. Time to get back to making that marker demo people have been asking for. What to use for data? Maybe WA state boat launches, like in my other demo. That sounds fine.
-
-I'm not going to add docs or rename .geo-labels-container. It's not needed if you use negative margins on the .geo-label CSS class.
-
-In my canvas version of my marker demo, I think the image is taking too long to load, or rather the service is made visible too quickly. It's the right time for a jQuery Promise I think. Nah, I'll just refresh after the image loads.
-
-===click mode===
-Peter wins. I'm going to add a click mode to the official list. It will be identical to drawPoint but trigger the click event instead of the shape event.
-
-==2012-09-30==
-===helping brazil===
-I got a question from a student in brazil about jQuery Geo not rendering graphics. Here are some tips I told him:
-
-There are no built-in limits in jQuery Geo. However, I can think of a few potential reasons why nothing is showing up.
-
-1.  I don't usually have trouble with the number of coordinates in a polygon but the total amount of polygons. Too many polygons can cause browsers to stop responding. A combination of both (many coordinates and many polygons) will be even worse so it's always a good idea to generalize your data when you don't need it to be so accurate.
-2.  When you append a lot of features with the append function, add a ", false" at the end to delay refreshing the map until all the features are in. You can call "refresh" on the map when you're done. Something like this: $.each(polygons, function() { map.geomap("append", this, false); }); map.geomap("refresh");
-3.  Be sure that if your data is in lat/long, that you put the longitude first in any coordinates. Despite how they are generally spoken, longitude is an X coordinate and should come first in jQuery geo: center: [ -71 /*lon*/, 40 /*lat*/ ],
-4.  When possible, store and draw your shapes in web mercator meters instead of lon, lat coordinates so jQuery Geo doesn't have to process them.
-5.  When you are trying to draw a LOT of data, it's best to use a map server and render it as a shingled service in jQuery Geo. I recommend GeoServer for PostGIS.
-6.  Lastly, try to get one polygon to render as a test first before attempting to render your whole country.
-
-I think it's good advice.
-
-===tiger===
-tiger has map services now, so, that's cool. They are running ArcGIS Server. I forget how to restyle layers in AGS. At least it's AGS 10 so we *can* change it. No we can't, that just determines a definition query. The layers do have a WMS service but it's an Esri one. I'm not sure if you can change the style in a URL. Each layer only has one style named: default. Maybe you can, with the SLD_BODY argument!
-
-Here's an example, encodeURIComponent on something like this:
-
-<sld:StyledLayerDescriptor xmlns:sld="http://www.opengis.net/sld" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml"><sld:NamedLayer><sld:Name>74</sld:Name><sld:NamedStyle><sld:Name/></sld:NamedStyle><sld:UserStyle><sld:Name>redStates</sld:Name><sld:Title>redStates</sld:Title><sld:FeatureTypeStyle><sld:Rule><sld:LineSymbolizer><sld:Stroke><sld:CssParameter name="stroke">#FF0000</sld:CssParameter></sld:Stroke></sld:LineSymbolizer></sld:Rule></sld:FeatureTypeStyle></sld:UserStyle></sld:NamedLayer></sld:StyledLayerDescriptor>
-
-Good luck getting that to look nice in code :/
-
-I made it smaller. Oh, and you can't send that to Esri's REST API because it's a WMS parameter. Ignoring it for now. That's too bad, it would really add to my TIGER demo.
-
-==2012-09-29==
-===twheat===
-I'm going to release the new version to Twheat! tonight, Twheat! 2.
-
-===range===
-There's an issue with jQuery Geo and Chrome's handling of the range input. Chrome doesn't stop tracking the mouse, likely because we're cancelling the mouseup event.
-
-==2012-09-21==
-===gaming===
-A month break (well, a couple bug fixes & a b1.1 release between) to play some games. Also, I did get it running as a desktop (Store) app in Windows 8 & will post about that later.
-
-==2012-08-24==
-===center/zoom options===
-Ishmael has found some errors with setting zoom & center options. Specifically, if you set the zoom first and then the center, the final image doesn't refresh properly.
-
-http://jsfiddle.net/dyTn9/11/
-
-==2012-08-22==
-===shapeStyle===
-Somethings wrong with setting shapeStyle at init. I'm not sure this is a problem. I think I was appending to a service and didn't set the service's shape style, was setting the map's shapeStyle. Phew!
-
-===default service===
-There really needs to be a way to get a copy of the default service object. Perhaps just the string: default?
-
-$("#map").geomap( {
-  services: [
-    "default",
-
-    {
-      id: "my-service",
-      type: "shingled",
-      src: ""
-    }
-  ]
-} );
-
-I kind of like that. Maybe I should go further and include other strings: "osm", "toposm", "mq-o", "mq-oa", "bing", "esri-wsm", "esri-demo-*"
-
-That's a lot of extra objects to have hanging around. I might not want to go that far. Also, with a string, there's no way to set opacity or visibility. I'll think further.
-
-===socrata===
-At Evergreen Apps Challenge in Spokane, WA. Socrata has some great data/APIs! I need a section in here on data/map endpoints.
-
-==2012-08-20==
-===drawPolygon===
-There's an error in my culling logic where I get a bbox that has xmax and ymax that are smaller than the minimum.
-
-I just noticed I don't double buffer drawLineString or drawPoint!
-
-===zoom class!===
-I had what I think is a great idea today. I can have a class on the map div that changes based on zoom, e.g., .geo-zoom-7. It won't help as much for non-tiled maps but it would be great to show/hide labels for tiled maps. Hide labels at world scale:
-
-.geo-zoom-0 .geo-label { display: none; }
-
-:)
-
-Although, maybe it should be a data selector: [data-zoom='0'] .geo-label
-
-That will be slower but looks nicer. I'm not sure.
-
-==2012-08-14==
-===Deferred===
-I fixed that issue. _cancelUnloaded was correctly removing image elments but the load event still fired and old images removed unloaded, but correct, images before they could be shown. Nice error!
-
-==2012-08-13==
-===Deferred===
-Here's a fiddle that shows the Deferred missing image on shingled service issue: http://fiddle.jshell.net/ryanttb/nZMEV/show/
-
-jQuery Geo gets the images but none are shown in the map frame after all is said & done.
-
-==2012-08-08==
-===image===
-There's a GigaPan of an Olymic Women's Volleyball tournament. It's a quadkey-based tile system and I can implement it in Geo. Here are some notes:
-
-      some gigapan tile ids
-http://tile111.gigapan.org/gigapans0/111225/tiles.83f6152eea5140f76880a283c3479288//rXX/rXXYYY.jpg
-http://tile111.gigapan.org/gigapans0/111225/tiles.83f6152eea5140f76880a283c3479288//rXX/YYY/rXXYYYZ.jpg
-
-level 0:
-r00/r000.jpg r00/r001.jpg r01/r010.jpg r01/r011.jpg r10/r100.jpg r10/r101.jpg
-r00/r002.jpg r00/r003.jpg r01/r012.jpg r01/r013.jpg r10/r102.jpg r10/r013.jpg
-
-level 1:
-r00/r0000.jpg r00/r0001.jpg r00/r0010.jpg r00/r0011.jpg 
-r00/r0002.jpg r00/r0003.jpg r00/r0010.jpg r00/r0011.jpg 
-
-==2012-08-07==
-===labelsContainer===
-Since this is always positioned relative to the graphics container, I think I can tell developers that it exists, has the class geo-labels-container and that they can offset it. That would be the best way to get image markers with an offset center. However, I think I'm going to rename it .geo-labels instead because it's shorter.
-
-.geo-map
-  .geo-service
-    .geo-labels
-      .geo-label
-  .geo-service
-  .geo-service
-  .geo-labels
-    .geo-label
-
-
-==2012-07-31==
-===beta===
-1.0b1 is out. I hope people like it.
-
-===wkt===
-I will need to test bad input later so that there aren't JavaScript errors even when I will be returning null.
-
-===b2===
-No rest.
-
-==2012-07-28==
-===multitouch status===
-Here's some code to render multitouch status to an h1 tag. For future reference/debugging:
-
-          $("h1").html("multitouch {<br>" + 
-            "anchorDistance: " + anchorDistance + "<br>" +
-            "currentDistance: " + currentDistance + "<br>" +
-            "delta: " + ( ( currentDistance - anchorDistance ) / anchorDistance * 5 ) + "<br>" +
-          "}" );
-
-Place it in touchmove.
-
-===multitouch refresh===
-I'm disabling refresh during multitouch and it makes the whold multitouch experience better, I think.
-
-===zoomMin===
-I'm going to fit this in for b1; might as well complete the API.
-
-==2012-07-26==
-===mouse===
-Peter's mouse can't wheel zoom easilly. It's a high precision mouse and it doesn't click when you scroll it. I have a feeling I'm getting .25 delta and it's rounding down to zero.
-
-===iOS touch===
-I have to stop killing the document events on iOS. Phew! I wasn't shutting _inOp off after multitouch ends.
-
-==2012-07-26==
-===zoomMax===
-Seems to work ok with tiled & shingled. I think I should document and add zoomMin this weekend.
-
-===pixelSizes===
-That bug where rendering zoom 0 with string src...this one:
-
-* geomap - [bug] tiled services with pixelSizes set do not render zoom level 0, when src is a template string
-
-appears to have been fixed with the latest jsRender for me. Here's a jsFiddle to prove it: http://jsfiddle.net/ryanttb/RNrNC/
-
-==2012-07-25==
-===zoomMax===
-Only clamp if it's *over* the zoomMax value.
-
-===shapeStyle===
-Since I'm not creating geographics widgets (or elements) for layers during startup, the shapeStyle property doesn't work.
-
-==2012-07-24==
-===refresh tiles===
-I'm going to see if I can set jQuery Geo up to load tiles faster on faster browsers. Depending on how fast the initial refresh runs, I can decrease the timout delay.
-
-===click===
-The y value of a clicked coordinate is off a little. I'm creating a jsFiddle to find out what's up. It's not off. Something in their website is messing up my calculations for map point location.
-
-===refresh===
-Wow, I didn't notice until now that the new interactiveTransform code wasn't triggering refresh if the user was moving the mouse, even if they weren't actively panning. That's a good one to not have in b1 :)
-
-===zoomMax===
-I have too much redundant code calculating/testing agains zoomMax. I need to specify which functions don't test agains it. Likely _getPixelSize should not but _getZoom should.
-
-==2012-07-22==
-===force===
-There is code from our original implementation to reload tiles. It is no longer being triggered. I'm wondering if I should remove it. There is also code for dirty tiles. They are removed at the end of refresh. I'm not sure I need to keep that code in there because I don't think it's being triggered either.
-
-==2012-07-20==
-===jsRender===
-There's new syntax for default templating. It uses the {{>var}} syntax. I think the old one is still valid, {{:var}} but the new one is preferred. I will change jQuery Geo to use the new one by default. I should also change the docs. Ah, no, it's new syntax to do HTML encoding. I'll have to check the measure templates but I think I will go with higher performance {{:var}}.
-
-===refresh===
-I need to take control of when this is called so I can handle service-level refresh properly.
-
-That's better. _refresh will only run on the map itself and calls _refreshShapes on all the service objects.
-
-===interactiveTransform===
-I turned the timeout back up to 500. Panning was no longer happy in IE with some shapes to manage.
-
-==2012-07-13==
-===interactiveTransform===
-A side effect of the way I'm doing interactiveTransform is that changes to the widget options bbox, center, and pixelSize aren't immediately available. I need to at least update the public options during each change. That may be a little expensive because I will have to do projection but is necessary.
-
-Ok, I think that's better, except that I forgot the zoom option. Added.
-
-===tile query===
-I've decreased the delay to begin checking for new images from 500ms to 256ms. There's a balance here somewhere.
-
-==2012-07-10==
-===dragCircle===
-Time to move this into _refreshDrawing. But first, I have to trigger the Point shape event. Maybe not. I can't zoom. That's against the docs but I think I can leave it for b2.
-
-==2012-07-07==
-===dragCircle===
-I'm going to add this to beta. It will work similar to dragBbox, including sending the bbox.
-
-===dragBbox===
-I may rename this to dragRectangle before the b1 release to keep the drawing modes more about geometry than geography.
-
-==2012-07-06==
-===bboxMax===
-A side effect of changing bboxMax is that zoom's value will have to change. This means that changing bboxMax should refresh the map services.
-
-There's going to be more to do later when I want to handle changing bboxMax properly at runtime. It should hook into the interactiveTransform engine. For now, though, I'm going to make it work right during init.
-
-Heh, bboxMax wasn't doing anything right :) It now sets both centerMax & pixelSizeMax.
-
-===inset===
-A new example is up based on AppGeo's MapGeo product's inset map.
-
-===dragBbox===
-This needs to finally send a bbox. Also, handle points differently. No more click event but you will get a Point shape event.
-
-==2012-07-05==
-===inset shingled map is off===
-If I pre-render an inset map and use a shingled service, the extent box is wrong vs. what we see on the map.
-
-===bboxMax===
-Initializing this property should set _userGeodetic because sometimes you want to init with bboxMax: [], zoom: 0.
-
-==2012-06-22==
-===client work===
-I finished the docs last time, then client work stopped me from finishing the code.
-
-===bostock===
-In implementing the Bostock demo, I found a bug in jQuery Geo. There's a way around it but it's a little slower. The bug will go away when I fix bbox storage on appended shapes.
-
-==2012-06-07==
-===vacation===
-I've been away for almost two weeks. Time to finish b1.
-
-===zoomMax===
-This is where I left off. I'm also considering zoomMin and zoomMax on service objects but that's not until later if needed.
-
-==2012-05-23==
-===tiled===
-The new origin stuff appears to work better. I'm going to run through the other examples & see if I'm ready for a build.
-
-===chrome===
-Chrome's screen tearing is really bad. I'm going to try to disable 3d transform in Chrome. Maybe it's just my laptop, Chrome is doing the tearing even without translateZ. I'm reverting the changes for that test.
-
-===bbox===
-I'm getting a bbox event after a single tap.
-
-===setInteractiveTimemout===
-I need to only call this if: a) it's already been called once (to keep it going) & b) we actually change centerInteractive or pixelSizeInteractive.
-
-The programatic changes are going to be a part of this, too. I need a way to turn on trigger during setInteractiveTimemout.
-
-===programatic===
-I updated all the programatic calls to use the new system with the ability to say not to trigger. I will need to test these but for now, I do think I'm finally ready to merge.
-
-===merge===
-I merged the interactive rewrite into b1. There are bugs that I will have to work through before this becomes beta.
-
-===initial zoom===
-No matter what your initial zoom is, you can see the map at zoom 0 before the new tiles show up. That makes sense given the changes I've made.
-
-ok, the area that handles init options checks to see if the widget has been created before heading into intractiveTransform mode.
-
-===ie8===
-I *know* ie8 support is broken. I haven't even tried it yet. We will keep supporting that browser, though.
-
-==2012-05-22==
-===mouseup===
-I'm ignoring rogue mouseup events now. Hopefully, that will clean resize up a bit on Chrome & Firefox.
-
-===resize===
-Seems to work like it did before. I'm going to increase the frequency (decrease the timeout) of the resize check. In the future, I want the resize in two parts, one to move stuff around in real time/animationFrame time, another to perform the final refresh. Maybe move the latter back up to 500ms? Maybe not.
-
-67ms is too soon, Chrome flickers. I'm bumping it back up to 500ms for now.
-
-This should really be part of the new interactiveTransform code. At least, moving the images around and waiting for the final setCenterAndZoom. The issue I'm seeing with tiled now is that if I pan and the resize before the new tiles come in, the map jumps from the interactive to the final center. Same with shingled.
-
-For now, I think I may be done enough with this to merge back into the main project. That's a lie. I disabled a bunch of stuff before doing this, like marquee zoom. Any of the immediate mode changes.
-
-===immediate===
-I'm going to try to tie these into the new interactiveTransform.
-
-===draw===
-The last obvious thing broken is moving the draw points during interactiveTransform.
-
-shapesContainer is no longer part of panContainer which is now only draw or measure layers.
-
-Scratch that, I'm not going to move the original panContainer. I need to include the draw and measure coordinates in the new interactiveTransform stuff as well.
-
-That works ok, I think. I might change it later depending on how was shape drawing to img elements goes.
-
-I still need to test scale changes with drawing but I have a feeling it's fine. Took the code from pinch zoom.
-
-===tiled===
-I forgot, tiled still needs some of the origin fixes I put into shingled.
-
-==2012-05-14==
-===mouseup===
-Chrome & Firefox trigger a rogue mouseup event when maximizing the window. I don't think that's right but I suppose I have to handle it. But, for some reason, geomap in Firefox doesn't trigger the refresh.
-
-==2012-05-10==
-===shingled===
-Much better now! Two things I was missing: 1) I needed to base calculation on the original map origin of the scale container & 2) the position is now %-based, like tiled.
-
-===keepAlive===
-I don't think there's a need for this any more so I removed it. I had better make sure :) Oh, right. It was for opacity. We don't want to layer semi-transparent images.
-
-The code's not here. I see where I set keepAlive but can't find where I delete the images. This may be a regression from, like a2.
-
-I probably had it chained to a line I deleted. 
-
-Oooh, I didn't need it anymore when I added the concept of a pan container way back. Since I no longer have pan containers, I have to add keepAlive back.
-
-Yep, I had to add it back with the pan/zoom rewrite.
-
-===resize===
-For resize, I should be able to just resize each scale container. Everything else is %-based.
-
-==2012-05-07==
-===shapes===
-I need to finish the rewrite by making sure graphic overlays move correctly.
-
-I might cheap out and hide the graphics for the b1 release. The geographics widget needs its own interactiveTransform method.
-
-===canvas===
-Do I need my blit canvas to be part of the document? I hope now, will remove it soon.
-
-===wow===
-I was originally moving all the servicesContainer for all services INSIDE the loop where I was moving all services.
-
-Also, _$servicesShapesContainer did not include the draw or primary shapes containers. I wonder if that was on purpose. It should not include the draw container because those shapes change during any change in the mouse or map.
-
-===shapesContainers===
-shapesContainers will eventually need the transform, but again, maybe not now. For now, I'm hiding the drawn shapes during interactiveTransform.
-
-===jump===
-There's still a jumpiness issue when you catch it just before/during refresh. Old tiles that have already been scaled pop into weird locations. Should I fix it now or continue with shapes? Probably, I should finish with shapes and then work on bugs.
-
-===pinch zoom===
-Hmm, there are issues here once I turned refresh back on.
-
-It's with double click zoom as well, once you start panning.
-
-A single hardware pinch zoom appears to work perfectly if you don't pan any time after the zoom. I end up in Africa or the Virgin Island a lot from MA on the iPad.
-
-Definitely a problem with refresh. Disabling the refresh timer shows that interactiveTransform still works fine.
-
-I'm not doing any pixelSize clamping in _setCenterAndSize. That must have originally been somewhere else. With that change, there is still the jump issue of old transformed tiles but I don't seem to end up in Africa.
-
-===pinch jump===
-I need to jump to the closest pixelSize, not the smallest. It will make this smoother...maybe in the future as well as it only affects when they zoom in just shy of the half-level mark.
-
-===shingled===
-I'm creating a new shingle for each pan, which is right, but not positioning it correctly after refresh.
-
-Actually, this is a much better representation of the jump issue I'm seeing in tiled. If I fix this, I may be able to fix tiled based on it.
-
-===data vs. parseInt===
-I'm going to guess that storing a number with $.data is much faster than trying to use parseInt on current CSS values. Although, the parseInt would only happen on refresh, while the .data call will happen with every pixel move.
-
-==2012-05-06==
-===shinged===
-I have to get this started. Appears to work pretty well. What's left for beta?
-
-===non-moving divs===
-I don't think I need the transform on divs that don't move, such as the event target and content frame. I'm removing it for now.
-
-==2012-05-01==
-===rewrite===
-I turned refresh back on and there's still that image repeating. I'm going to log some stuff and see what I can discover.
-
-First step, interactiveTransform is being called on every mouse move even when the mouse isn't down, that has to stop.
-
-===pixel-size===
-Wow, I was making a new scale container every time because I had changed to using data-pixel-size but was still testing for data-pixelSize.
-
-The duplication is now gone. You can still mess up the view if you start panning right at the right moment, just as it's about to refresh but I can live with that for now.
-
-===shingled===
-I suppose shingled is next.
-
-==2012-05-01==
-===shingled===
-Since tiled is pretty much ready for linking to the true refresh, I can either fix shinged now or actually implement the refresh. I suppose I should try to finish the rest of the geomap widget with tiled for now. It's not fun to be unable to refresh the map in this in-between state.
-
-===refresh===
-Tiled services are ready to be merged into refresh. I'm going to skip the _panEnd stuff now and just go to _panFinalize. I can add the inertial pan back later.
-
-Calling _setCenterAndSize at the end of my timer now. Pretty fast! I'm getting weird behavior with tiles that aren't in the current view, though. And some, look like they're repeating. It all settles down after the refresh but the quarter second leading up to it there is a visible jump.
-
-==2012-04-27==
-===transform===
-Setting the transform on the images helped iOS. Settig it on the map div itself helped Android a lot and iOS a little.
-
-===iOS===
-If there's anything else over the map, iOS doesn't respond very well. It doesn't let me pan (scrolling the page instead) and pinch zoom is just weird.
-
-Out of a whim, I didn't include the jQuery UI style sheet. iOS now works like the others. I wonder what's in the style that it doesn't like. Latest version of jQuery UI (1.8.19) still has the issue. I wonder which widget does it.
-
-Weird, if I take out the .button() calls, the demo works on iPad.
-
-iOS works fine with fixed position. It's still the .button calls. I'm sniffing out the button calls for iOS 4-5 for now. I don't have time to figure out that issue.
-
-===ie9===
-I've been wanting to use better features in ie9 for a while. Let's see how this goes because with the new code, I have to drop the filter. I didn't like using filter anyway.
-
-I cannot belive how nicely the transform scale + transform-origin work in ie9! I might investigate using them instead of the % hook on the scale container for webkit & Firefox.
-
-==2012-04-27==
-===panzoom===
-_inOp gets set to true during pan.
-
-When to have the interactive center and pixelSize match the current values? Any function where timeoutInteractive is null, likely.
-
-I may have been moving the services' shapesContainers twice, once in _panMove and again in the service's serviceContainer.children().css call. No, the service container is the data-geo-service object. Its only children are scale containers.
-
-I'm not going to move the scaleContainers separately during pan...oh, I have to because they will move at different velocities.
-
-===transform===
-I'm attempting to add transform support for iOS. 3D CSS transforms make the images bounce around funny during scaling. At least, when I set the CSS on the scaleContainer.
-
-==2012-04-26==
-===measure===
-In some instances, the measure tool doesn't position properly. Going to change it from a div to a span to calculate width better. The container can stay a div. Only the actual label needs to be inline.
-
-Fixed. I'm also clamping to [0, 0] so the measure label doesn't move past the left or top of the map.
-
-===pixel measure===
-I can tell I will have to add support for axisLayout=image into the measure code. The clamping is backwards.
-
-===centroid===
-On bad polygon geometry (hourglass is the common example), our centroid function returns weird results. I might clamp to the bbox for now as a stopgap until I fix it for real.
-
-That's better. Not great but not nearly as much weirdness.
-
-===pan/zoom===
-Back to this. I need to disable the pan pop as well as calls to refresh.
-
-When panning, we move the _$panContainer. It contains various top-level items (shapes/draw/measure containers). Each service moves their own content. Pan finalize resets the pan container as well as the shapes container for all services.
-
-I'm still doing too much in touchmove.
-
-Now caching the reference to services shapesContainers.
-
-==2012-04-24==
-===pan/zoom===
-Where was I? :) Right, first disable all refreshing and attempt a the new interactive pan.
-
-Not all refreshing will be disabled, the function/option calls from the developer should be honored.
-
-===zoomTo===
-Private but never called?
-
-===no refresh===
-With all _setCenterAndZoom calls commented out, the pan container still jumps back to starting position. That's expected with the current code but shouldn't happen when we're done. That jump needs to wait for the full refresh.
-
-==2012-04-20==
-===b1 docs===
-I got some more docs in. I need to take a small break and actually rework the pan/zoom engine.
-
-===pan/zoom===
-So it begins. I think the first thing to do is create the clearable refresh time during pan/zoom and remove the duplicate refresh code in interactivePan & interactiveScale.
-
-===google===
-Google Maps requests new tiles during pan when running in Chrome on the desktop, however, the mobile website waits until the user lets go of the map.
-
-==2012-04-12==
-===polygonize===
-That's what the bbox->polygon function will be called. It's in GEOS. Their docs say: Polygonizes a set of Geometries which contain linework that represents the edges of a planar graph.
-
-While that's supposed to be only for linework, e.g., a LineString to Polygon, I think it's fine to extend that to bbox. It's not called polygonize in JTS, there's a Polygonizer class and a getPolygons method. I'll simplify that, too.
-
-===shift===
-I changed the shape value to dragBbox so I can use it in the code a little more smoothly (choosing cursors, actually switching the mode).
-
-==2012-04-11==
-===foss===
-I gave my talk, went ok. Gotta get back to docs.
-
-===dragBbox===
-This mode should operate even if pannable is set to false. There's a test in the code where I have to special case that out.
-
-==2012-04-10==
-===foss===
-I'm coding at foss4g!
-
-===Deferred===
-Deferred demo is done.
-
-==2012-03-30==
-
-### markdown
-The new markdown file looks nice!
-
-### docs
-Time to document the last feature that are going into b1. Actually, I want to lint the last file, tiled.js.
-
-### Deferred context
-The last lint issue is that I shouldn't create functions in a loop. That's done when the user returns a Deferred object as the tiled service's src property. The function calls _loadImage on the service object but needs more than the url, which is all the Deferred done call gives it. How do I get the rest, such as $img, pixelSize, etc. $.proxy? But isn't that creating a function anyway, just one that lint can't see? Yes, it does. Maybe I can put the data on the Deferred object itself. I don't see why not.
-
-==2012-03-30==
-===grunt===
-I haven't written in a while. Checking out grunt now.
-
-Wow, that was cool. jQuery Geo now compiles with Grunt and I also have a jQuery plugin package file!
-
-===graphic holes===
-With canvas, I have better control of drawing polygons with holes. It's pretty nice. I can't wait to get into WebGL.
-
-==2012-02-15==
-===labels===
-The code already worked the way I wanted! No .geo-label div is created if you don't at least provide an empty string label.
-
-==2012-02-12==
-===find===
-Need to implement the * selector. That was easy. $.isPlainObject thankfully returns false on strings.
-
-===unloaded image===
-It appears that when you pan starting on an area that has an unloaded image, i.e., empty space, this._center gets set to string values. Checking on this now.
-
-===shingled 0===
-To prohibit shingled maps from zooming out past 0, I had to change quite a bit of code. I now have getZoom & getPixelSize methods that will work regardless of tilingScheme. I'm also calculating pixelSizeMax when bboxMax changes and making sure the non-tiled zoom doesn't go less than 0 in two spots. That seems to do the trick.
-
-===service-level shape refresh===
-Shapes on services draw twice, heh. That was a tough one. Turns out, when I create the service-level geomap widgets, I wasn't setting _graphicShapes to a new array before passing the (this) object to the widget factory. All services were sharing the same _graphicShapes reference.
-
-==2012-02-11==
-===current services===
-I need to make sure their style property is always full, that's the point of having an internal copy. This means I have to fill in visibility & opacity when I create the services based on defaults.
-
-=== service style===
-$.extend({
-    visibility: "visible",
-    opacity: 1
-  }, style)
-
-That returns what you would expect if style is undfined.
-
-===str src===
-I can't mod index in the template. I feel that there is a way, but it's not there yet.
-
-==2012-02-06==
-===mousewheel===
-This needs to be updated, it doesn't work with jQuery 1.7.
-
-==2012-02-04==
-===options===
-Right, this._options does equal this.options but only because the latter must be called so and we can minify the former for internal use.
-
-==2012-02-03==
-===proj===
-I seem to be able to detect geodetic coordinates ok. I'm switching all of the $.geo functions to use it. So far, so good.
-
-==2012-02-02==
-===transition===
-They look cool, but I don't think this project is ready for transitions, they have some unexpected side-effects. I would like to rewrite the interactive portion anyway.
-
-==2012-02-01==
-===destroy===
-There's a bug with shingled services if I call destroy and try to re-create.
-
-===services===
-Changing the services option will destroy all service-level shapes. I'm not sure what to do about that. Eventually, I will re-use serviceContainers (and service-geomaps) based on the new services array coming in but I currently don't do that.
-
-===proj===
-Finally, to get rid of proj. The point is, you should be able to use projected coordinates even when $.geo.proj is not null.
-
-The same geodetic test applies to both bbox & coords because the first two elements of either are the x and y of some number. Nice!
-
-==2012-01-31==
-===shapes zoom===
-Service-level shapes don't refresh while zooming and it's not going to be easy at the moment. All I can do is call geomap("refresh") on the serviceContainer which, since they're just service pseduo-map widgets, will only refresh the shapes. The problem is they don't have access to the in-between state of the zoom so the shapes don't draw correctly. I will fix this later when I re-invent the pan/zoom code for beta. For now, service-level shapes will not draw during interactive zoom.
-
-However, it's good to have an idea of how the new system will need to work. Each service-map widget will check the _interactiveCenter & _interactivePixelSize values to draw shapes in proper positions.
-
-==2012-01-30==
-===geographics===
-This widget needs some updates. For now, I'm just going to add the resize function.
-
-Note, with canvas, you don't need to set size CSS at all. The canvas is, by default, inline-block with width and height based on the html element attributes. Also, as is shown in this fiddle, changing the runtime width & height properties of the canvas element does clear the canvas: http://jsfiddle.net/jcGY2/
-
-==2012-01-28==
-===service-level shapes===
-Where was I before I stopped to add Deferred & fix bugs? Right. The service-level geomap widgets should now initialize their own shapesContainer. 
-
-===resize===
-resize is a method on the service object because shingled need to stretch the current image.
-
-I need to finally add resize to geographics.
-
-===find===
-find will have to query and include service level shapes.
-
-===map===
-This will be simpler if I allow services to get to the private map variables (similar to how I allow the service object to do it?). No, probably during create.
-
-Can you have protected properties in a jQuery UI widget? I would like to be able to pass a reference to the map during create...I could also use .data. That worked fine. I now have this._map which will be the same as this for the map object and a reference to the map object for services. Nice! On parts that need to work the same between maps and services, (such as _refreshShapes), I can just call this._map.x and it will be correct.
-
-===shapeStyle===
-This should be fine for services.
-
-==2012-01-27==
-===Deferred===
-The src function will be allowed to return a Deferred (or Promise) object. If it does, geomap will wait for the done or fail events. The src function will call resolve or fail.
-
-===service shapes===
-The opacity method might have to stay as a service method because it must directly manipulate image elements in some cases. However, the toggle method can operate on the new service container.
-
-===init services===
-So, the jQuery UI widget factory udpates non-array options fine, i.e., when I get into the _create method, this.options has whatever the user supplied merged in with the default options. However, array options are not copied so any changes to the initial service option are not maintained.
-
-Not true, but it does unfortunately merge the first user supplied service with the default service, osm.
-
-===options===
-I forget why I have _options and options. They are supposed to be internal vs exteternal but they are equal references.
-
-==2012-01-24==
-===a4===
-What's next for a4? static mode.
-
-===static mode===
-This shouldn't be too hard. Currently, any non-defined mode string will act close to static. That's different from how I want it to work. The mode "static" should be static and undefined modes should act like pan for now.
-
-The switch appears to have gone well. I can set the mode to "23" and it acts like it's in pan. That's a feature I will define more fully later and document before it's official.
-
-===labels===
-Time to merge labels into geographics. This is a huge step toward service-level shapes. I should be able to find all $labelsContainer references and move them into sections of geographics.
-
-Now that labelsContainer is part of shapesContainer, the next step is to put shapesContainer under a serviceContainer (which is inside servicesContainer). Got that?
-
-===service-level shapes===
-Here we go! Each serviceContainer has a div that contains all the images. The geographics widget will be a sibling of that.
-
-I may need a new container :/ the extra div was the tiled service's scale container. I need a container for the service/graphics elements.
-
-The map itself will have to manage this new container. I think the internal service objects will get this container and now append their functionality and elements to it. It will no longer have to return a new div for which the map will create a sub-geomap. 
-
-==2012-01-23==
-===addressing===
-I think address parsing (cracking) will be a useful feature for geocoding to non-Google geocoders. I might want to add that to $.geo at some point. Christian has some Python code that does it already I can port.
-
-==2012-01-21==
-===pinch aftermath===
-Adding pinch was pretty easy. The only big issue was if a second finger touched a short time after the first. To counter, I fake as if all touch has stopped and initiate a new one. There's room to consolidate code here but I'll get to that later.
-
-===drawPoint===
-This acted funny with pinch zoom in that when the second finger hit late, a shape event got triggered at the first finger.
-
-===draw other===
-Similar issue, touchstop gets triggered after pinch zoom and a segment is added to the shape. Maybe related to calling touchstop. We get in an odd state, actually. The segment shows up but the next touch causes it to disappear and a new one appear instead.
-
-I'm going to put this as a bug and get back to it later. There's much more actual functionality to get into alpha 4.
-
-==2012-01-20==
-===pinch===
-This is mostly ready for iOS. It's a little jumpy so I think I have to detect a second touch while the first one is down as long as they haven't started panning yet and move into pinch zoom.
-
-If the second finger is late, we still only get the touchmove event which will work great.
-
-===android===
-I am going to coin "hold scroll" for android to counter their lack of multitouch. When the user holds the map in the same place for between .5 seconds and before the browser takes over, the user can move the touch point vertically to start zooming as if there's a scroll wheel.
-
-I was going to have "expand zoom" (coined by Laura) where it works similar to "hold scroll" but instead of acting like a scroll wheel, it acted like the bbox was expanding from the hold position. In effect, a zoom in only fake pinch zoom. However, I like the zoom in/out ability of the fake wheel better. This will also work on iOS, I think and even desktop.
-
-===web workers===
-I eventually want the $.geo functions to allow the browser to use web workers but they'll have to be in a javascript file. Hopefully, I can use data URIs.
-
-I could always grab the worker js from the CDN but that would require internet access. What if it's all an internal site, like for government. Or, graphics only that doesn't need servers.
-
-I can use data URIs but I wasn't able to have a local variable in the function. You can, but you need all %20's instead of spaces.
-
-==2012-01-17==
-===geomapshape===
-May be getting multiple shape events when in drawPoint mode and attached via bind("geomapshape").
-
-Not just shape, all events. If you recreate a map on the same div & rebind an event to a new function, it will trigger more than once.
-
-===wkt===
-While not in this release, I have a need to fix WKT parsing. Finished parse LineString & (single ring) Polygons.
-
-===pinch===
-Next on the list is pinch zoom. I can hook this into the scroll zoom mechanics based on pinch center & ratio of initial pinch bbox to current pinch bbox to scale the tiles.
-
-Initially, I'm going to jump one scale level (or scale ratio) like wheel zoom. Later, when I update the whole interactive movement engine, I'm going to transition to the next scale level.
-
-This will tap into the _wheelLevel variable, which I should possibly rename later.
-
-Dropping out of multitouch (lifting one finger) will end interactive zoom & call setCenterAndZoom.
-
-We pick the largest ratio between x & y changes.
-
-==2012-01-16==
-===zoom===
-Accidentally moved some code to where it didn't belong & broke interactive zoom. Fixed.
-
-==2012-01-12==
-===getUrl===
-I would like to further have the service object's properties match html rather than css. I might rename this to just src.
-
-==2012-01-11==
-===scroll & drag===
-I need options to disable the default behavior of scrolling and dragging.
-
-===html attr===
-I think my options should reflect more like HTMl attributes than css properties. Including service object options. That might make me change visibility back to visible :( At least I'm not beta yet.
-
-Scratch that, it's a presentation option and all presentation options should follow CSS. However, I may move it to a style property of the service object. Are there other style properties?
-
-Only opacity.
-
-===scroll===
-I would like to support two-finger vertical slide as zoom on mobile devices but I'm not ready to write that up yet.
-
-Hmm. Can I handle scroll without an option? I can detect page scrolling and set a timeout. If the user has been scrolling the page, we don't want to scroll the map. But, what if the user's cursor just happens to be on the map when they want to scroll the page. I'm keeping scroll, the developer should have control to turn it off all together.
-
-==2012-01-2==
-===service===
-I'm still thinking about service-level methods. I'm not going to add the *All methods right now and I'm not going to have the single methods dive into the services (other than find, which even in jQuery digs into sub-elements not in your collection). The table I wrote below won't go into the docs. 
-
-Almost done with the docs for this. I wonder if I can have the jQuery UI widget method find merge results when more than one element are used in the selector. Unlikely but it would be cool. I'm going to have to assume not for now but keep that in mind.
-
-===geo-service===
-I am going to document that all service divs have the geo-service class. So, the default service will be both .osm and .geo-service.
-
-===find===
-It's quite clear to me that I should be able to call find on services. That will return shapes in that service. What does calling find on the map do? Should I have it search map and all services as planned or limit it to just map shapes? I have no idea what this would do in jQuery UI widget factory:
-
-var shapes = $( "#map,#map .osm" ).geomap( "find", { type: "Point", coordinates: [ -71, 42 ] }, 4 );
-
-What will be called, what's the return...just the first? Just the last?
-
-For this version, I'm going to have find on the map only return shapes appended to the map. That will match how the other functions work and document that you cannot use the comma selector with the find method.
-
-===proj===
-I need to get the final doc changes in for the $.geo.proj auto-handling. The definition of "map coordinates" is determined by the last use of center or bbox. The "map coordinates" are used as return values for the center, bbox, and the bbox property of the view object passed to getUrl. Now, how to write that...
-
-===replace===
-Removing the rather extraneous label and style methods from my to do list and adding the much more useful replace method.
-
-replace( existingShape, existingShape, style, label ) is the same as
-append( existingShape, style, label ) but that's fine. If you want to remove existingShape and add a new one, you won't need two calls (remove & append).
-
-===find===
-I'm not going to add a shapes method either. I want that to be part of find. The next version of the find method should take various selector strings such as * and return an array of shapes. This also makes me want to revisit whether or not find can dig into services...I'll see what Peter thinks.
-
-I feel like I want users to be able to write either:
-
-$("#map .osm").geomap("find", "*") or
-$("#map").geomap("find", ".osm *")
-
-append, replace and empty are very one-item specific but find is a digging query operation. I think I just convinced myself that it should be different. It should dig into the services. That's what I think devs will expect. I already can't use find with more than one target...so I'm already breaking the convention of the other three methods.
-
-I'm not going to support the service selector in find's selector argument at this point. But I documented how it will work with a service element selector and that seems pretty cool.
-
-==2012-01-01==
-===offline===
-Responded to an email asking about offline support. I wrote a few things in my reply that should give him some ideas. I'll copy them here:
-
-I have thought of offline support. While something like that likely won't be directly part of jQuery Geo itself, there are different ways to approach it depending on needs. I have plans to put up some demos to give developers ideas but here's a short list:
-
-1. Using the getUrl function to cache downloaded tiles in session storage on IndexDB. Since this function in the service object can do anything you want, it's perfectly fine to check some HTML5 storage options for tiles and returning, e.g., a data URI before attempting to access the Internet. Users will get roaming charges only when the images aren't in the cache. However, the amount of images you can store in the cache is limited by what the browser sets for the cache's upper limit. Some mobile browsers allow users to increase this limit, others don't. This is an option better suited for sites that want to show large areas with many zoom levels.
-
-2. Pre-caching the whole tile set in HTML5's appcache. This is suited for a site that only serves a small area and not too many zoom levels. You would have to get a copy of all the tiles and list them in a cache manifest file. If the user zooms or pans outside the site's area, they can get some "no tile" image. The huge advantage is that users can first browse to the site on WiFi, the app will cache the entire map (which will take a while) but can then walk around and map tiles will instantly come from the local cache. The disadvantage is that HTML5 appcache is usually only 5MB which won't hold too many tiles.
-
-===remove===
-I'm still trying to decide about whether or not remove should remove all references in all services or whether I need removeAll. There is precedent for xAll methods in jQuery. I will also need empty. This is too much for a4. Maybe beta or beyond.
-
-method                   | map or service | function
-==========================================================================
-append( shape )          | map            | appends shapes 
-                         |                |   only to the map
-append( shape )          | service        | appends shapes 
-                         |                |   only to the specific service
-find( Point, radius )    | map            | finds shapes appended 
-                         |                |   only to the map
-find( Point, radius )    | service        | finds shapes appended 
-                         |                |   only to the specific service
-findAll( Point, radius ) | map            | finds shapes appended 
-                         |                |   to the map or any service,
-                         |                |   will not return duplicates
-remove( shape )          | map            | removes shapes appended 
-                         |                |   only to the map
-remove( shape )          | service        | removes shapes appended 
-                         |                |   only to the specific service
-removeAll( shape )       | map            | removes shapes appended 
-                         |                |   to the map or any service,
-                         |                |   will remove all duplicates
-
-==2011-12-22==
-===buffer===
-I'm going to implement buffer as an internal geo method for now & document it later. It's needed.
-
-==2011-12-21==
-===two finger===
-So, Google has settled on two finger single tap for zoom out. Fine.
-
-==2011-12-09==
-===measure===
-Previous measure shows up if you destroy & create map after originally double clicking to end a measure.
-
-In destroy, _drawCoords and _drawPixels are both empty. Where's the data come from?
-
-When back into the new control, _drawPixels has values. There isn't a _drawCoords. Ah, widget factory was using old data, I have to make sure everything is cleared during create, including these two arrays.
-
-===measure-pan===
-Problem when you pan the first time while drawing in axisLayout image.
-
-It's not just axisLayout image. It's also not measure, it's drawPolygon as well. Ok, this is new ;) I works fine in a3. Maybe something with the implementation of axisLayout.
-
-Doh! Another "don't set arrays equal to each other" issue. Does this happen to other devs?
-
-==2011-12-08==
-===semver===
-All that chatter about what version naming to use and then the jQuery blog points to this: http://semver.org/
-
-Also, here's the deal about the new plugins site: http://blog.jquery.com/2011/12/08/what-is-happening-to-the-jquery-plugins-site/
-
-==2011-12-05==
-===measure area===
-I have to work on the measure area tool. Something's not quite right...oh yeah, I haven't implemented it yet.
-
-===length===
-measureDistance should be measureLength. The measureLabels object should have a length property.
-
-==2011-12-01==
-===getUrl===
-I was going to bring our urlFormat property over from the old code but now I think I want it to be the same property on the service object. I think getUrl can be a function, but can *also* be a string for shorthand. This will obviously be a jsrender template string.
-
-==2011-11-30==
-===twheat===
-I'm going to keep the twitter-heat demo and also leave twheat as its own app.
-
-===service-level===
-Finally writing some service-level shape docs for 1.0a4.
-
-===wheel===
-I would like to add a wheel option. We have a wheelMode property on the internal control that can be a few different things. I would like this to be simpler. Maybe just "wheel" and have it be "on" or "off". Or a boolean? But a boolean would limit future additions.
-
-==2011-11-23==
-===measure===
-I'm going to port measure over as pretty much how it's done in our original project, in that it will have its own dedicated label.
-
-===measure-label===
-Trying to make the measure label look nicer than before. I'm adding a style to the document head just for the measure tool. I'm prepending it so designers can override any of the properties.
-
-===jsrender===
-Pulling in jsrender for the measure label. I'm going to have to do it anyway for shapeLabel, may as well do it now. Works well for my needs, I'm going to document the measureLabels option.
-
-==2011-11-22==
-===jQuery 1.7.1===
-I'm still using 1.6.4 and will likely release that way. I'll have to test with 1.7. The notes say that .1 fixed a bug in mousewheel event. I didn't even know they had a mousewheel event. Maybe I can stop using the wheel plugin I've been using.
-
-===label-container===
-Judging from the layout below, I'm going to change textContainer to .geo-label-container and have it move around exactly like the shapesContainer. More like serviceContainer because it doesn't need to be the size of the frame.
-
- #map .geo-map
-   .geo-event-target.geo-content-frame
-     .geo-services-container
-       .geo-service*
-     .geo-shapes-container
-       canvas
-     .geo-labels-container
-       .geo-label*
-     .geo-draw-container
-       canvas
-     .geo-measure-container
-       .geo-measure-label.geo-label
-
-===refresh polygon===
-I'm still curious why I don't use toPixel on Polygon shapes as a whole? Why the loops? Right, I was thinking toGeodetic. geomap's toPixel function only takes up to two dimensional arrays. Updated both functions.
-
-===pan===
-I need to pan both shapes and labels at the same time. I think I need a new container for these because drawing might be part of this as well.
-
-===length & area===
-Documenting and coding these because I'll need them for the measure tools.
-
-===LineString middle===
-There must be something in JTS that's similar to Esri's ILine.QueryPoint function but I can't find it. This is for getting the point along the line for the label. I want to add a generic function to $.geo. Ah, LineSegment.pointAlong.
-
-Documenting pointAlong. Also implementing it! Works pretty well.
-
-===line rotate===
-I would like to rotate the line label based on the current segment but that will have to wait.
-
-===geographics===
-I'm going to merge labeling into geographics so that I can move the tech as a whole to indivdual services. That'll come later when I need to do service-level shapes.
-
-==2011-11-21==
-===measure===
-I started porting measureDistance today but merged the branch in after being able to draw a line. The rest of it depends on being able to draw labels. Our internal library has _labelShape specifically for measuring but I'm going to merge that into the labeling engine for this release.
-
-===append===
-I need to update the append docs to include label before I do anything. Done. Since it's needed right away, I'm going to start porting labels over.
-
-===shapesContainer===
-Can I re-use $shapesContainer for labels? I'd rather not keep track of a second div. However, I think $shapesContainer *is* a canvas element so that's not going to work. Yeah, it's a geographics widget which...no, geographics appends the canvas. I can re-use that element...but semantically, it isn't correct.
-
-That won't work anyway, I need these to exist at the service div level so they can be targeted by CSS.
-
-However, labels not associated with a service would not be in a service div and would need their own div.
-
-===layout===
-Currently, the layout is, e.g.:
-
- #map .geo-map
-   .geo-event-target
-     .geo-services-container
-       .geo-service
-     .geo-shapes-container
-       canvas
-     .geo-draw-container
-       canvas
-     ($textContainer)
-
-==2011-11-15==
-===twheat===
-I'm going to make this a real app with its own subdomain. I would like to use paging because the first page doesn't have enough results with a geo argument. What happens when there's no further pages. Is there a "next_page" property? Is is null?
-
-The page will be more impressive if I try to geocode the location property to get more results.
-
-Heh, this will blast a lot of queries at MapQuest. I'm going to have to store ids i've already processed.
-
-That's soo much nicer!
-
-Maybe I can get a couple old pages worth as well on the first search.
-
-Twheat exists!
-
-==2011-11-14==
-===a4===
-Time to start a4 docs. Hopefully this will be the last alpha.
-
-==2011-11-10==
-===merge===
-I merged in the changes to support photos. It amounts to only a few hundred bytes minified and can be pretty useful. I couldn't find a good example service to use for the axisLayout demo.
-
-==2011-11-09==
-===axisLayout===
-Peter likes axisLayout as well...sold!
-
-===first===
-Trying this out for the first time. I can get image tiles from an image server but the zoom is all wrong and it's not centered. wheel zoom is also pretty wrong.
-
-===bbox===
-bbox min values are negative. I suppose that makes sense because it's trying to put the top-left corner of the image in the center of the window. It should be tring to put the center of the image in the center of the window. 
-
-===mapbox===
-MapBox uses an "official" tiling spec. In that spec the origin is in the bottom left. That doesn't mean the y-axis is flipped though but it does change how I calculate the tiling scheme. Maybe it does go up. That's awful, why would they do it different than web mercator?
-
-Crisis averted, maybe? It looks like V2 of the MapBox API uses top-left origin and XYZ tiling: http://mapbox.com/hosting/api/
-
-Maybe not averted? Calvin is saying that TileStream itself (as in not hosted by MapBox) only has one API. That doesn't sound right.
-
-===getTiledZoom===
-This is wrong for image types the way we want to understand pixelSize with images. A low zoom means a low pixelSize which is opposite of maps. I seem to have fixed that. I'm getting closer.
-
-===refresh===
-Refresh is ignoring tiles on the bottom & right edge of the viewport.
-
-===top-left===
-The image still starts out in the middle of the page but you can move it around and zoom. 
-
-===getUrl===
-I forgot that while Peter's image server determines zoom levels backwards, I was going to handle that in the getUrl function of the service and have the pixelSizes of the tilingScheme be like normal. This works much better. Now I only have the top-left issue. That's not true, zooming bounces the new image to somewhere else, i.e., isn't smooth or correct.
-
-===center====
-So, I realized that at geomap zoom level 0, the image is way zoomed out and my center should be the center of the full image in pixels, so pixel width /2, etc. I changed that but my tiles are still misaligned.
-
-Ha! I wasn't checking for undefined if you pass a zoom of 0. That means I wasn't setting the new center & pixelSize with updated values. All set. Now I'm only offset in the y location and I have a feeling that's because of the axisLayout.
-
-===osm===
-Somehow, the osm class i getting on the serviceContainer element even though I'm completely redoing the services array at init.
-
-===centerMax===
-I think for now I have to assume that at max zoom, the whole service fits in a tile and the center is in the center of the tile. I don't have a way yet to specify the center of a tiling scheme, only the top-left.
-
-===pan===
-Pan is backwards as well when it creates the new bbox.
-
-Fixed pan.
-
-===zoom===
-Looking good! interactiveScale is last. Then maybe I should support shingled. Wait, no, that was interactivePan, when pulling in new tiles.
-
-Zooming twice is a bug but that's in core jQuery Geo, not this image addition.
-
-===shingled===
-Here's a link to a sample shingled image: http://lib.byu.edu/mrsid/bin/image_jpeg.pl?client=sample&image=sample.sid&x=1024&y=2048&level=0&width=1024&height=480
-
-Actually, there are levels so that's a tiled image. Yeah, definitely tiled because the level argument doesn't allow fractional numbers.
-
-===ie select===
-I think I forgot a userselect somewhere because if there are no inputs on the page and you pan, IE highlights everything in blue. Every map tile.
-
-Adding any input or link to the page fixes this. Also, adding this to inside the map div seems to fix it too: 
-
- <input type="hidden" autofocus />
-
-That fixed nothing. The issue isn't with panning, it's with shift-zoom and happens no matter what's on the page with IE9.
-
-==2011-11-08==
-===image coords===
-I need a new property to determine the direction of the y-axis but I want it to be more generic. The difference is a different coordinate system, the side effect is the inverted ordinate axis.
-
-Maybe just "coordinateSystem". I don't want to confuse users with the difference between coordinateSystem and tilingScheme though.
-
-The full, proper term would be coordinateSystemAxisDirection or coordinateSystemAxisType. There seems to be a little precedence for CoordinateSystemAxis, found in GeoTools: http://docs.geotools.org/stable/javadocs/org/opengis/referencing/cs/CoordinateSystemAxis.html
-
-Nothing in JTS.
-
-Hmm, axisLayout? Why not, it's short and specific. axisLayout = "map" | "image". Yes. I like it.
-
-==2011-11-07==
-===gzip===
-I added gzip to jquerygeo.com & all subdomains. jQuery Geo (minified & gzipped) is now 17k and falling!
-
-===move===
-I don't like that mouse move events seem laggy with this release. I need to find out what's different. I thought it was that I'm sending move events even while drawing that removing that hasn't helped.
-
-===drawing===
-Wow, geomap._refreshDrawing was terrible and geographics._drawLines needed a little tweaking.
-
-===return false===
-I didn't have any return falses at the end of my event handlers. I hope that plus the drawing fix makes panning better.
-
-Oops, I went too crazy and added too many and wasn't letting the browser grab events it needed. Chrome's type=number input went crazy up or down if you didn't move the mouse away.
-
-===chrome===
-I've done what I can. The issue appears to be with Chrome or something I'm doing with Chrome. Drawing and panning speed is tremendous in IE9 and Firefox 7.
-
-===geolocation===
-Wow, after any timeout, Firefox stops checking for watchPosition? Is that part of the spec? Nope, not part of the spec. Oh, it *is* part of the spec if it fails due to timeout. It does sound like it's not supposed to trigger until the position changes despite what you put in maximumAge.
-
-==2011-11-01==
-===shapeStyle===
-Time to redo the shapeStyle example in a much more awesome way.
-
-Did I miss something? jQuery UI widget factory isn't complaining that shapeStyle isn't an option on the widget even though I haven't added it yet.
-
-New demo is super-cool!
-
-===refreshShapes===
-I almost had this function clear the shapes geographics until I realized that it's recursive if there's a GeometryCollection. Can't do that.
-
-==2011-11-01==
-===refresh===
-Cleaned up the wording for append, remove & empty. Also, going to have append allow style only, refresh only, or both.
-
-===refreshShapes===
-Due to performance, I'm going to disable the auto refresh after interactiveScale of shapes if the number of shapes is over a certain limit, say, 255.
-
-==2011-10-31==
-===tile paint===
-Another app I want will be tilepaint.jquerygeo.com. It won't actually use jQuery Geo but will repaint tiles on the fly for you based in an input URL and color changes.
-
-===fromGeodeticPos===
-There's a bug trying to convert some positions of a town near Concord in the voting demo. I wonder what's different about that geometry.
-
-The shape is a multipolygon which I am not handling properly. It can be a quadArray. I also removed all the $.each calls which should speed things up a bit.
-
-All set now.
-
-===ArcGIS Wrapper===
-agw.jquerygeo.com will take an ArcGIS Server endpoint and spit out the jQueryGeo you need to initialize a map to that service. It should handle both cached and dynamic services.
-
-==2011-10-30==
-===voting===
-I'm working with Calvin Metcalf at MassDOT attempting to push all the data into jQuery Geo. I might want an option to turn off scaling vector data because it's rather slow. Maybe only do it if they have WebGL.
-
-Disabled it for now.
-
-===refresh===
-The refersh property must be made public, pushing large number of features isn't useful without out.
-
-==2011-10-29==
-===id/class===
-I'm at WhereCamp Boston 2011 and going to try to finish Alpha 3 while I'm here starting with making id optional.
-
-===initOptions===
-Was getting undefined when a user passed nothing as in the simplest test.
-
-===class===
-So, I forgot that class is a reserved word. I'm not sure what to do about that. I can make id optional for now but I'll have to decide about class as a property name. I know as an object literal, I'm supposed to enclose the word in quotes but that's not going to look right for the user who wants to use this. I might have to call it cssClass or something. I'll find out what jQuery uses.
-
-Google Closure won't even minify the build with the word class used as I'm using it. When I'm creating an element using jQuery's argument that takes an object for attributes, what do they use? They require quotes.
-
-===id===
-I'm still storing the service state by id. Since both id and class are optional, I think I need to store it as an array. That's not true, I can store an id on the service object via $.data. The id can be $.now. I wonder if $.now actually has different values if I'm creating more than on service at the same time? I will need to test and potentially use a different means to create the id.
-
-===service create===
-I'm going to assume that the service doesn't already exist during create. Not sure if that's a good idea though. Maybe for now, I won't and I can make the create code smaller later after I have time to test.
-
-I completely forgot that I'm going to store the entire service state via $.data. That will make things a lot easier.
-
-Seems to work ok.
-
-===double click on unloaded===
-When a singled image hasn't loaded after pan and you double click on empty space, the zoomed area seems wrong.
-
-===fusion===
-Andres from Google is showing radius query using fusion tables. Seems like something I can do with jQuery Geo.
-
-===kml===
-I might have to support kml.
-
-===maps.jquerygeo.com===
-I should support typing a url to a geojson file to append all of the json.
-
-==2011-10-28==
-===style===
-Both shapeStyle and drawStyle get and set a plain JavaScript object and should be widget "option"s. While changing them does have side effects, they perform no action themsevles.
-
-===centroid===
-I'm leaving centroid in a3 but removing support for GeometryCollection for now (in the docs & code). That can come later.
-
-===distance===
-No sense having the two lines that support arrays, they'll never hit a valid switch case and it's not in the docs.
-
-==2011-10-25==
-===service state===
-I finally moved it to a $.data store on the services container. It was getting messed up moving between pages in jQuery Mobile when one of the pages had a map.
-
-==2011-10-21==
-===resize===
-Shingled maps don't resize properly. I think I have to have a resize method in there & call it from geomap. All set, I had to mark the current scaleContainer as not being for the given scale any longer and re-center it.
-
-===visible===
-I can't decide about this property of the service object. I need an API audit from Bocoup :(
-
-Since I have opacity and visibility in shapeStyle, and I know I'm not going to change them, I think I do want to have the naming synergy because I do have opacity in service properties that I'm not going to change. Ugh, but the toggle method takes a true or false value. But so does jQuery's and that changes a CSS property from one text string to another.
-
-===change service object===
-Unlike the shape objects, I think it's fine if I change the service object's visibility property. It's sort of awful to see the check for undefined & I change it anyway when they use the toggle method. Why not just set it to "visible" when I create the service?
-
-==2011-10-15==
-===draw pan===
-The current version didn't get the code ported over that disables inertia while drawing. I think I need to put that in because without it, the drawing does feel too fidgety.
-
-I was calling _panEnd instead of _panFinalize for the draw modes.
-
-===draw polygon===
-Finally ported this code over. Seems ok.
-
-==2011-10-14==
-===maps===
-I would like to make an app that lives at maps.jquerygeo.com and has some useful functionality similar to Google maps but uses all open data.
-
-==2011-10-12==
-===push it===
-jQuery Geo is still functional in Chrome drawing all of the census tracts of MA. That's over 55,000 points and 3,000 features. Not too bad.
-
-==2011-10-07==
-===drawLineString===
-I've ported some initial line code and actually made it much more elegant than our internal one.
-
-===shingled===
-The shingled demo needs some work.
-
-==2011-10-06==
-===bbox===
-I pushed out a great new bbox example page. It links to a live jsFiddle even so people can play with the code.
-
-===jQM buttons===
-I did have to make the full screen map an external page. It worked ok after that and the back button still works.
-
-===jQM===
-jQM has virtual buttons to handle either touch or mouse input (some devices have both at the same time): vclick, vdown, vmove & vup. However, they don't handle multi-touch so I think I'm going to have to stick with what I have at the moment. I can't require jQM just to have jQG work on mobile.
-
-===draw===
-Porting our shape drawing code over finally. We're getting a new geographics widget to differentiate drawing from appended shapes.
-
-===drawStyle===
-I forgot to write about the drawStyle method. This one might actually be a true option as it will never be service-specific. It can only apply to the map widget.
-
-===draw functions===
-I need to rename some things. I've been using a few old names from our internal code but they don't quite make sense with some of the newer names of public properties. Mostly, shape should mean anything added via append and draw is the actual in-process drawing.
-
-Two internal method names should be: _refreshShapes (instead of _drawGraphics) & _refreshDrawing (instead of _redrawShape)
-
-===drawPoint dblclick===
-As the docs say, a double tap will zoom in just like in pan mode and not trigger the shape event.
-
-===geographics===
-Oops, my underlying geographics widget is sharing the same canvas context. Flicker city! Ah, much better.
-
-===drawPoint===
-Because I'm delaying before I trigger the shape event, it feels slugish. Maybe I can drop the delay down to 100ms. Too fast, I'm getting the shape event.
-
-==2011-10-04==
-===jqcon===
-I gave a presentation to jQuery Conference Boston 2011. I didn't have much time because I was sharing a block with another speaker. So, my presentation was rushed but I still think a few people interested. I will have to get better at conveying that this is not a wrapper for Google Maps or OpenLayers. We do not host any 3rd party controls.
-
-===jQM buttons===
-With a jQuery Mobile controlgroup or navbar on the same page as a full screen map, I get huge performance issues on Android. iOS seems ok with it. Desktop browsers are fine. The map doesn't pan while sliding your finger but it does show up in the new location when you let go.
-
-Removing the navbar completely didn't help. I think that unless it's a small in-page map, I'm going to have to make the page external.
-
-===bbox===
-To test these new bbox functions, I'm going to redo the bbox example page.
-
-==2011-09-30==
-===json===
-I can store a tiling scheme in JSON but just realized that I can't store a service definition in JSON because of the getUrl function property.
-
-==2011-09-29==
-===zoom===
-Documenting and adding the zoom method.
-
-===bbox===
-Made bbox public. It's also now storing projected coordinates. $.geo.proj can also accept bbox arguments now.
-
-==2011-09-28==
-===disable auto-proj===
-Peter suggested (for actual GIS users) a way to disable $.geo.proj but keep the object where it is. The situation is: "I know I'm working in a projection, and I want $.geo.proj to match that projection, but I don't want it to attempt to auto-project coordinates I pass to $.geo functions or geomap because I'm going to send it projected coordinates, but I do want the object around for when I might want to un-project some coordinates to geodetic."
-
-That's wordy but it does make sense.
-
-However, instead of adding a boolean on $.geo called autoproject and telling people that they can shut it off, I'm going to test diving into arguments to determine if they are geodetic and auto-projecting myself. There will be a performance hit but I need to test if it's too much or worth the simplicity. I think I'm going to find that it's worth the simplicity. I can then remove A LOT of words from the docs about if $.geo.proj is null, blah, blah.
-
-That's fine for input values, but what about auto-unprojecting output values? Maybe I do need that boolean property on $.geo? Or I can store the last way center, bbox, or bboxMax were set and return values in the same format. I would rather it not be that tricky though. If I do add a property, it would only need to be for geomap. The $.geo functions are stateless.
-
-===wkt===
-Working on WKT.stringify/parse. There will be a $.geo.WKT object.
-
-Moving along, made the frame of a nice test page too.
-
-===destroy memory===
-A destroyed geomap remembers what was in _graphicShapes. This means that any other private property initialized with _prop: default, is remembered. There could be other issues...until I replace all indivdual properties with a single state objects. For now, I'm going to reset _graphicShapes to [] in createWidget.
-
-==2011-09-27==
-===destroy===
-Somethings wrong with destroy, can't create after. One thing missing is that resize is called (by jQuery Mobile?) after the call to destroy which causes a script error. I have to make sure I unbind resize. Huh, I've never had to unbind a handler before. Heh, destroy erases any content you had inside the widget before you created a geomap.
-
-==2011-09-26==
-===refactor===
-Found bugs in serviceType.destroy and graphics due to code refactor. The CDN, while wonderful, takes too long to update. I suppose it's not the best idea to put the test branch on the CDN. Done. I'll still occasionally copy test to the CDN but mostly I'm going to update the non-CDN'd version until I know things are ok.
-
-Alpha 3 docs online & tweeted about!
-
-==2011-09-24==
-===resize===
-My code refactoring broke auto-resize. I wonder what else I broke :)
-
-==2011-09-23==
-===filename===
-I renamed the compiled JS files to match what code.jquery.com has for jQuery itself and jQM. jQUI isn't on there, which is odd.
-
-===widget factory syntax hack===
-Testing if the syntax I want is possible with the jQuery UI widget factory pattern. I only want the one widget, but I want to be able to call some functions on other child elements. I already hit a snag. Calling .geomap("toggle") on an element that has not been initialized as a geomap widget doesn't trigger _createWidget, _create or toggle.
-
-===serviceTyep files===
-I'm going to split out the service type objects into their own files. That'll help me make sense of the geomap.js file.
-
-To do that, I had to move _serviceTypes from being an option of geomap to a propery on $.geo itself. This will help third-party service type plugins down the road.
-
-===widget vars===
-I think I have to move all the widget vars back into the object passed to $.widget so that they don't conflict with each other, e.g., multiple geomap widgets. As they are now, I think they're all plugin-level widgets.
-
-===sub-widgets===
-This is awesome. It looks like I can get the syntax I want. Now to figure out the best way to call the method in the parent geomap widget from a service widget.
-
-It seems like the vars created in the closure supplied to $.widget are still used by all widgets on the page. Do I really have to store state in a data object on the element?
-
-Yes, they are shared. Yes, I will have to figure something out.
-
-I just had to plaster my code with this's. I don't like it but it now supports the toggle/opacity syntax I want and *I think* also supports multiple maps on the same page (I think). That's going to increase my minified size quite a bit. I'm going to have to go back and see what I can do to clean it up but I'm choosing proper functionality over code size for the moment.
-
-==2011-09-21==
-===docs===
-I'm trying to clean up the docs and change notational $.geo to jQuery Geo, but not mess up anywhere I mean to reference $.geo the namespace.
-
-===class===
-I have a better plan for service id. I'm going to keep my plan for having the presense of a name property create a hidden input but I'm going to allow the service object to have a class. The class will be applied directly to the built-in service divs. I will still apply data-service-type="tiled" or data-service-type="shingled" to the divs. To apply certain methods to specific services, you will now target the service class under the map element:
-
-$("#map .osm").geomap("toggle", false); // this will hide OSM.
-
-===service create===
-I'm going to require that the service type's create function return a jQuery collection of one item that is addressable for that service. It doesn't really HAVE to have anything in it but I'm going to store service state on it using $.data($el, "geoServiceState", {}) or something.
-
-===jqm===
-Upgraded to jQuery Mobile b3 & added some color to the headers of various doc pages.
-
-===service id===
-After talking to Peter, I'm going to allow class and id with a note that if you use id, you'll have to be careful of adding more than one map on the page. I like this plan. Also, if you do it by id, you can target it directly:
-
-$("#mass-gis").geomap("toggle");
-
-===widget tricks===
-I'm not sure I can do the selector tricks I want with the widget factory. I may have to change my docs & design if I can't do it elegantly :(
-
-==2011-09-20==
-===cache===
-I may be caching too aggressively. I think I should remove caching from $.geo.bbox and instead cache inside of append and clear the bbox cache in remove. I really only need it in the find method.
-
-===jquerygeo.com===
-It's time this project got its own nice site. Also, (mt) is faster than my previous host from places farther away than MA.
-
-==2011-09-18==
-===shape===
-Working on the event docs.
-
-===name===
-I was originally going to rename id in the service objects to name so I could use it as an input name on a hidden input. However, I'm now going to require id but allow name as an optional property. If present, it will create the hidden input. This is now a future task and will not be in alpha.
-
-===append===
-While adding the refresh argument to append, I started thinking again how I want to implement service-level graphics. It would be very nice if I could have the map>service syntax to jQuery and call append, remove and empty on that. I think I defined the syntax a while ago...yeah, see "On shape functions" from 2011-06-02.
-
-The issue I have is that a page can have two maps. The default service has id=OSM. So, if I allowed $("#map #OSM") syntax, it would cause the page to have two elements with the same id, #OSM. However, $("#map [data-geo-service='OSM']") is way to wordy. I'll have to discuss this with others later as this is not an alpha feature either.
-
-==2011-09-16==
-===foss4g===
-FOSS4G is an inspiring conference. I gave my talk and people seemed interested. There was a question about Google. I answered that it's illegal to use them and Chris Schmidt mentioned on Twitter that it's not illegal, it's just hard. We're talking different things. jQuery Geo would use Google tiles directly, which is against license. We will never host a third party widget inside the jQuery Geo div as part of the core functionality. OpenLayers wraps the official Google widget to get around the license restriction (since it's the official Google widget, there's nothing wrong with it) & keeps it up to date (or slides it around) when the user interacts with the OL map. I might do something similar as a blog post when I open up the service types plugin system but until then, but it won't be part of jQuery Geo..."here's how to do it if you want", type of thing. The developer would have to pull in the Google maps API themselves.
-
-===centroid===
-I'll have to see if JTS uses Point or Coordinate as a return value & match it.
-
-Centroid needs to use $.geo.proj for accuracy. The centroid should be calculated in web mercator & projected back to geodetic.
-
-===proj===
-The way we do projection is different than how GIS does it. Usually, when you define a projection, you work in non-geodetic coordinates because the coords have been projected to a flat plane. With jQuery Geo, you work in projected coordinates (I call them non-geodetic) when you set $.geo.proj to null. This can be a little confusing but I think it works.
-
-The first thing we would have to do internally is set $.geo.proj to null because we use pro
-
-===bbox proj===
-bbox might be an issue. a bbox in geodetic coordinates (lon/lat) that is a rectangle, will not be a rectangle in web mercator. That's not a problem with setting the bbox property on geomap but could prove interesting for the bbox of geometry objects. For example, the bbox of a square polygon will not be a parallelagram in geodetic coordinates.
-
-SUGGESTION: Calculate & cache bbox in projected coordinates
-SUGGESTION: Document that lon/lat bboxes will not appear to be correct?
-
-===bbox cache===
-Peter and I got into a talk about caching bboxes. He's worried that we will have too many floating references to objects that cannot be collected. That is a valid point. For example: a user creates a polygon as an object literal, they then call $.geo.bbox on it, then the function ends. We will have a cache of the bbox, but most importantly the cache will reference the original polygon so the browser cannot remove it from memory. I agree that this isn't a great situation. However, the performance benefit gained by the find method is hard to ignore. Also, this only becomes a problem when the developer calls bbox directly. Even though we call it during the find method (building up cache), they are all removed when the dev removes shapes from the map with the remove method. I also know I need to research more about how $.data works with objects. I may be wrong about the reference/memory leaks.
-
-===point bbox cache===
-Now that I know I should cache bbox as non-geodetic, I think I should revisit my jsperf regarding caching a point. Since there's going to be much more calculation involved in $.geo.bbox, I might want to cache points. However, I think I should only cache them if $.geo.proj is not null. When it's null, non-cached points will still be faster as per my original jsperf test.
-
-===events===
-The new shape event will need a new event type. Position event won't cover it but it's similar. I'm not 100% sure if I should merge them. The new event type will be a shape event.
-
-==2011-08-24==
-===utah===
-While zooming in, Chrome skips zoom level 12. I wonder if that's a bug in the control. It is. It's a rounding error in _getTiledZoom. Using floor and * instead...fixed.
-
-==2011-08-19==
-===contains===
-Contains is spatial ref agnostic and is called by distance.
-
-== 2011-08-07 ==
-=== bbox ===
-I think I'm missing something from my bbox description.
-
-=== append ===
-I would like to say that devs can call append again on a shape and it will replace the existing one and clear the bbox cache. That might be a good compromise for bbox cache clearing because I don't want a method specifically for that. Maybe, I'm not sold on the word append replacing something that's already there. Does jQuery have a replace function?
-
-SUGGESTION: geomap - append should allow re-append of existing shapes, replacing the old one and clearing the bbox cache
-
-=== bbox ex ===
-I'm writing an odd example and I already forget if fromGeodetic can take a single position. It can, according to my docs :)
-
-=== from/to pos ===
-I keep going back and forth about coordinate vs. position in terms of words. I almost thought of changing fromGeodeticPos to fromGeodeticCoord but they /are/ called positions in the spec so I'm going to leave it. Again, it's spoken words (of which I suppose I am now including API function names) and code, which is GeoJSON object properties and arguments. Still confusing, this will never be settled so I'm dropping it.
-
-=== bbox cache ===
-Oops, I wasn't namespacing my data. I thing it has to be geoBbox because the namespaced data attribute would be data-geo-bbox.
-
-== 2011-08-06 ==
-=== alpha 2.5 ===
-I released a new version last week and it seems to work well. I'm happy with it. On to documenting the features of alpha3!
-
-=== label ===
-I'm going to add labels and I think I want a label argument to append, however I want both style and label to be optional. In other words, you can pass a shape and a label. The label argument will be a string of html or a jQuery collection of elements to append to a label div. The outer label div is controlled by geomap. It will have a class on it, geo-label, if devs find they need or want to control it that way, i.e., add plain text and control the label style using the class.
-
-=== jQuery a plain ===
-Is a jQuery collection a plain object? Not according to this fiddle: http://jsfiddle.net/ryanttb/4rHK5/
-
-So, I will have two optional args: style and label. Style has to be a plain object. Label can be a string or jQuery object. I'll say style comes first but they can be in any order.
-
-=== shape props ===
-Even though I have args on append, I will eventually allow both style and label properties on the GeoJSON object. They're not standard but not illegal according to the spec.
-
-=== stored label ===
-For speed, I will have to build the label HTML during the call to append, whether or not I use the shapeLabel property on the map or the label supplied during append.
-
-=== override ===
-The label supplied to append will completely override the map's shapeLabel property.
-
-=== centroid ===
-While I would like a LineString's centroid to be a point along the line so I can using it for labeling, that's not the accepted definition of a centroid of a line. According to JTS, it's calculated like a polygon, except when there is a polygon as part of a GeometryCollection. In which case lines and points are ignored when calculating centroid.
-
-=== line label ===
-Checking to see if JTS has an official point-along-line function that I can add w/o creating my own name. It doesn't seem to. I just decided to not label on the centroid for lines but on the "center point" of the line. As you add more points, the label will move further along the line.
-
-=== envelope & bbox ===
-So, OGC simple features doesn't seem to define an Envelope class. The Envelope function is defined to return a Polygon, eww!
-
-=== ogc text align ===
-They do define text alignment options called HorizontalAlignment: start, center and end. Might be useful later for text label options.
-
-=== $.geo & proj ===
-Internally, I need to call the geometry ops in $.geo and I will already have a projected bbox or geometry object. I need a way to tell methods such as $.geo.expandBy to not call $.geo.proj.fromGeodetic even if $.geo.proj is not null. I think for now I will have an internal (and undocumented save for here) argument at the end called ignoreProj. If truthy, it will not call fromGeodetic. A false value or undefined will call fromGeodetic if $.geo.proj is not null.
-
-The documentation will always say fromGeodetic is called if $.geo.proj is not null.
-
-SUGGESTION: Add an internal ignoreProj argument to $.geo geometry functions.
-
-=== scaleBy ===
-I haven't used it yet buy my original port of the scaleBy function was wrong. I was calling expandBy which would make scaleBy(bbox, 1) actually increase the size of the bbox, however, scaleBy(bbox, 1) shouldn't change the size at all. Also, expandBy was wrong basing itself on center instead of just modifying the min/max values directly.
-
-=== geodetic bbox ===
-I forgot that from/toGeodetic don't currently support bboxes. What am I doing already in geomap? Ah, right. I only needed it once (the bbox property) so I'm converting to two positions by hand. I think I should make a conveniance method in $.geo.proj. fromGeodeticBbox or something. I'm not going to make it public. Devs shouldn't have to call it, they can work in whichever projection/non-projected state they set $.geo up as and the public functions can handle it.
-
-SUGGESTION: add private _from/_toGeodeticBbox methods
-
-I did remove the, "if $.geo.proj is not null X first calls fromGeodetic..." shpeal that I had in all the bbox methods because it's not accurate. I won't call from/toGeodetic, I'll call a private method.
-
-Actually, I should be able to detect a bbox vs any other geometry in the *Geodetic methods. It will be an array of 4 numbers, so .length == 4 and $.isArray(value[0]) == false. Maybe I'll put bbox conversion into them after all.
-
-== 2011-07-30 ==
-=== alpha 2.5 ===
-It's been too long since I had a chance to work on this and I want to get an alpha 2.5 release out.
-
-I need to push this back in an change my current branch name. I think it's alpha3 at the moment.
-
-=== jsperf ===
-I wrote a perf for point & linestring bbox cache testing. The test makes me think jQuery.data doesn't do what I think it's doing. When I cache the bbox in a local var, it's very fast but when I cache with data, it's not.
-
-* Here's the point test: http://jsperf.com/point-vs-bbox
-* Here's the line test: http://jsperf.com/line-vs-bbox
-
-It's always faster to test points by themselves, i.e., don't worry about checking for a cached the bbox.
-
-=== branch ===
-I was on master, so I pushed, then created & switched to alpha2-5.
-
-=== opacity ===
-When developing the heat map example, I remember running into an issue where I couldn't get the opaicty to look right between the border and center. Maybe I fixed it somewhere else because I can't seem to reproduce that.
-
-I can still get it on the latest fiddle of the heat map. It's when the opacity is 1 and the strokeOpacity is 0, the stroke still shows up but it should be hidden.
-
-I still can't recreate this on the shapeStyle test page :( Ah, but the twitter heat example has the issue.
-
-Turns out I was or'ing the stroke/fillOpacity with regular opacity in _getGraphicStyle. That's not the right place to do anything with them, and never or.
-
-=== service opacity ===
-I'm going to pull in the service opacity method from AppGeo.Web as "opacity" on each service object, like refresh.
-
-That's done. I haven't documented/implemented what happens if you don't pass a service id. It's required. I'm not sure what I want that to do yet.
-
-=== visible ===
-When starting to think about geomap.toggle, I realize I have a naming conflict so to speak. The service object has a boolean visible property while the shape style has a string visibility property. I think I want to change the service to match the shape style. I don't think there are any attributes in HTML that pertains to visibility so I'm going to match CSS even in the service object which is more internal and less graphical. That said, I don't want to start renaming things in alpha 2.5 so that'll wait until 3.
-
-SUGGESTION: Rename service.visible to visibility having either "visible" or "hidden" values
-
-=== service props ===
-So, I noticed that when a service is created, I don't modify the service objects to fill all the supported properties. So, when toggle is called, there's potentially not an initial visible property set.
-
-I think for now, alpha 2.5, I will have the toggle function assume that there could be an undefined service.visible. The refresh method does the same. Later, though I think I might want to set defaults during _createServices.
-
-=== proj ===
-New projection code seems to work and is awesomely 150 lines shorter!
-
-=== resize ===
-I'm going to hook into the window resize event automatically but I will still need a resize method later in case the dev changes the div size/css.
-
-SUGGESTION: Add a resize method to let geomap know the div has changed size programatically
-
-I'm not sure of the correct way to kill & remake graphics now that it's a jQuery UI widget. It appears that I can call distroy & re-create it.
-
-Resize, is working though when getting smaller, there is a space for the scroll bars. I don't remember having that issue with the internal AppGeo.Web control. That is an issue to tackle after alpha 2.5.
-
-=== dbl tap ===
-What is a thumb? On touch devices, and other soft-dblclick devices I don't take into account that the second click/tap might be too far from the first to count as a tap. There is no move event to cancel. I'm now calculating distance between the two based on _anchor (previous) and _current ( current :). This will need testing. I'm setting it at 10px for now, line 1480 of geomap.js as of this writing.
-
-== 2011-07-19 ==
-=== wkt ===
-Wrote up some to-WKT code for our internal control today. WKT will also be supported by parseWKT and textify methods in $.geo.
-
-SUGGESTION: Support WKT with $.geo.parseWKT (like JSON.parse or $.parseJSON) and $.geo.textify (like JSON.stringify).
-
-=== centroid ===
-Wrote up some centroid code for all but GeometryCollection as well for our internal control. Code similar to this will end up in $.geo.centroid.
-
-== 2011-07-15 ==
-=== presentation ===
-My first real talk about $.geo went well, I think. Next up is FOSS4G in September and, possibly, jQuery Conference Boston in October & Harvard WWW in December.
-
-=== alpha 2.5 ===
-I think I want to push out a bug-fix release of the alpha 2 tech. I'll tag it as alpha 2.5 in github but overwrite the alpha2 js file on host. Well, rename the old one as alpha2.0 in case people find a bug in the new one.
-
-I need to write down exactly what to do for alpha 2.5.
-
-=== shape images ===
-People really want images on shapes, particularly points. I'm removing this feature from my TO DO list:
-* geomap - Document and implement passing a function to shapeStyle and append that returns a geomap style object based on feature or geometry properties
-because I have a much better plan that involves the label div. It will be a normal div and have a class. Each will have relative position and designers can manipulate it however they want.
-
-== 2011-07-12 ==
-=== fiddles ===
-Some fiddles for my demo on Wednesday:
-
-# show a map:
-#* http://jsfiddle.net/ryanttb/A6avG/
-# show a map & zoom to boston
-#* http://jsfiddle.net/ryanttb/2qBgw/
-# show a map & zoom to geolocation
-#* http://jsfiddle.net/ryanttb/Pre4k/
-# add a location search
-#* http://jsfiddle.net/ryanttb/3LpqG/
-# add a twitter search: rpp=100
-#* http://jsfiddle.net/ryanttb/79zTk/
-# use map center as geocode, radius=(pixelSize * width/2 ) / 1000
-#* http://jsfiddle.net/ryanttb/2PCUu/
-# change style to heat map (16x16 size 8 border-radius)
-#* http://jsfiddle.net/ryanttb/PUeRc/
-# update on bboxchange
-#* http://jsfiddle.net/ryanttb/8LQLW/
-# show tweets in popup
-#* http://jsfiddle.net/ryanttb/y2gTh/
-
-== 2011-07-07 ==
-=== bbox ===
-I added bbox caching! I even check to see if the GeoJSON object has a bbox property, which is legal. There's no way to update the bbox but that'll come later.
-
-=== distance ===
-I almost tried to have distance support taking in a Feature but that opens a whole can of worms. I'm going to fix find to only send base geometry types to distance.
-
-DOCUMENT: geometry methods will only take base geometry types (Point, LineString, Polygon & Multi*) or coordinate arrays
-
-I had some weird comment on this method, it should be documented to only take base types, as I just said.
-
-=== form input ===
-I was talking to Chris last night about what geomap does that others don't and he reminded my about the idea I had of keeping a hidden input of the shapes as WKT. This would mean that I had to have a property on geomap for the map's name and also definitely change the service object to use name instead of id for when I add service-level shapes. WKT becomes a problem though when they've added features. I suppose I would dig into the features and only pull the geometry.
-
-=== json ===
-It's been a while since alpha 2. I'm working on a demo that draws the US state boundaries as graphics.
-
-== 2011-06-30 ==
-=== min ===
-Srsly? I wasn't using minified jQuery in my examples? Wow.
-
-== 2011-06-29 ==
-=== alpha2 ===
-Released alpha 2. I don't think anyone's really using it yet though.
-
-== 2011-06-28 ==
-=== on services ===
-I think it would be nice to deep extend service objects that come in via the services property if a service with the given id already exists in _currentServices. This way, you could set the initial opacity of OSM by simply sending {services: [{id: "OSM", opacity: .8}]} during init.
-
-SUGGESTION: deep extend existing service objects when services property is set
-
-=== on opacity ===
-I was beginning to try to throw the opacity & toggle methods into alpha2 but setting the services property is too flickery. I want to do it more like the old widget but that will require adding opacity and toggle methods into the services types. That will have to wait. It will be much faster to call the opacity/toggle methods on geomap than to set the services property each time. I will have to document that.
-
-SUGGESTION: require opacity and toggle functions in the service type objects
-
-== 2011-06-27 ==
-=== on events ===
-I almost forgot that I don't want bboxchange to fire when the developer changes a property in code. Unlike jQuery UI, my events trigger only when the user does something.
-
-=== on alpha 2 ===
-I'm trying to put this together.
-
-== 2011-06-24 ==
-
-=== on shape methods ===
-I'm almost done. I need to finish empty and then I have what I wanted for an alpha 2 release!
-
-=== on Point vs. coordinate ===
-I think I'm going to settle on using Point objects everywhere except the projection functions. Which means I need to change find to accept a Point instead of an array. This should work out because the position events already send GeoJSON objects instead of position arrays.
-
-=== on geometry ===
-contains doesn't care about projections. Lon/lat values do not need to be projected.
-
-I got done some of the geometry functions in $.geo but I'm leaving them private for now until I have a chance to document them and fully implement them.
-
-=== on proj ===
-Finished changing the $.geo.proj docs to explain that it will convert any GeoJSON coordinates array. I think I will also change the requirements to implement other projections by having the developer only have to override single position conversion functions (instead of worrying about the dimentionality of the passed array). Done.
-
-=== on find ===
-Now that proj is more powerful, I think I can handle find.
-
-== 2011-06-18 ==
-Accidentally coded append differently than how I documented. Will fix the code. Documentation FTW!
-
-I can't decide if the geometry functions in $.geo should only accept the base geometry types or not. Initially they will not. I don't want to even think about getting into $.geo.distance(multiPoint, geometryCollection).
-
-$.proj should go up to a three dimensional array to handle the coordinates in a Polygon. Go big or go home, I'm going to support four dimensional arrays so that I can get MultiPolygons as well. That will handle all of the GeoJSON types that have the coordinates property. If you have a GeometryCollection (geometries property), a Feature (geometry property) or a FeatureCollection (features property), then you're on your own.
-
-I may change every mention of "web mercator" to "spherical mercator" to be more specific.
-
-== 2011-06-17 ==
-Attempting to change drawPoint from ovals to rounded rectangles. Shortcutting to drawArc if the width/height/borderRadius are the same.
-
-Since I plan to make geographics public at some point, I thought I might make the drawPoint/Line/Polygon functions take actual GeoJSON shapes but I think that might conflict with some functionality internal to the geomap during digitization...I'll have to revisit this.
-
-I seriously need to settle on the word "position" in my code when referring to an array containing an x/y. I use coordinate a bunch because that's what I used in the old project. Oh, but the property name of the GeoJSON object is coordinates. Heh, this is so confusing :) Ok, as I have been doing: coordinates in code, position in documentation.
-
-I'm using cowboy's safeParse but can't tell what it's guarding against. I thought it would always give me a number but that's not the case. Guard against NaN or undefined?
-
-Should drawing a bbox ignore borderRadius? I haven't decided.
-
-You can fill and then stroke the same path, just sayin'.
-
-Point graphics now draw as rounded rectangles. There's weirdness if your sizes are a little off though. I should probably start clamping values to each other like width & height to borderRadius. Yeah, if either is smaller than borderRadius the drawing gets weird. Maybe I should clamp borderRadius instead. Probably. Yeah, have to clamp borderRadius to min(width, height)/2.
-
-I don't think you can disable fill by setting style.fill to "", but you should be allowed. It shouldn't be required to set fillOpacity to 0.
-
-I just dropped a couple loops out of my graphic drawing in geographics. Should help a bit :)
-
-== 2011-06-12 ==
-I'm finally pushing the renaming changes to the main project.
-
-=== On examples ===
-I talked to Boaz at Bocoup the other day. He suggested cleaning up the examples. I already had this in mind but I should probably do it sooner rather than later. Especially the simplest example. It will look nicer if I cut the div down to 256x256 to match the initial tile I think (done, it already feels better). I do need to keep the examples specific and don't want to add any HTML or JavaScript to them that does not directly relate to the feature I'm testing in the example.
-
-He also suggested unit tests and an API audit, both of which are great ideas and much needed by $.geo.
-
-=== On ovals ===
-Peter and I discussed how points are drawn and what width and height mean in geomap styles. We both agree that ovals are not very useful or used constructs in GIS and it would be better to have rounded rectangles. Therefore, I am dropping ovals and intead supporting a borderRadius property. Circles are still possible as long as your width, height and border radius are all the same, you will have a circle. This will be the default.
-
-=== On double-click zoom ===
-Peter and I both agree that double-click zoom should operate similar to mouse-wheel zoom in that the bbox should scale according to the placement of the mouse cursor during double-click instead of completely re-centering. You will notice that mouse-wheel feels right and double-click can be confusing.
-
-SUGGESTION: Double-click zoom should scale according to cursor location instead of re-centering
-
-=== On position events ===
-I cannot decide if I should officially make the geo argument passed to the position events (move, click, dblclick) a true GeoJSON Point object. The only difference would be the presense of a type property set to "Point". However, the extra pixels property that I have on the geo argument is not part of GeoJSON and will remain in memory. Also, if a developer pushes the new object to a database they are storing extra information that they don't need and will be useless later.
-
-Is the pixels property even that useful? The dev can call geomap.toPixels if they need it. I added the pixels property just because I had the pixels lying around in the internal handling of the event. I think I might just not pass them. It would be more useful to a developer I think to have a true GeoJSON Point object that they can send to geomap.append or a database without worrying about having extra useless data stored with it.
-
-SUGGESTION: Remove the pixels property from position events and add the type property to make the event argument a true GeoJSON Point
-
-I just updated the docs and changed the implementation. I already like this a lot better and am now thinking that the bbox event type could actually send a true GeoJSON Polygon with the bbox property set. That would be totally within the GeoJSON spec and might be useful. That's a bit of extra code on the widget's side though so for now I'm going to leave it as is. I can add that feature later since the current implementation (an object with just a bbox property) is already partially in a true Polygon's spec.
-
-FUTURE SUGGESTION: Send a true GeoJSON Polygon object as the geo argument of bbox events
-
-=== On returning jQuery collections ===
-I need to better design the return values of the shape methods other than find & shapeStyle. Should append, remove and emtpy return the jQuery object of the map elements that the call originated from? Probably.
-
-I just tested and yes, as long as you don't issue a return statement inside a jQuery UI widget method, jQuery UI will return the original jQuery collection for you.
-
-== 2011-06-10 ==
-
-=== On geographics ===
-I am going to leave drawArc in the graphics widget. The drawPoint method will draw our default point shape (rounded rectangle) but, in the future, when custom drawing is in, a developer can use the drawArc if they want.
-
-=== On proj ===
-Peter has updated web mercator <=> geodetic code for me to drop into $.geo.proj.
-
-== 2011-06-06 ==
-
-=== On renaming shape functions ===
-Renamed the shape functions. That was annoying but I'm glad I only had addShape implemented.
-
-=== On jQuery UI widgets ===
-The widget factory does hide methods that start _ from being called. So much for renaming drawArc to _drawArc and still calling it from geomap.
-
-DEPRECATED SUGGESTION: Turn geographics into a NON-jQuery UI plugin
-
-Did I totally get the scoping wrong for the jQuery UI widget? I have local vars in my initial plugin closure. Will they conflict if there are more than one map?
-
-SUGGESTION: Verify that vars local to initial closure do not conflict when multiple maps are placed
-
-== 2011-06-04 ==
-
-=== drawArc ===
-I just realized that by dropping geographics.drawArc in favor of drawPoint I am losing the ability to draw the circles I need for digitization modes. I wonder if, before I turn DrawPoint into a box-like function, that I should copy it to _drawArc. Will jQueryUI.widget let me call it from geomap?
-
-=== shapes ===
-Chris and I were talking about merging append (previously addshape) and find into one call: shapes. If you pass a GeoJSON object or array of, it will add them. Otherwise, it will find them. Thinking about this today, I don't quite think that's the way to go. I mostly feel that calling geomap functions to manipulate shapes is closer to adding elements to a jQuery collection. In other words, to call the geomap functions you must have already wrapped an element with jQuery, $("#map").geomap("funcName"). When you wrap elements with jQuery normally, you have to call append, find, etc. Geomap will work the same with. Of course, I do still want the syntactic sugar later: $("#map").append(geoJsonObj);
-
-== 2011-06-02 ==
-Who needs a blog. I feel like the best place to keep a developer journal is in the project itself so here we go.
-
-=== On addShape's style argument ===
-I showed Peter the shapeStyle demo. He expected that the shape-specific style applied via addShape would only override properties set during addShape. Further manipulation of the base shapeStyle would cascade to the shapes for any properties not explictily set. You know, like CSS. This is obviously the correct way to go and I already forget what made me code it the other way last night. Likely that I was coding at 2am and thought that if a user was passing a style to addShape they would want ALL style properties set in stone for that shape. That is not the right idea. If they want all properties set in stone, they can override all properties in the style object sent to addShape.
-
-I changed the implementation before leaving work.
-
-=== On storing & modifying style ===
-My initial implementation drawing shapes in $.geo is very similar to how I did it with our internal control. I also showed Chris the shapeStyle demo and explained how you can add a style that's different from the base style on the map. He suggested that there be a way to change the style of an already added shape. I figured that I could make addShape update existing geometries instead of adding a new one but the syntax felt wrong. An updateShape method would work and could pass right through to addShape internally.
-
-He also suggested allowing access to the internal GeoJSON->style map (as a return value for addShape) so they can maybe change the existing styles that way. However, something doesn't feel correctly designed about that.
-
-We discussed attaching the style to the GeoJSON object. I already had supporting that in mind. If the user happens to have put a style property on the GeoJSON object before passing it to addShape, I would use that when drawing. A style passed to addShape would override that. The cascade would be: base style => GeoJSON object style => addShape style. A developer can keep the style property on the object even when it's stored, such as in GeoCouch, something that Guido wants a lot.
-
-That said, I know I'm going about this wrong. As I said, my initial implementation feels too much like the old one and I want to do something much slicker in the jQuery world. On my walk home, I realized that since I am only storing a reference to the GeoJSON object and the user supplied style I can probably connect the style object to the GeoJSON object using jQuery's data method.
-
-I wasn't sure if targeting a plain object is allowed in jQuery. I know it's possible but that doesn't mean I should. I remember IRC talk about it but forget the outcome. Info on ticket 8108 (http://bugs.jquery.com/ticket/8108) reveals that the DataLink plugin does this so I'm going to assume it's ok.
-
-This little fiddle shows that the data properties don't show up with stringify http://jsfiddle.net/ryanttb/PetpJ/ but I'm going to do more research to see if it changes the object in a way devs will notice.
-
-The data method doesn't natively support namespacing. I could do it myself using a period but I would like to follow what jQuery Mobile is doing with their data attribute stuff. They use data-jm-role which I believe equates to the call .data("jmRole") but I need to check up on that as well. So if I were to do data-geo-style, that would be .data("geoStyle"). I can live with that.
-
-SUGGESTION: Store $.geo styles via $(geoJsonObj).data("geoStyle", style)
-
-=== On shape functions ===
-Again, the shape functions feel very old and were grabbed from my internal control. Tonight I was thinking about a new way to do this and it involves being able to wrap GeoJSON objects with jQuery collections and intercept $.fn calls such as .css. Also, non-jQuery UI functions can be added to the geomap widget's div to replace the old addShape method.
-
-For example: $("#map").geomap("addShape", geoJson) could be $("#map").append(geoJson).
-
-How would I add shapes to specific services in the future? $("#map [data-geo-service='OSM']").append(geoJson) maybe.
-
-This might be going too far. Perhaps the old way is fine but use newer names (without the Shape suffix): $("#map").geomap("append", geoJsonObj), $("#map").geomap("append", "OSM", geoJsonObj), $("#map").geomap("remove", geoJsonObj) and $("#map").geomap("empty").
-
-SUGGESTION: Rename the shape manipulation methods
-
-The methods also need to take arrays of GeoJSON objects as returned by databases and jQuery collections of GeoJSON objects as possibly returned by the find method.
-
-SUGGESTION: Shape manipulation methods should handle arrays
-
-Looking back at the above code, I feel like maybe if I really can get the selector-based way to work, e.g., intercept the append call on the geomap widget, I could target the services using a class. They are divs inside the map, I should be able to trap them:
-
-$("#map .OSM").append(geoJsonObj);
-
-That does look really nice.
-
-SUGGESTION: (future) Trap existing jQuery calls: append, remove and emtpy, on both the widget element and the service elements as syntactic sugar, forward them to geomap calls
-
-However, using the class selector feels wrong. Especially if I'm telling them to use the id property when creating the service objects. I could switch it to name when creating the service objects, then:
-
-$("#map [name='OSM']").append(geoJsonObj);
-
-I need to find out if any of this is possible as soon as possible. It's still shorter than calling geomap. I would have to warn users to make sure the space is there, this needs to be a descendant selector.
-
-SUGGESTION: Use name instead of id in the service objects.
-
-=== On finding shapes ===
-So you can append and remove shapes. Fine. But I also want a better way to search for shapes. Chris and I mulled over a selector-based way. I think I still want the simplicity of $("#map").geomap("find", position, pixelTol). That will cover a lot of use cases, users click maps a lot.
-
-However, there should be other ways to get at your shapes in a UI widget way:
-$("#map").geomap("find", [-67, 43], 8); // find all shapes within 8px of the map position (special case)
-$("#map").geomap("find", "[type='Point']"); // Finds all points
-$("#map").geomap("find", "[name='OSM'] *"); // all shapes in the OSM service (future)
-$("#map").geomap("find", ":intersects(wkt(POINT(-67 43)))"); // Advanced spatial filter, OGC selector names (way future)
-
-Here's how they would look with the future jQuery syntactic sugar:
-$("#map").find([-67, 43], 8); // find all shapes within 8px of the map position (special case)
-$("#map").find("[type='Point']"); // Finds all points
-$("#map [name='OSM']").find(); // all shapes in the OSM service (future)
-$("#map").find(":intersects(wkt(POINT(-67 43)))"); // Advanced spatial filter, OGC selector names (way future)
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/404.html b/libs/js/jquery-geo-1.0b2/docs/404.html
deleted file mode 100755 (executable)
index b5ea1ac..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<!doctype html>
-<title>not found</title>
-
-<style>
-body { text-align: center;}
-h1 { font-size: 50px; }
-body { font: 20px Constantia, 'Hoefler Text',  "Adobe Caslon Pro", Baskerville, Georgia, Times, serif; color: #999; text-shadow: 2px 2px 2px rgba(200, 200, 200, 0.5); }
-::-moz-selection{ background:#FF5E99; color:#fff; }
-::selection { background:#FF5E99; color:#fff; } 
-details { display:block; }
-a { color: rgb(36, 109, 56); text-decoration:none; }
-a:hover { color: rgb(96, 73, 141) ; text-shadow: 2px 2px 2px rgba(36, 109, 56, 0.5); }
-span[frown] { transform: rotate(90deg); display:inline-block; color: #bbb; }
-</style>
-
-
-
-
-<details>
-  <summary><h1>Not found</h1></summary>
-  <p><span frown>:(</span></p>
-</details>
\ No newline at end of file
diff --git a/libs/js/jquery-geo-1.0b2/docs/css/handheld.css b/libs/js/jquery-geo-1.0b2/docs/css/handheld.css
deleted file mode 100755 (executable)
index 0b8202e..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-* {
-  float: none;       
-  background: #fff;  
-  color: #000;
-}
-
-
-body { font-size: 80%; }
\ No newline at end of file
diff --git a/libs/js/jquery-geo-1.0b2/docs/css/style.css b/libs/js/jquery-geo-1.0b2/docs/css/style.css
deleted file mode 100755 (executable)
index 39b4f7c..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/* HTML5 âœ° Boilerplate */
-
-html, body, div, span, object, iframe,
-h1, h2, h3, h4, h5, h6, p, blockquote, pre,
-abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp,
-small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li,
-fieldset, form, label, legend,
-table, caption, tbody, tfoot, thead, tr, th, td,
-article, aside, canvas, details, figcaption, figure,
-footer, header, hgroup, menu, nav, section, summary,
-time, mark, audio, video {
-  margin: 0;
-  padding: 0;
-  border: 0;
-  font-size: 100%;
-  font: inherit;
-  vertical-align: baseline;
-}
-
-article, aside, details, figcaption, figure,
-footer, header, hgroup, menu, nav, section {
-  display: block;
-}
-
-blockquote, q { quotes: none; }
-blockquote:before, blockquote:after,
-q:before, q:after { content: ""; content: none; }
-ins { background-color: #ff9; color: #000; text-decoration: none; }
-mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; }
-del { text-decoration: line-through; }
-abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; }
-table { border-collapse: collapse; border-spacing: 0; }
-hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }
-input, select { vertical-align: middle; }
-
-body { font:13px/1.231 sans-serif; *font-size:small; }
-select, input, textarea, button { font:99% sans-serif; }
-pre, code, kbd, samp { font-family: monospace, sans-serif; }
-
-html { overflow-y: scroll; }
-a:hover, a:active { outline: none; }
-ul, ol { margin-left: 2em; }
-ol { list-style-type: decimal; }
-nav ul, nav li { margin: 0; list-style:none; list-style-image: none; }
-small { font-size: 85%; }
-strong, th { font-weight: bold; }
-td { vertical-align: top; }
-sub, sup { font-size: 75%; line-height: 0; position: relative; }
-sup { top: -0.5em; }
-sub { bottom: -0.25em; }
-
-pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; padding: 15px; }
-textarea { overflow: auto; } 
-.ie6 legend, .ie7 legend { margin-left: -7px; } 
-input[type="radio"] { vertical-align: text-bottom; }
-input[type="checkbox"] { vertical-align: bottom; }
-.ie7 input[type="checkbox"] { vertical-align: baseline; }
-.ie6 input { vertical-align: text-bottom; }
-label, input[type="button"], input[type="submit"], input[type="image"], button { cursor: pointer; }
-button, input, select, textarea { margin: 0; }
-input:valid, textarea:valid   {  }
-input:invalid, textarea:invalid { border-radius: 1px; -moz-box-shadow: 0px 0px 5px red; -webkit-box-shadow: 0px 0px 5px red; box-shadow: 0px 0px 5px red; }
-.no-boxshadow input:invalid, .no-boxshadow textarea:invalid { background-color: #f0dddd; }
-
-
-button {  width: auto; overflow: visible; }
-.ie7 img { -ms-interpolation-mode: bicubic; }
-
-body, select, input, textarea { color: #444; }
-h1, h2, h3, h4, h5, h6 { font-weight: bold; }
-
-/* jQuery Mobile f theme */
-.ui-bar-f {
-       background: rgb(116, 176, 66); border: 1px solid rgb(86, 160, 14); color: rgb(255, 255, 255); font-weight: bold; text-shadow: 0 -1px 1px #234403;
-}
-.ui-bar-f {
-       color: rgb(255, 255, 255);
-}
-.ui-bar-f .ui-link-inherit {
-       color: rgb(255, 255, 255);
-}
-.ui-bar-f .ui-link {
-       color: rgb(255, 255, 255); font-weight: bold;
-}
-
-
- /* Primary Styles
-    Author: Ryan Westphal
- */
-
-h1 img { width: 24px; height: 24px; margin-right: 4px; vertical-align: middle; }
-div>h2 { font-size: 1.1em; margin: .5em 0; text-decoration: underline; }
-p { margin: .5em 0; }
-th { text-align: right; padding: .5em 1em .5em 0; }
-td { padding: .5em 0; }
-b { font-weight: bold; }
-i { font-style: italic; }
-h4 { font-style: italic; font-weight: normal; }
-ul { margin-bottom: .5em; }
-
-.geomap-indoc
-{
-  height: 240px;
-  position: relative;
-  width: 98%;
-}
-
-.objectProperties th { text-align: left; }
-.objectProperties td { padding: .25em .5em; }
-.objectProperties tr:nth-child(2n+1) { background: #bbb; }
-
-code .comment { color: #393; }
-
-blockquote
-{
-  margin: 8px;
-  font-style: italic;
-}
-
-.ir { display: block; text-indent: -999em; overflow: hidden; background-repeat: no-repeat; text-align: left; direction: ltr; }
-.hidden { display: none; visibility: hidden; }
-.visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
-.visuallyhidden.focusable:active,
-.visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; }
-.invisible { visibility: hidden; }
-.clearfix:before, .clearfix:after { content: "\0020"; display: block; height: 0; overflow: hidden; }
-.clearfix:after { clear: both; }
-.clearfix { zoom: 1; }
-
-
-@media all and (orientation:portrait) {
-
-}
-
-@media all and (orientation:landscape) {
-
-}
-
-@media screen and (max-device-width: 480px) {
-  
-  /* html { -webkit-text-size-adjust:none; -ms-text-size-adjust:none; } */
-}
-
-
-@media print {
-  * { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important;
-  -ms-filter: none !important; } 
-  a, a:visited { color: #444 !important; text-decoration: underline; }
-  a[href]:after { content: " (" attr(href) ")"; }
-  abbr[title]:after { content: " (" attr(title) ")"; }
-  .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; }  
-  pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
-  thead { display: table-header-group; } 
-  tr, img { page-break-inside: avoid; }
-  @page { margin: 0.5cm; }
-  p, h2, h3 { orphans: 3; widows: 3; }
-  h2, h3{ page-break-after: avoid; }
-}
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/all-shingled.html b/libs/js/jquery-geo-1.0b2/docs/examples/all-shingled.html
deleted file mode 100755 (executable)
index 5d9ee53..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>everything shingled</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="A demo of everything using a shingled service">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-
-    h2 { display: inline-block; }
-    @media only screen and (min-width: 800px) 
-    {
-      h2 { display: inline-block; min-width: 8em; }
-    }
-
-    h3 { display: inline-block; margin-left: 2em; }
-
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-
-    /* a label CSS example: all text for labels on the hydro service will be blue! */
-    #massgis_hydrography
-    {
-      color: blue;
-    }
-
-    .modes { margin: .5em 0; }
-
-    #drawStyle label span { display: inline-block; font-weight: bold; text-align: right; width: 7em; }
-    #drawStyle input { width: 6em; }
-
-    .scrollOption-container, .scrollOptions, .clickTargets, .toggleTargets { display: inline-block; }
-
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info mobile-shrink">
-      <div class="links not-mobile">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/69mFE/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-
-      <h1>shingled <img id="indicator" alt="" src="img/ajax-loader.gif" style="display: none;" /></h1>
-
-      <p class="not-mobile">The everything demo, shingled edition!</p>
-
-      <section class="not-mobile">
-        <h2>info</h2> <button id="toggle-info" type="button" title="click to view some map info">show / hide</button>
-
-        <table id="mapInfo" style="display: none;">
-          <tr><th>bbox</th><td data-option="bbox"></td></tr>
-          <tr><th>center</th><td data-option="center"></td></tr>
-          <tr><th>zoom</th><td data-option="zoom"></td></tr>
-        </table>
-      </section>
-
-      <form>
-
-        <section>
-          <h2>basics</h2>
-
-          <input type="checkbox" id="togglePannable" name="togglePannable" value="togglePannable" checked="checked" /><label for="togglePannable">pannable</label>
-
-          <div class="scrollOption-container not-mobile">
-            <h3>scroll</h3>
-            <div class="scrollOptions">
-              <input type="radio" id="scrollOptionDefault" name="scrollOption" value="default" checked="checked" /><label for="scrollOptionDefault">default / scroll</label>
-              <input type="radio" id="scrollOptionOff" name="scrollOption" value="off" /><label for="scrollOptionOff">off</label>
-            </div>
-          </div>
-        </section>
-
-        <section>
-          <h2>mode</h2> <button id="change-mode" type="button" title="click to change the mode">pan</button>
-
-          <div id="modeOptions" style="display: none;">
-            <div class="modes">
-              <input type="radio" id="static" name="mode" value="static" /><label for="static">static</label>
-              <input type="radio" id="pan" name="mode" value="pan" checked="checked" /><label for="pan">pan</label>
-              <input type="radio" id="zoom" name="mode" value="zoom" /><label for="zoom">zoom</label>
-            </div>
-
-            <div class="modes">
-              <input type="radio" id="drawPoint" name="mode" value="drawPoint" /><label for="drawPoint">drawPoint</label>
-              <input type="radio" id="drawLineString" name="mode" value="drawLineString" /><label for="drawLineString">drawLineString</label>
-              <input type="radio" id="drawPolygon" name="mode" value="drawPolygon" /><label for="drawPolygon">drawPolygon</label>
-            </div>
-
-            <div class="modes">
-              <input type="radio" id="dragBox" name="mode" value="dragBox" /><label for="dragBox">dragBox</label>
-              <input type="radio" id="dragCircle" name="mode" value="dragCircle" /><label for="dragCircle">dragCircle</label>
-            </div>
-
-            <div class="modes">
-              <!--
-              jQuery Geo supports custom modes by letting you set the mode option to
-              any string you want. You can set a cursor for your custom mode using the
-              cursors option. When on a custom mode, you will get the geomapclick event.
-              -->
-              <input type="radio" id="remove" name="mode" value="remove" /><label for="remove">remove</label>
-            </div>
-
-            <div class="modes">
-              <input type="radio" id="measureLength" name="mode" value="measureLength" /><label for="measureLength">measureLength</label>
-              <input type="radio" id="measureArea" name="mode" value="measureArea" /><label for="measureArea">measureArea</label>
-            </div>
-          </div>
-        </section>
-
-        <section id="shapeLabels" style="display: none;">
-          <label>
-            <h2>label</h2>
-            <input type="text" name="shapeLabel" />
-          </label>
-        </section>
-
-        <div class="not-mobile">
-          <section id="drawStyle" style="display: none;">
-            <h2>style</h2>
-              <div>
-                <label><span>color</span> <input type="color" name="color" value="#7f0000" /></label>
-                <label><span>opacity</span> <input type="text" name="opacity" value="1.0" /></label>
-              </div>
-              <div>
-                <label><span>fill</span> <input type="color" name="fill" value="" /></label>
-                <label><span>fillOpacity</span> <input type="text" name="fillOpacity" value=".2" /></label>
-              </div>
-              <div>
-                <label><span>stroke</span> <input type="color" name="stroke" value="" /></label>
-                <label><span>strokeOpacity</span> <input type="text" name="strokeOpacity" value="1" /></label>
-              </div>
-              <div>
-                <label><span>strokeWidth</span> <input type="number" name="strokeWidth" value="2" /></label>
-              </div>
-              <div>
-                <label><span>width</span> <input type="number" name="width" value="8" /></label>
-                <label><span>height</span> <input type="number" name="height" value="8" /></label>
-              </div>
-              <div>
-                <label><span>borderRadius</span> <input type="number" name="borderRadius" value="8" /></label>
-              </div>
-
-          </section>
-        </div>
-
-        <section id="clickTarget" style="display: none;">
-          <h2>target</h2>
-          <div class="clickTargets">
-            <input type="radio" id="clickTargetWidget" name="clickTarget" value="widget" checked="checked" /><label for="clickTargetWidget">widget</label>
-            <input type="radio" id="clickTargetBasemapService" name="clickTarget" value="massgis_basemap" /><label for="clickTargetBasemapService">basemap</label>
-            <input type="radio" id="clickTargetHydroService" name="clickTarget" value="massgis_hydrography" /><label for="clickTargetHydroService">hydro</label>
-          </div>
-        </section>
-
-        <section id="serviceToggle">
-          <h2>toggle</h2>
-
-          <div class="toggleTargets">
-            <input type="checkbox" id="toggleTargetBasemapService" name="toggleTarget" value="massgis_basemap" checked="checked" /><label for="toggleTargetBasemapService">basemap</label>
-            <input type="checkbox" id="toggleTargetHydroService" name="toggleTarget" value="massgis_hydrography" checked="checked" /><label for="toggleTargetHydroService">hydro</label>
-          </div>
-        <section>
-
-        <section id="zoomButtons">
-          <h2>zoom</h2>
-
-          <button id="zoomOut" type="button">out</button>
-
-          <button id="zoomIn" type="button">in</button>
-        </section>
-      </form>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <!--<script src="../../js/excanvas.js"></script>
-  <script src="../../js/jsrender.js"></script>
-  <script src="../../js/jquery.mousewheel.js"></script>
-  <script src="../../js/jquery.ui.widget.js"></script>
-  <script src="../../js/jquery.geo.core.js"></script>
-  <script src="../../js/jquery.geo.geographics.js"></script>
-  <script src="../../js/jquery.geo.geomap.js"></script>
-  <script src="../../js/jquery.geo.tiled.js"></script>
-  <script src="../../js/jquery.geo.shingled.js"></script>-->
-  <script src="../jquery.geo-test.min.js"></script>
-  <script src="js/all-shingled.js"></script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/all-tiled.html b/libs/js/jquery-geo-1.0b2/docs/examples/all-tiled.html
deleted file mode 100755 (executable)
index 928fb80..0000000
+++ /dev/null
@@ -1,210 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>everything tiled</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="A demo of everything using a tiled service">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-
-    h2 { display: inline-block; }
-    @media only screen and (min-width: 800px) 
-    {
-      h2 { display: inline-block; min-width: 8em; }
-    }
-
-    h3 { display: inline-block; margin-left: 2em; }
-
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-
-    /* a label CSS example: all text for labels on the speedtest service will be purple and bold! */
-    #broadband-speedtest
-    {
-      color: purple;
-      font-weight: bold;
-    }
-
-    .modes { margin: .5em 0; }
-
-    #drawStyle label span { display: inline-block; font-weight: bold; text-align: right; width: 7em; }
-    #drawStyle input { width: 6em; }
-
-    .scrollOption-container, .scrollOptions, .clickTargets, .toggleTargets { display: inline-block; }
-
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info mobile-shrink">
-      <div class="links not-mobile">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/uSMjS/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-
-      <h1>tiled <img id="indicator" alt="" src="img/ajax-loader.gif" style="display: none;" /></h1>
-
-      <p class="not-mobile">The everything demo, tiled edition!</p>
-
-      <section class="not-mobile">
-        <h2>info</h2> <button id="toggle-info" type="button" title="click to view some map info">show / hide</button>
-
-        <table id="mapInfo" style="display: none;">
-          <tr><th>bbox</th><td data-option="bbox"></td></tr>
-          <tr><th>center</th><td data-option="center"></td></tr>
-          <tr><th>zoom</th><td data-option="zoom"></td></tr>
-        </table>
-      </section>
-
-      <form>
-
-        <section>
-          <h2>basics</h2>
-
-          <input type="checkbox" id="togglePannable" name="togglePannable" value="togglePannable" checked="checked" /><label for="togglePannable">pannable</label>
-
-          <div class="scrollOption-container not-mobile">
-            <h3>scroll</h3>
-            <div class="scrollOptions">
-              <input type="radio" id="scrollOptionDefault" name="scrollOption" value="default" checked="checked" /><label for="scrollOptionDefault">default / scroll</label>
-              <input type="radio" id="scrollOptionOff" name="scrollOption" value="off" /><label for="scrollOptionOff">off</label>
-            </div>
-          </div>
-        </section>
-
-        <section>
-          <h2>mode</h2> <button id="change-mode" type="button" title="click to change the mode">pan</button>
-
-          <div id="modeOptions" style="display: none;">
-            <div class="modes">
-              <input type="radio" id="static" name="mode" value="static" /><label for="static">static</label>
-              <input type="radio" id="pan" name="mode" value="pan" checked="checked" /><label for="pan">pan</label>
-              <input type="radio" id="zoom" name="mode" value="zoom" /><label for="zoom">zoom</label>
-            </div>
-
-            <div class="modes">
-              <input type="radio" id="drawPoint" name="mode" value="drawPoint" /><label for="drawPoint">drawPoint</label>
-              <input type="radio" id="drawLineString" name="mode" value="drawLineString" /><label for="drawLineString">drawLineString</label>
-              <input type="radio" id="drawPolygon" name="mode" value="drawPolygon" /><label for="drawPolygon">drawPolygon</label>
-            </div>
-
-            <div class="modes">
-              <input type="radio" id="dragBox" name="mode" value="dragBox" /><label for="dragBox">dragBox</label>
-              <input type="radio" id="dragCircle" name="mode" value="dragCircle" /><label for="dragCircle">dragCircle</label>
-            </div>
-
-            <div class="modes">
-              <!--
-              jQuery Geo supports custom modes by letting you set the mode option to
-              any string you want. You can set a cursor for your custom mode using the
-              cursors option. When on a custom mode, you will get the geomapclick event.
-              -->
-              <input type="radio" id="remove" name="mode" value="remove" /><label for="remove">remove</label>
-            </div>
-
-            <div class="modes">
-              <input type="radio" id="measureLength" name="mode" value="measureLength" /><label for="measureLength">measureLength</label>
-              <input type="radio" id="measureArea" name="mode" value="measureArea" /><label for="measureArea">measureArea</label>
-            </div>
-          </div>
-        </section>
-
-        <section id="shapeLabels" style="display: none;">
-          <label>
-            <h2>label</h2>
-            <input type="text" name="shapeLabel" />
-          </label>
-        </section>
-
-        <div class="not-mobile">
-          <section id="drawStyle" style="display: none;">
-            <h2>style</h2>
-              <div>
-                <label><span>color</span> <input type="color" name="color" value="#7f0000" /></label>
-                <label><span>opacity</span> <input type="text" name="opacity" value="1.0" /></label>
-              </div>
-              <div>
-                <label><span>fill</span> <input type="color" name="fill" value="" /></label>
-                <label><span>fillOpacity</span> <input type="text" name="fillOpacity" value=".2" /></label>
-              </div>
-              <div>
-                <label><span>stroke</span> <input type="color" name="stroke" value="" /></label>
-                <label><span>strokeOpacity</span> <input type="text" name="strokeOpacity" value="1" /></label>
-              </div>
-              <div>
-                <label><span>strokeWidth</span> <input type="number" name="strokeWidth" value="2" /></label>
-              </div>
-              <div>
-                <label><span>width</span> <input type="number" name="width" value="8" /></label>
-                <label><span>height</span> <input type="number" name="height" value="8" /></label>
-              </div>
-              <div>
-                <label><span>borderRadius</span> <input type="number" name="borderRadius" value="8" /></label>
-              </div>
-
-          </section>
-        </div>
-
-        <section id="clickTarget" style="display: none;">
-          <h2>target</h2>
-          <div class="clickTargets">
-            <input type="radio" id="clickTargetWidget" name="clickTarget" value="widget" checked="checked" /><label for="clickTargetWidget">widget</label>
-            <input type="radio" id="clickTargetBasemapService" name="clickTarget" value="mapquest-open" /><label for="clickTargetBasemapService">basemap</label>
-            <input type="radio" id="clickTargetSpeedtestService" name="clickTarget" value="broadband-speedtest" /><label for="clickTargetSpeedtestService">speedtest</label>
-          </div>
-        </section>
-
-        <section id="serviceToggle">
-          <h2>toggle</h2>
-
-          <div class="toggleTargets">
-            <input type="checkbox" id="toggleTargetBasemapService" name="toggleTarget" value="mapquest-open" checked="checked" /><label for="toggleTargetBasemapService">basemap</label>
-            <input type="checkbox" id="toggleTargetSpeedtestService" name="toggleTarget" value="broadband-speedtest" checked="checked" /><label for="toggleTargetSpeedtestService">speedtest</label>
-          </div>
-        <section>
-
-        <section id="zoomButtons">
-          <h2>zoom</h2>
-
-          <button id="zoomOut" type="button">out</button>
-
-          <button id="zoomIn" type="button">in</button>
-        </section>
-      </form>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../../js/excanvas.js"></script>
-  <script src="../../js/jsrender.js"></script>
-  <script src="../../js/jquery.mousewheel.js"></script>
-  <script src="../../js/jquery.ui.widget.js"></script>
-  <script src="../../js/jquery.geo.core.js"></script>
-  <script src="../../js/jquery.geo.geographics.js"></script>
-  <script src="../../js/jquery.geo.geomap.js"></script>
-  <script src="../../js/jquery.geo.tiled.js"></script>
-  <script src="../../js/jquery.geo.shingled.js"></script>
-  <!--<script src="../jquery.geo-test.min.js"></script>-->
-  <script src="js/all-tiled.js"></script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/append.html b/libs/js/jquery-geo-1.0b2/docs/examples/append.html
deleted file mode 100755 (executable)
index ed24f96..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>append test</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of append">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/NPdUp/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>append</h1>
-      <p>This page tests geomap's append method and some style and refresh arguments.</p>
-      <p class="not-mobile">A geomap widget is initialized to the continental US and a point is placed in Massachusetts. A line extends from MA to South Jersey where a triangle covers an area. For points, geomap draws a pixel-based oval around the map coordinate. Since the size of the oval is based on pixels, it will be the same size at all scales. The pixel length of lines and size of polygons changes at different scales because each point that makes up the shapes is locked at specific map coordinates. The stroke width for all shapes will be the same number of pixels at all scales.</p>
-      <p class="not-mobile">All the geometry is stored in a single GeometryCollection. This example first draws the entire collection with a broad stroked, off-white style to create a halo effect behind the real shapes. This makes them a little easier to see on the map. Then we draw each individual shape again with color. The first two have the default style which is red. For the last one, we change the color to blue.</p>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      // create a map
-      var map = $("#map").geomap({
-        center: [-75, 40],
-        zoom: 5
-      });
-
-      // create a geometry collection having a
-      // Point, LineString and Polygon
-      var gcol = {
-        type: "GeometryCollection",
-        geometries: [
-          {
-            type: "Point",
-            coordinates: [-71, 42]
-          },
-          {
-            type: "LineString",
-            coordinates: [
-              [-71, 42],
-              [-75, 39.5]
-            ]
-          },
-          {
-            type: "Polygon", // this Polygon has an outer ring and one hole
-            coordinates: [
-              [ 
-                [-75, 39.7],
-                [-74.8, 39.3],
-                [-75.2, 39.3],
-                [-75, 39.7]
-              ],
-              [ 
-                [-75, 39.6],
-                [-74.9, 39.4],
-                [-75.1, 39.4],
-                [-75, 39.6]
-              ]
-            ]
-          }
-        ]
-      };
-
-      // append the entire collection as a single geometry
-      // do not refresh the map yet
-      map.geomap("append", gcol, { strokeWidth: "8px", color: "#dedede" }, false);
-
-      // append the point
-      // I'm refreshing the map just as an example
-      // since true is the default, this is the same as not passing it
-      // we normally would pass false because there's more append calls below
-      map.geomap("append", gcol.geometries[0], true);
-
-      // append the LineString
-      // don't refresh the map yet,
-      // this is the correct way when there's more drawing to do
-      map.geomap("append", gcol.geometries[1], false);
-
-      // append the Polygon with a blue style
-      // refresh will default to true and the map will redraw
-      // even if we passed false to all append calls above
-      map.geomap("append", gcol.geometries[2], { color: "#00d" });
-    });
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/appendservice.html b/libs/js/jquery-geo-1.0b2/docs/examples/appendservice.html
deleted file mode 100755 (executable)
index d326ec5..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>append to service test</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of append to service">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/==JSFIDDLE==/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>append to service</h1>
-      <p>This page is similar to the regular append example but tests appending shapes to a specific service instead of the map itself. The result, however, should look exactly the same.</p>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      // create a map
-      var map = $( "#map" ).geomap( {
-            center: [-75, 40],
-            zoom: 5
-          } ),
-          service = map.find( ".osm" );
-
-      // create a geometry collection having a
-      // Point, LineString and Polygon
-      var gcol = {
-        type: "GeometryCollection",
-        geometries: [
-          {
-            type: "Point",
-            coordinates: [-71, 42]
-          },
-          {
-            type: "LineString",
-            coordinates: [
-              [-71, 42],
-              [-75, 39.5]
-            ]
-          },
-          {
-            type: "Polygon",
-            coordinates: [[
-              [-75, 39.7],
-              [-74.8, 39.3],
-              [-75.2, 39.3],
-              [-75, 39.7]
-            ]]
-          }
-        ]
-      };
-
-      // append the entire collection as a single geometry
-      // do not refresh the service yet
-      service.geomap("append", gcol, { strokeWidth: "8px", color: "#dedede" }, false);
-
-      // append the point
-      // I'm refreshing the service just as an example
-      // since true is the default, this is the same as not passing it
-      // we normally would pass false because there's more append calls below
-      service.geomap("append", gcol.geometries[0], true);
-
-      // append the LineString
-      // don't refresh the service yet,
-      // this is the correct way when there's more drawing to do
-      service.geomap("append", gcol.geometries[1], false);
-
-      // append the Polygon with a blue style
-      // refresh will default to true and the service will redraw
-      // even if we passed false to all append calls above
-      service.geomap("append", gcol.geometries[2], { color: "#00d" });
-    });
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/basemaps.html b/libs/js/jquery-geo-1.0b2/docs/examples/basemaps.html
deleted file mode 100755 (executable)
index 3f21aa9..0000000
+++ /dev/null
@@ -1,116 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>basemap switcher example</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of a bassemap switcher">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/58D64/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-
-      <h1>bassemap switcher</h1>
-
-      <div class="basemap-inputs">
-        <input type="radio" id="basemap-street" name="basemap" value="street" checked="checked" /><label for="basemap-street">Street</label>
-        <input type="radio" id="basemap-aerial" name="basemap" value="aerial" /><label for="basemap-aerial">aerial</label>
-      </div>
-      
-    </div>
-  </div>
-  <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/jquery-ui.min.js"></script>
-  <!--<script src="../../js/excanvas.js"></script>
-  <script src="../../js/jsrender.js"></script>
-  <script src="../../js/jquery.mousewheel.js"></script>
-  <script src="../../js/jquery.ui.widget.js"></script>
-  <script src="../../js/jquery.geo.core.js"></script>
-  <script src="../../js/jquery.geo.geographics.js"></script>
-  <script src="../../js/jquery.geo.geomap.js"></script>
-  <script src="../../js/jquery.geo.tiled.js"></script>
-  <script src="../../js/jquery.geo.shingled.js"></script>-->
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $( function ( ) {
-      // create a map with two basemap services, the aerial service is hidden
-
-      // note that the space in the "class" properties below means both services
-      // have the basemap class but each one has a second class that we use to show/hide them
-      var map = $( "#map" ).geomap( {
-        center: [ -71.0595678, 42.3604823 ],
-        zoom: 8,
-
-        services: [
-          {
-            "class": "basemap street",
-            type: "tiled",
-            src: function( view ) {
-              return "http://otile" + ((view.index % 4) + 1) + ".mqcdn.com/tiles/1.0.0/osm/" + view.zoom + "/" + view.tile.column + "/" + view.tile.row + ".png";
-            },
-            attr: "Tiles Courtesy of <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png'>"
-          },
-
-          {
-            "class": "basemap aerial",
-            type: "tiled",
-            src: function( view ) {
-              return "http://oatile" + ((view.index % 4) + 1) + ".mqcdn.com/tiles/1.0.0/sat/" + view.zoom + "/" + view.tile.column + "/" + view.tile.row + ".png";
-            },
-            style: {
-              visibility: "hidden"
-            },
-            attr: "Portions Courtesy NASA/JPL-Caltech and U.S. Depart. of Agriculture, Farm Service Agency"
-          }
-        ]
-      } );
-
-      // jQuery UI for pretty buttons
-
-      $( ".basemap-inputs" ).buttonset( );
-
-      // hook into when user clicks one of the basemap buttons
-      $( 'input[name="basemap"]' ).click( function( e ) {
-        // the value of the checked basemap input matches the class of the
-        // jQuery Geo service we want to show
-
-        var basemapServiceClass = $( 'input[name="basemap"]:checked' ).val();
-
-        // hide all basemap services
-        $( ".basemap" ).geomap( "toggle", false );
-
-        // show the selected one
-        $( "." + basemapServiceClass ).geomap( "toggle", true );
-      } );
-    } );  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/bbox.html b/libs/js/jquery-geo-1.0b2/docs/examples/bbox.html
deleted file mode 100755 (executable)
index 4464a61..0000000
+++ /dev/null
@@ -1,298 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>bbox examples</title>
-  <meta charset="utf-8">
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of bbox property and bbox functions">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-    
-    table 
-    {
-      table-layout: fixed;
-      width: 99%;
-    }
-    
-    table th
-    {
-      font-weight: bold;
-      padding-right: 2px;
-      text-align: right;
-      width: 35%;
-    }
-    
-    .bbox-prop input
-    {
-      font-family: Courier New, Monospace;
-      width: 70%;
-    }
-    
-    .expandBy input
-    {
-      width: 80px;
-    }
-    
-    .scaleBy input, .reaspect input
-    {
-      width: 64px;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/wQ86c/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1> bbox</h1>
-      <p class="not-mobile">This example tests getting and setting the bbox property on the geomap widget as well as calling various $.geo bbox functions.</p>
-
-      <form id="loc">
-        <label>
-          Search OSM for
-          <input type="text" name="l" />
-        </label>
-        <button type="submit">
-          Go</button>
-      </form>
-
-      <form action="bbox.html" class="bbox">
-        <table>
-          <tr class="bbox-prop">
-            <th><label for="bbox-prop">.geomap(&quot;option&quot;, &quot;bbox&quot;,</label> </th>
-            <td><input id="bbox-prop" name="bbox-prop" type="text" /> <b>)</b> <button type="submit">set</button></td>
-          </tr>
-          <tr class="bbox-bbox">
-            <th>.geomap( &quot;option&quot;, &quot;bbox&quot; )</th>
-            <td></td>
-          </tr>
-          <tr class="bbox-proj">
-            <th>$.geo.proj.fromGeodetic( bbox )</th>
-            <td></td>
-          </tr>
-          <tr class="bbox-projto">
-            <th>$.geo.proj.toGeodetic( bbox )</th>
-            <td></td>
-          </tr>
-          <tr class="bbox-center">
-            <th>$.geo.center( bbox )</th>
-            <td></td>
-          </tr>
-          <tr class="bbox-width">
-            <th>$.geo.width( bbox )</th>
-            <td></td>
-          </tr>
-          <tr class="bbox-height">
-            <th>$.geo.height( bbox )</th>
-            <td></td>
-          </tr>
-        </table>
-      </form>
-      <div class="not-mobile">
-        <p>For this example, the functions below operate on the above text input only. After using them, you can click <b>set</b> to update the map and other info.</p>
-        <form action="bbox.html" class="expandBy">
-          <table>
-            <tr>
-              <th>$.geo.expandBy( bbox, </th>
-              <td><input type="text" name="dx" value="20000" /> <b>,</b> <input type="text" name="dy" value="20000" /> <b>)</b> <button type="submit">expand</button></td>
-            </tr>
-          </table>
-        </form>
-        <form action="bbox.html" class="scaleBy">
-          <table>
-            <tr>
-              <th>$.geo.scaleBy( bbox, </th>
-              <td><input type="text" name="scale" value="2" /> <b>)</b> <button type="submit">scale</button></td>
-            </tr>
-          </table>
-        </form>
-        <p>This last function, reaspect, forces an aspect ratio (calculation of width divided height) onto the bbox. You can run this but it will be difficult to visually see the effects because the geomap widget will automatically reaspect again to fit the bbox back into the viewport.</p>
-        <p>Common aspect ratio values: 16:9 = 16/9 ~ <b>1.78</b>:1 &amp; 4:3 = 4/3 ~ <b>1.33</b>:1</p>
-        <form action="bbox.html" class="reaspect">
-          <table>
-            <tr>
-              <th>$.geo.reaspect( bbox, </th>
-              <td><input type="text" name="ratio" value="1.78" /> <b>)</b> <button type="submit">reaspect</button></td>
-            </tr>
-          </table>
-        </form>
-      </div>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      var $bboxInput = $(".bbox-prop input"); //< bbox input reference
-
-      // create a map
-      var map = $("#map").geomap({
-            center: [-71.0595678, 42.3604823],
-            zoom: 8,
-            bboxchange: function (e, geo) {
-              // inside the bboxchange event, update the input with the current bbox
-              // the geo object has a bbox property which is the new bbox
-              updateBboxDisplay(geo.bbox);
-            }
-          });
-
-      $("#loc").submit(function () {
-        // when the user clicks the location search button,
-        // send a request to nominatim for an OpenStreatMap data search
-        $.ajax({
-          url: "http://open.mapquestapi.com/nominatim/v1/search",
-          data: {
-            format: "json",
-            q: $("#loc input").val()
-          },
-          dataType: "jsonp",
-          jsonp: "json_callback",
-          success: function (results) {            
-            if (results && results.length > 0) {
-              // if we a result, set the map's extent
-              // unfortunately, the nominatim search spec returns a bbox
-              // that is not properly GeoJSON formatted so we need to reorder
-              var nbbox = results[0].boundingbox;
-              $bboxInput.val( "[ " + [
-                nbbox[2], /* min longitude*/
-                nbbox[0], /* min latitude */
-                nbbox[3], /* max longitude */
-                nbbox[1]  /* max latitude */
-              ].join( ", " ) + " ]" );
-
-              $("form.bbox").submit( );
-            } else {
-              alert( "sorry, we could not find that" );
-            }
-          },
-          error: function ( xhr ) {
-            alert( "there was an error searching OSM" );
-          }
-        });
-        return false;
-      });
-
-
-      $("form.bbox").submit(function () {
-        // a new bbox is submitted, update the bbox option
-        // since the bbox is a JavaScript array, jQuery's parseJSON method will work
-        map.geomap("option", "bbox", $.parseJSON($bboxInput.val()));
-
-        // based on the map view's aspect ratio, the final bbox can be different than the one set
-        // update the input and display based on the new/final value
-        updateBboxDisplay(map.geomap("option", "bbox"));
-
-        // return false to short circuit the form, we don't want to actually submit
-        return false;
-      });
-
-      $("form.expandBy").submit(function () {
-        // read the bbox from the input using jQuery's parseJSON method
-        var bbox = $.parseJSON($bboxInput.val());
-
-        // read the dx, dy inputs
-        var dx = parseFloat($("input[name='dx']").val()),
-            dy = parseFloat($("input[name='dy']").val());
-
-        // call expandBy
-        // expandBy takes a bbox argument & returns an updated bbox
-        bbox = $.geo.expandBy(bbox, dx, dy);
-
-        // only update the bbox input for now and let the user click set
-        $bboxInput.val("[" + bbox + "]");
-
-        return false;
-      });
-
-      $("form.scaleBy").submit(function () {
-        // read the bbox from the input using jQuery's parseJSON method
-        var bbox = $.parseJSON($bboxInput.val());
-
-        // read the scale input
-        var scale = parseFloat($("input[name='scale']").val());
-
-        // call scaleBy
-        // scaleBy takes a bbox argument & returns an updated bbox
-        bbox = $.geo.scaleBy(bbox, scale);
-
-        // only update the bbox input for now and let the user click set
-        $bboxInput.val("[" + bbox + "]");
-
-        return false;
-      });
-
-      $("form.reaspect").submit(function () {
-        // read the bbox from the input using jQuery's parseJSON method
-        var bbox = $.parseJSON($bboxInput.val());
-
-        // read the aspect ratio input
-        var ratio = parseFloat($("input[name='ratio']").val());
-
-        // call reaspect
-        // reaspect takes a bbox argument & returns an updated bbox
-        bbox = $.geo.reaspect(bbox, ratio);
-
-        // only update the bbox input for now and let the user click set
-        $bboxInput.val("[" + bbox + "]");
-
-        return false;
-      });
-
-      // jQuery UI for a pretty button
-      $("button").button();
-
-      // set the initial display based on the map's current bbox
-      updateBboxDisplay(map.geomap("option", "bbox"));
-
-      function updateBboxDisplay(bbox) {
-        // update the bbox displayed in the input and calculated values
-        // the bbox argument is a GeoJSON bounding box, which is a JavaScript array
-        // we can call join on the array to add spaces after the bbox values
-        // the values are: min longitude/x, min latitude/y, max longitude/x, max latitude/y
-        $bboxInput.val( "[" + bbox + "]" );
-
-        // the bbox as the map widget sees it
-        $(".bbox-bbox td").text( "[" + map.geomap( "option", "bbox" ).join( ", " ) + "]" );
-
-        // projected coordinates of the bbox
-        $(".bbox-proj td").text("[" + $.geo.proj.fromGeodetic(bbox).join( ", " ) + "]");
-
-        // geodetic coordinates of the bbox
-        $(".bbox-projto td").text("[" + $.geo.proj.toGeodetic(bbox).join( ", " ) + "]");
-
-        // center of the bbox, a GeoJSON position
-        $(".bbox-center td").text("[" + $.geo.center(bbox).join( ", " ) + "]");
-
-        // width & height of the bbox, in meters because the default service is web mercator meters
-        // the units will match whatever coordinate system you set via geomap's tilingScheme or bboxMax properties
-        $(".bbox-width td").text($.geo.width(bbox) + " m");
-        $(".bbox-height td").text($.geo.height(bbox) + " m");
-      }
-    });  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/bostock.html b/libs/js/jquery-geo-1.0b2/docs/examples/bostock.html
deleted file mode 100755 (executable)
index 5eca514..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>Bostock demo</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="D3 + Leaflet demo done in jQuery Geo">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/==JSFIDDLE==/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>Bostock demo</h1>
-      <p>Inspired by: <a href="http://bost.ocks.org/mike/leaflet/">D3 + Leaflet</a></p>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script src="js/iecors.js"></script>
-  <script>
-    $( function ( ) {
-      // create a map
-      var state = null,
-          map = $( "#map" ).geomap( {
-            center: [ -96.9, 37.8 ],
-            zoom: 4,
-            shapeStyle: {
-              fill: "#000",
-              fillOpacity: .2,
-              stroke: "#fff",
-              strokeWidth: "1.5px"
-            },
-            move: function( e, geo ) {
-              if ( state ) {
-                map.geomap( "remove", state );
-              }
-
-              var states = map.geomap( "find", geo, 1 );
-              if ( states.length > 0 ) {
-                state = $.extend( true, { }, states[ 0 ] );
-                map.geomap( "append", state, {
-                  fill: "brown",
-                  fillOpacity: .7
-                } );
-              }
-            }
-          } );
-
-      $.getJSON( "http://data.jquerygeo.com/usastates.json", function (result) {
-          map.geomap("append", result);
-        } );
-
-    } );  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/census.html b/libs/js/jquery-geo-1.0b2/docs/examples/census.html
deleted file mode 100755 (executable)
index 97be907..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-
-  <title>Census</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-
-  <meta name="description" content="Displaying Census data">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      bottom: 0;
-      left: 0;
-      right: 0;
-      top: 0;
-    }
-    </style>
-</head>
-<body>
-  <div id="map"></div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-
-      $.ajaxTransport( function( options, originalOptions, jqXHR ) {
-        var xdr;
-
-        return {
-          send: function( _, completeCallback ) {
-            xdr = new XDomainRequest();
-            xdr.onload = function() {
-              var responses = {
-                text: xdr.responseText
-              };
-
-              // force status code to 200, XDomainRequest rejects all other successful status codes
-              if (xdr.contentType.match(/\/json/)) {
-                options.dataTypes.push("json");
-                completeCallback(200, 'success', responses);
-              } else {
-                completeCallback(200, 'success', responses); 
-                // see bug https://connect.microsoft.com/IE/feedback/ViewFeedback.aspx?FeedbackID=334804
-              }
-            };
-            xdr.onerror = xdr.ontimeout = function() {
-              var responses = {
-                text: xdr.responseText
-              };
-              completeCallback(400, 'failed', responses);
-            }
-
-            xdr.open(options.type, options.url);
-            xdr.send(options.data);
-          },
-          abort: function() {
-            if(xdr) {
-              xdr.abort();
-            }
-          }
-        };
-      });
-
-
-
-      // create a map
-      var map = $("#map").geomap({
-        center: [-71.0595678, 42.3604823],
-        zoom: 8,
-        services: [
-          {
-            id: "GeoIQ-acetate",
-            type: "tiled",
-            src: function (view) {
-              return "http://acetate.geoiq.com/tiles/acetate-base/"
-               + view.zoom + "/"
-               + view.tile.column + "/"
-               + view.tile.row
-               + ".png";
-            },
-            attr: "<p>GeoIQ Acetate layer</p>"
-          },
-          {
-            id: "broadbandmap-income-demographics",
-            type: "tiled",
-            src: function (view) {
-              return "http://www.broadbandmap.gov/StamenTiles/demographics/education/"
-               + view.zoom + "/"
-               + view.tile.column + "/"
-               + view.tile.row
-               + ".png";
-            },
-            attr: "<p>National Broadband Map income demographics</p>"
-          }
-        ]
-//        click: function(e, geo) {
-//          $.ajax({
-//            url: "http://www.broadbandmap.gov/broadbandmap/demographic/fall2010/coordinates",
-//            data: {
-//              longitude: geo.coordinates[0],
-//              latitude: geo.coordinates[1],
-//              format: "jsonp"
-//            },
-//            dataType: "jsonp",
-//            success: function(result) {
-//              //alert(result.Results.blockFips + ": " + result.Results.educationBachelorOrGreater);
-//            },
-//            error: function(xhr) {
-//              alert(xhr.statusText);
-//            }
-//          })
-//        }
-      });
-
-      $.ajax({
-        url: "http://data.jquerygeo.com/gz_2010_25_140_00_500k.geojson",
-        dataType: "json",
-        success: function(result) {
-          map.geomap("append", result);
-        },
-        error: function(xhr) {
-          alert(xhr.statusText);
-        }
-      });
-    });  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/center.html b/libs/js/jquery-geo-1.0b2/docs/examples/center.html
deleted file mode 100755 (executable)
index b0d59b6..0000000
+++ /dev/null
@@ -1,147 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>center/zoom example</title>
-  <meta charset="utf-8">
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of the center, zoom and pixelSize options">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/ku2eC/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>center &amp; zoom example</h1>
-      <p>This page tests getting and setting the center &amp; zoom options as well as getting the read-only pixelSize.</p>
-      <p class="not-mobile">The center option is a <a href="http://geojson.org/geojson-spec.html#positions">GeoJSON position</a>. The zoom option for a tiled service a whole number from zero to the number of levels defined by the tilingScheme minus one. The pixelSize is the number of map units that fit in a single pixel of the current view. By default, pixelSize is in meters because the default map service is in web mercator meters.</p>
-      <h2>runtime options</h2>
-      <p>Change the center or zoom option and click set to update the map.</p>
-      <div>
-        <label>center <input type="text" name="runtimeCenter" value="[-74.5,40.3]" /></label>
-        <button id="cmdRuntimeCenter" type="button">set</button>
-      </div>
-      <div>
-        <label>zoom <input type="number" name="runtimeZoom" value="8" /></label>
-        <button id="cmdRuntimeZoom" type="button">set</button>
-      </div>
-      <h2>actual values</h2>
-      <p class="not-mobile">The center option is in geodetic cooridinates, [lon, lat], but the internal center is in map units, web mercator by default.</p>
-      <table>
-        <tr>
-          <th>.geomap( &quot;option&quot;, &quot;center&quot; )</th>
-          <td id="lblCenterPublic"></td>
-        </tr>
-        <tr>
-          <th>$.geo.proj.toGeodetic( center )</th>
-          <td id="lblCenterGeodetic"></td>
-        </tr>
-        <tr>
-          <th><i>internal center, always projected</i></th>
-          <td id="lblCenterInternal"></td>
-        </tr>
-        <tr>
-          <th>.geomap( &quot;option&quot;, &quot;zoom&quot; )</th>
-          <td id="lblZoom"></td>
-        </tr>
-        <tr>
-          <th>.geomap( &quot;option&quot;, &quot;pixelSize&quot; )</th>
-          <td id="lblPixelSize"></td>
-        </tr>
-      </table>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      // store references to the inputs
-      var runtimeCenter = $("input[name='runtimeCenter']"),
-          runtimeZoom = $("input[name='runtimeZoom']");
-
-      // create a map, base the initial center and zoom on the inputs
-      var map = $("#map").geomap({
-        center: $.parseJSON(runtimeCenter.val()),
-        zoom: parseInt(runtimeZoom.val()),
-        bboxchange: function (e, geo) {
-          // when the bbox changes, update the displayed values
-          refreshActual();
-        }
-      });
-
-      $("#cmdRuntimeCenter").button().click(function () {
-        // when the user sets the center, pass the new value to geomap
-        // since plain JavaScript arrays are valid JSON,
-        // we can use $.parseJSON to convert the string into a value
-        map.geomap("option", "center", $.parseJSON(runtimeCenter.val()));
-
-        // geomap doesn't trigger the bbox event when options are set programmatically
-        // update the displayed values
-        refreshActual();
-      });
-
-      $("#cmdRuntimeZoom").button().click(function () {
-        // when the user sets the zoom, pass the new value to geomap
-        // zoom is always a whole number
-        map.geomap("option", "zoom", parseInt(runtimeZoom.val()));
-
-        // geomap doesn't trigger the bbox event when options are set programmatically
-        // update the displayed values
-        refreshActual();
-      });
-
-      // update the displayed values with how the map widget was initialized
-      refreshActual();
-
-      function refreshActual() {
-        // get the center
-        // by default, this is in geodetic coordinates, [lon, lat]
-        // but the developer can use projected coordinates
-        var actualCenter = map.geomap("option", "center");
-        $("#lblCenterPublic").text("[" + actualCenter + "]");
-
-        if ($.geo.proj) {
-          // if there is a projection set,
-          // we can display the center in both geodetic and projected units
-
-          var geodetic = $.geo.proj.toGeodetic(actualCenter);
-          $("#lblCenterGeodetic").text("[" + geodetic + "]");
-
-          // the internal center is always projected
-          var internal = $.geo.proj.fromGeodetic(actualCenter);
-          $("#lblCenterInternal").text("[" + internal + "]");
-        } else {
-          // if not, then both the center option and internal center are the same
-          $("#lblCenterInternal").text("[" + actualCenter + "]");
-
-          // also, we have no way to display the center in lon, lat
-        }
-
-        // get and display the current zoom value
-        $("#lblZoom").text(map.geomap("option", "zoom"));
-
-        // get and display the current pixelSize value
-        // you cannot set pixelSize, it's read only
-        $("#lblPixelSize").text(map.geomap("option", "pixelSize"));
-      }
-    });  
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/css/style.css b/libs/js/jquery-geo-1.0b2/docs/examples/css/style.css
deleted file mode 100755 (executable)
index 974d08f..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-.links
-{
-  float: right;
-}
-
-.docLink 
-{
-  background: url(../../images/$.geo-logo-small.png) right no-repeat;
-  color: #7f0000;
-  display: block;
-  font-size: 24px;
-  font-weight: bold;
-  padding-right: 24px;
-  text-decoration: none;
-  text-transform: uppercase;
-}
-
-.fiddleLink
-{
-  display: block;
-  font-weight: bold;
-  margin: 4px;
-  text-align: right;
-  text-decoration: none;
-}
-
-.fiddleLink img
-{
-  border: none;
-  vertical-align: middle;
-}
-  
-.mobile-shrink
-{
-  font-size: .6em;
-}
-
-.not-mobile
-{
-  display: none;
-}
-
-@media only screen and (min-width: 800px) 
-{  
-  .info
-  {
-    width: 45% !important;
-    position: fixed;
-    right: 16px;
-    top: 16px;
-  }
-
-  .mobile-shrink
-  {
-    font-size: 1em;
-  }
-  
-  .not-mobile
-  {
-    display: block;
-  }
-}
-
-html
-{
-  font:13px/1.231 Calibri,Arial,sans-serif; *font-size:small;
-}
-
-.info 
-{
-  background: #fff;
-  border-radius: 8px;
-  box-shadow: -4px 4px #444;
-  opacity: .8;
-  padding: 8px;
-  width: 90%;
-}
-
-fieldset { border: none; }
-
-legend {
-  font-size: 14px;
-  font-weight: bold;
-}
-
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/defer.html b/libs/js/jquery-geo-1.0b2/docs/examples/defer.html
deleted file mode 100755 (executable)
index 8ba89d7..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>defer example</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of deferring an image load">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/Sq457/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>defer</h1>
-      <p>The src function in this demo returns a jQuery Defer object so it can download the tile ahead of time and draw the bbox on it before passing the final image to the map widget as a data URL.</p>
-      <p class="non-mobile">This demo does not work in IE8.</p>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <!--<script src="../../js/excanvas.js"></script>
-  <script src="../../js/jsrender.js"></script>
-  <script src="../../js/jquery.mousewheel.js"></script>
-  <script src="../../js/jquery.ui.widget.js"></script>
-  <script src="../../js/jquery.geo.core.js"></script>
-  <script src="../../js/jquery.geo.geographics.js"></script>
-  <script src="../../js/jquery.geo.geomap.js"></script>
-  <script src="../../js/jquery.geo.tiled.js"></script>
-  <script src="../../js/jquery.geo.shingled.js"></script>-->
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $( function ( ) {
-      // create a canvas element to draw dynamic tiles
-      // interesting tidbit: it's inefficient to create a new canvas for each tile
-      // however, JavaScript is single threaded so we can use the same canvas to draw each tile
-      var canvas = document.createElement( "canvas" );
-
-      // the size of the canvas element matches the size of a tile
-      canvas.width = 256;
-      canvas.height = 256;
-
-      // grab a 2d context to draw onto the canvas element
-      var context = canvas.getContext( "2d" );
-
-      // a link to the jQuery Geo logo
-      // drawn on every tile
-      var logoUrl = "../../apple-touch-icon.png";
-
-      // create a map
-      var map = $( "#map" ).geomap( {
-        center: [ -71.0595678, 42.3604823 ],
-        zoom: 8,
-        services: [ {
-          type: "tiled",
-          src: function( view ) {
-            // create a new Defer object for this tile request
-            var defer = new jQuery.Deferred();
-
-            // for this example, every tile will also contain the jQuery Geo logo :)
-
-            // interesting tidbit:
-            // you might /want/ to build a URL to an OpenStreetMap tile here
-            // however, that is a cross domain security error when we call toDataURL below
-            // http://stackoverflow.com/questions/2390232/why-does-canvas-todataurl-throw-a-security-exception
-
-            // if you really want to get OSM map tiles and draw on them,
-            // you will have to proxy them from your own website/domain
-
-            // create a new img element where we will download an image
-            var img = new Image( );
-            
-            // hook into the load event
-            img.onload = function( ) {
-              // this callback is triggered when the tile is done being downloaded to the img element
-
-              // at this point, we have already returned the Deferred object
-              // to jQuery Geo for the current tile so it can calculate other tiles; neat!
-
-              // clear the canvas to draw a new tile
-              context.clearRect( 0, 0, 256, 256 );
-
-              // draw a small version of our logo on the top-right corner of the tile
-              context.drawImage( img, 208, 16, 32, 32 );
-
-              // draw a border for the tile
-              context.strokeRect( 0, 0, 255, 255 );
-
-              // use $.geo.proj to convert the bbox to lon, lat
-              var geodeticBbox = $.geo.proj.toGeodetic( view.bbox );
-
-              // however, make it look nicer by rounding the numbers
-              geodeticBbox[ 0 ] = geodeticBbox[ 0 ].toFixed( 2 );
-              geodeticBbox[ 1 ] = geodeticBbox[ 1 ].toFixed( 2 );
-              geodeticBbox[ 2 ] = geodeticBbox[ 2 ].toFixed( 2 );
-              geodeticBbox[ 3 ] = geodeticBbox[ 3 ].toFixed( 2 );
-
-              // draw the tile dimensions to the tile
-              context.strokeText( "[ " + geodeticBbox.join( ", " ) + " ]", 32, 96 );
-
-              // we are done, resolve the deferred object and complete this tile
-              // the image is returned to jQuery Geo as a data URL thanks to canvas
-              defer.resolve( canvas.toDataURL( "image/png" ) );
-            };
-
-            // now that we've hooked up our load handler,
-            // we have to set the image's src attribute to get things going
-            img.src = logoUrl;
-
-            // return the Deferred object so the map widget can wait for done to be triggered
-            return defer;
-          }
-        } ]
-      } );
-    } );  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/destroy.html b/libs/js/jquery-geo-1.0b2/docs/examples/destroy.html
deleted file mode 100755 (executable)
index ca2f92c..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>destroy example</title>
-  <meta charset="utf-8">
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of destroy">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-      <div class="info">
-        <a href="../" class="docLink">&lt; docs</a>
-        <h1>
-          destroy</h1>
-        <p>
-          This example allows you to create and destroy the geomap widget and test that everything is returned to normal.</p>
-        <button type="button" data-command="create">create</button>
-        <button type="button" data-command="destroy">destroy</button>
-      </div>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      $("#map").geomap({
-        center: [-71.0595678, 42.3604823],
-        zoom: 8
-      });
-
-      var created = true;
-
-      $("button[data-command='create']").button().click(function () {
-        if (!created) {
-          $("#map").geomap({
-            center: [-71.0595678, 42.3604823],
-            zoom: 8
-          });
-          created = true;
-        }
-      });
-
-      $("button[data-command='destroy']").button().click(function () {
-        if (created) {
-          $("#map").geomap("destroy");
-          created = false;
-        }
-      });
-    });  
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/drag.html b/libs/js/jquery-geo-1.0b2/docs/examples/drag.html
deleted file mode 100755 (executable)
index 3573cc8..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>drag example</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of drag modes">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/==JSFIDDLE==/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-
-      <h1>drag</h1>
-
-      <p>There are currently two drag modes: dragBox and dragCircle. This demo tests only dragBox when set as the mode during init.</p>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $( function ( ) {
-      // create a map, setting the mode to dragBox
-      var map = $( "#map" ).geomap( {
-        center: [ -71.0595678, 42.3604823 ],
-        zoom: 8,
-        mode: "dragBox",
-        shape: function( e, geo ) {
-          // drag modes generate GeoJSON objects and send them as the geo argument
-          // you can append them to the map
-          map.geomap( "append", geo );
-        }
-      } );
-    } );  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/draw.html b/libs/js/jquery-geo-1.0b2/docs/examples/draw.html
deleted file mode 100755 (executable)
index 5ae4583..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>drawing examples</title>
-  <meta charset="utf-8">
-  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
-  <meta name="description" content="An example of drawing with the mode property">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/2TAzc/embedded/" class="fiddleLink not-mobile"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>drawing</h1>
-      <p class="not-mobile">This example tests the three shape drawing modes: drawPoint, drawLineString and drawPolygon. Choose a tool below and start tapping!</p>
-      <p class="not-mobile">Double-tap to add the last point and end lines &amp; polygons.</p>
-      <p class="not-mobile">You can remove individual points while drawing lines &amp; polygons with the escape key.</p>
-      <div id="modes">
-        <input type="radio" id="drawPoint" name="mode" value="drawPoint" checked="checked" /><label for="drawPoint">point</label>
-        <input type="radio" id="drawLineString" name="mode" value="drawLineString" /><label for="drawLineString">line</label>
-        <input type="radio" id="drawPolygon" name="mode" value="drawPolygon" /><label for="drawPolygon">polygon</label>
-      </div>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      // create a map, setting mode to drawPoint initially
-      var map = $("#map").geomap({
-        center: [-71.0595678, 42.3604823],
-        zoom: 8,
-        mode: "drawPoint",
-        shape: function (e, geo) {
-          // the shape event triggers when a user draws a shape
-          // the geo object is a simple GeoJSON object: Point, LineString or Polygon
-          // we can append it directly to the map
-          map.geomap("append", geo);
-        }
-      });
-
-      // jQuery UI for pretty buttons
-      $("#modes").buttonset();
-
-      $("#modes input").click(function () {
-        // set the map's mode option based on value of the input clicked
-        // this will change the map's mode to drawPoint, drawLineString or drawPolygon
-        map.geomap("option", "mode", $(this).val());
-      });
-    });  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/drawStyle.html b/libs/js/jquery-geo-1.0b2/docs/examples/drawStyle.html
deleted file mode 100755 (executable)
index cd539d1..0000000
+++ /dev/null
@@ -1,142 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8" />
-  <title>drawStyle test</title>
-  <meta name="description" content="geomap drawStyle test" />
-  <meta name="author" content="Ryan Westphal" />
-  <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" />
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-
-    label { white-space: nowrap; }
-
-    label span { display: inline-block; width: 7rem; }
-    input { width: 6rem; }
-
-    button { width: 16rem; }
-  </style>
-</head>
-<body>
-  <div class="drawStyle">
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/BXgV4/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>drawStyle</h1>
-      <p>This page tests various style properties using the drawStyle option to change the style displayed when a user is drawing shapes in drawLineString and drawPolygon modes.</p>
-      <div id="modes">
-        <input type="radio" id="drawPoint" name="mode" value="drawPoint" checked="checked" /><label for="drawPoint">point</label>
-        <input type="radio" id="drawLineString" name="mode" value="drawLineString" /><label for="drawLineString">line</label>
-        <input type="radio" id="drawPolygon" name="mode" value="drawPolygon" /><label for="drawPolygon">polygon</label>
-      </div>
-      <form id="drawStyle">
-        <fieldset>
-          <legend>geomap drawStyle option</legend>
-          <div>
-            <label><span>color</span> <input type="color" name="color" value="#7f0000" /></label>
-            <label><span>opacity</span> <input type="text" name="opacity" value="1.0" /></label>
-          </div>
-          <div>
-            <label><span>fill</span> <input type="color" name="fill" value="" /></label>
-            <label><span>fillOpacity</span> <input type="text" name="fillOpacity" value=".2" /></label>
-          </div>
-          <div>
-            <label><span>stroke</span> <input type="color" name="stroke" value="" /></label>
-            <label><span>strokeOpacity</span> <input type="text" name="strokeOpacity" value="1" /></label>
-            <label><span>strokeWidth</span> <input type="number" name="strokeWidth" value="2" /></label>
-          </div>
-          <div>
-            <label><span>width</span> <input type="number" name="width" value="8" /></label>
-            <label><span>height</span> <input type="number" name="height" value="8" /></label>
-            <label><span>borderRadius</span> <input type="number" name="borderRadius" value="8" /></label>
-          </div>
-        </fieldset>
-        <button type="button">set drawStyle</button>
-        <button type="reset">reset drawStyle</button>
-      </form>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      // create a map
-      var map = $( "#map" ).geomap( {
-        center: [ -71.0595678, 42.3604823 ],
-        zoom: 8,
-        mode: "drawPoint",
-        shape: function( e, geo ) {
-          // the shape event triggers when the user finishes drawing a shape
-          // the geo argument is a GeoJSON object representing the shape
-          // for this example, we'll append it to the map forcing an
-          // individual style that matches the current drawStyle
-
-          // make a copy of the current drawStyle
-          var drawStyle = $.extend( { }, map.geomap( "option", "drawStyle" ) );
-
-          // append the shape using that style
-          map.geomap( "append", geo, drawStyle );
-
-        }
-      } );
-
-      $( "#drawStyle input" ).change( function( ) {
-        // when an input of the drawStyle form changes,
-        // immediately set the property of geomap's drawStyle option
-
-        // keep in mind that the three point-only styles (width, height & borderRadius)
-        // cannot be seen because with drawPoint, the shape event triggers immediately
-        // without drawing a shape
-        // this example, however, does use them when appending the shape after a click
-
-        // first, we can grab a jQuery reference to the input that changed
-        var $this = $( this );
-
-        // next, we can create an object that represents this change
-        // this example doesn't, but you can set more than one property
-        // on geomap's drawStyle option at a time
-        var styleOption = { };
-        styleOption[ $this.attr( "name" ) ] = $this.val();
-
-        map.geomap( "option", "drawStyle", styleOption );
-      } );
-
-      // jQuery UI for pretty buttons
-      $("#modes").buttonset();
-
-      $("#modes input").click(function () {
-        // set the map's mode option based on value of the input clicked
-        // this will change the map's mode to drawPoint, drawLineString or drawPolygon
-        map.geomap("option", "mode", $(this).val());
-      });
-
-      // jQuery UI for pretty reset buttons
-      $( "button" ).button( );
-
-      // maintin a copy of the original drawStyle so we can reset it later
-      var originaldrawStyle = map.geomap( "option", "drawStyle" );
-
-      $( "#drawStyle button[type='reset']" ).click( function( ) {
-        // when the user resets the drawStyle form,
-        // we want to also reset the drawStyle option
-        // back to its original state
-        map.geomap( "option", "drawStyle", originaldrawStyle );
-      } );
-    });
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/empty.html b/libs/js/jquery-geo-1.0b2/docs/examples/empty.html
deleted file mode 100755 (executable)
index 69b54de..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>geomap empty test</title>
-  <meta name="description" content="Small test of jQuery Geo's shape functions">
-  <meta name="author" content="Ryan Westphal">
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-</head>
-<body>
-  <div>
-    <a href="../" class="docLink">&lt; docs</a>
-    <h1>
-      geomap empty test</h1>
-    <p>
-      Click the map to add points, click the Empty button to remove them all at once.</p>
-    <button type="button">
-      Empty</button>
-    <div class="geomap" style="width: 640px; height: 480px;">
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      var geomap = $(".geomap").geomap({
-        center: [-71.05, 42.35],
-        zoom: 13,
-        mode: "drawPoint",
-        shape: function (e, geo) {
-          geomap.geomap("append", geo);
-        }
-      });
-
-      $("button").click(function () {
-        geomap.geomap("empty");
-      });
-    });
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/emptyservice.html b/libs/js/jquery-geo-1.0b2/docs/examples/emptyservice.html
deleted file mode 100755 (executable)
index 1e9e708..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>geomap empty service test</title>
-  <meta name="description" content="Small test of jQuery Geo's shape functions">
-  <meta name="author" content="Ryan Westphal">
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-</head>
-<body>
-  <div>
-    <a href="../" class="docLink">&lt; docs</a>
-    <h1>geomap empty service test</h1>
-    <p>This page is similar to the regular empty example but tests removing all shapes from a specific service instead of the map itself.</p>
-    <button type="button">Empty</button>
-    <div class="geomap" style="width: 640px; height: 480px;">
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      var geomap = $(".geomap").geomap({
-            center: [-71.05, 42.35],
-            zoom: 13,
-            click: function (e, geo) {
-              geomap.find( ".osm" ).geomap("append", geo);
-            }
-          }),
-          service = geomap.find( ".osm" );
-
-      $("button").click(function () {
-        service.geomap("empty");
-      });
-    });
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/events.html b/libs/js/jquery-geo-1.0b2/docs/examples/events.html
deleted file mode 100755 (executable)
index 63e2bf3..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>events example</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of basic interaction events">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-    th
-    {
-      text-align: left;
-    }
-    th, td
-    {
-      margin: 0;
-      padding: 4px;
-      border-left: solid 2px #dedede;
-    }
-  </style>
-</head>
-<body>
-  <div id="events">
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/fg6wv/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>events</h1>
-      <p>The basic interaction events are: move, click, dblclick, and bboxchange. jQuery Geo triggers then when a user interacts with the map.</p>
-     <table cellspacing="0">
-      <thead>
-        <tr>
-          <th>
-            event (time)
-          </th>
-          <th>
-            geo argument
-          </th>
-        </tr>
-      </thead>
-      <tbody>
-        <tr class="geomapmove">
-          <td>
-            move (<span class="date"></span>)
-          </td>
-          <td class="data">
-          </td>
-        </tr>
-        <tr class="geomapclick">
-          <td>
-            click (<span class="date"></span>)
-          </td>
-          <td class="data">
-          </td>
-        </tr>
-        <tr class="geomapdblclick">
-          <td>
-            dblclick (<span class="date"></span>)
-          </td>
-          <td class="data">
-          </td>
-        </tr>
-        <tr class="geomapbboxchange">
-          <td>
-            bboxchange (<span class="date"></span>)
-          </td>
-          <td class="data">
-          </td>
-        </tr>
-      </tbody>
-    </table>
-   </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      // create a map
-      // hook into all the events and update the screen when they're triggered
-      // we don't need to prefix the events with the widget's name during initialization
-      var map = $("#map").geomap({
-        center: [-71.0595678, 42.3604823],
-        zoom: 8,
-
-        // position events get a GeoJSON Point object
-        move: positionEventHandler,
-        click: positionEventHandler,
-        dblclick: positionEventHandler,
-
-        // bbox events get an object with a bbox property
-        bboxchange: bboxEventHandler
-      });
-
-      function positionEventHandler( e, geo ) {
-        // jQuery stores the event type in e.type
-        // outside of the initialization function,
-        // the jQuery UI widget events all have a widget prefix
-        // in this case it's: geomap
-
-        // this example builds a selector for the class
-        // of the table's row for this event
-        // if the event is, e.g., move, e.type is geomapmove and the row we want is .geomapmove
-        var eventRowClass = "." + e.type;
-
-        // update the time stamp for this event
-        $(eventRowClass + " .date").text($.now());
-
-        // contained in the geo argument as a GeoJSON Point object
-
-        // the coordinates property is an array,
-        // this example joins them with an extra space so they look a little nicer
-        var displayCoords = geo.coordinates.join( ", " );
-
-            
-        // convert the map coordinates to pixel locations to show them as well
-        var displayPixels = map.geomap( "toPixel", geo.coordinates ).join( ", " );
-
-        // update the position data
-        $(eventRowClass + " .data").html("pixels: [ " + displayPixels + " ]<br>coordinates: [ " + displayCoords + " ]");
-      }
-
-      function bboxEventHandler( e, geo ) {
-        // again, build a selector for the class of the table's row for this event
-        // for example, the bboxchange event's e.type is geomapbboxchange
-        // and the row we want is .geomapbboxchange
-        var eventRowClass = "." + e.type;
-
-        // update the time stamp for this event
-        $( eventRowClass + " .date" ).text( $.now( ) );
-
-        // update the position data,
-        // contained in the geo argument as an object with a bbox property
-        // currently that's all the object has
-        $( eventRowClass + " .data" ).text( "[ " + geo.bbox.join( ", " ) + " ]" );
-      }
-    });  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/find.html b/libs/js/jquery-geo-1.0b2/docs/examples/find.html
deleted file mode 100755 (executable)
index be10258..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>geomap find test</title>
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-</head>
-<body>
-    <a href="../" class="docLink">&lt; docs</a>
-  <h1>geomap find test</h1>
-  <div class="geomap" style="width: 640px; height: 480px;"></div>
-  <div class="output">
-    <h2>Click the geometry!</h2>
-    <ul></ul>
-    <button id="findAll" type="button">find( &quot;*&quot; )</button>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      var geomap = $(".geomap").geomap({
-        center: [-71.05, 42.35],
-        zoom: 13,
-        // because of the geomap widget's custom modes,
-        // we can set mode to whatever is appropriate for the situation
-        // here, we set it to find and give the find mode a crosshair cursor
-        mode: "find",
-        cursors: { find: "crosshair" },
-        click: function (e, geo) {
-          var outputHtml = "",
-              result = geomap.geomap("find", geo, 8);
-
-          $.each(result, function () {
-            outputHtml += ("<li>Found a " + this.type + " at " + this.coordinates + "</li>");
-          });
-
-          $(".output ul").html(outputHtml);
-        }
-      });
-
-      var geoms = {
-        one: { type: "Point", coordinates: [-71.05, 42.35] },
-        two: { type: "Point", coordinates: [-71.045, 42.355] },
-        three: { type: "Point", coordinates: [-71.055, 42.345] },
-        four: { type: "Point", coordinates: [-71.055, 42.355] },
-        five: { type: "Point", coordinates: [-71.045, 42.345] },
-        six: { type: "LineString", coordinates: [[-71.055, 42.355], [-71.045, 42.355]] },
-        seven: { type: "Polygon", coordinates: [[[-71.06, 42.3425], [-71.06, 42.3475], [-71.04, 42.3475], [-71.04, 42.3425], [-71.06, 42.3425]]] }
-      };
-
-      for (var geomKey in geoms) {
-        geomap.geomap("append", geoms[geomKey]);
-      }
-
-      $( "#findAll" ).click( function() {
-        var outputHtml = "",
-            result = geomap.geomap( "find", "*" );
-
-        $.each(result, function () {
-          outputHtml += ("<li>Found a " + this.type + " at " + this.coordinates + "</li>");
-        });
-
-        $(".output ul").html(outputHtml);
-      } );
-    });
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/findservice.html b/libs/js/jquery-geo-1.0b2/docs/examples/findservice.html
deleted file mode 100755 (executable)
index 9030006..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>geomap find service test</title>
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-</head>
-<body>
-    <a href="../" class="docLink">&lt; docs</a>
-  <h1>geomap find service test</h1>
-  <div class="geomap" style="width: 640px; height: 480px;"></div>
-  <div class="output">
-    <h2>Click the geometry!</h2>
-    <ul></ul>
-    <button id="findAll" type="button">find( &quot;*&quot; )</button>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      var geomap = $(".geomap").geomap({
-            center: [-71.05, 42.35],
-            zoom: 13,
-            click: function (e, geo) {
-              var outputHtml = "",
-                  mapShapes = geomap.geomap("find", geo, 8),
-                  serviceShapes = geomap.find( ".osm" ).geomap("find", geo, 8);
-
-              outputHtml += '<li><b>map shapes</b></li>';
-              $.each(mapShapes, function () {
-                outputHtml += ("<li>Found a " + this.type + " at " + this.coordinates + "</li>");
-              });
-
-              outputHtml += '<li><b>service shapes</b></li>';
-              $.each(serviceShapes, function () {
-                outputHtml += ("<li>Found a " + this.type + " at " + this.coordinates + "</li>");
-              });
-
-              $(".output ul").html(outputHtml);
-            }
-          }),
-          service = geomap.find( ".osm" );
-
-      var geoms = {
-        one: { type: "Point", coordinates: [-71.05, 42.35] },
-        two: { type: "Point", coordinates: [-71.045, 42.355] },
-        three: { type: "Point", coordinates: [-71.055, 42.345] },
-        four: { type: "Point", coordinates: [-71.055, 42.355] },
-        five: { type: "Point", coordinates: [-71.045, 42.345] },
-        six: { type: "LineString", coordinates: [[-71.055, 42.355], [-71.045, 42.355]] },
-        seven: { type: "Polygon", coordinates: [[[-71.06, 42.3425], [-71.06, 42.3475], [-71.04, 42.3475], [-71.04, 42.3425], [-71.06, 42.3425]]] }
-      };
-
-      var i = 0;
-      for (var geomKey in geoms) {
-        if ( i % 2 ) {
-          geomap.geomap("append", geoms[geomKey]);
-        } else {
-          service.geomap("append", geoms[geomKey]);
-        }
-        i++;
-      }
-
-      $( "#findAll" ).click( function() {
-        var outputHtml = "",
-            result = geomap.geomap( "find", "*" );
-
-        $.each(result, function () {
-          outputHtml += ("<li>Found a " + this.type + " at " + this.coordinates + "</li>");
-        });
-
-        $(".output ul").html(outputHtml);
-      } );
-    });
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/geo-geometry.html b/libs/js/jquery-geo-1.0b2/docs/examples/geo-geometry.html
deleted file mode 100755 (executable)
index 0496cec..0000000
+++ /dev/null
@@ -1,344 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>geometry function examples</title>
-  <meta charset="utf-8">
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="Examples of geometry functions">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-    .calc
-    {
-      display: inline-block;
-      vertical-align: top;
-    }
-    td
-    {
-      max-width: 96px;
-      overflow: hidden;
-      text-overflow: ellipsis;
-    }
-    .red { color: #c00; }
-    .green { color: #0c0; }
-    .blue { color: #00c; }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/yv58r/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>
-        geometry functions</h1>
-      <p>This example appends a few Points, LineStrings, and Polygons. It then calculates some relationships and info about the shapes using the geometry functions in the $.geo namespace. The red box is the bbox of all red shapes.</p>
-      <div class="calc">
-        <table>
-          <tr>
-            <td></td>
-            <th>distance</th>
-          </tr>
-          <tr>
-            <th><span class="red">pt</span>, <span class="red">pt</span></th>
-            <td class="rpt-2-rpt-distance"></td>
-          </tr>
-          <tr>
-            <th><span class="red">pt</span>, <span class="red">line</span></th>
-            <td class="rpt-2-line-distance"></td>
-          </tr>
-          <tr>
-            <th><span class="red">pt</span>, <span class="red">poly</span></th>
-            <td class="rpt-2-poly-distance"></td>
-          </tr>
-          <tr>
-            <th><span class="red">line</span>, <span class="red">pt</span></th>
-            <td class="line-2-rpt-distance"></td>
-          </tr>
-          <tr>
-            <th><span class="red">line</span>, <span class="red">line</span></th>
-            <td class="line-2-line-distance"></td>
-          </tr>
-          <tr>
-            <th><span class="red">line</span>, <span class="red">poly</span></th>
-            <td class="line-2-poly-distance"></td>
-          </tr>
-          <tr>
-            <th><span class="red">poly</span>, <span class="red">pt</span></th>
-            <td class="poly-2-rpt-distance"></td>
-          </tr>
-          <tr>
-            <th><span class="red">poly</span>, <span class="red">line</span></th>
-            <td class="poly-2-line-distance"></td>
-          </tr>
-          <tr>
-            <th><span class="red">poly</span>, <span class="red">poly</span></th>
-            <td class="poly-2-poly-distance"></td>
-          </tr>
-        </table>
-      </div>
-      <div class="calc">
-        <table>
-          <tr>
-            <td></td>
-            <th>contains</th>
-          </tr>
-          <tr>
-            <th><span class="red">pt</span>, <span class="red">pt</span></th>
-            <td class="rpt-2-rpt-contains"></td>
-          </tr>
-          <tr>
-            <th><span class="red">pt</span>, <span class="red">line</span></th>
-            <td class="rpt-2-line-contains"></td>
-          </tr>
-          <tr>
-            <th><span class="red">pt</span>, <span class="red">poly</span></th>
-            <td class="rpt-2-poly-contains"></td>
-          </tr>
-          <tr>
-            <th><span class="red">line</span>, <span class="red">pt</span></th>
-            <td class="line-2-rpt-contains"></td>
-          </tr>
-          <tr>
-            <th><span class="red">line</span>, <span class="red">line</span></th>
-            <td class="line-2-line-contains"></td>
-          </tr>
-          <tr>
-            <th><span class="red">line</span>, <span class="red">poly</span></th>
-            <td class="line-2-poly-contains"></td>
-          </tr>
-          <tr>
-            <th><span class="red">poly</span>, <span class="red">pt</span></th>
-            <td class="poly-2-rpt-contains"></td>
-          </tr>
-          <tr>
-            <th><span class="red">poly</span>, <span class="red">line</span></th>
-            <td class="poly-2-line-contains"></td>
-          </tr>
-          <tr>
-            <th><span class="red">poly</span>, <span class="red">poly</span></th>
-            <td class="poly-2-poly-contains"></td>
-          </tr>
-        </table>
-      </div>
-      <div class="calc">
-        <table>
-          <tr>
-            <td></td>
-            <th>contains</th>
-          </tr>
-          <tr>
-            <th><span class="red">poly</span>, <span class="green">pt</span></th>
-            <td class="poly-2-gpt-contains"></td>
-          </tr>
-          <tr>
-            <th><span class="red">poly</span>, <span class="green">line</span></th>
-            <td class="poly-2-gline-contains"></td>
-          </tr>
-          <tr>
-            <th><span class="red">poly</span>, <span class="green">poly</span></th>
-            <td class="poly-2-gpoly-contains"></td>
-          </tr>
-          <tr>
-            <th><span class="red">poly</span>, <span class="blue">poly</span></th>
-            <td class="poly-2-bpoly-contains"></td>
-          </tr>
-        </table>
-      </div>
-      <div class="calc">
-        <table>
-          <tr>
-            <td></td>
-            <th>centroid</th>
-          </tr>
-          <tr>
-            <th><span class="red">pt</span></th>
-            <td class="rpt-centroid"></td>
-          </tr>
-          <tr>
-            <th><span class="red">line</span></th>
-            <td class="rline-centroid"></td>
-          </tr>
-          <tr>
-            <th><span class="red">poly</span></th>
-            <td class="rpoly-centroid"></td>
-          </tr>
-          <tr>
-            <th><span class="green">poly</span></th>
-            <td class="gpoly-centroid"></td>
-          </tr>
-          <tr>
-            <th><span class="blue">poly</span></th>
-            <td class="bpoly-centroid"></td>
-          </tr>
-        </table>
-      </div>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      // create a map
-      var map = $("#map").geomap({
-        center: [-71.0595678, 42.3604823],
-        zoom: 8
-      });
-
-      // bbox of all red shapes
-      var redBbox = null;
-
-      // append a red Point
-      var pt = {
-        type: "Point",
-        coordinates: [-71, 42]
-      };
-      map.geomap("append", pt);
-
-      // use the point's coordinate as our initial bbox (will be converted to bbox)
-      redBbox = $.geo.include( redBbox, pt.coordinates );
-
-      // append a red LineString
-      var line = {
-        type: "LineString",
-        coordinates: [
-          [-71.5, 42],
-          [-72, 41.5]
-        ]
-      };
-      map.geomap("append", line);
-
-      // include the line's bbox
-      redBbox = $.geo.include( redBbox, $.geo.bbox( line ) );
-
-      // append a red Polygon
-      var poly = {
-        type: "Polygon",
-        coordinates: [[
-          [-72.5, 41.7],
-          [-72.3, 41.3],
-          [-72.7, 41.3],
-          [-72.5, 41.7]
-        ]]
-      };
-      map.geomap("append", poly);
-
-      // include the polygon's bbox
-      redBbox = $.geo.include( redBbox, $.geo.bbox( poly ) );
-
-      // draw the bbox of red shapes
-      map.geomap( "append", $.geo.polygonize( redBbox ), {
-        fill: "transparent",
-        strokeWidth: 1
-      } );
-
-      // distance calculations between all red shapes
-      $(".rpt-2-rpt-distance").text($.geo.distance(pt, pt));
-      $(".rpt-2-line-distance").text($.geo.distance(pt, line));
-      $(".rpt-2-poly-distance").text($.geo.distance(pt, poly));
-
-      $(".line-2-rpt-distance").text($.geo.distance(line, pt));
-      $(".line-2-line-distance").text($.geo.distance(line, line));
-      $(".line-2-poly-distance").text($.geo.distance(line, poly));
-
-      $(".poly-2-rpt-distance").text($.geo.distance(poly, pt));
-      $(".poly-2-line-distance").text($.geo.distance(poly, line));
-      $(".poly-2-poly-distance").text($.geo.distance(poly, poly));
-      
-      // contains relationships between all red shapes
-      $(".rpt-2-rpt-contains").text($.geo.contains(pt, pt));
-      $(".rpt-2-line-contains").text($.geo.contains(pt, line));
-      $(".rpt-2-poly-contains").text($.geo.contains(pt, poly));
-
-      $(".line-2-rpt-contains").text($.geo.contains(line, pt));
-      $(".line-2-line-contains").text($.geo.contains(line, line));
-      $(".line-2-poly-contains").text($.geo.contains(line, poly));
-
-      $(".poly-2-rpt-contains").text($.geo.contains(poly, pt));
-      $(".poly-2-line-contains").text($.geo.contains(poly, line));
-      $(".poly-2-poly-contains").text($.geo.contains(poly, poly));
-
-      // append a green Point inside the red Polygon
-      var gpt = {
-        type: "Point",
-        coordinates: [-72.5, 41.6]
-      };
-      map.geomap("append", gpt, { color: "green" });
-
-      // append a green LineString inside the red Polygon
-      var gline = {
-        type: "LineString",
-        coordinates: [
-          [-72.55, 41.5],
-          [-72.45, 41.5]
-        ]
-      };
-      map.geomap("append", gline, { color: "green", strokeWidth: "3px" });
-
-      // append a green Polygon completely inside the red Polygon
-      var gpoly = {
-        type: "Polygon",
-        coordinates: [[
-          [-72.55, 41.45],
-          [-72.5, 41.35],
-          [-72.65, 41.35],
-          [-72.55, 41.45]
-        ]]
-      };
-      map.geomap("append", gpoly, { color: "green", strokeWidth: "3px" });
-
-      // contains relationships between the red polygon & some green shapes
-      // these all return true because the red polygon completely contains all of them
-      $(".poly-2-gpt-contains").text($.geo.contains(poly, gpt));
-      $(".poly-2-gline-contains").text($.geo.contains(poly, gline));
-      $(".poly-2-gpoly-contains").text($.geo.contains(poly, gpoly));
-
-      // append a blue Polygon partially inside the red Polygon
-      var bpoly = {
-        type: "Polygon",
-        coordinates: [[
-          [-72.35, 41.45],
-          [-72.25, 41.35],
-          [-72.45, 41.35],
-          [-72.35, 41.45]
-        ]]
-      };
-      map.geomap("append", bpoly, { color: "blue", strokeWidth: "3px" });
-
-      // contains relationships between the red polygon the blue polygon
-      // this returns false because the red polygon does not completely contain the blue one
-      $(".poly-2-bpoly-contains").text($.geo.contains(poly, bpoly));
-
-      // centroid calculations for all red shapes and the green and blue polygons
-      $(".rpt-centroid").text($.geo.centroid(pt).coordinates.join(", "));
-      $(".rline-centroid").text($.geo.centroid(line).coordinates.join(", "));
-      $(".rpoly-centroid").text($.geo.centroid(poly).coordinates.join(", "));
-      $(".gpoly-centroid").text($.geo.centroid(gpoly).coordinates.join(", "));
-      $(".bpoly-centroid").text($.geo.centroid(bpoly).coordinates.join(", "));
-
-    });  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/geometry.html b/libs/js/jquery-geo-1.0b2/docs/examples/geometry.html
deleted file mode 100755 (executable)
index 3d6ba94..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>proj test</title>
-  <meta name="description" content="Small test of $.geo.proj">
-  <meta name="author" content="Ryan Westphal">
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    label
-    {
-      display: block;
-      margin: .25em;
-    }
-    label span
-    {
-      display: inline-block;
-      font-weight: bold;
-      width: 8em;
-    }
-    #lblStatus
-    {
-      background: #ee4;
-      border-radius: .5em;
-      padding: .5em;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <a href="../" class="docLink">&lt; docs</a>
-    <h1>
-      proj test</h1>
-    <p>
-      This page has a couple basic interactive tests of the default $.geo.proj object.</p>
-    <h2>
-      direct conversion</h2>
-    <p>
-      Enter a lon/lat in the top inputs (remember, longitude is first here and throughout jQuery Geo but usually spoken second) &amp; click fromGeodetic to convert it to web mercator and store the new values in the bottom two inputs. Click toGeodetic to reverse.</p>
-    <label>
-      <span>longitude</span>
-      <input type="text" id="txtLon" value="-71.0597732" />
-    </label>
-    <label>
-      <span>latitude</span>
-      <input type="text" id="txtLat" value="42.3584308" />
-    </label>
-    <button type="button" id="cmdFrom">
-      \/ fromGeodetic</button>
-    <button type="button" id="cmdTo">
-      /\ toGeodetic</button>
-    <label>
-      <span>web mercator x</span>
-      <input type="text" id="txtX" value="-7910337.768509507" />
-    </label>
-    <label>
-      <span>web mercator y</span>
-      <input type="text" id="txtY" value="5214822.77694091" />
-    </label>
-    <h2>
-      osm nominatim</h2>
-    <p>
-      Enter a search term in the input and click search. If successful, geodetic &amp; web mercator coordinates are written to the inputs above. This example uses MapQuest's OSM API: <a href="http://open.mapquestapi.com/nominatim/">http://open.mapquestapi.com/nominatim</a>.</p>
-    <label>
-      <span>query</span>
-      <input type="text" id="txtQuery" value="Boston,MA" />
-    </label>
-    <button type="button" id="cmdSearch">search</button>
-    <h2>
-      status</h2>
-    <p>
-      Status result for any test.</p>
-    <div id="lblStatus">
-      ready</div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      $("#cmdFrom").click(function () {
-        try {
-          var projected = $.geo.proj.fromGeodetic([[parseFloat($("#txtLon").val()), parseFloat($("#txtLat").val())]]);
-          $("#txtX").val(projected[0][0])
-          $("#txtY").val(projected[0][1])
-          $("#lblStatus").html("done " + (new Date()).toString());
-        } catch (e) {
-          $("#lblStatus").html("error" + e.toString());
-        }
-      });
-      $("#cmdTo").click(function () {
-        try {
-          var geodetic = $.geo.proj.toGeodetic([[parseFloat($("#txtX").val()), parseFloat($("#txtY").val())]]);
-          $("#txtLon").val(geodetic[0][0])
-          $("#txtLat").val(geodetic[0][1])
-          $("#lblStatus").html("done " + (new Date()).toString());
-        } catch (e) {
-          $("#lblStatus").html("error" + e.toString());
-        }
-      });
-
-      $("#cmdSearch").click(function () {
-        try {
-          var query = "http://open.mapquestapi.com/nominatim/v1/search?format=json&q=" + $("#txtQuery").val();
-          $.ajax({
-            url: query,
-            dataType: "jsonp",
-            jsonp: "json_callback",
-            success: function (result) {
-              if (result && result.length > 0) {
-                $("#txtLon").val(result[0].lon)
-                $("#txtLat").val(result[0].lat)
-                var projected = $.geo.proj.fromGeodetic([[result[0].lon, result[0].lat]]);
-                $("#txtX").val(projected[0][0])
-                $("#txtY").val(projected[0][1])
-                $("#lblStatus").html("done " + (new Date()).toString());
-              } else {
-                $("#lblStatus").html("nothing found :(");
-              }
-            },
-            error: function (xhr) {
-              $("#lblStatus").html(xhr.statusText);
-            }
-          });
-        } catch (e) {
-          $("#lblStatus").html("error" + e.toString());
-        }
-      });
-    });  
-  </script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/hurricane.html b/libs/js/jquery-geo-1.0b2/docs/examples/hurricane.html
deleted file mode 100755 (executable)
index f41408d..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <head>
-    <meta charset="utf-8">
-
-    <title>hurricane</title>
-    <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-
-    <meta name="description" content="Displaying storm activity in the Atlantic">
-    <meta name="author" content="Ryan Westphal">
-    <link rel="stylesheet" type="text/css" href="css/style.css" />
-    <style type="text/css">
-      #map
-      {
-        position: fixed;
-        bottom: 0;
-        left: 0;
-        right: 0;
-        top: 0;
-      }
-      #popup
-      {
-        background: #fff;
-        border: solid 1px #444;
-        border-radius: 8px;
-        display: none;
-        padding: 4px;
-        position: absolute;
-        opacity: .6;
-        overflow: hidden;
-        width: auto;
-      }
-    </style>
-  </head>
-  <body>
-    <div id="hurricane">
-      <div id="map">
-        <div id="popup">
-        </div>
-      </div>
-      <div class="info">
-        <a href="../" class="docLink">&lt; docs</a>
-          <h1>Hurricane tracking</h1>
-          <p>Displaying a snapshot of storm data extracted from <a href="http://stormpulse.com">stormpulse.com</a></p>
-      </div>
-    </div>
-    <script id="tmplHurricane" type="text/x-jsrender">
-      <h2>{{:category}}</h2>
-      <table>
-        <tr><th>date</th><td>{{:date}}</td></tr>
-        <tr><th>accuracy</th><td>{{:accuracy}}/40</td></tr>
-        <tr><th>eye diameter</th><td>{{:eyeDiameter}}</td></tr>
-        <tr><th>direction</th><td>{{if direction}}{{:direction}}&deg{{/if}}</td></tr>
-        <tr><th>pressure</th><td>{{:pressure}}</td></tr>
-        <tr><th>wind radii</th><td>{{:windRadii}}</td></tr>
-        <tr><th>wind speed</th><td>{{:windSpeed}}</td></tr>
-        <tr><th>gusts</th><td>{{:gusts}}</td></tr>
-      </table>
-    </script>
-    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-    <script src="js/iecors.js"></script>
-    <script src="../jquery.geo-test.min.js"></script>
-    <script>
-      $(function () {
-        var map = $("#map").geomap({
-            center: [-76.6, 30.4],
-            zoom: 5,
-            mode: "find",
-            cursors: { find: "default" },
-            move: function (e, geo) {
-              $("#popup").hide().html("");
-              var tracks = map.geomap("find", geo, 4);
-
-              $.each(tracks, function() {
-                if (this.type == "Feature") {
-                  $( "#popup" ).append( $( "#tmplHurricane" ).render( this.properties ) );
-                  var popupLocation = map.geomap( "toPixel", geo.coordinates );
-                  $("#popup").css({
-                    left: popupLocation[ 0 ],
-                    top: popupLocation[ 1 ]
-                  }).css("display", "inline-block");
-                }
-              });
-            }
-          });
-
-        $.ajax({
-          url: "http://data.jquerygeo.com/hurricane.json",
-          dataType: "json",
-          success: function (result) {
-            var shapeStyle = {
-              color: "gray",
-              strokeWidth: "4px"
-            };
-
-            $.each(result.stormData.storms.tracks[0].track, function(i) {
-              var trackPoint = {
-                type: "Feature",
-                geometry: {
-                  type: "Point",
-                  coordinates: [
-                    parseFloat(this[16]),
-                    parseFloat(this[7])
-                  ]
-                },
-                properties: {
-                  eyeDiameter: this[0],
-                  windRadii: this[1],
-                  category: this[4],
-                  accuracy: this[10] || 0,
-                  direction: this[11],
-                  pressure: this[14],
-                  date: this[15],
-                  gusts: this[17],
-                  windSpeed: this[18]
-                }
-              };
-
-              if (trackPoint.properties.date != null) {
-                var dateStr = trackPoint.properties.date.toString(),
-                    year = dateStr.substr(0, 4),
-                    month = dateStr.substr(4, 2),
-                    day = dateStr.substr(6);
-                trackPoint.properties.date = year + "-" + month + "-" + day;
-              }
-
-              switch (trackPoint.properties.category) {
-                case "Tropical Storm":
-                  shapeStyle.color = "#eee";
-                  break;
-
-                case "Hurricane - Category 1":
-                  shapeStyle.color = "#ff8";
-                  break;
-
-                case "Hurricane - Category 2":
-                  shapeStyle.color = "orange";
-                  break;
-
-                case "Major Hurricane - Category 3":
-                  shapeStyle.color = "#f88";
-                  break;
-
-                default:
-                  shapeStyle.color = "gray";
-                  break;
-              }
-
-              if (trackPoint.properties.accuracy != null) {
-                var pos = trackPoint.geometry.coordinates,
-                    a = .2 + (40 - trackPoint.properties.accuracy)/40;
-
-                shapeStyle.strokeOpacity = trackPoint.properties.accuracy/40;
-
-                map.geomap("append", {
-                  type: "Polygon",
-                  coordinates: [[
-                    [pos[0] - a, pos[1] - a],
-                    [pos[0] - a, pos[1] + a],
-                    [pos[0] + a, pos[1] + a],
-                    [pos[0] + a, pos[1] - a],
-                    [pos[0] - a, pos[1] - a]
-                  ]]
-                }, $.extend({}, shapeStyle));
-              }
-
-              map.geomap("append", trackPoint, { color: "#444" });
-            });
-          },
-          error: function (xhr) {
-            alert("Sorry, we were unable to read the storm data.");
-          }
-        });
-      });  
-    </script>
-  </body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/image.html b/libs/js/jquery-geo-1.0b2/docs/examples/image.html
deleted file mode 100755 (executable)
index 3c53ed3..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>image example</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of image display">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: absolute;
-      top: 0;
-      right: 0;
-      bottom: 0;
-      left: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/x6Sq3/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>axisLayout: &quot;image&quot;</h1>
-      <p>Viewing a GigaPan image from the 2012 Olympic Games in London with jQuery Geo.</p>
-      <p>Inspired by: <a href="http://sportsillustrated.cnn.com/olympics/2012/gigapan/beach_volleyball/" target="_blank">Beach Volleyball GigaPan</a></p>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      // set $.geo.proj to null because images don't have a projection
-      $.geo.proj = null;
-
-      // create a map
-      var map = $("#map").geomap({
-        bbox: [ 0, 0, 768 * 64, 256 * 64 ],
-        zoom: 3,
-        zoomMin: 3,
-        axisLayout: "image",
-        services: [
-          {
-            type: "tiled",
-            src: function (view) {
-              if ( view.tile.column >= 0 && view.tile.row >= 0 ) {
-                var quadKey = tileToQuadkey(view.tile.column, view.tile.row, view.zoom),
-                    r = quadKey.substr( 0, 2 );
-
-                if ( quadKey.length > 5 ) {
-                  return "http://tile111.gigapan.org/gigapans0/111225/tiles.83f6152eea5140f76880a283c3479288//r" + r + "/" + quadKey.substr( 2, 3 ) + "/r" + quadKey + ".jpg";
-                } else {
-                  return "http://tile111.gigapan.org/gigapans0/111225/tiles.83f6152eea5140f76880a283c3479288//r" + r + "/r" + quadKey + ".jpg";
-                }
-              } else {
-                return "";
-              }
-            },
-            attr: '<span style="color: white; font-weight: bold;">&copy; David Bergman, Sports Illustrated</span>'
-          }
-        ],
-        tilingScheme: {
-          tileWidth: 256,
-          tileHeight: 256,
-          levels: 9,
-          basePixelSize: 256,
-          origin: [ 0, 0 ]
-        },
-      });
-
-      function tileToQuadkey(column, row, zoom) {
-        var quadKey = "",
-            digit,
-            mask;
-
-        for ( var i = zoom; i > 0; i-- ) {
-          digit = 0;
-          mask = 1 << (i - 1);
-          if ((column & mask) !== 0) {
-            digit++;
-          }
-          if ((row & mask) !== 0) {
-            digit += 2;
-          }
-          quadKey += digit;
-        }
-        return quadKey;
-      }
-    });  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/img/ajax-loader.gif b/libs/js/jquery-geo-1.0b2/docs/examples/img/ajax-loader.gif
deleted file mode 100755 (executable)
index e100531..0000000
Binary files a/libs/js/jquery-geo-1.0b2/docs/examples/img/ajax-loader.gif and /dev/null differ
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/img/boat.png b/libs/js/jquery-geo-1.0b2/docs/examples/img/boat.png
deleted file mode 100755 (executable)
index 0825189..0000000
Binary files a/libs/js/jquery-geo-1.0b2/docs/examples/img/boat.png and /dev/null differ
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/img/jsfiddle.png b/libs/js/jquery-geo-1.0b2/docs/examples/img/jsfiddle.png
deleted file mode 100755 (executable)
index 082c0ab..0000000
Binary files a/libs/js/jquery-geo-1.0b2/docs/examples/img/jsfiddle.png and /dev/null differ
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/img/marker.png b/libs/js/jquery-geo-1.0b2/docs/examples/img/marker.png
deleted file mode 100755 (executable)
index 95dc17e..0000000
Binary files a/libs/js/jquery-geo-1.0b2/docs/examples/img/marker.png and /dev/null differ
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/inset.html b/libs/js/jquery-geo-1.0b2/docs/examples/inset.html
deleted file mode 100755 (executable)
index 581f80e..0000000
+++ /dev/null
@@ -1,166 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>Inset map example</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="Shingled inset map bug">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-
-    /* these are from the 'inspired by' site */
-    .Panel
-    {
-      position: absolute;
-      background-color: White;
-      border: solid 1px #8080A8;
-      -webkit-border-radius: 4px;
-      -moz-border-radius: 4px;
-      border-radius: 4px;
-      -webkit-box-shadow: #909090 2px 2px 4px;
-      -moz-box-shadow: #909090 2px 2px 4px;
-      box-shadow: #909090 2px 2px 4px;
-    }
-
-    #pnlInsetContainer
-    {
-      right: 6px;
-      bottom: 6px;
-    }
-
-    #insetFrame
-    {
-      position: absolute;
-      left: 2px;
-      top: 2px;
-      right: 2px;
-      bottom: 2px;
-      border: solid 1px Silver;
-      overflow: hidden;
-    }
-
-    #insetMap
-    {
-      position: absolute;
-      left: 0px;
-      top: 0px;
-    }
-  </style>
-</head>
-<body>
-  <div>
-<div id="map">
-</div>
-<div id="pnlInsetContainer" class="Panel" style="width: 246px; height: 206px;">
-  <div id="insetFrame">
-    <div id="insetMap"></div>
-  </div>
-</div>
-<div class="info">
-  <div class="links">
-    <a href="../" class="docLink">&lt; docs</a>
-    <a href="http://jsfiddle.net/ryanttb/wHRKc/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-  </div>
-  <h1>Inset map example</h1>
-  <p class="not-mobile">Add an inset map to display the current bbox against a larger area. The inset map, in this example, is a pre-rendered image drawn a shingled service. You can click the inset map to recenter the main map.</p>
-  <a href="http://www.mapgeo.com/CumberlandME/">Inspired by MapGeo</a>
-</div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <!--<script src="../../js/excanvas.js"></script>
-  <script src="../../js/jsrender.js"></script>
-  <script src="../../js/jquery.mousewheel.js"></script>
-  <script src="../../js/jquery.ui.widget.js"></script>
-  <script src="../../js/jquery.geo.core.js"></script>
-  <script src="../../js/jquery.geo.geographics.js"></script>
-  <script src="../../js/jquery.geo.geomap.js"></script>
-  <script src="../../js/jquery.geo.tiled.js"></script>
-  <script src="../../js/jquery.geo.shingled.js"></script>-->
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $( function ( ) {
-      // create a map, use some tiles from S3
-      var map = $( "#map" ).geomap( {
-        services: [
-          {
-            type: "tiled",
-            src: "http://s3.amazonaws.com/MapGeo_ME/Cumberland/Basemap/{{:zoom}}/{{:tile.row}}/{{:tile.column}}"
-          }
-        ],
-        bbox: [-70.34, 43.73, -70.14, 43.84], //< set an initial bbox to Cumberland, ME
-        zoom: 13, //< modify the bbox to force zoom level 13
-        zoomMin: 12, //< the tile set is only rendered from zoom level 12 on
-        bboxchange: function( e, geo ) {
-          // when the bbox changes, update the shape on the inset
-          drawInsetBox(geo.bbox);
-        }
-      } );
-
-      // create an inset map, it's static so user's can't mess with it
-      var inset = $( "#insetMap" ).geomap( {
-        tilingScheme: null, //< set to null because there are no tiled service, i.e., we're using bboxMax
-        bboxMax: [-70.3444019030059, 43.730566740521596, -70.14623355132912, 43.849775819303616], //< required when you set tilingScheme to null, needs to precisely match our static image's bbox
-        mode: "static",
-        services: [
-          {
-            id: "inset",
-            type: "shingled", //< we can use shingled services to display a single, unchanging image
-            src: "http://www.mapgeo.com/CumberlandME/Custom/Images/Inset.png" //< our src is a single, static image
-          }
-        ],
-        shapeStyle: {
-          color: "#f00"
-        }
-      });
-
-      // since mode is static, we can trap user events on the inset map div itself
-      $( "#insetMap" ).click( function( e ) {
-        // allow users to recenter by clicking the inset map
-
-        // we don't get the geo argument (this is a normal jQuery event),
-        // but we can ask jQuery Geo for it, we have to account for map placement
-        var offset = $( "#insetMap" ).offset( ),
-            geo = inset.geomap( "toMap", [
-              e.pageX - offset.left,
-              e.pageY - offset.top
-            ] );
-
-        // recenter the map
-        map.geomap( "option", "center", geo );
-
-        // draw the new bbox
-        // (we won't be getting the bboxchange event because we changed it via code)
-        drawInsetBox( map.geomap( "option", "bbox" ) );
-      } );
-
-      function drawInsetBox(extent) {
-        // clear and redraw the main map's bbox onto the inset map
-        inset.geomap( "empty" ).geomap( "append", $.geo.polygonize( extent ) );
-      }
-
-      // geomap won't trigger the bboxchange event during init,
-      // do it once to start things off
-      drawInsetBox( map.geomap( "option", "bbox" ) );
-    } );  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/insetmap.html b/libs/js/jquery-geo-1.0b2/docs/examples/insetmap.html
deleted file mode 100755 (executable)
index 97b2b99..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>inset map example</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of inset map">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-
-    #insetmap
-    {
-      border: solid 2px #444;
-      position: fixed;
-      right: 8px;
-      bottom: 8px;
-      width: 20%;
-      height: 20%;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-      <div id="insetmap">
-      </div>
-    </div>
-
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/aH7kG/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>inset map</h1>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $( function ( ) {
-      // create a map
-      var map = $( "#map" ).geomap( {
-        center: [ -71.0595678, 42.3604823 ],
-        zoom: 9,
-        bboxchange: function( e, geo ) {
-          // whenever the bbox changes, update the inset map's shape
-          insetmap.geomap( "empty" );
-          insetmap.geomap( "append", bboxToPolygon( geo.bbox ) );
-        }
-      } );
-
-      // create a smaller map
-      // stop interaction (static mode) and add the default service but
-      // without an attr property, it's on the main map
-      var insetmap = $( "#insetmap" ).geomap( {
-        center: [ -71.0595678, 42.3604823 ],
-        zoom: 6,
-        mode: "static",
-        services: [ {
-          type: "tiled",
-          src: "http://tile.openstreetmap.org/{{:zoom}}/{{:tile.column}}/{{:tile.row}}.png"
-        } ]
-      } );
-
-      // append a shape to the inset map to show the big map's bbox
-      insetmap.geomap( "append", bboxToPolygon( map.geomap( "option", "bbox" ) ) );
-
-      function bboxToPolygon( bbox ) {
-        // a quick function to convert a bbox into a true GeoJSON Polygon
-        return {
-          type: "Polygon",
-          coordinates: [ [
-            [ bbox[ 0 ], bbox[ 1 ] ],
-            [ bbox[ 0 ], bbox[ 3 ] ],
-            [ bbox[ 2 ], bbox[ 3 ] ],
-            [ bbox[ 2 ], bbox[ 1 ] ],
-            [ bbox[ 0 ], bbox[ 1 ] ]
-          ] ]
-        }
-      }
-    } );  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/isGeodetic.html b/libs/js/jquery-geo-1.0b2/docs/examples/isGeodetic.html
deleted file mode 100755 (executable)
index 2f649ef..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>TEMPLATE example</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of TEMPLATE">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/==JSFIDDLE==/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>Is Geodetic?</h1>
-      <table class="tests">
-        <tr><th>[-71.05, 42.36]</th><td></td></tr> <!-- position / Point -->
-        <tr><th>[-8102018.97, 5011809.33]</th><td></td></tr>
-        <tr><th>[-72.78, 40.99, -69.33, 43.69]</th><td></td></tr> <!-- bbox -->
-        <tr><th>[-8102018.97, 5011809.33, -7718610.83, 5418454.32]</th><td></td></tr>
-        <tr><th>[[-72.78, 43.32], [-71.33, 42.43]]</th><td></td></tr> <!-- LineString / MultiPoint -->
-        <tr><th>[[-8102018.97, 5011809.33], [-7718610.83, 5418454.32]]</th><td></td></tr>
-        <tr><th>[[[-72.78, 43.32], [-71.33, 42.43], [-70.12, 43.16], [-72.78, 43.32]]]</th><td></td></tr> <!-- Polygon / MultiLineString-->
-        <tr><th>[[[-8102018.97, 5011809.33], [-7718610.83, 5418454.32], [-8102018.83, 5418454.32], [-8102018.97, 5011809.33]]]</th><td></td></tr>
-        <tr><th>[[[[-72.78, 43.32], [-71.33, 42.43], [-70.12, 43.16], [-72.78, 43.32]]]]</th><td></td></tr> <!-- MultiPolygon -->
-        <tr><th>[[[[-8102018.97, 5011809.33], [-7718610.83, 5418454.32], [-8102018.83, 5418454.32], [-8102018.97, 5011809.33]]]]</th><td></td></tr>
-      </table>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      // create a map
-      var map = $("#map").geomap({
-        center: [-71.0595678, 42.3604823],
-        zoom: 8
-      });
-
-      $( ".tests tr" ).each( function( ) {
-        var testJson = $( this ).find( "th" ).text(),
-            testVal = testJson != "" ? JSON.parse( testJson ) : "",
-            isGeodetic = $.geo._isGeodetic( testVal );
-
-
-
-        $( this ).find( "td" ).text( isGeodetic ? "geodetic" : "projected" );
-
-      } );
-    });  
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/jqm.html b/libs/js/jquery-geo-1.0b2/docs/examples/jqm.html
deleted file mode 100755 (executable)
index 0d7d3de..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>TEMPLATE example</title>
-  <meta name="HandheldFriendly" content="True">
-  <meta name="MobileOptimized" content="320">
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of TEMPLATE">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #mapTab
-    {
-      min-height: 99%;
-    }
-
-    #map
-    {
-      position: absolute;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div id="app" data-role="page">
-    <div data-role="header">
-      <h1><span data-text="DisplayName">Amherst</span></h1>
-    </div>
-
-    <div data-role="content">
-      <div class="have-mapTabs">
-        <p>Which map would you like?</p>
-        <ul data-role="listview" data-inset="true">
-          <li><a href="#mapTab" data-map-tab="{&quot;MapTabID&quot;:&quot;ParcelMap&quot;,&quot;DisplayName&quot;:&quot;Parcel Map&quot;}">Parcel Map</a></li>
-          <li><a href="#mapTab" data-map-tab="{&quot;MapTabID&quot;:&quot;ZoningMap&quot;,&quot;DisplayName&quot;:&quot;Zoning Map&quot;}">Zoning Map</a></li>
-        </ul>
-      </div>
-    </div>
-  </div>
-  
-  <div id="mapTab" data-role="page" data-fullscreen="true">
-    <div data-role="header" data-position="fixed">
-      <h1><span data-text="DisplayName">Parcel App</span></h1>
-      <a href="#app" data-role="button" data-icon="arrow-d" data-iconpos="notext" data-transition="slidedown" class="mapTab-switch ui-btn-right">Select Tab</a>
-    </div>
-
-    <div data-role="content">
-      <div id="map">
-      </div>
-    </div>
-
-
-    <div data-role="footer" data-position="fixed">
-      <p>&nbsp;</p>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-  (function() {
-    var mapTab = window.sessionStorage.getItem("mapTab") || null,
-        map = null,
-        bbox = window.sessionStorage.getItem("bbox") || null;
-
-    if (mapTab) {
-      mapTab = JSON.parse(mapTab);
-    }
-
-    $("#app").delegate("a", "click", function() {
-      mapTab = $(this).data("mapTab");
-      window.sessionStorage.setItem("mapTab", JSON.stringify(mapTab));
-    });
-
-    $("#mapTab").bind("pageinit", function() {
-      $.mobile.fixedToolbars.setTouchToggleEnabled(false);
-    });
-
-    $("#mapTab").bind("pagebeforeshow", function() {
-      $("#mapTab [data-text='DisplayName']").text(mapTab.DisplayName);
-      $("title").text(mapTab.DisplayName);
-    });
-
-    $( document ).bind( "pagechange", function(e, mobile) {
-      if ( $(mobile.toPage).is("#mapTab") ) {
-        $.geo.proj = null;
-
-        // create a map
-        if ( map == null ) {
-          map = $("#map").geomap({
-            tilingScheme: null,
-            bboxMax: [ 372440,2935595,396368,2985633 ],
-            bbox: bbox ? JSON.parse(bbox) : [ 372440,2935595,396368,2985633 ],
-            services: [{
-              id: "gpv",
-              type: "shingled",
-              src: function(view) {
-                var mapState = {
-                      Application: "ParcelApp",
-                      MapTab: mapTab.MapTabID,
-                      Extent: {
-                        bbox: view.bbox
-                      }
-                    };
-
-                return "http://alpha.appgeo.com/GPV/Services/MapImage.ashx?m=GetMapImage&state=" + JSON.stringify(mapState) + "&width=" + view.width + "&height=" + view.height;
-              }
-            }],
-            bboxchange: function(e, geo) {
-              bbox = "[" + geo.bbox.toString() + "]";
-              window.sessionStorage.setItem("bbox", bbox);
-            }
-          });
-        } else {
-          map.geomap( "resize" );
-        }
-      }
-    });  
-
-    /*
-    $("#mapTab").bind("pagebeforehide", function() {
-      if (map) {
-        map.geomap("destroy");
-        map = null;
-      }
-    });
-    */
-  })();
-  </script>
-
-  <script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/js/all-shingled.js b/libs/js/jquery-geo-1.0b2/docs/examples/js/all-shingled.js
deleted file mode 100755 (executable)
index 164bc18..0000000
+++ /dev/null
@@ -1,269 +0,0 @@
-$(function () {
-  // Firefox likes to cache form values during refresh
-  $( "form" )[ 0 ].reset( );
-
-  $( "form" ).submit( function( ) {
-    // also, we don't want the form to actually submit
-    return false;
-  } );
-
-  // set proj to null because we don't have the code for this projection 
-  // and are working entirely in map units
-
-  $.geo.proj = null;
-
-  // define two shingled services
-  var services = [
-    // define a basemap service
-    {
-      id: "massgis_basemap",
-      type: "shingled",
-      src: "http://giswebservices.massgis.state.ma.us/geoserver/wms?LAYERS=massgis_basemap&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&SRS=EPSG%3A26986&BBOX={{:bbox}}&WIDTH={{:width}}&HEIGHT={{:height}}",
-      attr: "&copy; 2011 Commonwealth of Massachusetts"
-    },
-
-    // define a second service as a layer on top of the basemap
-    // we use this service as the target when "target" is set to service in this demo
-    {
-      id: "massgis_hydrography",
-      type: "shingled",
-      src: "http://giswebservices.massgis.state.ma.us/geoserver/wms?LAYERS=massgis%3AGISDATA.MAJPOND_POLY,massgis%3AGISDATA.MAJSTRM_ARC&TRANSPARENT=true&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&SRS=EPSG%3A26986&BBOX={{:bbox}}&WIDTH={{:width}}&HEIGHT={{:height}}",
-      style: {
-        opacity: .8
-      }
-    }
-  ];
-
-
-  // create a map without a tilingScheme & with the two shingled services
-  var map = $( "#map" ).geomap( {
-    // add a cursor for our custom mode: remove
-    cursors: { remove: "crosshair" },
-
-    // use the services array defined above
-    services: services,
-
-    // you must set bboxMax for shingled services for the zoom property to mean anything
-    bboxMax: [ 31789.1658, 790194.4183, 337250.8970, 961865.1338 ],
-
-    // shingled services do not have a tilingScheme
-    tilingScheme: null,
-
-    // center & zoom values that fit MassGIS's projection
-    center: [ 235670.21967, 900771.290247 ],
-    zoom: 4,
-
-    // the Charles River is too large after zoom level 8
-    zoomMax: 8,
-
-    loadstart: function( ) {
-      // we can show an indicator when the map widget is loading images via the loadstart event
-      $("#indicator").show( );
-    },
-
-    loadend: function( ) {
-      // we can hide the indicator when the map widget is done loading images via the loadend event
-      $("#indicator").hide( );
-    },
-
-    bboxchange: function( e, geo ) {
-      // when the bbox changes, update the info section with new option values
-      updateInfo( );
-    },
-
-    shape: function( e, geo ) {
-      // both the measure and draw/drag modes trigger the shape event
-      // but we only want to append for the draw & drag
-      if ( map.geomap( "option", "mode" ).substr( 0, 3 ) == "dra" ) {
-        // when the user draws or drags a shape, show it on the map
-        // the shape event triggers when the user finishes drawing a shape
-        // the geo argument is a GeoJSON object representing the shape
-
-        // for this example, we'll append it to the map forcing an
-        // individual style that matches the current drawStyle
-
-        // make a copy of the current drawStyle
-        var drawStyle = $.extend( { }, map.geomap( "option", "drawStyle" ) );
-
-        // grab the label (if any) from the input
-        var label = $( "#shapeLabels input" ).val( );
-
-        // append the shape using that style
-        // however, depending on which target is checked, we will append the shape to either the map widget itself or a specific map service
-        if ( $( "#clickTargetWidget" ).is( ":checked" ) ) {
-          // if the map is our target, just append the shape to the map
-          // if there's a label entered, used it
-          map.geomap( "append", geo, drawStyle, label );
-        } else {
-          // otherwise, grab a reference to a service
-          // ( by id in this case ) and append the shape to that
-          // the value of the remaining radio buttons matches the id of a service
-          // if there's a label entered, used it
-          var serviceToAppend = $( "#" + $( "input[name='clickTarget']:checked" ).val( ) );
-
-          $( serviceToAppend ).geomap( "append", geo, drawStyle, label );
-
-          // also note, that the label is controlled seperately from the shape, by CSS, rather than by jQuery Geo shapeStyle objects
-          // if you look at the CSS, you will notice:
-          //
-          // #massgis_hydrography { color: blue; }
-          //
-          // which makes all labels on the hydro service blue text
-        }
-      }
-    },
-
-    click: function( e, geo ) {
-      if ( map.geomap( "option", "mode" ) == "remove" ) {
-        // when the user clicks the map while in our custom mode, remove,
-        // we will search for shapes on either the map widget itself
-        // ( and, by design, all map services) or a single, specific map service
-
-        // we'll use a nice, fat 5px radius for the searches here, that's what the (, 5) is below
-
-        // however, in this demo, we remove any shapes found from either the map or service
-
-        // if the map is our target, grab the map reference
-        // otherwise, grab a reference to a service, in this case, by id
-        var target = $( "#clickTargetWidget" ).is( ":checked" ) ? map : $( "#" + $( "input[name='clickTarget']:checked" ).val( ) );
-
-        // by design, calling find on the map itself returns all shapes at that location
-        // even if they have been appended to a service
-        // when target is the service, find is limited to shapes that have been appended there
-        var shapes = target.geomap( "find", geo, 3 );
-
-        // even though we potentially found service-level shapes with the find method,
-        // calling remove on the map does not remove from all services
-        // however, here we're calling remove on the same target where we found the shapes
-        // (note: remove can take an array of shapes, which the find method returns)
-        target.geomap( "remove", shapes );
-      }
-    }
-  } );
-
-  // jQuery UI for pretty button
-  // (except iOS 5, for some reason)
-  // (also, don't use user agent sniffing like this, will have to figure out the issue)
-  if (!navigator.userAgent.match(/OS [4-5](_\d)+ like Mac OS X/i)) {
-    $( "button, #togglePannable" ).button( );
-  }
-  $( ".modes, .scrollOptions, .clickTargets, .toggleTargets" ).buttonset( );
-
-  $( "#toggle-info" ).click( function( ) {
-    // show or hide some map info such as bbox, center and zoom
-    $( "#mapInfo" ).toggle( );
-  } );
-
-  $( "#togglePannable" ).click( function( ) {
-    // change the pannable option to allow users to pan or not pan your map
-    map.geomap( "option", "pannable", $( this ).is( ":checked" ) );
-  } );
-
-  $( ".scrollOptions input" ).click( function( ) {
-    // set the map's scroll option based on value of the input clicked
-    // currently, default and scroll are the same; the only other option is off
-    var scrollValue = $( this ).val( );
-    map.geomap( "option", "scroll", scrollValue );
-
-  } );
-
-  $( "#change-mode").click( function( ) {
-    // show or hide the mode options
-    $( "#modeOptions" ).toggle( );
-  } );
-
-  $( ".modes input" ).click( function () {
-    // set the map's mode option based on value of the input clicked
-    var modeValue = $( this ).val( );
-    map.geomap( "option", "mode", modeValue );
-
-    // if mode is one of the draw/drag modes (or remove), show the target section, otherwise hide it
-    $( "#clickTarget" ).toggle( modeValue.substr( 0, 3 ) === "dra" || modeValue === "remove" );
-
-    // if mode is one of the draw/drag modes,
-    // show the label inputs & shape style as well
-    $( "#shapeLabels, #drawStyle" ).toggle( modeValue.substr( 0, 3 ) === "dra" );
-
-    // also display the current mode on the button
-    $( "#change-mode .ui-button-text" ).text( modeValue );
-
-    // hide the mode options
-    $( "#modeOptions" ).hide( );
-  } );
-
-    $( "#drawStyle input" ).change( function( ) {
-      // when an input of the drawStyle area changes,
-      // immediately set the property of geomap's drawStyle option
-
-      // keep in mind that the three point-only styles (width, height & borderRadius)
-      // cannot be seen because with drawPoint, the shape event triggers immediately
-      // without drawing a shape
-      // this example, however, does use them when appending the shape after a click
-
-      // first, we can grab a jQuery reference to the input that changed
-      var $this = $( this );
-
-      // next, we can create an object that represents this change
-      // this example doesn't, but you can set more than one property
-      // on geomap's drawStyle option at a time
-      var styleOption = { };
-      styleOption[ $this.attr( "name" ) ] = $this.val();
-
-      map.geomap( "option", "drawStyle", styleOption );
-    } );
-
-
-  $( ".toggleTargets input" ).click( function( ) {
-    // when a service is toggled, we tell the geomap widget to toggle it
-    // the value of each checkbox input equals the id of a service
-    var checkboxClicked = $( this );
-    var serviceToToggle = $( "#" + checkboxClicked.val( ) );
-
-    // toggle the service, shapes on the service will also be toggled
-    serviceToToggle.geomap( "toggle" );
-  } );
-
-  $( "#zoomOut" ).button( "option", {
-    // just icons for the zoom buttons
-    icons: { primary: "ui-icon-minus" },
-    text: false
-  } ).click( function( ) {
-    // use the zoom method to zoom out
-    map.geomap( "zoom", -1 );
-  } );
-
-  $( "#zoomIn" ).button( "option", {
-    // just icons for the zoom buttons
-    icons: { primary: "ui-icon-plus" },
-    text: false
-  } ).click( function( ) {
-    // also use the zoom method to zoom in
-    map.geomap( "zoom", +1 );
-  } );
-
-  // update the info section with initial option values
-  updateInfo( );
-
-  function updateInfo( ) {
-    // update the info section with option values
-    $( "#mapInfo td" ).each( function( ) {
-      // a reference to the current option td element
-      var optionCell = $( this );
-
-      // since each td has a data-option attribute,
-      // jQuery can extract the option value via the data function
-      var optionValue = map.geomap( "option", optionCell.data( "option" ) );
-
-      if ( $.isArray( optionValue ) ) {
-        // display array values a little nicer
-        $.each( optionValue, function( i ) {
-          optionValue[ i ] = this.toFixed( 2 );
-        } );
-        optionCell.text( "[ " + optionValue.join( ", " ) + " ]" );
-      } else {
-        optionCell.text( optionValue );
-      }
-    } );
-  }
-});  
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/js/all-tiled.js b/libs/js/jquery-geo-1.0b2/docs/examples/js/all-tiled.js
deleted file mode 100755 (executable)
index acb31e5..0000000
+++ /dev/null
@@ -1,273 +0,0 @@
-$(function () {
-  // Firefox likes to cache form values during refresh
-  $( "form" )[ 0 ].reset( );
-
-  $( "form" ).submit( function( ) {
-    // also, we don't want the form to actually submit
-    return false;
-  } );
-
-  // define two tiled services
-  var services = [
-    // a free basemap tile set from MapQuest
-    {
-      id: "mapquest-open",
-      type: "tiled",
-      src: function( view ) {
-        return "http://otile" + ((view.index % 4) + 1) + ".mqcdn.com/tiles/1.0.0/osm/" + view.zoom + "/" + view.tile.column + "/" + view.tile.row + ".png";
-      },
-      attr: 'Tiles Courtesy of <a href="http://www.mapquest.com/" target="_blank">MapQuest</a> <img src="http://developer.mapquest.com/content/osm/mq_logo.png">'
-    },
-
-    // define a second service as a layer on top of the basemap
-    // we use this service as the target when "target" is set to service in this demo
-    {
-      id: "broadband-speedtest",
-      type: "tiled",
-      src: "http://www.broadbandmap.gov/StamenTiles/speedtest/speedtest/download/{{:zoom}}/{{:tile.column}}/{{:tile.row}}.png",
-      attr: "Speed Test data maintained by the NTIA, in collaboration with the FCC"
-    }
-  ];
-
-  // create a map with a tilingScheme & with the two tiled services
-  var map = $( "#map" ).geomap( {
-    // add a cursor for our custom mode: remove
-    cursors: { remove: "crosshair" },
-
-    // use the services array defined above
-    services: services,
-
-    // these tiled services are in jQuery Geo's default tilingScheme, web mercator
-    // we don't need to change it but will write it here in comments, for this demo
-    /*
-    tilingScheme: {
-      tileWidth: 256,
-      tileHeight: 256,
-      levels: 18,
-      basePixelSize: 156543.03392799936,
-      pixelSizes: null,
-      origin: [ -20037508.342787, 20037508.342787 ]
-    },
-    */
-
-    // center & zoom values that default to showing the contenental United States of America
-    center: [ -89.34, 38.84 ],
-    zoom: 5,
-
-    // the speedtest service only supports zooming out to level 3, lock the map to that min zoom
-    zoomMin: 3,
-
-    // the speedtest service only zooming in to level 10, lock the map to that max zoom
-    zoomMax: 10,
-
-    loadstart: function( ) {
-      // we can show an indicator when the map widget is loading images via the loadstart event
-      $("#indicator").show( );
-    },
-
-    loadend: function( ) {
-      // we can hide the indicator when the map widget is done loading images via the loadend event
-      $("#indicator").hide( );
-    },
-
-    bboxchange: function( e, geo ) {
-      // when the bbox changes, update the info section with new option values
-      updateInfo( );
-    },
-
-    shape: function( e, geo ) {
-      // both the measure and draw/drag modes trigger the shape event
-      // but we only want to append for the draw & drag
-      if ( map.geomap( "option", "mode" ).substr( 0, 3 ) == "dra" ) {
-        // when the user draws or drags a shape, show it on the map
-        // the shape event triggers when the user finishes drawing a shape
-        // the geo argument is a GeoJSON object representing the shape
-
-        // for this example, we'll append it to the map forcing an
-        // individual style that matches the current drawStyle
-
-        // make a copy of the current drawStyle
-        var drawStyle = $.extend( { }, map.geomap( "option", "drawStyle" ) );
-
-        // grab the label (if any) from the input
-        var label = $( "#shapeLabels input" ).val( );
-
-        // append the shape using that style
-        // however, depending on which target is checked, we will append the shape to either the map widget itself or a specific map service
-        if ( $( "#clickTargetWidget" ).is( ":checked" ) ) {
-          // if the map is our target, just append the shape to the map
-          // if there's a label entered, used it
-          map.geomap( "append", geo, drawStyle, label );
-        } else {
-          // otherwise, grab a reference to a service
-          // ( by id in this case ) and append the shape to that
-          // the value of the remaining radio buttons matches the id of a service
-          // if there's a label entered, used it
-          var serviceToAppend = $( "#" + $( "input[name='clickTarget']:checked" ).val( ) );
-
-          $( serviceToAppend ).geomap( "append", geo, drawStyle, label );
-
-          // also note, that the label is controlled seperately from the shape, by CSS, rather than by jQuery Geo shapeStyle objects
-          // if you look at the CSS, you will notice:
-          //
-          // #broadband-speedtest { color: purple; font-weight: bold; }
-          //
-          // which makes all labels on the speedtest service blue text
-        }
-      }
-    },
-
-    click: function( e, geo ) {
-      if ( map.geomap( "option", "mode" ) == "remove" ) {
-        // when the user clicks the map while in our custom mode, remove,
-        // we will search for shapes on either the map widget itself
-        // (and, by design, all map services) or a single, specific map service
-
-        // we'll use a nice, fat 5px radius for the searches here, that's what the (, 5) is below
-
-        // however, in this demo, we remove any shapes found from either the map or service
-
-        // if the map is our target, grab the map reference
-        // otherwise, grab a reference to a service, in this case, by id
-        var target = $( "#clickTargetWidget" ).is( ":checked" ) ? map : $( "#" + $( "input[name='clickTarget']:checked" ).val( ) );
-
-        // by design, calling find on the map itself returns all shapes at that location
-        // even if they have been appended to a service
-        // when target is the service, find is limited to shapes that have been appended there
-        var shapes = target.geomap( "find", geo, 3 );
-
-        // even though we potentially found service-level shapes with the find method,
-        // calling remove on the map does not remove from all services
-        // however, here we're calling remove on the same target where we found the shapes
-        // (note: remove can take an array of shapes, which the find method returns)
-        target.geomap( "remove", shapes );
-      }
-    }
-  } );
-
-  // jQuery UI for pretty button
-  // (except iOS 5, for some reason)
-  // (also, don't use user agent sniffing like this, will have to figure out the issue)
-  if (!navigator.userAgent.match(/OS [4-5](_\d)+ like Mac OS X/i)) {
-    $( "button, #togglePannable" ).button( );
-  }
-  $( ".modes, .scrollOptions, .clickTargets, .toggleTargets" ).buttonset( );
-
-  $( "#toggle-info" ).click( function( ) {
-    // show or hide some map info such as bbox, center and zoom
-    $( "#mapInfo" ).toggle( );
-  } );
-
-  $( "#togglePannable" ).click( function( ) {
-    // change the pannable option to allow users to pan or not pan your map
-    map.geomap( "option", "pannable", $( this ).is( ":checked" ) );
-  } );
-
-  $( ".scrollOptions input" ).click( function( ) {
-    // set the map's scroll option based on value of the input clicked
-    // currently, default and scroll are the same; the only other option is off
-    var scrollValue = $( this ).val( );
-    map.geomap( "option", "scroll", scrollValue );
-
-  } );
-
-  $( "#change-mode").click( function( ) {
-    // show or hide the mode options
-    $( "#modeOptions" ).toggle( );
-  } );
-
-  $( ".modes input" ).click( function () {
-    // set the map's mode option based on value of the input clicked
-    var modeValue = $( this ).val( );
-    map.geomap( "option", "mode", modeValue );
-
-    // if mode is one of the draw/drag modes (or remove), show the target section, otherwise hide it
-    $( "#clickTarget" ).toggle( modeValue.substr( 0, 3 ) === "dra" || modeValue === "remove" );
-
-    // if mode is one of the draw/drag modes,
-    // show the label inputs & shape style as well
-    $( "#shapeLabels, #drawStyle" ).toggle( modeValue.substr( 0, 3 ) === "dra" );
-
-    // also display the current mode on the button
-    $( "#change-mode .ui-button-text" ).text( modeValue );
-
-    // hide the mode options
-    $( "#modeOptions" ).hide( );
-  } );
-
-    $( "#drawStyle input" ).change( function( ) {
-      // when an input of the drawStyle area changes,
-      // immediately set the property of geomap's drawStyle option
-
-      // keep in mind that the three point-only styles (width, height & borderRadius)
-      // cannot be seen because with drawPoint, the shape event triggers immediately
-      // without drawing a shape
-      // this example, however, does use them when appending the shape after a click
-
-      // first, we can grab a jQuery reference to the input that changed
-      var $this = $( this );
-
-      // next, we can create an object that represents this change
-      // this example doesn't, but you can set more than one property
-      // on geomap's drawStyle option at a time
-      var styleOption = { };
-      styleOption[ $this.attr( "name" ) ] = $this.val();
-
-      map.geomap( "option", "drawStyle", styleOption );
-    } );
-
-
-  $( ".toggleTargets input" ).click( function( ) {
-    // when a service is toggled, we tell the geomap widget to toggle it
-    // the value of each checkbox input equals the id of a service
-    var checkboxClicked = $( this );
-    var serviceToToggle = $( "#" + checkboxClicked.val( ) );
-
-    // toggle the service, shapes on the service will also be toggled
-    serviceToToggle.geomap( "toggle" );
-  } );
-
-  $( "#zoomOut" ).button( "option", {
-    // just icons for the zoom buttons
-    icons: { primary: "ui-icon-minus" },
-    text: false
-  } ).click( function( ) {
-    // use the zoom method to zoom out
-    map.geomap( "zoom", -1 );
-  } );
-
-  $( "#zoomIn" ).button( "option", {
-    // just icons for the zoom buttons
-    icons: { primary: "ui-icon-plus" },
-    text: false
-  } ).click( function( ) {
-    // also use the zoom method to zoom in
-    map.geomap( "zoom", +1 );
-  } );
-
-  // update the info section with initial option values
-  updateInfo( );
-
-  function updateInfo( ) {
-    // update the info section with option values
-    $( "#mapInfo td" ).each( function( ) {
-      // a reference to the current option td element
-      var optionCell = $( this );
-
-      // since each td has a data-option attribute,
-      // jQuery can extract the option value via the data function
-      var optionValue = map.geomap( "option", optionCell.data( "option" ) );
-
-      if ( $.isArray( optionValue ) ) {
-        // display array values a little nicer
-        $.each( optionValue, function( i ) {
-          optionValue[ i ] = this.toFixed( 2 );
-        } );
-        optionCell.text( "[ " + optionValue.join( ", " ) + " ]" );
-      } else {
-        optionCell.text( optionValue );
-      }
-    } );
-  }
-});  
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/js/iecors.js b/libs/js/jquery-geo-1.0b2/docs/examples/js/iecors.js
deleted file mode 100755 (executable)
index 3dce2a4..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-$.ajaxTransport( function( options, originalOptions, jqXHR ) {
-  var xdr;
-
-  return {
-    send: function( _, completeCallback ) {
-      xdr = new XDomainRequest();
-
-      xdr.onload = function() {
-        var responses = {
-          text: xdr.responseText
-        };
-
-        // force status code to 200, XDomainRequest rejects all other successful status codes
-        if (xdr.contentType.match(/\/xml/)){
-          // there is no responseXML in XDomainRequest, so we have to create it manually
-          var dom = new ActiveXObject('Microsoft.XMLDOM');
-          dom.async = false;
-          dom.loadXML(xdr.responseText);
-          responses.xml = dom;
-
-          if($(dom).children('error').length != 0) {
-            var $error = $(dom).find('error');
-            completeCallback(parseInt($error.attr('response_code')), $error.attr('message_key'), responses);
-          } else {
-            completeCallback(200, 'success', responses);
-          }
-        } else if (xdr.contentType.match(/\/json/)) {
-          options.dataTypes.push("json");
-          completeCallback(200, 'success', responses);
-        } else {
-          completeCallback(200, 'success', responses); 
-          // see bug https://connect.microsoft.com/IE/feedback/ViewFeedback.aspx?FeedbackID=334804
-        }
-      };
-
-      xdr.onprogress = function() { };
-
-      xdr.onerror = xdr.ontimeout = function() {
-        var responses = {
-          text: xdr.responseText
-        };
-        completeCallback(400, 'failed', responses);
-      };
-
-      xdr.open(options.type, options.url);
-      xdr.send(options.data);
-    },
-    abort: function() {
-      if(xdr) {
-        xdr.abort();
-      }
-    }
-  };
-});
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/js/json2.min.js b/libs/js/jquery-geo-1.0b2/docs/examples/js/json2.min.js
deleted file mode 100755 (executable)
index 0bdcc5e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-var JSON;if(!JSON){JSON={}}(function(){function f(n){return n<10?"0"+n:n}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(key){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+f(this.getUTCMonth()+1)+"-"+f(this.getUTCDate())+"T"+f(this.getUTCHours())+":"+f(this.getUTCMinutes())+":"+f(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(key){return this.valueOf()}}var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==="string"?c:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+string+'"'}function str(key,holder){var i,k,v,length,mind=gap,partial,value=holder[key];if(value&&typeof value==="object"&&typeof value.toJSON==="function"){value=value.toJSON(key)}if(typeof rep==="function"){value=rep.call(holder,key,value)}switch(typeof value){case"string":return quote(value);case"number":return isFinite(value)?String(value):"null";case"boolean":case"null":return String(value);case"object":if(!value){return"null"}gap+=indent;partial=[];if(Object.prototype.toString.apply(value)==="[object Array]"){length=value.length;for(i=0;i<length;i+=1){partial[i]=str(i,value)||"null"}v=partial.length===0?"[]":gap?"[\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"]":"["+partial.join(",")+"]";gap=mind;return v}if(rep&&typeof rep==="object"){length=rep.length;for(i=0;i<length;i+=1){if(typeof rep[i]==="string"){k=rep[i];v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}else{for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=str(k,value);if(v){partial.push(quote(k)+(gap?": ":":")+v)}}}}v=partial.length===0?"{}":gap?"{\n"+gap+partial.join(",\n"+gap)+"\n"+mind+"}":"{"+partial.join(",")+"}";gap=mind;return v}}if(typeof JSON.stringify!=="function"){JSON.stringify=function(value,replacer,space){var i;gap="";indent="";if(typeof space==="number"){for(i=0;i<space;i+=1){indent+=" "}}else{if(typeof space==="string"){indent=space}}rep=replacer;if(replacer&&typeof replacer!=="function"&&(typeof replacer!=="object"||typeof replacer.length!=="number")){throw new Error("JSON.stringify")}return str("",{"":value})}}if(typeof JSON.parse!=="function"){JSON.parse=function(text,reviver){var j;function walk(holder,key){var k,v,value=holder[key];if(value&&typeof value==="object"){for(k in value){if(Object.prototype.hasOwnProperty.call(value,k)){v=walk(value,k);if(v!==undefined){value[k]=v}else{delete value[k]}}}}return reviver.call(holder,key,value)}text=String(text);cx.lastIndex=0;if(cx.test(text)){text=text.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){j=eval("("+text+")");return typeof reviver==="function"?walk({"":j},""):j}throw new SyntaxError("JSON.parse")}}}());
\ No newline at end of file
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/kml.html b/libs/js/jquery-geo-1.0b2/docs/examples/kml.html
deleted file mode 100755 (executable)
index 8e8330e..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>KML example</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of rendering KML points">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/NCUK7/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>KML</h1>
-      <p>Example of parsing a simple KML file as GeoJSON points to append.</p>
-    </div>
-  </div>
-  <script src="http://code.jquery.com/jquery-1.8.1.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $( function ( ) {
-      // start with xml text
-      var kml = '<?xml version="1.0" encoding="utf-8"?> <kml xmlns="http://www.opengis.net/kml/2.2"> <Placemark> <name>My office</name> <description>This is the location of my office.</description> <Point> <coordinates>-71.0595678,42.3604823</coordinates> </Point> </Placemark> </kml>',
-
-          kmlDoc = $.parseXML( kml ), //< parsed xml document
-          
-          // create a map
-          map = $( "#map" ).geomap( {
-            center: [ -71.0595678, 42.3604823 ],
-            zoom: 8
-          } ),
-          
-          cEl, //< storage for our parsed coordinate element
-          c; //< storage for our parsed coordinate values
-
-      // find & iterate over Point features
-      $(kmlDoc).find("Point").each(function() {
-        // find the coordinates element on this Point element
-        cEl = $(this).find("coordinates");
-
-        // extract and split the coordinate's values
-        c = $(cEl).text().split(",");
-
-        // append the coordinate to the map
-        map.geomap( "append", {
-          type: "Point",
-          coordinates:[ parseFloat( c[0] ), parseFloat( c[1] ) ]
-        }, {
-          fillOpacity: 1
-        });
-      });
-
-    } );  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/label.html b/libs/js/jquery-geo-1.0b2/docs/examples/label.html
deleted file mode 100755 (executable)
index d12d5c8..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>label examples</title>
-  <meta charset="utf-8">
-  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
-  <meta name="description" content="An example of drawing shapes with labels">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/2TAzc/embedded/" class="fiddleLink not-mobile"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>label</h1>
-      <p class="not-mobile">This example builds on the drawing example by appending a label with shapes. Enter label text (HTML is ok), choose a tool below, and start labelling!</p>
-      <input type="text" name="label" value="a label" autofocus />
-      <div id="modes">
-        <input type="radio" id="drawPoint" name="mode" value="drawPoint" checked="checked" /><label for="drawPoint">point</label>
-        <input type="radio" id="drawLineString" name="mode" value="drawLineString" /><label for="drawLineString">line</label>
-        <input type="radio" id="drawPolygon" name="mode" value="drawPolygon" /><label for="drawPolygon">polygon</label>
-      </div>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      // create a map, setting mode to drawPoint initially
-      var map = $("#map").geomap({
-        center: [-71.0595678, 42.3604823],
-        zoom: 8,
-        mode: "drawPoint",
-        shape: function (e, geo) {
-          // the shape event triggers when a user draws a shape
-          // the geo object is a simple GeoJSON object: Point, LineString or Polygon
-          // we can append it directly to the map
-
-          // grab the text of the label input and send it as a label for this shape
-          map.geomap("append", geo, $("input[name='label']").val());
-        }
-      });
-
-      // jQuery UI for pretty buttons
-      $("#modes").buttonset();
-
-      $("#modes input").click(function () {
-        // set the map's mode option based on value of the input clicked
-        // this will change the map's mode to drawPoint, drawLineString or drawPolygon
-        map.geomap("option", "mode", $(this).val());
-      });
-    });  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/labelservice.html b/libs/js/jquery-geo-1.0b2/docs/examples/labelservice.html
deleted file mode 100755 (executable)
index d926417..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>label service examples</title>
-  <meta charset="utf-8">
-  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
-  <meta name="description" content="An example of drawing shapes with labels on services">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/2TAzc/embedded/" class="fiddleLink not-mobile"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>label service</h1>
-      <p class="not-mobile">This page is similar to the regular label example but tests appending labeled shapes to a specific service instead of the map itself.</p>
-      <input type="text" name="label" value="a label" autofocus />
-      <div id="modes">
-        <input type="radio" id="drawPoint" name="mode" value="drawPoint" checked="checked" /><label for="drawPoint">point</label>
-        <input type="radio" id="drawLineString" name="mode" value="drawLineString" /><label for="drawLineString">line</label>
-        <input type="radio" id="drawPolygon" name="mode" value="drawPolygon" /><label for="drawPolygon">polygon</label>
-      </div>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      // create a map, setting mode to drawPoint initially
-      var map = $("#map").geomap({
-            center: [-71.0595678, 42.3604823],
-            zoom: 8,
-            mode: "drawPoint",
-            shape: function (e, geo) {
-              // the shape event triggers when a user draws a shape
-              // the geo object is a simple GeoJSON object: Point, LineString or Polygon
-              // we can append it directly to the map
-
-              // grab the text of the label input and send it as a label for this shape
-              map.find( ".osm" ).geomap("append", geo, $("input[name='label']").val());
-            }
-          });
-
-      // jQuery UI for pretty buttons
-      $("#modes").buttonset();
-
-      $("#modes input").click(function () {
-        // set the map's mode option based on value of the input clicked
-        // this will change the map's mode to drawPoint, drawLineString or drawPolygon
-        map.geomap("option", "mode", $(this).val());
-      });
-    });  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/logo.html b/libs/js/jquery-geo-1.0b2/docs/examples/logo.html
deleted file mode 100755 (executable)
index b0800e6..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-<!DOCTYPE html>
-<!--[if lt IE 7]> <html class="no-js ie6" lang="en"> <![endif]-->
-<!--[if IE 7]>    <html class="no-js ie7" lang="en"> <![endif]-->
-<!--[if IE 8]>    <html class="no-js ie8" lang="en"> <![endif]-->
-<!--[if gt IE 8]><!-->  <html class="no-js" lang="en"> <!--<![endif]-->
-<head>
-  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-  <title>jQuery Geo logo</title>
-  <meta name="description" content="Drawing the jQuery Geo logo">
-  <meta name="author" content="Ryan Westphal">
-  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map 
-    {
-      position: fixed;
-      left: 0px;
-      top: 0px;
-      right: 0px;
-      bottom: 0px;
-    }
-    .ie7 #map, .ie6 #map
-    {
-      width: 100%;
-      right: auto;
-      bottom: auto;
-      min-height: 600px;
-    }
-  </style>
-</head>
-<body>
-  <div class="content">
-    <div id="map">
-    </div>
-    <div class="info">
-      <a href="../" class="docLink">&lt; docs</a>
-      <h1>
-        jQuery Geo logos!</h1>
-      <p>This demo uses jQuery Geo to draw its own logo at the top left of the map. Single-click the map to make more logos! The shapes created for the logo are based on the pixelSize of the current scale so your map's current zoom determines the Earth-size of the logo. When you zoom in, the points of the individual logos will spread out.</p>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      var map = $("#map").geomap({
-            center: [-75, 40],
-            zoom: 5,
-            mode: "drawPoint",
-            shape: function (e, geo) {
-              addLogo(geo);
-            }
-          });
-
-      var width = $(document).width();
-
-      addLogo({ pixels: [16, 16], coordinates: map.geomap("toMap", [32, 16]) });
-
-      function addLogo(geo) {
-        var geoPixels = map.geomap("toPixel", geo.coordinates),
-            logoOuterCoords = map.geomap("toMap", [
-              [geoPixels[0] - 16, geoPixels[1]],
-              [geoPixels[0] - 15, geoPixels[1] + 6],
-              [geoPixels[0] - 11, geoPixels[1] + 11],
-              [geoPixels[0] - 6, geoPixels[1] + 15],
-              [geoPixels[0], geoPixels[1] + 16]
-            ]),
-            logoOuterPoints = [],
-            logoInnerCoords = map.geomap("toMap", [
-              [geoPixels[0] - 8, geoPixels[1]],
-              [geoPixels[0] - 6, geoPixels[1] + 6],
-              [geoPixels[0], geoPixels[1] + 8]
-            ]),
-            logoInnerPoints = [],
-            logoCornerCoord = geo.coordinates,
-            logoLines = {
-              type: "GeometryCollection",
-              geometries: []
-            },
-            logoPoints = {
-              type: "GeometryCollection",
-              geometries: []
-            };
-
-        $.merge(logoLines.geometries, [{
-          type: "LineString",
-          coordinates: logoOuterCoords
-        }]);
-
-        $.merge(logoLines.geometries, [{
-          type: "LineString",
-          coordinates: logoInnerCoords
-        }]);
-
-        $.each(logoOuterCoords, function (i) {
-          logoOuterPoints[i] = {
-            type: "Point",
-            coordinates: this
-          };
-        });
-
-        $.merge(logoPoints.geometries, logoOuterPoints);
-
-        $.each(logoInnerCoords, function (i) {
-          logoInnerPoints[i] = {
-            type: "Point",
-            coordinates: this
-          };
-        });
-
-        $.merge(logoPoints.geometries, logoInnerPoints);
-
-        $.merge(logoPoints.geometries, [{
-          type: "Point",
-          coordinates: logoCornerCoord
-        }]);
-
-        map.geomap("append", logoLines, { strokeWidth: "2px", fill: "#faa", fillOpacity: 1 });
-        map.geomap("append", logoPoints, { strokeWidth: "1px", width: "3px", height: "3px", fill: "#faa", fillOpacity: 1 });
-      }
-    });
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/marker.html b/libs/js/jquery-geo-1.0b2/docs/examples/marker.html
deleted file mode 100755 (executable)
index 8bdc69f..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>marker example</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="marker example">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-
-    /* set all labels on the .osm service to have an image background, with negative margins */
-    .osm .geo-label
-    {
-      width: 32px;
-      height: 37px;
-      background: url(img/marker.png);
-      margin-left: -16px !important;
-      margin-top: -37px !important;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-      <div class="info">
-        <h1>markers</h1>
-      </div>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      var map = null;
-
-      function setPosition( center ) {
-        // create a point for the center of the map, default to Boston
-        var geo = {
-              type: "Point",
-              coordinates: center || [ -71.0595678, 42.3604823 ]
-            };
-
-        if ( ! map ) {
-          // create a map & set it's center if we don't have one already
-          map = $( "#map" ).geomap( {
-            center: geo.coordinates,
-            zoom: 15
-          } );
-          
-          // set the .osm service's shapeStyle to hide point shapes by giving them zero width/height
-          $( ".osm" ).geomap( "option", "shapeStyle", {
-            width: 0,
-            height: 0
-          } );
-
-          // append a shape to the .osm service at the center, give it an empty label
-          // the empty string is required because we're using labels as markers
-          // without the empty string, jQuery Geo won't create a label element
-          // the content of the label is set by the CSS above
-          $( ".osm" ).geomap( "append", geo, "" );
-        } else {
-          // clear .osm service and append a new marker at the center, don't bother refreshing yet
-          $( ".osm" ).geomap( "empty", false ).geomap( "append", geo, "", false );
-
-          // set the map's center, this will refresh the service too
-          map.geomap( "option", "center", center );
-        }
-      }
-
-      if ( navigator.geolocation ) {
-        navigator.geolocation.watchPosition( function ( p ) {
-          setPosition( [ p.coords.longitude, p.coords.latitude ] );
-        }, function (error) {
-          setPosition( );
-        });
-      } else {
-        setPosition( );
-      }
-      
-    });  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/markers.html b/libs/js/jquery-geo-1.0b2/docs/examples/markers.html
deleted file mode 100755 (executable)
index 1a99097..0000000
+++ /dev/null
@@ -1,267 +0,0 @@
-<!doctype html>
-<html>
-<head>
-  <meta charset="utf-8">
-
-  <title>Marker drawing techniques</title>
-  
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="marker example">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-
-  <style type="text/css">
-    #map {
-      position: fixed;
-      top: 0;
-      right: 0;
-      left: 0;
-      bottom: 0;
-    }
-
-    input {
-      vertical-align: text-bottom;
-    }
-
-    /* boat launch css markers (as geomap shape labels)
-     * this style will affect all labels on the boat-launch-css service
-     * since these are our only real shapes, we could omit the #boat-launch-css
-     * part of the rule but it's here for example
-     * this does not affect the boat-launch-canvas service (those are drawn without labels)
-     *
-     * the top-left pixel of each label is placed at the boat launch point on the map
-     * by using height, width, and negative margins, we can make each background image appear an the correct location
-     *
-     * when we append the shapes in javascript, we have to pass an empty string (instead of null or undefined)
-     * so that a label gets generated, even though the label has no text
-     */
-    #boat-launch-css .geo-label {
-      background-image: url(img/boat.png);
-      width: 32px;
-      height: 37px;
-      margin-left: -16px;
-      margin-top: -32px;
-    }
-  </style>
-</head>
-
-<body>
-  <div id="map">
-  </div>
-  <div class="info">
-    <div class="links">
-      <a href="../" class="docLink">&lt; docs</a>
-      <a href="http://jsfiddle.net/ryanttb/uxEVX/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-    </div>
-    <h1>Marker drawing techniques</h1>
-    <p>There are two reasonable ways to draw point markers. This example demos them. Check out the jsFiddle for docs.</p>
-    <fieldset>
-      <legend>technique</legend>
-      <label>
-        <input type="radio" name="technique" value="css" checked />
-        <span>CSS labels</span>
-      </label>
-      <label>
-        <input type="radio" name="technique" value="canvas" />
-        <span>canvas service</span>
-      </label>
-    </fieldset>
-  </div>
-
-  <script src="http://code.jquery.com/jquery-1.8.1.min.js"></script>
-  <!--<script src="../../js/excanvas.js"></script>
-  <script src="../../js/jsrender.js"></script>
-  <script src="../../js/jquery.mousewheel.js"></script>
-  <script src="../../js/jquery.ui.widget.js"></script>
-  <script src="../../js/jquery.geo.core.js"></script>
-  <script src="../../js/jquery.geo.geographics.js"></script>
-  <script src="../../js/jquery.geo.geomap.js"></script>
-  <script src="../../js/jquery.geo.tiled.js"></script>
-  <script src="../../js/jquery.geo.shingled.js"></script>-->
-  <script src="../jquery.geo-test.min.js"></script>
-
-  <script>
-    $(function() {
-      var canvas = document.createElement("canvas"), //< a canvas where we draw markers for the second service in the canvas service's src function
-          boatImage = $( '<img src="img/boat.png" />' ).load( function( ) {
-            // the image doesn't always load fast enough
-            // we could cache it but this is just as easy
-            // refresh the canvas-based service once when the image it needs is ready
-
-            // we could also have a flag to denote that the image hasn't loaded yet
-            // and not bother drawing the service the first time
-            boatLaunchCanvas.geomap( "refresh" );
-          } )[ 0 ], // HTML image element to draw onto the canvas
-
-      // check for cached data, why wait if it's not going to change that often
-          boatLaunchData = window.localStorage.getItem( "boatLaunchData" );
-
-      if ( boatLaunchData ) {
-        // cached data is a string, we need to parse it
-        boatLaunchData = JSON.parse( boatLaunchData );
-      }
-
-      // create a map
-      var map = $("#map").geomap({
-        center: [ -120.5, 47.5 ], //< center on WA
-        zoom: 7, //< zoom in a bit
-
-        // an array of service objects
-        services: [
-          // MapQuest OSM basemap
-          // tiled, web mercator
-          {
-            type: "tiled",
-            src: function( view ) {
-              return "http://otile" + ((view.index % 4) + 1) + ".mqcdn.com/tiles/1.0.0/osm/" + view.zoom + "/" + view.tile.column + "/" + view.tile.row + ".png";
-            },
-            attr: "<p>Tiles Courtesy of <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png'></p>"
-          },
-
-          // a service where we draw boat launch sites as CSS markers
-          // it doesn't need a src, all the data is appended as shapes
-          // this is the quick and easy way, the second way (using canvas) is
-          // an advanced technique but can be a lot faster
-          {
-            id: "boat-launch-css",
-            type: "shingled",
-            src: ""
-          },
-
-          // a service where we draw boat launch sites as dynamically generated canvas
-          // the src is a function that renders points for the current map view onto
-          // a canvas and returns the data URI
-          // note: this technique will not work in IE8
-          {
-            id: "boat-launch-canvas",
-            type: "shingled",
-            src: function( view ) {
-              // set the canvas' size to the currently requested view's size
-              canvas.width = view.width;
-              canvas.height = view.height;
-
-              var context = canvas.getContext( "2d" ), //< used to draw on the canvas
-                  pixelSize = map.geomap( "option", "pixelSize" ), //< map size of a pixel in the current zoom level
-                  halfMarkerWidth = pixelSize * 16, //< 1/2 width of the marker image in this zoom level
-                  halfMarkerHeight = pixelSize * 18, //< 1/2 height of the marker image in this zoom level
-                  coords, //< coordinates of the current boat dock in the loop below
-                  pixelPoint; //< pixel location of a single boat dock when we draw them on the canvas
-
-              $.each( boatLaunchData, function( ) {
-                // first, determine if the point should be drawn in this view
-                // make sure to account for the size of the marker image
-                coords = this.geometry.coordinates;
-
-                // for a speed improvement, compare the map position of the marker image
-                // with the bbox of the current view
-                // if the marker should be in this view, draw it
-                // this "if" statement isn't required but with a large number of points
-                // can produce significant performance increases (don't draw if you don't have to)
-                if ( coords[ 0 ] >= view.bbox[ 0 ] - halfMarkerWidth &&
-                     coords[ 1 ] >= view.bbox[ 1 ] - halfMarkerHeight &&
-                     coords[ 0 ] <= view.bbox[ 2 ] + halfMarkerWidth &&
-                     coords[ 1 ] <= view.bbox[ 3 ] + halfMarkerHeight ) {
-
-                  // if we should draw this one, convert the map point to a pixel location for the current view
-                  pixelPoint = map.geomap( "toPixel", this.geometry.coordinates );
-
-                  // draw the image using canvas
-                  // the x location is in position 0 of pixelPoint, the y location is in position 1
-                  // however, we need to offset because of the shape of the marker image
-                  context.drawImage( boatImage, pixelPoint[ 0 ] - 16, pixelPoint[ 1 ] - 32 );
-                }
-              } );
-
-              // once done drawing, return the image as a data URI
-              return canvas.toDataURL( );
-            },
-            style: {
-              // this service is hidden by default;
-              // no sense drawing both, they have the same data
-              visibility: "hidden"
-            }
-          }
-        ]
-      });
-
-      $( "input" ).click( function( ) {
-        // handle technique change clicks on the input buttons
-        // hide the service that is not the checked technique
-        // show the service that is
-        var technique = $("input:checked").val();
-
-        switch ( technique ) {
-          case "css":
-            boatLaunchCanvas.geomap( "toggle", false );
-            boatLaunchCss.geomap( "toggle", true );
-            break;
-
-          case "canvas":
-            boatLaunchCss.geomap( "toggle", false );
-            boatLaunchCanvas.geomap( "toggle", true );
-            break;
-        }
-      } );
-
-      // keep references to services we interact with
-      var boatLaunchCss = $("#boat-launch-css").geomap( "option", "shapeStyle", { width: 0, height: 0 } ),
-          boatLaunchCanvas = $("#boat-launch-canvas");
-
-      // download boat launch sites (unless we already have them)
-      if ( boatLaunchData ) {
-        // immediately append them to the CSS-based services
-        // we only need to do this once
-        boatLaunchCss.geomap( "append", boatLaunchData, "" );
-
-        // show the canvas service now that we have them
-        //$( "#boat-launch-canvas" ).geomap( "toggle", true );
-      } else {
-        // wa.gov doesn't support CORS but AGS supports JSONP
-        $.ajax({
-          url: "http://gismanager.rco.wa.gov/ArcGIS/rest/services/RCOBoatFacs/MapServer/1/query?where=1%3D1&returnGeometry=true&outFields=OBJECTID,FACILITY_NM,WTR_BDY&f=json",
-          dataType: "jsonp",
-          success: function(result) {
-            if ( result && result.features ) {
-              // convert to GeoJSON Point Features
-              var geoJsonResults = $.map( result.features, function( value ) {
-                return {
-                  type: "Feature",
-                  geometry: {
-                    type: "Point",
-                    coordinates: [ value.geometry.x, value.geometry.y ]
-                  },
-                  properties: {
-                    name: value.attributes.FACILITY_NM,
-                    waterBody: value.attributes.WTR_BDY
-                  }
-                }
-              } );
-
-              try {
-                // may fail if quota exceeded
-                window.localStorage.setItem( "boatLaunchData", JSON.stringify( geoJsonResults ) );
-              } catch ( ex ) { }
-
-              // we finally have the boat launch data
-              // append them to the CSS-based services
-              // again, we only need to do this once
-              boatLaunchCss.geomap( "append", geoJsonResults, "" );
-
-              // show the canvas service now that we have them
-              //$( "#boat-launch-canvas" ).geomap( "toggle", true );
-            } else {
-              // O_o
-              alert( "There are no Boat Launches :O" );
-            }
-          },
-          error: function(xhr) {
-            // :(
-            alert(":( " + xhr.statusText);
-          }
-        });
-      }
-    });
-  </script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/measure.html b/libs/js/jquery-geo-1.0b2/docs/examples/measure.html
deleted file mode 100755 (executable)
index d720bbf..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>measure example</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of measure">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/==JSFIDDLE==/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>measure</h1>
-      <p class="not-mobile">This example tests the two measure modes: measureLength, and measureArea. Choose a tool below and start measuring!</p>
-      <div id="modes">
-        <input type="radio" id="measureLength" name="mode" value="measureLength" checked="checked" /><label for="measureLength">length</label>
-        <input type="radio" id="measureArea" name="mode" value="measureArea" /><label for="measureArea">area</label>
-      </div>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      // create a map
-      var map = $("#map").geomap({
-        center: [-71.0595678, 42.3604823],
-        zoom: 8,
-        mode: "measureLength",
-        measureLabels: {
-          length: "{{:length.toFixed( 4 )}} meters"
-        },
-        drawStyle: {
-          color: "blue"
-        }
-      });
-
-      // jQuery UI for pretty buttons
-      $("#modes").buttonset();
-
-      $("#modes input").click(function () {
-        // set the map's mode option based on value of the input clicked
-        // this will change the map's mode to measureLength or measureArea
-        map.geomap("option", "mode", $(this).val());
-      });
-    });  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/mobile.html b/libs/js/jquery-geo-1.0b2/docs/examples/mobile.html
deleted file mode 100755 (executable)
index 0c3f2f2..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <head>
-    <meta charset="utf-8">
-
-    <title>mobile</title>
-    <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-
-    <meta name="description" content="A very simple instantiation of the geomap widget for a full screen mobile app">
-    <meta name="author" content="Ryan Westphal">
-
-    <link rel="stylesheet" type="text/css" href="css/style.css" />
-  </head>
-<body>
-  <div>
-    <div id="map" style="position: fixed; left: 0; top: 0; right: 0; bottom: 0;">
-    </div>
-    <div class="info not-mobile" style="float: right;">
-      <a href="../" class="docLink">&lt; docs</a>
-      <h1>mobile</h1>
-      <p>A full window div...geomap called, zoomed in to level 6.</p>
-      <p>Add a <i>meta viewport</i> tag to your head element and you're good to go.</p>
-    </div>
- </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      $("#map").geomap({
-        center: [-71.0595678, 42.3604823],
-        zoom: 7
-      });
-    });  
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/mode-zoom.html b/libs/js/jquery-geo-1.0b2/docs/examples/mode-zoom.html
deleted file mode 100755 (executable)
index 75d0f1d..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>zoom mode example</title>
-  <meta charset="utf-8">
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of zoom mode">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/e6YHv/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>
-        zoom mode</h1>
-      <p>When a geomap widget's mode option is &quot;zoom&quot;, you can your your mouse to draw a rectangle. jQuery Geo will change the bbox of the map to match the rectangle as closely as possible based on the tiling scheme and viewport size.</p>
-      <p class="not-mobile">This mode is more useful for dynamic map services and may be more familiar to GIS professionals.</p>
-      <p class="not-mobile">Hint: in pan or any of the draw modes, you can hold the shift key to temporarily switch to zoom mode.</p>
-      <div id="modes">
-        <input type="radio" id="pan" name="mode" value="pan" /><label for="pan">pan</label>
-        <input type="radio" id="zoom" name="mode" value="zoom" checked="checked" /><label for="zoom">zoom</label>
-      </div>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      // create a map, setting mode to zoom initially
-      var map = $("#map").geomap({
-        center: [-71.0595678, 42.3604823],
-        zoom: 8,
-        mode: "zoom"
-      });
-
-      // jQuery UI for pretty buttons
-      $("#modes").buttonset();
-
-      $("#modes input").click(function () {
-        // set the map's mode option based on value of the input clicked
-        // this will change the map's mode to pan or zoom
-        map.geomap("option", "mode", $(this).val());
-      });
-    });  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/opacity.html b/libs/js/jquery-geo-1.0b2/docs/examples/opacity.html
deleted file mode 100755 (executable)
index 0b87cf7..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-
-  <title>opacity</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="A test of geomap's opacity and toggle methods">
-  <meta name="author" content="Ryan Westphal">
-
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" href="css/style.css" />
-  <style type="text/css">
-    #map {
-      position: fixed;
-      left: 0; top: 0; right: 0; bottom: 0;
-      background: #b5d0d0;
-    }
-    
-    label { display: block; }
-
-    label span:first-child
-    {
-      font-weight: bold;
-      margin-right: 12px;
-    }
-    
-    .slider
-    {
-      display: inline-block;
-      width: 60%
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/kY5SC/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>opacity &amp; toggle</h1>
-      <p>The slider calls geomap's opacity method targeting the OSM service. The default service object doesn't have an id but it does have a class, osm, that we can reference using $(&quot;.osm&quot;). The button calls the toggle method. I've matched the map div's background color to OSM's water color for effect.</p>
-      <label>
-        <span>opacity</span>
-        <span class="slider"></span>
-      </label>
-      <label>
-        <span>visibility</span>
-        <button type="button">toggle</button>
-      </label>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      // create a map
-      $("#map").geomap({
-        center: [-71.0595678, 42.3604823],
-        zoom: 6
-      });
-
-      // create a jQuery UI slider
-      // in the slide event, search for the default service by its class, .osm, and call the opacity method.
-      // the ui argument's value is a number from 0-100 so to make a percentage that the opacity CSS property needs, we divide by 100.
-      $(".slider").slider({
-        value: 100,
-        slide: function (e, ui) {
-          $(".osm").geomap("opacity", ui.value / 100);
-        }
-      });
-
-      // create a jQuery UI button
-      // in the click event, search for the default service by its class, .osm, and call the toggle method.
-      // with no argument, toggle will flip the service's visibility but you can also pass true or false as a second argument after toggle to force a specific result.
-      $("button").button().click(function() {
-        $(".osm").geomap("toggle");
-      });
-    });  
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/panscroll.html b/libs/js/jquery-geo-1.0b2/docs/examples/panscroll.html
deleted file mode 100755 (executable)
index 3f16a28..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>panning &amp; scroll example</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of panning &amp; scroll">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/aSFsK/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>panning &amp; scroll</h1>
-
-      <p>The panning option can remove a user's ability to pan the map. The scroll option can remove a user's ability to use the mouse wheel to zoom.</p>
-
-      <p class="not-mobile">scroll options default and zoom work the same.</p>
-
-      <fieldset>
-        <legend>pannable (click to toggle)</legend>
-        <input type="checkbox" id="pannable" checked="checked" /><label for="pannable">pannable</label>
-      </fieldset>
-
-      <fieldset>
-        <legend>scroll</legend>
-        <div id="scroll">
-          <input type="radio" id="default" name="scroll" value="default" checked="checked" /><label for="default">default</label>
-          <input type="radio" id="zoom" name="scroll" value="zoom" /><label for="zoom">zoom</label>
-          <input type="radio" id="off" name="scroll" value="off" /><label for="off">off</label>
-        </div>
-      </fieldset>
-
-      
-
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      // create a map
-      // set pannable and scroll options based on current input values
-      // in case the browser has cached them
-      var map = $( "#map" ).geomap( {
-        center: [ -71.0595678, 42.3604823 ],
-        zoom: 8,
-        pannable: $( "#pannable" ).prop( "checked" ),
-        scroll: $( "input[name='scroll']:checked" ).val( )
-      } );
-
-      $( "#pannable" ).button( ).click( function( ) {
-        // toggle the pannable option based on the state
-        // of the pannable button
-        map.geomap( "option", "pannable", this.checked );
-      } );
-
-      $( "#scroll" ).buttonset( ).find( "input" ).click( function( ) {
-        // set the scroll option based on the currently checked radio's value
-        var scrollValue = $( "input[name='scroll']:checked" ).val( );
-        map.geomap( "option", "scroll", scrollValue );
-      } );
-
-    });  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/proj.html b/libs/js/jquery-geo-1.0b2/docs/examples/proj.html
deleted file mode 100755 (executable)
index 3d6ba94..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>proj test</title>
-  <meta name="description" content="Small test of $.geo.proj">
-  <meta name="author" content="Ryan Westphal">
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    label
-    {
-      display: block;
-      margin: .25em;
-    }
-    label span
-    {
-      display: inline-block;
-      font-weight: bold;
-      width: 8em;
-    }
-    #lblStatus
-    {
-      background: #ee4;
-      border-radius: .5em;
-      padding: .5em;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <a href="../" class="docLink">&lt; docs</a>
-    <h1>
-      proj test</h1>
-    <p>
-      This page has a couple basic interactive tests of the default $.geo.proj object.</p>
-    <h2>
-      direct conversion</h2>
-    <p>
-      Enter a lon/lat in the top inputs (remember, longitude is first here and throughout jQuery Geo but usually spoken second) &amp; click fromGeodetic to convert it to web mercator and store the new values in the bottom two inputs. Click toGeodetic to reverse.</p>
-    <label>
-      <span>longitude</span>
-      <input type="text" id="txtLon" value="-71.0597732" />
-    </label>
-    <label>
-      <span>latitude</span>
-      <input type="text" id="txtLat" value="42.3584308" />
-    </label>
-    <button type="button" id="cmdFrom">
-      \/ fromGeodetic</button>
-    <button type="button" id="cmdTo">
-      /\ toGeodetic</button>
-    <label>
-      <span>web mercator x</span>
-      <input type="text" id="txtX" value="-7910337.768509507" />
-    </label>
-    <label>
-      <span>web mercator y</span>
-      <input type="text" id="txtY" value="5214822.77694091" />
-    </label>
-    <h2>
-      osm nominatim</h2>
-    <p>
-      Enter a search term in the input and click search. If successful, geodetic &amp; web mercator coordinates are written to the inputs above. This example uses MapQuest's OSM API: <a href="http://open.mapquestapi.com/nominatim/">http://open.mapquestapi.com/nominatim</a>.</p>
-    <label>
-      <span>query</span>
-      <input type="text" id="txtQuery" value="Boston,MA" />
-    </label>
-    <button type="button" id="cmdSearch">search</button>
-    <h2>
-      status</h2>
-    <p>
-      Status result for any test.</p>
-    <div id="lblStatus">
-      ready</div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      $("#cmdFrom").click(function () {
-        try {
-          var projected = $.geo.proj.fromGeodetic([[parseFloat($("#txtLon").val()), parseFloat($("#txtLat").val())]]);
-          $("#txtX").val(projected[0][0])
-          $("#txtY").val(projected[0][1])
-          $("#lblStatus").html("done " + (new Date()).toString());
-        } catch (e) {
-          $("#lblStatus").html("error" + e.toString());
-        }
-      });
-      $("#cmdTo").click(function () {
-        try {
-          var geodetic = $.geo.proj.toGeodetic([[parseFloat($("#txtX").val()), parseFloat($("#txtY").val())]]);
-          $("#txtLon").val(geodetic[0][0])
-          $("#txtLat").val(geodetic[0][1])
-          $("#lblStatus").html("done " + (new Date()).toString());
-        } catch (e) {
-          $("#lblStatus").html("error" + e.toString());
-        }
-      });
-
-      $("#cmdSearch").click(function () {
-        try {
-          var query = "http://open.mapquestapi.com/nominatim/v1/search?format=json&q=" + $("#txtQuery").val();
-          $.ajax({
-            url: query,
-            dataType: "jsonp",
-            jsonp: "json_callback",
-            success: function (result) {
-              if (result && result.length > 0) {
-                $("#txtLon").val(result[0].lon)
-                $("#txtLat").val(result[0].lat)
-                var projected = $.geo.proj.fromGeodetic([[result[0].lon, result[0].lat]]);
-                $("#txtX").val(projected[0][0])
-                $("#txtY").val(projected[0][1])
-                $("#lblStatus").html("done " + (new Date()).toString());
-              } else {
-                $("#lblStatus").html("nothing found :(");
-              }
-            },
-            error: function (xhr) {
-              $("#lblStatus").html(xhr.statusText);
-            }
-          });
-        } catch (e) {
-          $("#lblStatus").html("error" + e.toString());
-        }
-      });
-    });  
-  </script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/refresh.html b/libs/js/jquery-geo-1.0b2/docs/examples/refresh.html
deleted file mode 100755 (executable)
index 4f66238..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>refresh example</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of refresh">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/==JSFIDDLE==/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>refresh</h1>
-      <p>The refresh method can:
-      <ul>
-        <li><a id="refreshAll" href="javascript:void(0);">refresh all services getting only new data</a></li>
-        <li><a id="refreshAllForce" href="javascript:void(0);">refresh all services re-requesting already downloaded data</a></li>
-        <li><a id="refreshOne" href="javascript:void(0);">refresh &quot;generated&quot; service getting only new data</a></li>
-        <li><a id="refreshOneForce" href="javascript:void(0);">refresh &quot;generated&quot; service re-requesting already downloaded data</a></li>
-      </ul>
-      </p>
-      <p>All versions redraw appended shapes. Calling refresh on individual services will redraw only shapes on that service</p>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $( function ( ) {
-      // since JavaScript is still single-threaded, we can reuse the same canvas
-      // element for drawing our fake tiles and not worry race conditions for the canvas
-      // resource when multiple tiles are requested at the same time
-      // (sorry to bore you with that)
-      var canvas = document.createElement( "canvas" ),
-          context = canvas.getContext( "2d" );
-      
-      // create a map
-      // the first one is regular OSM, the second one draws the current time in ms
-      // onto the tile so each tile is always different every time it is re-requested
-      var map = $( "#map" ).geomap( {
-        center: [ -71.0595678, 42.3604823 ],
-        zoom: 8,
-        services: [
-          {
-            id: "osm",
-            type: "tiled",
-            src: "http://tile.openstreetmap.org/{{:zoom}}/{{:tile.column}}/{{:tile.row}}.png"
-          },
-          {
-            id: "generated",
-            type: "tiled",
-            src: function( view ) {
-              // clear the canvas to draw a new tile
-              context.clearRect( 0, 0, 256, 256 );
-
-              // set a reasonable font
-              context.font = "12px Arial";
-
-              // draw the current time in ms
-              context.strokeText( "now: " + $.now( ), 8, 16 );
-
-              // return the new tile as a data URI
-              return canvas.toDataURL( );
-            }
-          }
-        ]
-      } );
-
-      // handle the link clicks
-
-      $( "#refreshAll" ).click( function( ) {
-        // refresh all services but images that have already been downloaded
-        // will not be re-requested
-        map.geomap( "refresh" );
-      } );
-
-      $( "#refreshAllForce" ).click( function( ) {
-        // refresh all services, even existing tiles will be re-requested
-        // the browser can still send cached copies of tiles if your web server allows caching
-        map.geomap( "refresh", true );
-      } );
-
-      $( "#refreshOne" ).click( function( ) {
-        // refresh just the generated service but tiles that have already been created
-        // will not be re-requested
-        $( "#generated" ).geomap( "refresh" );
-      } );
-
-      $( "#refreshOneForce" ).click( function( ) {
-        // refresh just the generated service but tiles that have already been created
-        // will be re-requested
-        $( "#generated" ).geomap( "refresh", true );
-      } );
-    } );  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/remove.html b/libs/js/jquery-geo-1.0b2/docs/examples/remove.html
deleted file mode 100755 (executable)
index 8bdeafa..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>geomap remove test</title>
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    .geomap
-    {
-      display: inline-block;
-      position: relative;
-      width: 640px;
-      height: 480px;
-    }
-
-    #point-list
-    {
-      display: inline-block;
-      list-style-type: none;
-    }
-  </style>
-</head>
-<body>
-  <a href="../" class="docLink">&lt; docs</a>
-  <h1>geomap remove test</h1>
-  <p>Click on the buttons to the right to call geomap.remove on points one at a time.</p>
-  <div class="geomap">
-  </div>
-  <ul id="point-list"></ul>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      var geomap = $(".geomap").geomap({
-        center: [-71.05, 42.35],
-        zoom: 13
-      });
-
-      var points = {
-        one: { type: "Point", coordinates: [-71.05, 42.35] },
-        two: { type: "Point", coordinates: [-71.045, 42.355] },
-        three: { type: "Point", coordinates: [-71.055, 42.345] },
-        four: { type: "Point", coordinates: [-71.055, 42.355] },
-        five: { type: "Point", coordinates: [-71.045, 42.345] }
-      };
-
-      var buttons = "";
-
-      for (var pointKey in points) {
-        geomap.geomap("append", points[pointKey]);
-        buttons += '<li><button type="button" data-point-key="' + pointKey + '">' + points[pointKey].coordinates + '</button></li>';
-      }
-      $("#point-list").append(buttons);
-
-      $("#point-list button").click(function () {
-        var pointKey = $(this).data("pointKey");
-        $(".geomap").geomap("remove", points[pointKey]);
-        $(this).remove();
-      });
-    });
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/removeservice.html b/libs/js/jquery-geo-1.0b2/docs/examples/removeservice.html
deleted file mode 100755 (executable)
index cb473be..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>geomap remove service test</title>
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    ul
-    {
-      float: right;
-      list-style-type: none;
-    }
-  </style>
-</head>
-<body>
-  <a href="../" class="docLink">&lt; docs</a>
-  <h1>geomap remove service test</h1>
-  <p>Similar to the regular remove example but tests removing shapes from a specific service instead of the map itself.</p>
-  <ul>
-  </ul>
-  <div class="geomap" style="width: 640px; height: 480px;">
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      var geomap = $(".geomap").geomap({
-            center: [-71.05, 42.35],
-            zoom: 13
-          }),
-          service = geomap.find( ".osm" );
-
-      var points = {
-        one: { type: "Point", coordinates: [-71.05, 42.35] },
-        two: { type: "Point", coordinates: [-71.045, 42.355] },
-        three: { type: "Point", coordinates: [-71.055, 42.345] },
-        four: { type: "Point", coordinates: [-71.055, 42.355] },
-        five: { type: "Point", coordinates: [-71.045, 42.345] }
-      };
-
-      var buttons = "";
-
-      for (var pointKey in points) {
-        service.geomap("append", points[pointKey]);
-        buttons += '<li><button type="button" data-point-key="' + pointKey + '">' + points[pointKey].coordinates + '</button></li>';
-      }
-      $("ul").append(buttons);
-
-      $("ul button").click(function () {
-        var pointKey = $(this).data("pointKey");
-        service.geomap("remove", points[pointKey]);
-        $(this).remove();
-      });
-    });
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/services.html b/libs/js/jquery-geo-1.0b2/docs/examples/services.html
deleted file mode 100755 (executable)
index 6895f7a..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>services example</title>
-  <meta charset="utf-8">
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of the services property">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/==JSFIDDLE==/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>services</h1>
-      <p>This example tests setting the service object array, i.e., the geomap services option, in different ways.</p>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      // create a map
-      var map = $("#map").geomap({
-        center: [-71.0595678, 42.3604823],
-        zoom: 8
-      });
-    });  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/shapeStyle.html b/libs/js/jquery-geo-1.0b2/docs/examples/shapeStyle.html
deleted file mode 100755 (executable)
index c4fd120..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8" />
-  <title>shapeStyle test</title>
-  <meta name="description" content="geomap shapeStyle test" />
-  <meta name="author" content="Ryan Westphal" />
-  <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" />
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-
-    label { white-space: nowrap; }
-
-    label span { display: inline-block; width: 7rem; }
-    input { width: 6rem; }
-
-    button { width: 16rem; }
-  </style>
-</head>
-<body>
-  <div class="shapeStyle">
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/BXgV4/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>shapeStyle</h1>
-      <p>This page tests various style properties using the shapeStyle option to change the default style or and passing a shape-specific style to the append method.</p>
-      <form id="shapeStyle">
-        <fieldset>
-          <legend>base geomap shapeStyle option</legend>
-          <div>
-            <label><span>color</span> <input type="color" name="color" value="#7f0000" /></label>
-            <label><span>opacity</span> <input type="text" name="opacity" value="1.0" /></label>
-          </div>
-          <div>
-            <label><span>fill</span> <input type="color" name="fill" value="" /></label>
-            <label><span>fillOpacity</span> <input type="text" name="fillOpacity" value=".2" /></label>
-          </div>
-          <div>
-            <label><span>stroke</span> <input type="color" name="stroke" value="" /></label>
-            <label><span>strokeOpacity</span> <input type="text" name="strokeOpacity" value="1" /></label>
-            <label><span>strokeWidth</span> <input type="number" name="strokeWidth" value="2" /></label>
-          </div>
-          <div>
-            <label><span>width</span> <input type="number" name="width" value="8" /></label>
-            <label><span>height</span> <input type="number" name="height" value="8" /></label>
-            <label><span>borderRadius</span> <input type="number" name="borderRadius" value="8" /></label>
-          </div>
-        </fieldset>
-        <button type="button">set shapeStyle</button>
-        <button type="reset">reset shapeStyle</button>
-      </form>
-      <form id="append">
-        <fieldset>
-          <legend>specific append style argument</legend>
-          <div>
-            <label><span>color</span> <input type="color" name="color" value="" /></label>
-            <label><span>opacity</span> <input type="text" name="opacity" value="" /></label>
-          </div>
-          <div>
-            <label><span>fill</span> <input type="color" name="fill" value="" /></label>
-            <label><span>fillOpacity</span> <input type="text" name="fillOpacity" value="" /></label>
-          </div>
-          <div>
-            <label><span>stroke</span> <input type="color" name="stroke" value="" /></label>
-            <label><span>strokeOpacity</span> <input type="text" name="strokeOpacity" value="" /></label>
-            <label><span>strokeWidth</span> <input type="number" name="strokeWidth" value="" /></label>
-          </div>
-          <div>
-            <label><span>width</span> <input type="number" name="width" value="" /></label>
-            <label><span>height</span> <input type="number" name="height" value="" /></label>
-            <label><span>borderRadius</span> <input type="number" name="borderRadius" value="" /></label>
-          </div>
-        </fieldset>
-        <button type="reset">clear append style</button>
-      </form>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      // create a map
-      var map = $( "#map" ).geomap( {
-        center: [ -71.0595678, 42.3604823 ],
-        zoom: 8,
-        click: function ( e, geo ) {
-          // in the click handler append the shape to the map
-          // the final display style will be the base shapeStyle
-          // plus individual shape style property overrides via
-          // a style passed to the append method
-          var appendStyle = { };
-
-          $.each( $( "#append input" ).serializeArray( ), function( ) {
-            // run through each input in the append fieldset and
-            // build a style object if there are any style overrides
-            if ( this.value ) {
-              appendStyle[ this.name ] = this.value;
-            }
-          } );
-
-          // append the shape
-          // it will get the base shapeStyle (which can change later)
-          // plus any overrides from the append style (which cannot change)
-          map.geomap( "append", geo, appendStyle );
-        }
-      } );
-
-      $( "#shapeStyle input" ).change( function( ) {
-        // when an input of the shapeStyle section changes,
-        // immediately set the property of geomap's shapeStyle option
-        // this change will effect all appended shapes that don't have
-        // an explicit override for the style property that's changing
-
-        // first, we can grab a jQuery reference to the input that changed
-        var $this = $( this );
-
-        // next, we can create an object that represents this change
-        // this example doesn't, but you can set more than one property
-        // on geomap's shapeStyle option at a time
-        var shapeOption = { };
-        shapeOption[ $this.attr( "name" ) ] = $this.val();
-
-        map.geomap( "option", "shapeStyle", shapeOption );
-      } );
-
-      // jQuery UI for pretty reset buttons
-      $( "button" ).button( );
-
-      // maintin a copy of the original shapeStyle so we can reset it later
-      var originalShapeStyle = map.geomap( "option", "shapeStyle" );
-
-      $( "#shapeStyle button[type='reset']" ).click( function( ) {
-        // when the user resets the shapeStyle form,
-        // we want to also reset the shapeStyle option
-        // back to its original state
-        map.geomap( "option", "shapeStyle", originalShapeStyle );
-      } );
-    });
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/shapeStyleservice.html b/libs/js/jquery-geo-1.0b2/docs/examples/shapeStyleservice.html
deleted file mode 100755 (executable)
index b11f93b..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8" />
-  <title>shapeStyle service test</title>
-  <meta name="description" content="geomap shapeStyle service test" />
-  <meta name="author" content="Ryan Westphal" />
-  <meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0" />
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-
-    label { white-space: nowrap; }
-
-    label span { display: inline-block; width: 7rem; }
-    input { width: 6rem; }
-
-    button { width: 16rem; }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/BXgV4/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>shapeStyle service</h1>
-      <p>This page is similar to the regular shapeStyle example but tests changing the style of a specific service instead of the map itself.</p>
-      <form id="shapeStyle">
-        <fieldset>
-          <legend>base geomap shapeStyle option</legend>
-          <div>
-            <label><span>color</span> <input type="color" name="color" value="#7f0000" /></label>
-            <label><span>opacity</span> <input type="text" name="opacity" value="1.0" /></label>
-          </div>
-          <div>
-            <label><span>fill</span> <input type="color" name="fill" value="" /></label>
-            <label><span>fillOpacity</span> <input type="text" name="fillOpacity" value=".2" /></label>
-          </div>
-          <div>
-            <label><span>stroke</span> <input type="color" name="stroke" value="" /></label>
-            <label><span>strokeOpacity</span> <input type="text" name="strokeOpacity" value="1" /></label>
-            <label><span>strokeWidth</span> <input type="number" name="strokeWidth" value="2" /></label>
-          </div>
-          <div>
-            <label><span>width</span> <input type="number" name="width" value="8" /></label>
-            <label><span>height</span> <input type="number" name="height" value="8" /></label>
-            <label><span>borderRadius</span> <input type="number" name="borderRadius" value="8" /></label>
-          </div>
-        </fieldset>
-        <button type="button">set shapeStyle</button>
-        <button type="reset">reset shapeStyle</button>
-      </form>
-      <form id="append">
-        <fieldset>
-          <legend>specific append style argument</legend>
-          <div>
-            <label><span>color</span> <input type="color" name="color" value="" /></label>
-            <label><span>opacity</span> <input type="text" name="opacity" value="" /></label>
-          </div>
-          <div>
-            <label><span>fill</span> <input type="color" name="fill" value="" /></label>
-            <label><span>fillOpacity</span> <input type="text" name="fillOpacity" value="" /></label>
-          </div>
-          <div>
-            <label><span>stroke</span> <input type="color" name="stroke" value="" /></label>
-            <label><span>strokeOpacity</span> <input type="text" name="strokeOpacity" value="" /></label>
-            <label><span>strokeWidth</span> <input type="number" name="strokeWidth" value="" /></label>
-          </div>
-          <div>
-            <label><span>width</span> <input type="number" name="width" value="" /></label>
-            <label><span>height</span> <input type="number" name="height" value="" /></label>
-            <label><span>borderRadius</span> <input type="number" name="borderRadius" value="" /></label>
-          </div>
-        </fieldset>
-        <button type="reset">clear append style</button>
-      </form>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      // create a map
-      var map = $( "#map" ).geomap( {
-            center: [ -71.0595678, 42.3604823 ],
-            zoom: 8,
-            click: function ( e, geo ) {
-              // in the click handler append the shape to the map
-              // the final display style will be the base shapeStyle
-              // plus individual shape style property overrides via
-              // a style passed to the append method
-              var appendStyle = { };
-
-              $.each( $( "#append input" ).serializeArray( ), function( ) {
-                // run through each input in the append fieldset and
-                // build a style object if there are any style overrides
-                if ( this.value ) {
-                  appendStyle[ this.name ] = this.value;
-                }
-              } );
-
-              // append the shape
-              // it will get the base shapeStyle (which can change later)
-              // plus any overrides from the append style (which cannot change)
-              map.find( ".osm" ).geomap( "append", geo, appendStyle );
-            }
-          } ),
-          service = map.find( ".osm" );
-
-      $( "#shapeStyle input" ).change( function( ) {
-        // when an input of the shapeStyle section changes,
-        // immediately set the property of geomap's shapeStyle option
-        // this change will effect all appended shapes that don't have
-        // an explicit override for the style property that's changing
-
-        // first, we can grab a jQuery reference to the input that changed
-        var $this = $( this );
-
-        // next, we can create an object that represents this change
-        // this example doesn't, but you can set more than one property
-        // on geomap's shapeStyle option at a time
-        var shapeOption = { };
-        shapeOption[ $this.attr( "name" ) ] = $this.val();
-
-        service.geomap( "option", "shapeStyle", shapeOption );
-      } );
-
-      // jQuery UI for pretty reset buttons
-      $( "button" ).button( );
-
-      // maintin a copy of the original shapeStyle so we can reset it later
-      var originalShapeStyle = service.geomap( "option", "shapeStyle" );
-
-      $( "#shapeStyle button[type='reset']" ).click( function( ) {
-        // when the user resets the shapeStyle form,
-        // we want to also reset the shapeStyle option
-        // back to its original state
-        service.geomap( "option", "shapeStyle", originalShapeStyle );
-      } );
-    });
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/shingled.html b/libs/js/jquery-geo-1.0b2/docs/examples/shingled.html
deleted file mode 100755 (executable)
index 8601933..0000000
+++ /dev/null
@@ -1,141 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>shingled example</title>
-  <meta charset="utf-8">
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of shingled services">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/WmqDx/embedded/" class="fiddleLink not-mobile"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>
-        shingled</h1>
-      <p class="not-mobile">This page tests geomap with shingled services, i.e., fully dynamic services that to not use a tilingScheme. Dynamic services can be set to any scale.</p>
-      <p class="not-mobile">If all shingled services are in the same projection, they can be layered and turned on and off at any time by updating and re-setting the services option of the geomap widget or by using the toggle convenience method.</p>
-      <p class="not-mobile">The toggle method is preferred because it is faster and you can use it on specific services, e.g., $(&quot;#massgis_interiorforest&quot;).geomap(&quot;toggle&quot;).</p>
-      <p class="not-mobile">These services are hosted by MassGIS.</p>
-      <div id="layers">
-        <input type="checkbox" id="interiorforest" name="layer" value="interiorforest" /><label for="interiorforest">Interior Forest</label>
-        <input type="checkbox" id="hydrography" name="layer" value="hydrography" /><label for="hydrography">Hydrography</label>
-      </div>
-
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      // Set proj to null because we are working a different projection &
-      // entirely in map units
-      //
-      // Note: this is still valid in a4
-      // Though not required because we're working entirely in map units,
-      // i.e., jQuery Geo will not need to project anything,
-      // it makes sense because we are not working in the default projection of web mercator
-
-      $.geo.proj = null;
-
-      // some strings used in all services
-      // base URL for image request
-      var massGisHost = "http://giswebservices.massgis.state.ma.us/geoserver/wms";
-      // view template used to get the map image
-      // notice that we can put the view arguments right into the template
-      var imageTemplate = "&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&SRS=EPSG%3A26986&BBOX={{:bbox}}&WIDTH={{:width}}&HEIGHT={{:height}}";
-
-      // create a map with three services from MassGIS
-      // the service types are "shingled"
-      // they must all be in the same coordinate system to work together
-      // to keep jQuery Geo's API simple, it will only work in one coordinate system at a time and will not reproject images on the fly
-
-      var map = $("#map").geomap({
-        services: [
-          // this is a basemap and will always be shown
-          // it's the only one we need to put the attr on
-          // since all services come from the same source
-          {
-            id: "massgis_basemap",
-            type: "shingled",
-            src: massGisHost + "?LAYERS=massgis_basemap" + imageTemplate,
-            attr: "&copy; 2011 Commonwealth of Massachusetts"
-          },
-
-          // this is a forest layer
-          // it has style.visibility set to "hidden"
-          {
-            id: "massgis_interiorforest",
-            type: "shingled",
-            src: massGisHost + "?LAYERS=massgis%3AGISDATA.INTERIORFOREST_POLY&STYLES=GISDATA.INTERIORFOREST_POLY%3A%3ADefault&TRANSPARENT=true" + imageTemplate,
-            style: {
-              visibility: "hidden"
-            }
-          },
-
-          // this is a water layer
-          // it has style.visibility set to "hidden"
-          {
-            id: "massgis_hydrography",
-            type: "shingled",
-            src: massGisHost + "?LAYERS=massgis%3AGISDATA.MAJPOND_POLY,massgis%3AGISDATA.MAJSTRM_ARC&TRANSPARENT=true" + imageTemplate,
-            style: {
-              visibility: "hidden"
-            }
-          }
-        ],
-
-        // you must set bboxMax for shingled services for the zoom property to mean anything
-        bboxMax: [31789.1658, 790194.4183, 337250.8970, 961865.1338],
-        // shingled services do not have a tilingScheme
-        tilingScheme: null,
-
-        center: [ 184670.21967, 890771.290247 ],
-        zoom: 4
-      });
-
-      // jQuery UI for pretty buttons
-      $("#layers").buttonset();
-
-      $("#layers input").click(function() {
-        // when a service object has the id property set,
-        // we can perform some geomap operations directly on the service
-
-        // in this case, the id of each extra layer is the same as the id for the checkbox but has a "massgis_" prefix 
-
-        // we can toggle the layer based on the prefix and input id
-        $("#massgis_" + this.id).geomap("toggle", $(this).prop("checked"));
-      });
-
-    });  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/simplest.html b/libs/js/jquery-geo-1.0b2/docs/examples/simplest.html
deleted file mode 100755 (executable)
index 0cc201f..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <head>
-    <meta charset="utf-8">
-
-    <title>simplest</title>
-
-    <meta name="description" content="A very simple instantiation of the geomap widget">
-    <meta name="author" content="Ryan Westphal">
-    <link rel="stylesheet" type="text/css" href="css/style.css" />
-  </head>
-<body>
-  <div>
-    <a href="../" class="docLink">&lt; docs</a>
-    <h1>simplest</h1>
-    <p>A 256x256 pixel div...geomap called with no arguments.</p>
-    <div id="map" style="width: 256px; height: 256px;"></div>
-  </div>
-
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      $("#map").geomap();
-    });  
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/spocode.html b/libs/js/jquery-geo-1.0b2/docs/examples/spocode.html
deleted file mode 100755 (executable)
index 9f0612b..0000000
+++ /dev/null
@@ -1,329 +0,0 @@
-<!doctype html>
-<html>
-  <head>
-    <meta charset="utf-8">
-
-    <title>Geeky Boating Elk</title>
-    
-    <meta name="viewport" content="width=device-width">
-
-    <style type="text/css">
-      body {
-        font-family: Verdana;
-      }
-
-      .title {
-        background: #fff;
-        border-radius: 8px;
-        border-bottom-left-radius: 0;
-        display: inline-block;
-        float: left;
-        padding: 8px;
-        margin: 0;
-      }
-
-      .title p { display: none; }
-
-      h1 {
-        display: inline-block;
-        margin: 0;
-      }
-
-      .legend {
-        font-size: .6em;
-        background: #fff;
-        border-bottom-left-radius: 16px;
-        border-bottom-right-radius: 16px;
-        clear: left;
-        display: inline-block;
-        float: left;
-        padding: 8px;
-      }
-
-      h2 {
-        font-size: 1em;
-        margin-top: 0;
-      }
-
-      .polygon-swatch {
-        box-sizing: border-box;
-        width: 16px;
-        height: 12px;
-      }
-
-      .point-swatch {
-        border-radius: 12px;
-        margin-left: 2px;
-        width: 12px;
-        height: 12px;
-      }
-
-      p { margin: 0; }
-
-      /* a big map */
-      #map {
-        position: fixed;
-        top: 0;
-        right: 0;
-        left: 0;
-        bottom: 0;
-      }
-
-      /* all labels will get this style */
-      .geo-label {
-        background: #eee;
-        border-radius: 8px;
-        padding: 4px;
-      }
-
-      #map ul {
-        font-size: .8em;
-      }
-
-      /* this section overrides the primary ('mobile first') styles */
-      @media only screen and (min-width: 35em) {
-        .title {
-          margin: 16px 0 0 16px;
-        }
-
-        .legend {
-          font-size: .8em;
-          margin: 0 0 16px 16px;
-        }
-
-        .title p { display: block; }
-
-        .polygon-swatch {
-          width: 24px;
-          height: 16px;
-        }
-
-        .point-swatch {
-          border-radius: 16px;
-          margin-left: 4px;
-          width: 16px;
-          height: 16px;
-        }
-  
-        #map ul {
-          font-size: 1em;
-        }
-      }
-    </style>
-  </head>
-
-  <body>
-    <div id="map">
-      <div class="title">
-        <h1>Geeky Boating Elk</h1>
-        <p>Where an elk can find good WiFi and a boat launch but not get shot.</p>
-      </div>
-      <div class="legend">
-        <h2>Legend</h2>
-        <table>
-          <tr><th><div class="polygon-swatch" style="background: rgb(255, 170, 0);"></div></th><td>1.5 &mdash; 3 Mbps wireless</td></tr>
-          <tr><th><div class="polygon-swatch" style="background: rgb(191, 75, 227);"></div></th><td>3 &mdash; 6 Mbps wireless</td></tr>
-          <tr><th><div class="polygon-swatch" style="background: rgb(76, 0, 115);"></div></th><td>6 &mdash; 10 Mbps wireless</td></tr>
-          <tr><th><div class="polygon-swatch" style="background: #888; border: 2px solid #222;"></div></th><td>Elk Hunt Area</td></tr>
-          <tr><th><div class="point-swatch" style="background: #942"></div></th><td>Boat Launch</td></tr>
-        </table>
-      </div>
-    </div>
-
-    <script src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
-    <script src="../jquery.geo-test.min.js"></script>
-
-    <script src="js/iecors.js"></script>
-    <script>
-
-$(function() {
-  // check for cached data, why wait if it's not going to change that often
-  var boatLaunchData = window.localStorage.getItem( "boatLaunchData" ),
-      elkHuntData = window.localStorage.getItem( "elkHuntData" ),
-      startingLocation = window.sessionStorage.getItem( "startingLocation" );
-
-
-  if ( boatLaunchData ) {
-    boatLaunchData = JSON.parse( boatLaunchData );
-  }
-
-  if ( elkHuntData ) {
-    elkHuntData = JSON.parse( elkHuntData );
-  }
-
-  if ( startingLocation ) {
-    startingLocation = JSON.parse( startingLocation );
-  } else {
-    startingLocation = {
-      center: [ -120.5, 47.5 ], //< center on WA
-      zoom: 7 //< zoom in a bit
-    };
-  }
-
-  // create a map
-  var map = $("#map").geomap({
-
-    center: startingLocation.center,
-
-    zoom: startingLocation.zoom,
-
-    mode: "drawPoint", //< triggers the shape event
-
-    // an array of service objects
-    services: [
-      // Esri World Street Map as basemap
-      // tiled, web mercator
-      {
-        type: "tiled",
-        src: "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{{:zoom}}/{{:tile.row}}/{{:tile.column}}",
-        attr: "&copy; Esri, et al."
-      },
-
-      // WA wireless download speeds
-      // orange: 1.5 - 3 Mb
-      // light purple: 3 - 6 Mb
-      // dark purple: 6 - 10 Mb
-      {
-        type: "shingled",
-        src: "http://mapservices.appgeo.com/ArcGIS/rest/services/WashingtonBroadband/MapServer/export?bbox={{:bbox}}&layers=show:3&layerdefs={3:\"MaxAdvDown = '4' or MaxAdvDown = '5' or MaxAdvDown = '6'\"}&size={{:width}},{{:height}}&format=png&transparent=true&f=image",
-        style: { opacity: .7 }
-      },
-
-      // a layer to append elk hunt areas
-      // we could append to the map but they would draw over our selection label
-      {
-        id: "elk-hunt",
-        type: "shingled",
-        src: "",
-        attr: "&copy; State of WA, WA DFW"
-      },
-
-      // a layer to keep boat launch sites so we're not searching
-      // through other appended features when we click the map
-      {
-        id: "boat-launch",
-        type: "shingled",
-        src: ""
-      },
-
-      // a layer used to highlight and label a selected boat launch
-      {
-        id: "selected-launch",
-        type: "shingled",
-        src: ""
-      }
-    ],
-
-    bboxchange: function( e, geo ) {
-      window.sessionStorage.setItem( "startingLocation", JSON.stringify( {
-        center: map.geomap( "option", "center" ),
-        zoom: map.geomap( "option", "zoom" )
-      } ) );
-    },
-
-    shape: function( e, geo ) {
-      var boatLaunch = boatLaunches.geomap( "find", geo, 4 );
-      if ( boatLaunch.length > 0 ) {
-        selectedLaunch.geomap( "empty" );
-        selectedLaunch.geomap( "append", {
-          type: "Point",
-          geometry: boatLaunch[ 0 ].geometry
-        }, {
-          color: "#2df"
-        }, '<b>' + boatLaunch[ 0 ].properties.name + '</b><br>' + boatLaunch[ 0 ].properties.waterBody  );
-      }
-    }
-  });
-
-  // keep references to services we interact with
-  var boatLaunches = $("#boat-launch"),
-      selectedLaunch = $("#selected-launch");
-
-  // download boat launch sites (unless we already have them)
-
-  if ( boatLaunchData ) {
-    boatLaunches.geomap( "append", boatLaunchData, { color: "#942", strokeOpacity: 0, fillOpacity: 1 } );
-  } else {
-    // wa.gov doesn't support CORS but AGS supports JSONP
-    $.ajax({
-      url: "http://gismanager.rco.wa.gov/ArcGIS/rest/services/RCOBoatFacs/MapServer/1/query?where=1%3D1&returnGeometry=true&outFields=OBJECTID,FACILITY_NM,WTR_BDY&f=json",
-      dataType: "jsonp",
-      success: function(result) {
-        if ( result && result.features ) {
-          // convert to GeoJSON Point Features
-          var geoJsonResults = $.map( result.features, function( value ) {
-            return {
-              type: "Feature",
-              geometry: {
-                type: "Point",
-                coordinates: [ value.geometry.x, value.geometry.y ]
-              },
-              properties: {
-                name: value.attributes.FACILITY_NM,
-                waterBody: value.attributes.WTR_BDY
-              }
-            }
-          } );
-
-          try {
-            // may fail if quota exceeded
-            window.localStorage.setItem( "boatLaunchData", JSON.stringify( geoJsonResults ) );
-          } catch ( ex ) { }
-
-          boatLaunches.geomap( "append", geoJsonResults, { color: "#942", strokeOpacity: 0, fillOpacity: 1 } );
-        } else {
-          // O_o
-          alert( "There are no Boat Launches :O" );
-        }
-      },
-      error: function(xhr) {
-        // :(
-        alert(xhr.statusText);
-      }
-    });
-  }
-
-  // download elk hunt areas (unless we already have them)
-
-  if ( elkHuntData ) {
-    $( "#elk-hunt" ).geomap( "append", elkHuntData, { color: "#222" } );
-  } else {
-    // arcgis.com supports true CORS
-    $.ajax({
-      url: "http://services.arcgis.com/jsIt88o09Q0r1j8h/ArcGIS/rest/services/WADFW_Elk_Areas/FeatureServer/0/query?where=1%3D1&outFields=OBJECTID&returnGeometry=true&f=json",
-      dataType: "json",
-      success: function(result) {
-        if ( result && result.features ) {
-          // convert to GeoJSON Polygons
-          // we ignore all properties and just add Polygon objects instead of Feature objects
-          var geoJsonResults = $.map( result.features, function( value ) {
-            return {
-              type: "Polygon",
-              coordinates: value.geometry.rings
-            }
-          } );
-
-          try {
-            // may fail if quota exceeded
-            window.localStorage.setItem( "elkHuntData", JSON.stringify( geoJsonResults ) );
-          } catch ( ex ) { }
-
-          $( "#elk-hunt" ).geomap( "append", geoJsonResults, { color: "#222" } );
-        } else {
-          // O_o
-          alert( "There are no Elk Areas :O" );
-        }
-      },
-      error: function(xhr) {
-        // :(
-        alert(xhr.statusText);
-      }
-    });
-  }
-});
-
-
-    </script>
-  </body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/static.html b/libs/js/jquery-geo-1.0b2/docs/examples/static.html
deleted file mode 100755 (executable)
index a8aa250..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>static mode example</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of static mode">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/==JSFIDDLE==/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>static mode</h1>
-      <p>When the mode option is set to &quot;static&quot; a developer can create a map that the user can see but cannot change.</p>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      // create a map with mode set to static
-      var map = $("#map").geomap({
-        center: [-71.0595678, 42.3604823],
-        zoom: 14,
-        mode: "static"
-      });
-    });  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/stringsrc.html b/libs/js/jquery-geo-1.0b2/docs/examples/stringsrc.html
deleted file mode 100755 (executable)
index 4563e47..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>string src example</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of setting a service src to a string">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/YPkj4/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>string service src</h1>
-      <p>This example shows how you can set a service's src property to a jsRender template string.</p>
-      <p>The src property of the service object for this map is set to:</p>
-      <p>&quot;http://tile.openstreetmap.org/{{:zoom}}/{{:tile.column}}/{{:tile.row}}.png&quot;</p>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      // create a map that replaces the default service with
-      // one using a string for the src property instead of a function
-      var map = $("#map").geomap({
-        center: [-71.0595678, 42.3604823],
-        zoom: 8,
-        services: [ {
-          id: "osm-string-src",
-          type: "tiled",
-          src: "http://tile.openstreetmap.org/{{:zoom}}/{{:tile.column}}/{{:tile.row}}.png"
-        } ]
-      });
-    });  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/template.html b/libs/js/jquery-geo-1.0b2/docs/examples/template.html
deleted file mode 100755 (executable)
index 303ba1b..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>TEMPLATE example</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of TEMPLATE">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/==JSFIDDLE==/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>TEMPLATE</h1>
-      <p></p>
-    </div>
-  </div>
-  <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.24/jquery-ui.min.js"></script>
-  <script src="../../js/excanvas.js"></script>
-  <script src="../../js/jsrender.js"></script>
-  <script src="../../js/jquery.mousewheel.js"></script>
-  <script src="../../js/jquery.ui.widget.js"></script>
-  <script src="../../js/jquery.geo.core.js"></script>
-  <script src="../../js/jquery.geo.geographics.js"></script>
-  <script src="../../js/jquery.geo.geomap.js"></script>
-  <script src="../../js/jquery.geo.tiled.js"></script>
-  <script src="../../js/jquery.geo.shingled.js"></script>
-  <!--<script src="../jquery.geo-test.min.js"></script>-->
-  <script>
-    $( function ( ) {
-      // create a map
-      var map = $( "#map" ).geomap( {
-        center: [ -71.0595678, 42.3604823 ],
-        zoom: 8
-      } );
-    } );  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/tiger.html b/libs/js/jquery-geo-1.0b2/docs/examples/tiger.html
deleted file mode 100755 (executable)
index 171ab5b..0000000
+++ /dev/null
@@ -1,215 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>TIGER polygon example</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of TIGER polygons in WMS or JSON">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info not-mobile">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/==JSFIDDLE==/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>TIGER polygons</h1>
-      <p>
-        <label><input type="radio" name="poly-type" value="ags" checked /> <span>ArcGIS MapServer</span></label>
-        <label><input type="radio" name="poly-type" value="json" /> <span>ArcGIS JSON (<span id="lblPolyType">Counties</span>)</span></label>
-      </p>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $( function ( ) {
-      var jsonXhr = null, // json request for tiger data, so we can cancel it
-          polyType = "ags",
-
-          // so we can let the user know what they're seeing
-          polyTypeNames = {
-            "74": "States",
-            "76": "Counties",
-            "6": "Census Tracts",
-            "8": "Census Block Groups",
-            "10": "Census Blocks"
-          },
-
-          // we only want to query one layer depending on the zoom level
-          // this array maps zoom levels to census layers
-          jsonLayerMap = [ 74, 74, 74, 74, 74, 74, 74, 74, 76, 76, 76, 6, 6, 6, 8, 8, 10, 10 ];
-
-      // create a map
-      var map = $( "#map" ).geomap( {
-        center: [ -71.0595678, 42.3604823 ],
-        zoom: 8,
-        bboxchange: function( ) {
-          if ( polyType === "json" ) {
-            // only update the JSON layer if we're rendering with JSON
-
-            var layer = jsonLayerMap[ map.geomap( "option", "zoom" ) ];
-
-            if ( layer == 74 ) {
-              // remove any non-state shapes
-              tigerJson.geomap( "empty" );
-            } else {
-              updateTigerJson( layer, map.geomap( "option", "bbox" ), tigerJson );
-            }
-          }
-
-          // update the poly type label
-          $( "#lblPolyType" ).text( polyTypeNames[ jsonLayerMap[ map.geomap( "option", "zoom" ) ] ] );
-        },
-        services: [
-          // MapQuest basemap
-          {
-            type: "tiled",
-            src: function( view ) {
-              return "http://otile" + ((view.index % 4) + 1) + ".mqcdn.com/tiles/1.0.0/osm/" + view.zoom + "/" + view.tile.column + "/" + view.tile.row + ".png";
-            },
-            attr: "<p>Tiles Courtesy of <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png'></p>"
-          },
-
-          // TIGER data as map images from an ArcGIS Server
-          {
-            id: "tiger-ags",
-            "class": "tiger",
-            type: "shingled",
-            src: "http://tigerweb.geo.census.gov/ArcGIS/rest/services/tigerWMS_Current/MapServer/export?bbox={{:bbox}}&layers=show:6,8,10,20,74,75,76,77&size={{:width}},{{:height}}&format=png&transparent=true&f=image"
-          },
-
-          // TIGER data as map images from ArcGIS's WMS Server
-          // I would love to use this so I can test the SLD_BODY argument to change the colors
-          // but it just isn't working for me
-          /*
-          {
-            id: "tiger-wms",
-            type: "shingled",
-            src: "http://tigerweb.geo.census.gov/ArcGIS/rest/services/tigerWMS_Current/MapServer/WMSServer?VERSION=1.3.0&REQUEST=GetMap&CRS=EPSG:3857&BBOX={{:bbox}}&LAYERS=States&STYLES=default&WIDTH={{:width}}&HEIGHT={{:height}}&FORMAT=image/png&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_xml" //&SLD_BODY=" + encodeURIComponent('<sld:StyledLayerDescriptor xmlns:sld="http://www.opengis.net/sld" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml"><sld:NamedLayer><sld:Name>74</sld:Name><sld:NamedStyle><sld:Name/></sld:NamedStyle><sld:UserStyle><sld:Name>redStates</sld:Name><sld:Title>redStates</sld:Title><sld:FeatureTypeStyle><sld:Rule><sld:LineSymbolizer><sld:Stroke><sld:CssParameter name="stroke">#FF0000</sld:CssParameter></sld:Stroke></sld:LineSymbolizer></sld:Rule></sld:FeatureTypeStyle></sld:UserStyle></sld:NamedLayer></sld:StyledLayerDescriptor>')
-          },
-          */
-
-          // TIGER data drawn dynamically as shapes from JSON data
-          {
-            id: "tiger-json",
-            "class": "tiger",
-            type: "shingled",
-            src: "",
-            style: { visibility: "hidden" }
-          },
-
-          // TIGER states drawn dynamically from JSON data
-          // we put states in their own service to cache them
-          // because they will likely be requested more than other layers
-          // and they're lower polygon count
-          {
-            id: "tiger-json-states",
-            "class": "tiger",
-            type: "shingled",
-            src: "",
-            style: { visibility: "hidden" }
-          }
-        ]
-      } );
-
-      // don't fill the json layer's shapes
-      var tigerJson = $( "#tiger-json" ).geomap( "option", "shapeStyle", { fillOpacity: 0 } );
-      var tigerJsonStates = $( "#tiger-json-states" ).geomap( "option", "shapeStyle", { fillOpacity: 0, strokeWidth: 3 } );
-
-      $( "input[name='poly-type']" ).click( function( ) {
-        // when the type of render changes, update the visible service
-        $( ".tiger" ).geomap( "toggle", false );
-
-        polyType = $( "input[name='poly-type']:checked" ).val( );
-
-        switch ( polyType ) {
-          case "json":
-            // always show the states
-            tigerJsonStates.geomap( "toggle", true );
-
-            var layer = jsonLayerMap[ map.geomap( "option", "zoom" ) ];
-
-            if ( layer == 74 ) {
-              // remove any non-state shapes
-              tigerJson.geomap( "empty" );
-            } else {
-              updateTigerJson( layer, map.geomap( "option", "bbox" ), tigerJson );
-            }
-            break;
-        }
-
-        $( "#tiger-" + polyType ).geomap( "toggle", true );
-      } );
-
-      // get all of the states because we will likely see them soon
-      updateTigerJson( "74", null, tigerJsonStates );
-
-      function updateTigerJson( layer, bbox, service ) {
-        if ( jsonXhr ) {
-          // stop any previous ajax requests
-          jsonXhr.abort( );
-        }
-
-        // request JSON data from TIGER
-        jsonXhr = $.ajax({
-          url: "http://tigerweb.geo.census.gov/ArcGIS/rest/services/tigerWMS_Current/MapServer/" + layer + "/query",
-          data: {
-            geometry: bbox ? $.geo.proj.fromGeodetic( bbox ).join( "," ) : "",
-            geometryType: bbox ? "esriGeometryEnvelope" : "",
-            spatialRel: bbox ? "esriSpatialRelIntersects" : "",
-            where: "1=1",
-            returnGeometry: "true",
-            outFields: "OBJECTID",
-            f: "json"
-          },
-          dataType: "jsonp",
-          complete: function( ) {
-            jsonXhr = null;
-          },
-          success: function( result ) {
-            // remove any previous shapes
-            service.geomap( "empty" );
-
-            // draw the new ones
-            $.each( result.features, function( i ) {
-              // Esri REST Polygon results are only off from GeoJSON by one word
-              service.geomap( "append", {
-                type: "Polygon",
-                coordinates: this.geometry.rings
-              }, i == result.features.length - 1 );
-            } );
-          },
-          error: function(xhr) {
-            // something's wrong but we're just showing shapes so don't bother
-            // the user, who will likely pan or refresh to try again
-          }
-        });
-      }
-    } );  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/tiledservices.html b/libs/js/jquery-geo-1.0b2/docs/examples/tiledservices.html
deleted file mode 100755 (executable)
index 37f5e86..0000000
+++ /dev/null
@@ -1,239 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>tiled services test</title>
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    label
-    {
-      display: block;
-      margin: .25em;
-    }
-    label span
-    {
-      display: inline-block;
-      font-weight: bold;
-      width: 8em;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <a href="../" class="docLink">&lt; docs</a>
-    <h1>tiled services test</h1>
-
-    <p>This page tests initializing geomap with different services that support the same tilingScheme.</p>
-
-    <p>
-      So long as all services support the current tiling scheme, they are interchangeabe without worrying about the tilingScheme property.</p>
-    <p>
-      Dynamic services can be layered on top of tiled services as they don't require a tilingScheme at all, however you have to make sure the map units match, e.g., the dynamic service accepts a geodetic (lon/lat) bounding box or you set $.proj to null and work entirely in a specific projection's map units.</p>
-    <h2>
-      service examples</h2>
-    <p>
-      Choose a services array and click <b>set via init</b> to refresh the page and re-initialize the map (including center &amp; zoom properties) or <b>set via property</b> to change only the services property at runtime.</p>
-    <form action="tiledservices.html" method="get">
-    <fieldset>
-      <label>
-        <input type="radio" name="initService" value="defaultOsm" />
-        default OSM
-      </label>
-      <pre><code>[
-  {
-    id: &quot;OSM&quot;,
-    type: &quot;tiled&quot;,
-    src: function (view) {
-      return &quot;http://tile.openstreetmap.org/&quot;
-       + view.zoom + &quot;/&quot;
-       + view.tile.column + &quot;/&quot;
-       + view.tile.row
-       + &quot;.png&quot;;
-    },
-    attr: &quot;&copy; OpenStreetMap &amp; contributors, CC-BY-SA&quot;
-  }
-]</code></pre>
-      <label>
-        <input type="radio" name="initService" value="mapquestOsm" />
-        MapQuest OSM
-      </label>
-      <pre><code>[
-  {
-    id: &quot;OSM_MapQuest&quot;,
-    type: &quot;tiled&quot;,
-    src: function (view) {
-      return &quot;http://otile&quot; + ((view.index % 4) + 1) + &quot;.mqcdn.com/tiles/1.0.0/osm/&quot;
-       + view.zoom + &quot;/&quot;
-       + view.tile.column + &quot;/&quot;
-       + view.tile.row
-       + &quot;.png&quot;;
-    },
-    attr: &quot;Tiles Courtesy of &lt;a href='http://www.mapquest.com/' target='_blank'&gt;MapQuest&lt;/a&gt; &lt;img src='http://developer.mapquest.com/content/osm/mq_logo.png'&gt;&quot;
-  }
-]</code></pre>
-      <label>
-        <input type="radio" name="initService" value="mapquestOrtho" />
-        MapQuest Open Ortho
-      </label>
-      <pre><code>[
-  {
-    id: &quot;Ortho_MapQuest&quot;,
-    type: &quot;tiled&quot;,
-    src: function (view) {
-      return &quot;http://oatile&quot; + ((view.index % 4) + 1) + &quot;.mqcdn.com/naip/&quot;
-       + view.zoom + &quot;/&quot;
-       + view.tile.column + &quot;/&quot;
-       + view.tile.row
-       + &quot;.png&quot;;
-    },
-    attr: &quot;Tiles Courtesy of &lt;a href='http://www.mapquest.com/' target='_blank'&gt;MapQuest&lt;/a&gt; &lt;img src='http://developer.mapquest.com/content/osm/mq_logo.png'&gt;&quot;
-  }
-]</code></pre>
-      <label>
-        <input type="radio" name="initService" value="mapquestAll" />
-        MapQuest Open Ortho + MapQuest OSM at 30% opacity
-      </label>
-      <pre><code>[
-  {
-    id: &quot;Ortho_MapQuest&quot;,
-    type: &quot;tiled&quot;,
-    src: function (view) {
-      return &quot;http://oatile&quot; + ((view.index % 4) + 1) + &quot;.mqcdn.com/naip/&quot;
-       + view.zoom + &quot;/&quot;
-       + view.tile.column + &quot;/&quot;
-       + view.tile.row
-       + &quot;.png&quot;;
-    },
-    attr: &quot;Tiles Courtesy of &lt;a href='http://www.mapquest.com/' target='_blank'&gt;MapQuest&lt;/a&gt; &lt;img src='http://developer.mapquest.com/content/osm/mq_logo.png'&gt;&quot;
-  },
-  {
-    id: &quot;OSM_MapQuest&quot;,
-    type: &quot;tiled&quot;,
-    src: function (view) {
-      return &quot;http://otile&quot; + ((view.index % 4) + 1) + &quot;.mqcdn.com/tiles/1.0.0/osm/&quot;
-       + view.zoom + &quot;/&quot;
-       + view.tile.column + &quot;/&quot;
-       + view.tile.row
-       + &quot;.png&quot;;
-    },
-    style: { opacity: .3 }
-  }
-]</code></pre>
-    </fieldset>
-    <button type="submit">
-      set via init</button>
-    <button type="button">
-      set via property</button>
-    </form>
-    <div id="map" style="position: relative; width: 480px; height: 320px; background: #e88;">
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-
-      var selectionOptions = {
-        defaultOsm: {
-          services: [
-            {
-              id: "OSM",
-              type: "tiled",
-              src: function (view) {
-                return "http://tile.openstreetmap.org/" + view.zoom + "/" + view.tile.column + "/" + view.tile.row + ".png";
-              },
-              attr: "&copy; OpenStreetMap &amp; contributors, CC-BY-SA"
-            }
-          ],
-          center: [-71, 42],
-          zoom: 7
-        },
-
-        mapquestOsm: {
-          services: [
-            {
-              id: "OSM_MapQuest",
-              type: "tiled",
-              src: function (view) {
-                return "http://otile" + ((view.index % 4) + 1) + ".mqcdn.com/tiles/1.0.0/osm/" + view.zoom + "/" + view.tile.column + "/" + view.tile.row + ".png";
-              },
-              attr: "Tiles Courtesy of <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png'>"
-            }
-          ],
-          center: [-71, 42],
-          zoom: 7
-        },
-
-        mapquestOrtho: {
-          services: [
-            {
-              id: "Ortho_MapQuest",
-              type: "tiled",
-              src: function (view) {
-                return "http://oatile" + ((view.index % 4) + 1) + ".mqcdn.com/naip/" + view.zoom + "/" + view.tile.column + "/" + view.tile.row + ".png";
-              },
-              attr: "Tiles Courtesy of <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png'>"
-            }
-          ],
-          center: [-71, 42],
-          zoom: 7
-        },
-
-        mapquestAll: {
-          services: [
-            {
-              id: "Ortho_MapQuest",
-              type: "tiled",
-              src: function (view) {
-                return "http://oatile" + ((view.index % 4) + 1) + ".mqcdn.com/naip/" + view.zoom + "/" + view.tile.column + "/" + view.tile.row + ".png";
-              },
-              attr: "Tiles Courtesy of <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png'>"
-            },
-            {
-              id: "OSM_MapQuest",
-              type: "tiled",
-              src: function (view) {
-                return "http://otile" + ((view.index % 4) + 1) + ".mqcdn.com/tiles/1.0.0/osm/" + view.zoom + "/" + view.tile.column + "/" + view.tile.row + ".png";
-              },
-              style: { opacity: .3 }
-            }
-          ],
-          center: [-71, 42],
-          zoom: 7
-        }
-      };
-
-
-      var 
-      search = window.location.search,
-      searchParts = search.length && search[0] == "?" ? search.slice(1).split("&") : null,
-      initService = "defaultOsm",
-      serviceChanged = false;
-
-      if (searchParts) {
-        $.each(searchParts, function () {
-          var kvp = this.split("=");
-          switch (kvp[0]) {
-            case "initService":
-              initService = kvp[1];
-              serviceChanged = true;
-              break;
-          }
-        });
-      }
-
-      $("input[value='" + initService + "']").click();
-
-      $("button[type='button']").click(function () {
-        initService = $("input[name='initService']:checked").val();
-        $("#map").geomap("option", "services", selectionOptions[initService].services);
-      });
-
-      if (serviceChanged) {
-        window.scrollTo(0, $(document).height());
-      }
-
-      $("#map").geomap(selectionOptions[initService]);
-    });  
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/tilingScheme.html b/libs/js/jquery-geo-1.0b2/docs/examples/tilingScheme.html
deleted file mode 100755 (executable)
index c05fae9..0000000
+++ /dev/null
@@ -1,211 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>tilingScheme test</title>
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    label
-    {
-      display: block;
-      margin: .25em;
-    }
-    label span
-    {
-      display: inline-block;
-      font-weight: bold;
-      width: 8em;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <a href="../" class="docLink">&lt; docs</a>
-    <h1>
-      tilingScheme test</h1>
-    <p>
-      This page tests initializing geomap with services requiring different tilingSchemes.</p>
-    <p>
-      Dynamic services are not yet implemented but will be able to be layered on top of tiled services as they don't require a tilingScheme at all.</p>
-    <p>
-      For this example, I have set $.geo.proj to null and am setting the center in real map units. This is because the second service, New Jersey, is not in web mercator and geomap does not provide a built-in conversion from lon/lat.</p>
-    <p>
-      The New Jersey service is a tiled service with an ArcGIS Server REST endpoint. The level stops of an ArcGIS Server tile cache are often not a power of two and therefore cannot be calculated. We list them all out by using the pixelSizes property of the tilingScheme instead of specifying basePixelSize and levels properties.</p>
-    <h2>
-      examples</h2>
-    <p>
-      Choose a service/tilingScheme combo and click <b>set</b> to refresh the page and re-initialize the map<!-- (including center &amp; zoom properties) or <b>set via property</b> to change only the services property at runtime-->.</p>
-    <form action="tilingScheme.html" method="get">
-    <fieldset>
-      <label>
-        <input type="radio" name="initService" value="defaultOsm" />
-        default OSM (web mercator via hosted images)
-      </label>
-      <pre><code>services: [
-  {
-    id: &quot;OSM&quot;,
-    type: &quot;tiled&quot;,
-    src: function (view) {
-      return &quot;http://tile.openstreetmap.org/&quot;
-       + view.zoom + &quot;/&quot;
-       + view.tile.column + &quot;/&quot;
-       + view.tile.row
-       + &quot;.png&quot;;
-    },
-    attr: &quot;&copy; OpenStreetMap &amp; contributors, CC-BY-SA&quot;
-  }
-],
-tilingScheme: {
-  tileWidth: 256,
-  tileHeight: 256,
-  levels: 18,
-  basePixelSize: 156543.03392799936,
-  origin: [-20037508.342787, 20037508.342787]
-}</code></pre>
-      <label>
-        <input type="radio" name="initService" value="newjersey" />
-        New Jersey (NAD83 / New Jersey (ft US); ESPG 3424 via ArcGIS Server REST API)
-      </label>
-      <pre><code>services: [
-  {
-    id: &quot;NewJersey&quot;,
-    type: &quot;tiled&quot;,
-    src: function (view) {
-      return &quot;http://njgin.state.nj.us/ArcGIS/rest/services/Basemap/basemap/MapServer/tile/&quot;
-       + view.zoom + &quot;/&quot;
-       + view.tile.row + &quot;/&quot;
-       + view.tile.column;
-    }
-  }
-],
-tilingScheme: {
-  tileWidth: 512,
-  tileHeight: 512,
-  pixelSizes: [
-    3472.22222222222,
-    2604.16666666667,
-    2170.13888888889,
-    1562.5,
-    976.5625,
-    494.791666666667,
-    260.416666666667,
-    130.208333333333,
-    65.1041666666667,
-    32.5520833333333,
-    21.7013888888889,
-    10.8506944444444,
-    5.20833333333333,
-    2.08333333333333,
-    1.04166666666667
-  ],
-  origin: [-842000, 1440000]
-}</code></pre>
-    </fieldset>
-    <button type="submit">
-      set</button>
-    <!--<button type="button">
-      set via property</button>-->
-    </form>
-    <div id="map" style="position: relative; width: 480px; height: 320px; background: #e88;">
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-
-      var selectionOptions = {
-        defaultOsm: {
-          services: [
-            {
-              id: "OSM",
-              type: "tiled",
-              src: function (view) {
-                return "http://tile.openstreetmap.org/" + view.zoom + "/" + view.tile.column + "/" + view.tile.row + ".png";
-              },
-              attr: "&copy; OpenStreetMap &amp; contributors, CC-BY-SA"
-            }
-          ],
-          tilingScheme: {
-            tileWidth: 256,
-            tileHeight: 256,
-            levels: 18,
-            basePixelSize: 156543.03392799936,
-            origin: [-20037508.342787, 20037508.342787]
-          },
-          center: [-8299838.279318, 4853754.340195],
-          zoom: 7
-        },
-
-        newjersey: {
-          services: [
-            {
-              id: "NewJersey",
-              type: "tiled",
-              src: function (view) {
-                return "http://njgin.state.nj.us/ArcGIS/rest/services/Basemap/basemap/MapServer/tile/" + view.zoom + "/" + view.tile.row + "/" + view.tile.column;
-              }
-            }
-          ],
-          tilingScheme: {
-            tileWidth: 512,
-            tileHeight: 512,
-            pixelSizes: [
-              3472.22222222222,
-              2604.16666666667,
-              2170.13888888889,
-              1562.5,
-              976.5625,
-              494.791666666667,
-              260.416666666667,
-              130.208333333333,
-              65.1041666666667,
-              32.5520833333333,
-              21.7013888888889,
-              10.8506944444444,
-              5.20833333333333,
-              2.08333333333333,
-              1.04166666666667
-            ],
-            origin: [-842000, 1440000]
-          },
-          center: [458240.213369, 458773.907696],
-          zoom: 1
-        }
-      };
-
-
-      var 
-      search = window.location.search,
-      searchParts = search.length && search[0] == "?" ? search.slice(1).split("&") : null,
-      initService = "defaultOsm",
-      serviceChanged = false;
-
-      if (searchParts) {
-        $.each(searchParts, function () {
-          var kvp = this.split("=");
-          switch (kvp[0]) {
-            case "initService":
-              initService = kvp[1];
-              serviceChanged = true;
-              break;
-          }
-        });
-      }
-
-      $("input[value='" + initService + "']").click();
-
-//      $("button[type='button']").click(function () {
-//        initService = $("input[name='initService']:checked").val();
-//        $("#map").geomap("option", "services", selectionOptions[initService].services);
-//      });
-
-      if (serviceChanged) {
-        window.scrollTo(0, $(document).height());
-      }
-
-      $.geo.proj = null;
-      $("#map").geomap(selectionOptions[initService]);
-    });  
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/tracking.html b/libs/js/jquery-geo-1.0b2/docs/examples/tracking.html
deleted file mode 100755 (executable)
index c5713fd..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>GPS Tracking</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="A demo that continually tracks your current location">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      bottom: 0;
-      left: 0;
-      right: 0;
-      top: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info not-mobile">
-      <a href="../" class="docLink">&lt; docs</a>
-      <h1>GPS Tracking</h1>
-      <p>This simple demo continually follows your location at zoom level 15 showing the Esri World Street Map tiles. It now shows the geolocation accuracy buffer.</p>
-      <p>
-        <a href="http://roycesimpson.wordpress.com/2011/07/19/air-android-arcgis-server-flex-api-gps-activated-mapping-apps/" target="_blank">Inspired by Royce Simpson</a></p>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      var map = null;
-
-      function initMap(center) {
-        map = $("#map").geomap({
-          center: center || [-71.0597732, 42.3584308],
-          zoom: 15,
-          mode: "static", //< this example is display-only; disable user interaction
-
-          // use an Esri map service to match the original sample
-          services: [
-            {
-              type: "tiled",
-              src: "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{{:zoom}}/{{:tile.row}}/{{:tile.column}}",
-              attr: "&copy; Esri"
-            }
-          ]
-        });
-      }
-
-      if (navigator.geolocation) {
-        navigator.geolocation.watchPosition( function (p) {
-          coord = [p.coords.longitude, p.coords.latitude];
-          if (!map) {
-            initMap(coord);
-          } else {
-            map.geomap("option", "center", coord);
-          }
-          map.geomap("empty", false);
-          var accuracyBuffer = p.coords.accuracy / map.geomap("option", "pixelSize");
-          map.geomap("append", { type: "Point", coordinates: coord }, { color: "#cc0", width: accuracyBuffer, height: accuracyBuffer, borderRadius: accuracyBuffer }, false);
-          map.geomap("append", { type: "Point", coordinates: coord });
-        }, function (error) {
-          if ( !map ) {
-            initMap();
-          }
-        }, {
-          enableHighAccuracy: true,
-          maximumAge: 10000
-        } );
-      } else {
-        initMap();
-      }
-    });  
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/twheat/css/style.css b/libs/js/jquery-geo-1.0b2/docs/examples/twheat/css/style.css
deleted file mode 100755 (executable)
index 8a22008..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-html
-{
-  font:13px/1.231 Calibri,Arial,sans-serif; *font-size:small;
-}
-
-.links
-{
-  float: right;
-}
-
-.docLink 
-{
-  background: url(../img/$.geo-logo-small.png) left no-repeat;
-  color: #7f0000;
-  display: block;
-  font-size: 24px;
-  font-weight: bold;
-  padding: 0 24px;
-  text-decoration: none;
-}
-
-.info 
-{
-  background: #fff;
-  border-radius: 8px;
-  box-shadow: -4px 4px #444;
-  opacity: .8;
-  padding: 8px;
-  position: absolute !important;
-  right: 16px;
-  top: 16px;
-}
-
-.not-mobile
-{
-  display: none;
-}
-
-@media only screen and (min-width: 800px) 
-{  
-  .not-mobile
-  {
-    display: block;
-  }
-}
-
-h1
-{
-  margin-right: 256px;
-}
-
-.two
-{
-  color: #7f0000;
-}
-
-h2
-{
-  font-style: italic;
-  margin-left: 1rem;
-}
-
-#map
-{
-  position: fixed;
-  bottom: 0;
-  left: 0;
-  right: 0;
-  top: 0;
-}
-#popup
-{
-  background: #fff;
-  border: solid 1px #444;
-  border-radius: 8px;
-  display: none;
-  max-height: 80%;
-  padding: 4px;
-  position: absolute;
-  opacity: .8;
-  overflow: hidden;
-  width: 30%;
-}
-#popup p
-{
-  border-top: 2px solid #444;
-  margin: 0;
-  padding: 0;
-}
-#popup p:first-child
-{
-  border-top: none;
-}
-#content
-{
-  background: #fefefe;
-  border: 2px solid #444;
-  border-radius: 8px;
-  padding: 4px;
-  position: relative;
-  display: inline-block;
-}
-#content label span
-{
-  display: inline-block;
-  text-align: right;
-  width: 10rem;
-}
-#content button
-{
-  width: 6rem;
-}
-
-#zoom
-{
-  text-align: right;
-}
-
-#tweetButton
-{
-  display: inline-block;
-}
-
-.tweet-search-info
-{
-  float: right;
-  margin-top: 1rem;
-}
-
-.tweet-search-info img
-{
-  vertical-align: middle;
-}
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/twheat/img/$.geo-logo-small.png b/libs/js/jquery-geo-1.0b2/docs/examples/twheat/img/$.geo-logo-small.png
deleted file mode 100755 (executable)
index 1a9ad85..0000000
Binary files a/libs/js/jquery-geo-1.0b2/docs/examples/twheat/img/$.geo-logo-small.png and /dev/null differ
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/twheat/img/ajax-loader.gif b/libs/js/jquery-geo-1.0b2/docs/examples/twheat/img/ajax-loader.gif
deleted file mode 100755 (executable)
index e87b9a3..0000000
Binary files a/libs/js/jquery-geo-1.0b2/docs/examples/twheat/img/ajax-loader.gif and /dev/null differ
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/twheat/index.html b/libs/js/jquery-geo-1.0b2/docs/examples/twheat/index.html
deleted file mode 100755 (executable)
index fedacaa..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>Twheat</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="Search Twitter based on location and draw the results as a heat map">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="css/style.css" />
-</head>
-<body>
-  <div>
-    <div id="map">
-      <div id="popup">
-      </div>
-    </div>
-    <div id="content">
-      <form id="loc">
-        <label>
-          <span>center on</span>
-          <input type="text" name="l" autofocus />
-        </label>
-        <button type="submit">center</button>
-      </form>
-      <form id="zoom">
-        <!--<label>
-          <span>zoom</span>
-          <input type="range" name="zoom" min="5" max="16" value="10" style="visibility: hidden;" />
-        </label>-->
-        <button id="zoomout" type="button">zoom out</button>
-        <button id="zoomin" type="button">zoom in</button>
-      </form>
-      <form id="twit">
-        <label>
-          <span>search twitter for</span>
-          <input type="text" name="q" />
-        </label>
-        <button type="submit">search</button>
-      </form>
-      <div class="tweet-search-info">
-        <img id="ajaxIndicator" src="img/ajax-loader.gif" style="visibility: hidden;">
-        <span id="appendedCount">no tweets mapped yet :(</span>
-      </div>
-      <div id="tweetButton"></div>
-    </div>
-    <div class="info not-mobile">
-      <div class="links">
-        <a href="http://jquerygeo.com/" class="docLink">jQuery Geo &gt;</a>
-      </div>
-      <h1>Twheat! <span class="two">2</span></h1>
-      <h2>A Twitter Heat Map</h2>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../../jquery.geo-test.min.js"></script>
-  <script src="js/twheat.js"></script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/twheat/js/twheat.js b/libs/js/jquery-geo-1.0b2/docs/examples/twheat/js/twheat.js
deleted file mode 100755 (executable)
index 1f4a47c..0000000
+++ /dev/null
@@ -1,452 +0,0 @@
-$(function () {
-  var map = null,
-      checkedIds = [], //< list of tweet ids we've checked
-      appendedCount = 0, //< number of tweets we successfully appended
-      searchTerm = "", //< last search term
-      searching = false,
-      currentXhr = null, //< an ajax request reference if we need to cancel
-      
-      twitterButtonHtml = '<a href="https://twitter.com/share" class="twitter-share-button" data-count="vertical" data-via="ryanttb">Tweet</a><script src="//platform.twitter.com/widgets.js">\x3C/script>',
-      timeoutRefresh = null,
-      timeoutTweetsMapped = null,
-      i; // a generic counter
-
-  function initMap(center, zoom) {
-    // create a map using an optional center and zoom
-    // we're re-adding the default basemap because we're adding extra services on top of it
-    var services = [
-          {
-            type: "tiled",
-            src: function( view ) {
-                return "http://otile" + ((view.index % 4) + 1) + ".mqcdn.com/tiles/1.0.0/osm/" + view.zoom + "/" + view.tile.column + "/" + view.tile.row + ".png";
-            },
-            attr: "<p>Tiles Courtesy of <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png'></p>"
-          }
-        ];
-      
-    for ( i = 0; i < 11; i++ ) {
-      // for each hue breakpoint, create a new shingled service
-      // later, we will put tweets in these depending on how many other tweets around
-      services.push( {
-        id: "h" + ( 240 - ( i * 24 ) ),
-        type: "shingled",
-        src: ""
-      } );
-    }
-
-    map = $("#map").geomap({
-      center: center || [-71.0597732, 42.3584308],
-      zoom: zoom || 10,
-      zoomMin: 5,
-      zoomMax: 16,
-
-      services: services,
-
-      mode: "point",
-      scroll: "off",
-      cursors: {
-        point: "default"
-      },
-
-      dblclick: function( e, geo ) { 
-        // prevent the default dblclick zoom behavior,
-        // we want to change the URL so it can be tweeted
-        e.preventDefault( );
-
-        var zoom = map.geomap( "option", "zoom" );
-        if ( zoom < 16 ) {
-          window.location.search = 
-            "q=" + encodeURIComponent($("#twit input").val()) +
-            "&l=" + encodeURIComponent($("#loc input").val()) +
-            "&center=" + $.geo.proj.toGeodetic( geo.coordinates ) +
-            "&zoom=" + ( map.geomap( "option", "zoom" ) + 1 );
-        }
-      },
-
-      // set the shapeStyle to a largish solid but translucent circle
-      // to give the tweets a heat map effect
-      shapeStyle: {
-        //strokeOpacity: 0,
-        fillOpacity: 1
-        //width: "16px",
-        //height: "16px",
-        //borderRadius: "16px",
-        //color: "#e44"
-      },
-
-      move: function (e, geo) {
-        // when the user moves, search for appended tweets
-        // and show a popup
-
-        // clear the popup
-        $("#popup").hide().html("");
-
-        if (searchTerm) {
-          // spatial query, geo has the cursor location as a map point
-          // this will find appended tweets within 3 pixels
-          var features = $( "#h240" ).geomap("find", geo, 31),
-              popupHtml = "",
-              i = 0;
-
-          // for each tweet found, add some html to the popup
-          for (; i < features.length; i++) {
-            popupHtml += "<p>" + features[i].properties.tweet + "</p>";
-          }
-
-          if (popupHtml) {
-            // if any tweets found, show the popup
-            var $popup = $("#popup").append(popupHtml).css({
-              left: e.pageX,
-              top: e.pageY
-            });
-            
-            // try to reposition the popup inside the browser if it's too big
-            var widthOver = $(window).width() - ( $popup.width() + e.pageX ),
-                heightOver = ($(window).height() - 32) - ( $popup.height() + e.pageY ),
-                left = e.pageX,
-                top = e.pageY;
-
-            if ( widthOver < 0 ) {
-              left += widthOver;
-            }
-
-            if ( heightOver < 0 ) {
-              top += heightOver;
-            }
-
-            $popup.css({
-              left: left,
-              top: top
-            }).show();
-          }
-        }
-      }
-    });
-
-    for ( i = 0; i < 11; i++ ) {
-      // for each hue service, set the shapeStyle based on
-      // the number of tweets required before a new level is reached
-      // for example, the "hot" layer is tiny and red
-      var hue = 240 - ( i * 24 ),
-          impact = ( hue + 16) / 2 - Math.floor( i / 2 );
-          //impact = hue + 16;
-      $( "#h" + hue ).geomap( "option", "shapeStyle", { 
-        color: "hsl(" + hue + ",100%,50%)",
-        width: impact,
-        height: impact,
-        borderRadius: impact,
-        fillOpacity: 1
-      } );
-    }
-
-    // set the zoom input the map's zoom
-    //$( "#zoom input" ).val( map.geomap( "option", "zoom" ) ).css( "visibility", "visible" );
-
-    if ( searchTerm && !searching ) {
-      // kick off an autoSearch if we have a search term
-      autoSearch();
-    }
-  }
-
-  $("#loc").submit(function (e) {
-    e.preventDefault();
-
-    $("#ajaxIndicator").css("visibility", "visible");
-
-    // when the user clicks the location search button,
-    // send a request to nominatim for an OpenStreatMap data search
-    $.ajax({
-      url: "http://open.mapquestapi.com/nominatim/v1/search",
-      data: {
-        format: "json",
-        q: $("#loc input").val()
-      },
-      dataType: "jsonp",
-      jsonp: "json_callback",
-      complete: function( ) {
-        $("#ajaxIndicator").css("visibility", "hidden");
-      },
-      success: function (results) {            
-        if (results && results.length > 0) {
-          // if we get a result, relaunch the app to the new location with the old search
-          // this will allow users to tweet their map
-          window.location.search = 
-            "q=" + encodeURIComponent($("#twit input").val()) +
-            "&l=" + encodeURIComponent($("#loc input").val()) +
-            "&center=" + results[0].lon + "," + results[0].lat +
-            "&zoom=" + ( map.geomap("option", "zoom") );
-        }
-      }
-    });
-    return false;
-  });
-
-  $( "#zoomout" ).click( function( e ) {
-    //$( "#zoom input" ).css( "visibility", "hidden" );
-    var zoom = map.geomap( "option", "zoom" );
-    if ( zoom > 5 ) {
-      window.location.search = 
-        "q=" + encodeURIComponent($("#twit input").val()) +
-        "&l=" + encodeURIComponent($("#loc input").val()) +
-        "&center=" + map.geomap( "option", "center" ) +
-        "&zoom=" + ( map.geomap( "option", "zoom" ) - 1 );
-    }
-  } );
-
-  $( "#zoomin" ).click( function( e ) {
-    //$( "#zoom input" ).css( "visibility", "hidden" );
-    var zoom = map.geomap( "option", "zoom" );
-    if ( zoom  < 16 ) {
-      window.location.search = 
-        "q=" + encodeURIComponent($("#twit input").val()) +
-        "&l=" + encodeURIComponent($("#loc input").val()) +
-        "&center=" + map.geomap( "option", "center" ) +
-        "&zoom=" + ( map.geomap( "option", "zoom" ) + 1 );
-    }
-  } );
-
-  $("#twit").submit(function (e) {
-    e.preventDefault();
-
-    // when the user clicks the tweet search button,
-    // send a request to twitter
-
-    if (currentXhr) {
-      // if there's a search pending, cancel it
-      currentXhr.abort();
-      currentXhr = null;
-    }
-
-    $("#popup").hide().html("");
-
-    // save our search term
-    searchTerm = $("#twit input").val();
-
-    if ( searchTerm ) {
-      // if we have a new search term, relaunch the app to the same location with the new search
-      // this will allow users to tweet their map
-      window.location.search = 
-        "q=" + encodeURIComponent(searchTerm) +
-        "&l=" + encodeURIComponent($("#loc input").val()) +
-        "&center=" + map.geomap("option", "center").toString() +
-        "&zoom=" + ( map.geomap("option", "zoom") );
-    }
-
-    return false;
-  });
-
-  function search() {
-    // called by autoSearch, this function actually searches Twitter for geo-enabled tweets
-
-    if ( map !== null ) {
-      var center = map.geomap("option", "center"), //< the center of the map in lon, lat
-          // the geocode argument to Twitter search,
-          // it's an array with [ lat, lon, radius in km ]
-          // geomap's center is lon, lat so we have to switch
-          // for radius we'll use document width * pixelSize converted to km (from meters)
-          // Twitter search has a max of 2500km
-          geocode = [ 
-            center[1],
-            center[0],
-            Math.min(2500, map.geomap("option", "pixelSize") * $(document).width() / 2 / 1000) + "km"
-          ],
-          lastSearchTerm = searchTerm;
-
-      clearTimeout( timeoutTweetsMapped );
-      $("#ajaxIndicator").css("visibility", "visible");
-
-      // actually send the request to Twitter
-      currentXhr = $.ajax({
-        url: "http://search.twitter.com/search.json",
-        data: {
-          rpp: 100,
-          q: lastSearchTerm,
-          geocode: geocode.join(",")
-        },
-        dataType: "jsonp",
-        complete: function () {
-          currentXhr = null;
-        },
-        success: function (tweets) {
-          if (searchTerm == lastSearchTerm && tweets.results) {
-            // if we have results, search each of them for the geo or location property
-            $.each(tweets.results, function () {
-              appendTweet( this );
-            });
-          }
-
-          timeoutTweetsMapped = setTimeout( function() {
-            $("#ajaxIndicator").css("visibility", "hidden");
-          }, 1000 );
-        },
-        error: function() {
-          // oops, Twitter search failed
-          $("#ajaxIndicator").css("visibility", "hidden");
-        }
-      });
-    }
-  }
-
-  function appendTweet( tweet ) {
-    // attempt to append a tweet if we haven't already
-    if ( $.inArray( tweet.id_str, checkedIds ) >= 0 ) {
-      return;
-    }
-
-    // we don't want to attempt more than once for a given tweet
-    checkedIds.push( tweet.id_str );
-
-    // store some tweet html as a property on the feature
-    var feature = {
-      type: "Feature",
-      geometry: {
-        type: "Point",
-        coordinates: [ 0, 0 ]
-      },
-      properties: {
-        tweet: "<b>" + tweet.from_user + "</b>: " + tweet.text
-      }
-    };
-
-    if (tweet.geo) {
-      // if we have a geo property, flip the coordinates because Twitter search isn't
-      // in proper GeoJSON spec order
-      // Twitter uses [lat, lon] instead of [lon, lat]
-      feature.geometry.coordinates = [
-        tweet.geo.coordinates[1],
-        tweet.geo.coordinates[0]
-      ];
-
-      appendTweetShape( feature );
-    } else if ( tweet.location ) {
-      // otherwise, attempt to geocode the location property
-      $.ajax({
-        url: "http://open.mapquestapi.com/nominatim/v1/search",
-        data: {
-          format: "json",
-          q: tweet.location
-        },
-        dataType: "jsonp",
-        jsonp: "json_callback",
-        success: function (results) {            
-          if (results && results.length > 0) {
-            // if found, grab the location's lon & lat
-            if (results[0].lon && results[0].lat) {
-              feature.geometry.coordinates = [
-                results[0].lon,
-                results[0].lat
-              ];
-
-              appendTweetShape( feature );
-            }
-          }
-
-          // delay hiding the ajax indicator for another second
-          clearTimeout( timeoutTweetsMapped );
-          timeoutTweetsMapped = setTimeout( function() {
-            $("#ajaxIndicator").css("visibility", "hidden");
-          }, 1000 );
-        }
-      });
-    }
-  }
-
-  function appendTweetShape( feature ) {
-    // called for every tweet
-    // pick the appropriate hue service based on number of tweets around
-    // and add this tweet to EACH hue service up to that point
-    // this will add a bunch of bubbles per tweet as more tweets are found
-    if ( timeoutRefresh ) {
-      clearTimeout( timeoutRefresh );
-      timeoutRefresh = null;
-    }
-
-    var searchService = $( "#h240" );
-
-    for ( var i = 0; i < 11; i++ ) {
-      var hue = 240 - ( i * 24 ),
-          hueService = $( "#h" + hue ),
-          impact = ( hue + 16) / 2 - Math.floor( i / 2 ), //hue + 16 - i,
-          radius = impact, //( hue + 16) / 2 - Math.floor( i / 2 ),
-          existing = searchService.geomap( "find", feature.geometry, radius );
-      
-      hueService.geomap( "append", feature, false );
-
-      if ( existing.length <= i ) {
-        break;
-      }
-    }
-
-    // even though we may have appended four shapes for a medium hotness
-    // tweet, we have only processed one actual tweet, update appendedCount & UI
-    appendedCount++;
-    $("#appendedCount").text(appendedCount + " tweets mapped!");
-
-    timeoutRefresh = setTimeout( function( ) {
-      timeoutRefresh = null;
-      map.geomap( "refresh" );
-    }, 1000 );
-  }
-
-  function autoSearch() {
-    searching = true;
-    if ( searchTerm ) {
-      search();
-      setTimeout(autoSearch, 10000);
-    }
-  }
-
-  // for fun, we support sending center, zoom and a tweet query in the query string
-  var queryString = window.location.search.substring(1),
-      params = queryString.split("&"),
-      options = {};
-
-  $.each(params, function() {
-    var idx = this.indexOf("=");
-    if (idx > 0) {
-      options[this.substring(0, idx)] = this.substring(idx + 1);
-    }
-  });
-
-  if (options.center) {
-    if (options.zoom) {          
-      initMap($.parseJSON("[" + options.center + "]"), parseInt(options.zoom));
-    } else {
-      initMap($.parseJSON("[" + options.center + "]"));
-    }
-  } else {
-    // if there's no center in the query string, try to use geolocation
-    if (navigator.geolocation) {
-      navigator.geolocation.getCurrentPosition(function (p) {
-        initMap([p.coords.longitude, p.coords.latitude]);
-      }, function (error) {
-        initMap();
-      });
-    } else {
-      // if all else fails, use defaults
-      initMap();
-    }
-  }
-
-  var title = "Twheat !";
-
-  if (options.q) {
-    searchTerm = decodeURIComponent(options.q);
-    $("#twit input").val(searchTerm);
-    title += " " + searchTerm;
-
-    if ( map !== null && !searching ) {
-      autoSearch();
-    }
-  }
-
-  if (options.l) {
-    var loc = decodeURIComponent(options.l);
-    $("#loc input").val(loc);
-    title += " " + loc;
-  }
-
-  $("title").html(title);
-  $("#tweetButton").append(twitterButtonHtml);
-});  
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/twitter-heat.html b/libs/js/jquery-geo-1.0b2/docs/examples/twitter-heat.html
deleted file mode 100755 (executable)
index f7c4c69..0000000
+++ /dev/null
@@ -1,307 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>Twitter Heat Map</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="A demo that continually searches Twitter based on location and draws the results as a heat map">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      bottom: 0;
-      left: 0;
-      right: 0;
-      top: 0;
-    }
-    #popup
-    {
-      background: #fff;
-      border: solid 1px #444;
-      border-radius: 8px;
-      display: none;
-      max-height: 50%;
-      padding: 4px;
-      position: absolute;
-      opacity: .6;
-      overflow: hidden;
-      width: 30%;
-    }
-    #popup p
-    {
-      border-top: 2px solid #444;
-    }
-    #popup p:first-child
-    {
-      border-top: none;
-    }
-    #content
-    {
-      background: #fefefe;
-      border: 2px solid #444;
-      border-radius: 8px;
-      padding: 4px;
-      position: relative;
-      width: 320px;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-      <div id="popup">
-      </div>
-    </div>
-    <div id="content">
-      <form id="loc">
-        <label>
-          Zoom to
-          <input type="text" name="l" autofocus />
-        </label>
-        <button type="submit">
-          Go</button>
-      </form>
-      <form id="twit">
-        <label>
-          Search Twitter for
-          <input type="text" name="q" />
-        </label>
-        <button type="submit">
-          Go</button>
-      </form>
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/kjSGL/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>
-        Twitter Heat Map</h1>
-      <p>
-        This demo continually searches Twitter based on location &amp; query and draws the results as a heat map.</p>
-      <p>
-        You can hover over data to read the tweets.</p>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      var map = null,
-          searchTerm = "", //< last search term
-          currentXhr = null; //< an ajax request reference if we need to cancel
-
-      function initMap(center, zoom) {
-        // create a map using an optional center and zoom
-        map = $("#map").geomap({
-          center: center || [-71.0597732, 42.3584308],
-          zoom: zoom || 10,
-          mode: "showTweet",
-          cursors: { showTweet: "default" },
-          move: function (e, geo) {
-            // when the user moves, search for appended tweets
-            // and show a popup
-
-            // clear the popup
-            $("#popup").hide().html("");
-
-            if (searchTerm) {
-              // spatial query, geo has the cursor location as a map point
-              // this will find appended tweets within 3 pixels
-              var features = map.geomap("find", geo, 3),
-                  popupHtml = "",
-                  i = 0;
-
-              // for each tweet found, add some html to the popup
-              for (; i < features.length; i++) {
-                popupHtml += "<p>" + features[i].properties.tweet + "</p>";
-              }
-
-              if (popupHtml) {
-                // if any tweets found, show the popup
-                $("#popup").append(popupHtml).css({
-                  left: e.pageX,
-                  top: e.pageY
-                }).show();
-              }
-            }
-          }
-        });
-
-        // set the shape style to a largish solid but translucent circle
-        // to give the tweets a heat map effect
-        map.geomap("option", "shapeStyle", {
-          strokeOpacity: 0,
-          fillOpacity: .3,
-          width: "16px",
-          height: "16px",
-          borderRadius: "8px",
-          color: "#44e"
-        });
-      }
-
-      $("#loc").submit(function () {
-        // when the user clicks the location search button,
-        // send a request to nominatim for an OpenStreatMap data search
-        $.ajax({
-          url: "http://open.mapquestapi.com/nominatim/v1/search",
-          data: {
-            format: "json",
-            q: $("#loc input").val()
-          },
-          dataType: "jsonp",
-          jsonp: "json_callback",
-          success: function (results) {            
-            if (results && results.length > 0) {
-              // if we a result, set the map's extent
-              // unfortunately, the nominatim search spec returns a bbox
-              // that is not properly GeoJSON formatted so we need to reorder
-              $("#popup").hide().html("");
-              var nbbox = results[0].boundingbox;
-              map.geomap("option", "bbox", [
-                nbbox[2], /* min longitude*/
-                nbbox[0], /* min latitude */
-                nbbox[3], /* max longitude */
-                nbbox[1]  /* max latitude */
-              ]);
-            }
-          }
-        });
-        return false;
-      });
-
-      $("#twit").submit(function () {
-        // when the user clicks the tweet search button,
-        // send a request to twitter
-
-        if (currentXhr) {
-          // if there's a search pending, cancel it
-          currentXhr.abort();
-          currentXhr = null;
-        }
-
-        $("#popup").hide().html("");
-
-        // clear the map of previous search tweets
-        map.geomap("empty");
-
-        // save our search term
-        searchTerm = $("#twit input").val();
-
-        // autoSearch will keep searching every five seconds
-        autoSearch();
-        return false;
-      });
-
-      function search() {
-        // called by autoSearch, this function actually searches Twitter for geo-enabled tweets
-
-        if ( map !== null ) {
-          var center = map.geomap("option", "center"), //< the center of the map in lon, lat
-              // the geocode argument to Twitter search,
-              // it's an array with [ lat, lon, radius in km ]
-              // geomap's center is lon, lat so we have to switch
-              // for radius we'll use document width * pixelSize converted to km (from meters)
-              // Twitter search has a max of 2500km
-              geocode = [ 
-                center[1],
-                center[0],
-                Math.min(2500, map.geomap("option", "pixelSize") * $(document).width() / 2 / 1000) + "km"
-              ],
-              lastSearchTerm = searchTerm;
-
-          // actually send the request to Twitter
-          currentXhr = $.ajax({
-            url: "http://search.twitter.com/search.json",
-            data: {
-              rpp: 100,
-              q: lastSearchTerm,
-              geocode: geocode.join(",")
-            },
-            dataType: "jsonp",
-            complete: function () {
-              currentXhr = null;
-            },
-            success: function (tweets) {
-              if (searchTerm == lastSearchTerm && tweets.results) {
-                // if we have results, search each of them for the geo property
-                $.each(tweets.results, function () {
-                  if (this.geo) {
-                    // if there is one, flip the coordinates because Twitter search isn't
-                    // in proper GeoJSON spec order
-                    // Twitter uses [lat, lon] instead of [lon, lat]
-                    this.geo.coordinates = [
-                      this.geo.coordinates[1],
-                      this.geo.coordinates[0]
-                    ];
-
-                    // search for a tweet at the exact location so we don't add duplicates
-                    if (map.geomap("find", this.geo, .01).length == 0) {
-                      // if we don't have a tweet there, append a feature
-                      // store some tweet html as a property on the feature
-                      var feature = {
-                        type: "Feature",
-                        geometry: this.geo,
-                        properties: {
-                          tweet: "<b>" + this.from_user + "</b>: " + this.text
-                        }
-                      };
-                      map.geomap("append", feature);
-                    }
-                  }
-                });
-              }
-            }
-          });
-        }
-      }
-
-      function autoSearch() {
-        if (searchTerm) {
-          search();
-          setTimeout(autoSearch, 5000);
-        }
-      }
-
-      // for fun, we support sending center, zoom and a tweet query in the query string
-      var queryString = window.location.search.substring(1),
-          params = queryString.split("&"),
-          options = {};
-      $.each(params, function() {
-        var idx = this.indexOf("=");
-        if (idx > 0) {
-          options[this.substring(0, idx)] = this.substring(idx + 1);
-        }
-      });
-
-      if (options.center) {
-        if (options.zoom) {          
-          initMap($.parseJSON("[" + options.center + "]"), parseInt(options.zoom));
-        } else {
-          initMap($.parseJSON("[" + options.center + "]"));
-        }
-      } else {
-        // if there's no center in the query string, try to use geolocation
-        if (navigator.geolocation) {
-          navigator.geolocation.getCurrentPosition(function (p) {
-            initMap([p.coords.longitude, p.coords.latitude]);
-          }, function (error) {
-            initMap();
-          });
-        } else {
-          // if all else fails, use defaults
-          initMap();
-        }
-      }
-
-      if (options.q) {
-        searchTerm = decodeURIComponent(options.q);
-        $("#twit input").val(searchTerm);
-        autoSearch();
-      }
-    });  
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/usastates.html b/libs/js/jquery-geo-1.0b2/docs/examples/usastates.html
deleted file mode 100755 (executable)
index 141518d..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>USA States</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="A demo that pulls in USA state data from GeoCommons">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="css/style.css" />
-  <style type="text/css">
-    #map { position: fixed; left: 0; top: 0; right: 0; bottom: 0; }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/sh8uH/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>USA States</h1>
-      <p class="not-mobile">This map reads USA state boundary data as a GeoJSON FeatureCollection and draws it on top of OpenStreetMap.</p>
-      <p>Click a state to change its color!</p>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js"></script>
-  <script src="js/iecors.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      var map = $("#map").geomap({
-        center: [-71.0595678, 42.3604823],
-        zoom: 6,
-        mode: "drawPoint",
-        shape: function (e, geo) {
-          var state = map.geomap("find", geo, 0);
-          if (state.length > 0) {
-            map.geomap("remove", state[0]);
-
-            var color = Math.round(0xffffff * Math.random()).toString(16);
-
-            map.geomap("append", state[0], {
-              color: "#" + ( color.length == 5 ? "0" : "" ) + color
-            });
-          }
-        }
-      }),
-      states = null;
-
-      $.ajax({
-        url: "http://data.jquerygeo.com/usastates.json",
-        dataType: "json",
-        success: function (result) {
-          states = result;
-          map.geomap("append", states);
-        },
-        error: function (xhr) {
-          alert(xhr.statusText);
-        }
-      });
-    });  
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/utah/apple-touch-icon.png b/libs/js/jquery-geo-1.0b2/docs/examples/utah/apple-touch-icon.png
deleted file mode 100755 (executable)
index 8bcff2d..0000000
Binary files a/libs/js/jquery-geo-1.0b2/docs/examples/utah/apple-touch-icon.png and /dev/null differ
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/utah/css/style.css b/libs/js/jquery-geo-1.0b2/docs/examples/utah/css/style.css
deleted file mode 100755 (executable)
index 4c27467..0000000
+++ /dev/null
@@ -1,222 +0,0 @@
-/* HTML5 âœ° Boilerplate */
-
-html, body, div, span, object, iframe,
-h1, h2, h3, h4, h5, h6, p, blockquote, pre,
-abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp,
-small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li,
-fieldset, form, label, legend,
-table, caption, tbody, tfoot, thead, tr, th, td,
-article, aside, canvas, details, figcaption, figure,
-footer, header, hgroup, menu, nav, section, summary,
-time, mark, audio, video {
-  margin: 0;
-  padding: 0;
-  border: 0;
-  font-size: 100%;
-  font: inherit;
-  vertical-align: baseline;
-}
-
-article, aside, details, figcaption, figure,
-footer, header, hgroup, menu, nav, section {
-  display: block;
-}
-
-blockquote, q { quotes: none; }
-blockquote:before, blockquote:after,
-q:before, q:after { content: ""; content: none; }
-ins { background-color: #ff9; color: #000; text-decoration: none; }
-mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; }
-del { text-decoration: line-through; }
-abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; }
-table { border-collapse: collapse; border-spacing: 0; }
-hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }
-input, select { vertical-align: middle; }
-
-body { font:13px/1.231 sans-serif; *font-size:small; }
-select, input, textarea, button { font:99% sans-serif; }
-pre, code, kbd, samp { font-family: monospace, sans-serif; }
-
-a:hover, a:active { outline: none; }
-ul, ol { margin-left: 2em; }
-ol { list-style-type: decimal; }
-nav ul, nav li { margin: 0; list-style:none; list-style-image: none; }
-small { font-size: 85%; }
-strong, th { font-weight: bold; }
-td { vertical-align: top; }
-sub, sup { font-size: 75%; line-height: 0; position: relative; }
-sup { top: -0.5em; }
-sub { bottom: -0.25em; }
-
-pre { white-space: pre; white-space: pre-wrap; word-wrap: break-word; padding: 15px; }
-textarea { overflow: auto; } 
-.ie6 legend, .ie7 legend { margin-left: -7px; } 
-input[type="radio"] { vertical-align: text-bottom; }
-input[type="checkbox"] { vertical-align: bottom; }
-.ie7 input[type="checkbox"] { vertical-align: baseline; }
-.ie6 input { vertical-align: text-bottom; }
-label, input[type="button"], input[type="submit"], input[type="image"], button { cursor: pointer; }
-button, input, select, textarea { margin: 0; }
-input:valid, textarea:valid   {  }
-input:invalid, textarea:invalid { border-radius: 1px; -moz-box-shadow: 0px 0px 5px red; -webkit-box-shadow: 0px 0px 5px red; box-shadow: 0px 0px 5px red; }
-.no-boxshadow input:invalid, .no-boxshadow textarea:invalid { background-color: #f0dddd; }
-
-
-a:link { -webkit-tap-highlight-color: #FF5E99; }
-button {  width: auto; overflow: visible; }
-.ie7 img { -ms-interpolation-mode: bicubic; }
-
-body, select, input, textarea { color: #444; }
-h1, h2, h3, h4, h5, h6 { font-weight: bold; }
-a, a:active, a:visited { color: #607890; }
-a:hover { color: #036; }
-
-
-/**
- * Primary styles
- *
- * Author: Ryan Westphal
- */
-
-body { background: #ccc; }
-#index { bottom: 0; left: 32px; min-width: 800px; position: absolute; right: 32px; top: 0; }
-header
-{
-  background: #fdfdfd;
-  -moz-border-radius-bottomright: 16px;
-  -moz-border-radius-bottomleft: 16px;
-  -webkit-border-bottom-right-radius: 16px;
-  -webkit-border-bottom-left-radius: 16px;
-  border-bottom-right-radius: 16px;
-  border-bottom-left-radius: 16px;
-  padding: 16px 12px 16px 12px;
-}
-h1 { color: #1C56A3; display: inline; font-family: Georgia; font-size: 32px; }
-#basemapButtons { float: right; }
-span.selector { background: url(../img/BaseMapSelectorSprite-v1.1.png) no-repeat scroll; display: block; height: 49px; width: 50px; }
-span.Lite { background-position: -90px -276px; }
-span.Hybrid { background-position: -15px -276px; }
-span.Hillshade { background-position: -15px -213px; }
-span.Terrain { background-position: -91px -18px; }
-span.Vector { background-position: -15px -84px; }
-span.Imagery2009 { background-position: -15px -149px; }
-span.Topo { background-position: -15px -18px; }
-
-#pnlInfoAndSearch
-{
-  left: 12px;
-  position: relative;
-  top: 12px;
-}
-
-#lblCoords 
-{
-  color: #1C56A3;
-  display: inline-block;
-  font-size: 14px;
-  font-weight: bold;
-  width: 512px;
-}
-
-.ie7 #lblCoords
-{
-  float: left;
-}
-
-#pnlSearch
-{
-  display: inline-block;
-  font-size: 14px;
-  font-weight: bold;
-}
-
-.ie7 #pnlSearch
-{
-  float: left;
-}
-
-#pnlSearch label span
-{
-  color: #1C56A3;
-  margin-right: 4px;
-}
-
-#pnlSearch input
-{
-  width: 192px;
-}
-
-#pnlSearch button
-{
-  display: none;
-}
-
-#map 
-{
-  background: #ccc;
-  -moz-border-radius-topleft: 16px;
-  -moz-border-radius-topright: 16px;
-  -webkit-border-top-left-radius: 16px;
-  -webkit-border-top-right-radius: 16px;
-  border-top-left-radius: 16px;
-  border-top-right-radius: 16px;
-  bottom: 0;
-  left: 0;
-  position: fixed;
-  right: 0;
-  top: 128px;
-}
-
-#infoBar
-{
-  background: #ccc;
-  bottom: 0;
-  color: #1C56A3;
-  font-size: 14px;
-  font-weight: bold;
-  left: 0;
-  padding: 16px;
-  position: absolute;
-  right: 0;
-}
-
-.ir { display: block; text-indent: -999em; overflow: hidden; background-repeat: no-repeat; text-align: left; direction: ltr; }
-.hidden { display: none; visibility: hidden; }
-.visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
-.visuallyhidden.focusable:active,
-.visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; }
-.invisible { visibility: hidden; }
-.clearfix:before, .clearfix:after { content: "\0020"; display: block; height: 0; overflow: hidden; }
-.clearfix:after { clear: both; }
-.clearfix { zoom: 1; }
-
-
-@media all and (orientation:portrait) {
-
-}
-
-@media all and (orientation:landscape) {
-
-}
-
-@media screen and (max-device-width: 480px) {
-  
-  /* html { -webkit-text-size-adjust:none; -ms-text-size-adjust:none; } */
-}
-
-
-@media print {
-  * { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important;
-  -ms-filter: none !important; } 
-  a, a:visited { color: #444 !important; text-decoration: underline; }
-  a[href]:after { content: " (" attr(href) ")"; }
-  abbr[title]:after { content: " (" attr(title) ")"; }
-  .ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; }  
-  pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
-  thead { display: table-header-group; } 
-  tr, img { page-break-inside: avoid; }
-  @page { margin: 0.5cm; }
-  p, h2, h3 { orphans: 3; widows: 3; }
-  h2, h3{ page-break-after: avoid; }
-}
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/utah/favicon.ico b/libs/js/jquery-geo-1.0b2/docs/examples/utah/favicon.ico
deleted file mode 100755 (executable)
index 04122e7..0000000
Binary files a/libs/js/jquery-geo-1.0b2/docs/examples/utah/favicon.ico and /dev/null differ
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/utah/img/BaseMapSelectorSprite-v1.1.png b/libs/js/jquery-geo-1.0b2/docs/examples/utah/img/BaseMapSelectorSprite-v1.1.png
deleted file mode 100755 (executable)
index 84a7a8a..0000000
Binary files a/libs/js/jquery-geo-1.0b2/docs/examples/utah/img/BaseMapSelectorSprite-v1.1.png and /dev/null differ
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/utah/index.html b/libs/js/jquery-geo-1.0b2/docs/examples/utah/index.html
deleted file mode 100755 (executable)
index a51d564..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<!doctype html>
-<!--[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]-->
-<!--[if IE 7 ]>    <html class="no-js ie7" lang="en"> <![endif]-->
-<!--[if IE 8 ]>    <html class="no-js ie8" lang="en"> <![endif]-->
-<!--[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
-<head>
-  <meta charset="utf-8">
-  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-
-  <title>Atlas Utah!</title>
-  <meta name="description" content="State of Utah interactive basemap viewer">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-  <link rel="shortcut icon" href="./favicon.ico">
-  <link rel="apple-touch-icon" href="./apple-touch-icon.png">
-
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/overcast/jquery-ui.css" />
-  <link rel="stylesheet" href="css/style.css?v=2">
-
-  <script src="js/libs/modernizr-1.7.min.js"></script>
-</head>
-
-<body>
-
-  <div id="index">
-    <header>
-      <form id="basemapButtons">
-                   <input id="basemapLite" type="radio" name="basemap" value="UtahBaseMap-Lite" data-tile-size="256" checked="checked" /><label for="basemapLite" title="Lite"><span class="selector Lite">Lite</span></label>
-                   <input id="basemapHybrid" type="radio" name="basemap" value="UtahBasemap-Hybrid" data-tile-size="256" /><label for="basemapHybrid" title="Hybrid"><span class="selector Hybrid">&nbsp;</span></label>
-                   <input id="basemapHillshade" type="radio" name="basemap" value="UtahBaseMap-Hillshade" data-tile-size="256" /><label for="basemapHillshade" title="Hillshade"><span class="selector Hillshade">&nbsp;</span></label>
-                   <input id="basemapTerrain" type="radio" name="basemap" value="UtahBaseMap-Terrain" data-tile-size="256" /><label for="basemapTerrain" title="Terrain"><span class="selector Terrain">&nbsp;</span></label>
-                   <input id="basemapVector" type="radio" name="basemap" value="UtahBaseMap-Vector" data-tile-size="256" /><label for="basemapVector" title="Streets"><span class="selector Vector">&nbsp;</span></label>
-                   <input id="basemapImagery2009" type="radio" name="basemap" value="UtahBaseMap-Imagery2009" data-tile-size="256" /><label for="basemapImagery2009" title="Imagery"><span class="selector Imagery2009">&nbsp;</span></label>
-                   <input id="basemapTopo" type="radio" name="basemap" value="UtahBaseMap-Topo" data-tile-size="256" /><label for="basemapTopo" title="Topo"><span class="selector Topo">&nbsp;</span></label>
-      </form>
-      <h1>Atlas Utah!</h1>
-      <div>inspired by <a href="http://atlas.utah.gov/">http://atlas.utah.gov/</a></div>
-    </header>
-    <div id="main" role="main">
-      <div id="pnlInfoAndSearch">
-        <span id="lblCoords">UTM NAD83 coords: (<span>453709,4333922</span>)</span>
-        <div id="pnlSearch">
-          <form>
-            <label><span>Search</span> <input type="search" name="search" /></label>
-            <button type="submit">Search</button>
-          </form>
-        </div>
-      </div>
-      <div id="map"></div>
-    </div>
-    <footer>
-      <div id="infoBar" style="display: none;"></div>
-    </footer>
-  </div> <!-- eo #index -->
-
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../../jquery.geo-test.min.js"></script>
-  <script src="js/libs/jquery.watermark.min.js"></script>
-  <script src="js/script.js"></script>
-
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/utah/js/libs/jquery.watermark.min.js b/libs/js/jquery-geo-1.0b2/docs/examples/utah/js/libs/jquery.watermark.min.js
deleted file mode 100755 (executable)
index 4cc6e43..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
-       Watermark v3.1.3 (March 22, 2011) plugin for jQuery
-       http://jquery-watermark.googlecode.com/
-       Copyright (c) 2009-2011 Todd Northrop
-       http://www.speednet.biz/
-       Dual licensed under the MIT or GPL Version 2 licenses.
-*/
-(function(a,h,y){var w="function",v="password",j="maxLength",n="type",b="",c=true,u="placeholder",i=false,t="watermark",g=t,f="watermarkClass",q="watermarkFocus",l="watermarkSubmit",o="watermarkMaxLength",e="watermarkPassword",d="watermarkText",k=/\r/g,s="input:data("+g+"),textarea:data("+g+")",m="input:text,input:password,input[type=search],input:not([type]),textarea",p=["Page_ClientValidate"],r=i,x=u in document.createElement("input");a.watermark=a.watermark||{version:"3.1.3",runOnce:c,options:{className:t,useNative:c,hideBeforeUnload:c},hide:function(b){a(b).filter(s).each(function(){a.watermark._hide(a(this))})},_hide:function(a,r){var p=a[0],q=(p.value||b).replace(k,b),l=a.data(d)||b,m=a.data(o)||0,i=a.data(f);if(l.length&&q==l){p.value=b;if(a.data(e))if((a.attr(n)||b)==="text"){var g=a.data(e)||[],c=a.parent()||[];if(g.length&&c.length){c[0].removeChild(a[0]);c[0].appendChild(g[0]);a=g}}if(m){a.attr(j,m);a.removeData(o)}if(r){a.attr("autocomplete","off");h.setTimeout(function(){a.select()},1)}}i&&a.removeClass(i)},show:function(b){a(b).filter(s).each(function(){a.watermark._show(a(this))})},_show:function(g){var p=g[0],u=(p.value||b).replace(k,b),h=g.data(d)||b,s=g.attr(n)||b,t=g.data(f);if((u.length==0||u==h)&&!g.data(q)){r=c;if(g.data(e))if(s===v){var m=g.data(e)||[],l=g.parent()||[];if(m.length&&l.length){l[0].removeChild(g[0]);l[0].appendChild(m[0]);g=m;g.attr(j,h.length);p=g[0]}}if(s==="text"||s==="search"){var i=g.attr(j)||0;if(i>0&&h.length>i){g.data(o,i);g.attr(j,h.length)}}t&&g.addClass(t);p.value=h}else a.watermark._hide(g)},hideAll:function(){if(r){a.watermark.hide(m);r=i}},showAll:function(){a.watermark.show(m)}};a.fn.watermark=a.fn.watermark||function(p,o){var t="string";if(!this.length)return this;var s=i,r=typeof p===t;if(r)p=p.replace(k,b);if(typeof o==="object"){s=typeof o.className===t;o=a.extend({},a.watermark.options,o)}else if(typeof o===t){s=c;o=a.extend({},a.watermark.options,{className:o})}else o=a.watermark.options;if(typeof o.useNative!==w)o.useNative=o.useNative?function(){return c}:function(){return i};return this.each(function(){var B="dragleave",A="dragenter",z=this,i=a(z);if(!i.is(m))return;if(i.data(g)){if(r||s){a.watermark._hide(i);r&&i.data(d,p);s&&i.data(f,o.className)}}else{if(x&&o.useNative.call(z,i)&&(i.attr("tagName")||b)!=="TEXTAREA"){r&&i.attr(u,p);return}i.data(d,r?p:b);i.data(f,o.className);i.data(g,1);if((i.attr(n)||b)===v){var C=i.wrap("<span>").parent(),t=a(C.html().replace(/type=["']?password["']?/i,'type="text"'));t.data(d,i.data(d));t.data(f,i.data(f));t.data(g,1);t.attr(j,p.length);t.focus(function(){a.watermark._hide(t,c)}).bind(A,function(){a.watermark._hide(t)}).bind("dragend",function(){h.setTimeout(function(){t.blur()},1)});i.blur(function(){a.watermark._show(i)}).bind(B,function(){a.watermark._show(i)});t.data(e,i);i.data(e,t)}else i.focus(function(){i.data(q,1);a.watermark._hide(i,c)}).blur(function(){i.data(q,0);a.watermark._show(i)}).bind(A,function(){a.watermark._hide(i)}).bind(B,function(){a.watermark._show(i)}).bind("dragend",function(){h.setTimeout(function(){a.watermark._show(i)},1)}).bind("drop",function(e){var c=i[0],a=e.originalEvent.dataTransfer.getData("Text");if((c.value||b).replace(k,b).replace(a,b)===i.data(d))c.value=a;i.focus()});if(z.form){var w=z.form,y=a(w);if(!y.data(l)){y.submit(a.watermark.hideAll);if(w.submit){y.data(l,w.submit);w.submit=function(c,b){return function(){var d=b.data(l);a.watermark.hideAll();if(d.apply)d.apply(c,Array.prototype.slice.call(arguments));else d()}}(w,y)}else{y.data(l,1);w.submit=function(b){return function(){a.watermark.hideAll();delete b.submit;b.submit()}}(w)}}}}a.watermark._show(i)})};if(a.watermark.runOnce){a.watermark.runOnce=i;a.extend(a.expr[":"],{data:function(c,d,b){return!!a.data(c,b[3])}});(function(c){a.fn.val=function(){var e=this;if(!e.length)return arguments.length?e:y;if(!arguments.length)if(e.data(g)){var f=(e[0].value||b).replace(k,b);return f===(e.data(d)||b)?b:f}else return c.apply(e,arguments);else{c.apply(e,arguments);a.watermark.show(e);return e}}})(a.fn.val);p.length&&a(function(){for(var b,c,d=p.length-1;d>=0;d--){b=p[d];c=h[b];if(typeof c===w)h[b]=function(b){return function(){a.watermark.hideAll();return b.apply(null,Array.prototype.slice.call(arguments))}}(c)}});a(h).bind("beforeunload",function(){a.watermark.options.hideBeforeUnload&&a.watermark.hideAll()})}})(jQuery,window);
\ No newline at end of file
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/utah/js/libs/modernizr-1.7.min.js b/libs/js/jquery-geo-1.0b2/docs/examples/utah/js/libs/modernizr-1.7.min.js
deleted file mode 100755 (executable)
index 6f54850..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-// Modernizr v1.7  www.modernizr.com
-window.Modernizr=function(a,b,c){function G(){e.input=function(a){for(var b=0,c=a.length;b<c;b++)t[a[b]]=!!(a[b]in l);return t}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,f,h,i=a.length;d<i;d++)l.setAttribute("type",f=a[d]),e=l.type!=="text",e&&(l.value=m,l.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(f)&&l.style.WebkitAppearance!==c?(g.appendChild(l),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(l,null).WebkitAppearance!=="textfield"&&l.offsetHeight!==0,g.removeChild(l)):/^(search|tel)$/.test(f)||(/^(url|email)$/.test(f)?e=l.checkValidity&&l.checkValidity()===!1:/^color$/.test(f)?(g.appendChild(l),g.offsetWidth,e=l.value!=m,g.removeChild(l)):e=l.value!=m)),s[a[d]]=!!e;return s}("search tel url email datetime date month week time datetime-local number range color".split(" "))}function F(a,b){var c=a.charAt(0).toUpperCase()+a.substr(1),d=(a+" "+p.join(c+" ")+c).split(" ");return!!E(d,b)}function E(a,b){for(var d in a)if(k[a[d]]!==c&&(!b||b(a[d],j)))return!0}function D(a,b){return(""+a).indexOf(b)!==-1}function C(a,b){return typeof a===b}function B(a,b){return A(o.join(a+";")+(b||""))}function A(a){k.cssText=a}var d="1.7",e={},f=!0,g=b.documentElement,h=b.head||b.getElementsByTagName("head")[0],i="modernizr",j=b.createElement(i),k=j.style,l=b.createElement("input"),m=":)",n=Object.prototype.toString,o=" -webkit- -moz- -o- -ms- -khtml- ".split(" "),p="Webkit Moz O ms Khtml".split(" "),q={svg:"http://www.w3.org/2000/svg"},r={},s={},t={},u=[],v,w=function(a){var c=b.createElement("style"),d=b.createElement("div"),e;c.textContent=a+"{#modernizr{height:3px}}",h.appendChild(c),d.id="modernizr",g.appendChild(d),e=d.offsetHeight===3,c.parentNode.removeChild(c),d.parentNode.removeChild(d);return!!e},x=function(){function d(d,e){e=e||b.createElement(a[d]||"div");var f=(d="on"+d)in e;f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=C(e[d],"function"),C(e[d],c)||(e[d]=c),e.removeAttribute(d))),e=null;return f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),y=({}).hasOwnProperty,z;C(y,c)||C(y.call,c)?z=function(a,b){return b in a&&C(a.constructor.prototype[b],c)}:z=function(a,b){return y.call(a,b)},r.flexbox=function(){function c(a,b,c,d){a.style.cssText=o.join(b+":"+c+";")+(d||"")}function a(a,b,c,d){b+=":",a.style.cssText=(b+o.join(c+";"+b)).slice(0,-b.length)+(d||"")}var d=b.createElement("div"),e=b.createElement("div");a(d,"display","box","width:42px;padding:0;"),c(e,"box-flex","1","width:10px;"),d.appendChild(e),g.appendChild(d);var f=e.offsetWidth===42;d.removeChild(e),g.removeChild(d);return f},r.canvas=function(){var a=b.createElement("canvas");return a.getContext&&a.getContext("2d")},r.canvastext=function(){return e.canvas&&C(b.createElement("canvas").getContext("2d").fillText,"function")},r.webgl=function(){return!!a.WebGLRenderingContext},r.touch=function(){return"ontouchstart"in a||w("@media ("+o.join("touch-enabled),(")+"modernizr)")},r.geolocation=function(){return!!navigator.geolocation},r.postmessage=function(){return!!a.postMessage},r.websqldatabase=function(){var b=!!a.openDatabase;return b},r.indexedDB=function(){for(var b=-1,c=p.length;++b<c;){var d=p[b].toLowerCase();if(a[d+"_indexedDB"]||a[d+"IndexedDB"])return!0}return!1},r.hashchange=function(){return x("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},r.history=function(){return !!(a.history&&history.pushState)},r.draganddrop=function(){return x("dragstart")&&x("drop")},r.websockets=function(){return"WebSocket"in a},r.rgba=function(){A("background-color:rgba(150,255,150,.5)");return D(k.backgroundColor,"rgba")},r.hsla=function(){A("background-color:hsla(120,40%,100%,.5)");return D(k.backgroundColor,"rgba")||D(k.backgroundColor,"hsla")},r.multiplebgs=function(){A("background:url(//:),url(//:),red url(//:)");return(new RegExp("(url\\s*\\(.*?){3}")).test(k.background)},r.backgroundsize=function(){return F("backgroundSize")},r.borderimage=function(){return F("borderImage")},r.borderradius=function(){return F("borderRadius","",function(a){return D(a,"orderRadius")})},r.boxshadow=function(){return F("boxShadow")},r.textshadow=function(){return b.createElement("div").style.textShadow===""},r.opacity=function(){B("opacity:.55");return/^0.55$/.test(k.opacity)},r.cssanimations=function(){return F("animationName")},r.csscolumns=function(){return F("columnCount")},r.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";A((a+o.join(b+a)+o.join(c+a)).slice(0,-a.length));return D(k.backgroundImage,"gradient")},r.cssreflections=function(){return F("boxReflect")},r.csstransforms=function(){return!!E(["transformProperty","WebkitTransform","MozTransform","OTransform","msTransform"])},r.csstransforms3d=function(){var a=!!E(["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"]);a&&"webkitPerspective"in g.style&&(a=w("@media ("+o.join("transform-3d),(")+"modernizr)"));return a},r.csstransitions=function(){return F("transitionProperty")},r.fontface=function(){var a,c,d=h||g,e=b.createElement("style"),f=b.implementation||{hasFeature:function(){return!1}};e.type="text/css",d.insertBefore(e,d.firstChild),a=e.sheet||e.styleSheet;var i=f.hasFeature("CSS2","")?function(b){if(!a||!b)return!1;var c=!1;try{a.insertRule(b,0),c=/src/i.test(a.cssRules[0].cssText),a.deleteRule(a.cssRules.length-1)}catch(d){}return c}:function(b){if(!a||!b)return!1;a.cssText=b;return a.cssText.length!==0&&/src/i.test(a.cssText)&&a.cssText.replace(/\r+|\n+/g,"").indexOf(b.split(" ")[0])===0};c=i('@font-face { font-family: "font"; src: url(data:,); }'),d.removeChild(e);return c},r.video=function(){var a=b.createElement("video"),c=!!a.canPlayType;if(c){c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"');var d='video/mp4; codecs="avc1.42E01E';c.h264=a.canPlayType(d+'"')||a.canPlayType(d+', mp4a.40.2"'),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"')}return c},r.audio=function(){var a=b.createElement("audio"),c=!!a.canPlayType;c&&(c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"'),c.mp3=a.canPlayType("audio/mpeg;"),c.wav=a.canPlayType('audio/wav; codecs="1"'),c.m4a=a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;"));return c},r.localstorage=function(){try{return!!localStorage.getItem}catch(a){return!1}},r.sessionstorage=function(){try{return!!sessionStorage.getItem}catch(a){return!1}},r.webWorkers=function(){return!!a.Worker},r.applicationcache=function(){return!!a.applicationCache},r.svg=function(){return!!b.createElementNS&&!!b.createElementNS(q.svg,"svg").createSVGRect},r.inlinesvg=function(){var a=b.createElement("div");a.innerHTML="<svg/>";return(a.firstChild&&a.firstChild.namespaceURI)==q.svg},r.smil=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"animate")))},r.svgclippaths=function(){return!!b.createElementNS&&/SVG/.test(n.call(b.createElementNS(q.svg,"clipPath")))};for(var H in r)z(r,H)&&(v=H.toLowerCase(),e[v]=r[H](),u.push((e[v]?"":"no-")+v));e.input||G(),e.crosswindowmessaging=e.postmessage,e.historymanagement=e.history,e.addTest=function(a,b){a=a.toLowerCase();if(!e[a]){b=!!b(),g.className+=" "+(b?"":"no-")+a,e[a]=b;return e}},A(""),j=l=null,f&&a.attachEvent&&function(){var a=b.createElement("div");a.innerHTML="<elem></elem>";return a.childNodes.length!==1}()&&function(a,b){function p(a,b){var c=-1,d=a.length,e,f=[];while(++c<d)e=a[c],(b=e.media||b)!="screen"&&f.push(p(e.imports,b),e.cssText);return f.join("")}function o(a){var b=-1;while(++b<e)a.createElement(d[b])}var c="abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",d=c.split("|"),e=d.length,f=new RegExp("(^|\\s)("+c+")","gi"),g=new RegExp("<(/*)("+c+")","gi"),h=new RegExp("(^|[^\\n]*?\\s)("+c+")([^\\n]*)({[\\n\\w\\W]*?})","gi"),i=b.createDocumentFragment(),j=b.documentElement,k=j.firstChild,l=b.createElement("body"),m=b.createElement("style"),n;o(b),o(i),k.insertBefore(m,k.firstChild),m.media="print",a.attachEvent("onbeforeprint",function(){var a=-1,c=p(b.styleSheets,"all"),k=[],o;n=n||b.body;while((o=h.exec(c))!=null)k.push((o[1]+o[2]+o[3]).replace(f,"$1.iepp_$2")+o[4]);m.styleSheet.cssText=k.join("\n");while(++a<e){var q=b.getElementsByTagName(d[a]),r=q.length,s=-1;while(++s<r)q[s].className.indexOf("iepp_")<0&&(q[s].className+=" iepp_"+d[a])}i.appendChild(n),j.appendChild(l),l.className=n.className,l.innerHTML=n.innerHTML.replace(g,"<$1font")}),a.attachEvent("onafterprint",function(){l.innerHTML="",j.removeChild(l),j.appendChild(n),m.styleSheet.cssText=""})}(a,b),e._enableHTML5=f,e._version=d,g.className=g.className.replace(/\bno-js\b/,"")+" js "+u.join(" ");return e}(this,this.document)
\ No newline at end of file
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/utah/js/script.js b/libs/js/jquery-geo-1.0b2/docs/examples/utah/js/script.js
deleted file mode 100755 (executable)
index f506072..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-/* Author: Ryan Westphal
-
-*/
-
-$(function () {
-  $("#basemapButtons").buttonset().find("label").click(function () {
-    var inputId = $(this).attr("for"),
-        $basemapInput = $("#" + inputId),
-        basemapValue = $basemapInput.val(),
-        tileSize = parseInt($basemapInput.data("tileSize")),
-        serviceOptions = makeService(basemapValue, tileSize);
-
-    $("#map").geomap("option", {
-      tilingScheme: serviceOptions.tilingScheme,
-      services: serviceOptions.services,
-      center: $("#map").geomap("option", "center")
-    });
-  });
-
-  var options = $.extend( { }, makeService("UtahBaseMap-Lite", 256), {
-          center: [453709, 4333922],
-          zoom: 2,
-          move: function (e, geo) {
-            $("#lblCoords>span").text("" + geo.coordinates);
-          }
-        } );
-
-  $("input[value='UtahBaseMap-Lite']").prop("checked", true);
-
-  $("#pnlSearch form").submit(function (e) {
-    e.preventDefault();
-
-    var address = $(this).find("input").val().replace(/,\s*UT/i, ""),
-        addressParts = address.split(",");
-
-    if (addressParts.length >= 2) {
-      address = address.replace(addressParts[addressParts.length - 1], "").replace(",", "");
-      $.ajax({
-        url: "http://mapserv.utah.gov/wsut/Geocode.svc/appgeo/street(" + $.trim(address) + ")zone(" + $.trim(addressParts[addressParts.length - 1]) + ")",
-        dataType: "jsonp",
-        success: function (result) {
-          $("#map").geomap("option", {
-            center: [result.UTM_X, result.UTM_Y],
-            zoom: 13
-          });
-        },
-        error: function (xhr) {
-          displayMessage(xhr.statusText);
-        }
-      });
-    } else {
-      displayMessage("Please enter both a street address and either a city or zip separated by a comma");
-    }
-
-    return false;
-  });
-
-  $("#pnlSearch input").watermark("street addres, city or zip");
-
-  $.geo.proj = null;
-  $("#map").geomap(options);
-
-  function displayMessage(msg) {
-    $("#infoBar").html(msg).fadeTo(0, 1.0).delay(5000).fadeOut("slow");
-  }
-
-  function makeService(name, tileSize) {
-    return {
-      services: [
-        {
-          type: "tiled",
-          src: "http://mapserv.utah.gov/ArcGIS/rest/services/" + name + "/MapServer/tile/{{:zoom}}/{{:tile.row}}/{{:tile.column}}",
-          attr: "&copy; AGRC"
-        }
-      ],
-      tilingScheme: {
-        tileWidth: tileSize,
-        tileHeight: tileSize,
-        pixelSizes: [
-          4891.96999883583,
-          2445.98499994708,
-          1222.99250010583,
-          611.496250052917,
-          305.748124894166,
-          152.8740625,
-          76.4370312632292,
-          38.2185156316146,
-          19.1092578131615,
-          9.55462890525781,
-          4.77731445262891,
-          2.38865722657904,
-          1.19432861315723,
-          0.597164306578613,
-          0.298582153289307
-        ],
-        origin: [-5120900, 9998100]
-      }
-    }
-  }
-});
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/voting.html b/libs/js/jquery-geo-1.0b2/docs/examples/voting.html
deleted file mode 100755 (executable)
index 8d5c029..0000000
+++ /dev/null
@@ -1,224 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>Voting districts example</title>
-  <meta charset="utf-8">
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of voting districts">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/start/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      background: #fff;
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-
-    #sliders
-    {
-      margin-top: 32px;
-    }
-    .slider
-    {
-      margin: 8px;
-    }
-
-    h1, #demographic { display: inline-block; }
-
-    #demographic img { margin-left: 8px; }
-
-    tr { display: inline-block; }
-
-    td:first-child { font-weight: bold }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/DkqDX/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <div id="sliders">
-        <fieldset>
-          <legend>basemap transparency</legend>
-          <div id="sliderBasemap"></div>
-        </fieldset>
-        <fieldset>
-          <legend>demographic color</legend>
-          <div>
-            <label>red</label> <div id="sliderR" class="slider"></div>
-            <label>green</label> <div id="sliderG" class="slider"></div>
-            <label>blue</label> <div id="sliderB" class="slider"></div>
-            <label>transparency</label> <div id="sliderA" class="slider"></div>
-          </div>
-        </fieldset>
-      </div>
-      <h1>Voting Districts by %</h1>
-      <div id="demographic">
-        <input type="radio" id="optWhite" name="demographic" value="1" checked /><label for="optWhite">White</label>
-        <input type="radio" id="optBlack" name="demographic" value="2" /><label for="optBlack">Black</label>
-        <input type="radio" id="optAsian" name="demographic" value="3" /><label for="optAsian">Asian</label>
-        <input type="radio" id="optHispanic" name="demographic" value="4" /><label for="optHispanic">Hispanic</label>
-        <img alt="" src="img/ajax-loader.gif" title="Loading 2011 MA voting district data" />
-      </div>
-      <h2 data-text="Name"></h2>
-      <div data-html="Description">
-        <p>Once the data has loaded (which may take a while, even on broadband connections), you can dynamically change the demographic display color. You can also click a voting district to zoom in and see details.</p>
-      </div>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="js/iecors.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $( function () {
-      // create a map
-      var data, // GeoJSON data of voting districts
-          selection, // reference to current selection highlight
-          map = $( "#map" ).geomap( {
-            center: [ -71.0595678, 42.3604823 ],
-            zoom: 8,
-            click: function( e, geo ) {
-              // remove any previous selection graphic
-              if ( selection ) {
-                map.geomap( "remove", selection );
-              }
-
-              // find a voting district at the clicked location
-              var district = map.geomap( "find", geo, 1 );
-
-              if ( district.length > 0 ) {
-                // make a copy of the feature for selection highlight
-                selection = $.extend( true, { }, district[ 0 ] );
-
-                // display some info about the voting district
-                $( "[data-text='Name']" ).text( selection.properties.Name );
-                var $descTable = $( selection.properties.Description );
-                $descTable.find( "tr:eq(5)" ).remove( );
-                $descTable.find( "tr:eq(4) td:first-child" ).text( "Hispanic Origin" );
-                $( "[data-html='Description']" ).empty().append( $descTable ).show();
-
-                // set the map's bbox to the bbox of the feature
-                // but scale the bbox by 2x first to zoom out a little
-                map.geomap( "option", "bbox", $.geo.scaleBy( $.geo.bbox( selection ), 2 ) );
-
-                // append the selection highlight shape with a thick red border
-                map.geomap( "append", selection, { opacity: 1, fillOpacity: 0, color: "red", strokeWidth: "4px" } );
-              }
-            }
-          } );
-
-      // set an initial shapeStyle for the demographic display, all white, no border
-      map.geomap( "option", "shapeStyle", { strokeWidth: "0px", opacity: 1, color: "#fff" } );
-
-      // jQuery UI for pretty sliders
-
-      $( "#sliderBasemap" ).slider( {
-        value: 100,
-        slide: function ( e, ui ) {
-          // when the basemap slider slides,
-          // set the new opacity on the osm layer
-          // you can target specific layers with jQuery selector syntax
-          // the default service object has a css class of osm
-          $( "#map .osm" ).geomap( "opacity", ui.value / 100 );
-        }
-      } );
-
-      $( ".slider" ).slider( {
-        value: 100,
-        change: function( e, ui ) {
-          // when any demographic slider changes, get all the values
-          var red = $( "#sliderR" ).slider( "option", "value" ),
-              green = $( "#sliderG" ).slider( "option", "value" ),
-              blue = $( "#sliderB" ).slider( "option", "value" ),
-              alpha = $( "#sliderA" ).slider( "option", "value" );
-            
-          // set the shapeStyle to the new color and global opacity
-          // since each individual shape only overrides fillOpacity,
-          // this single call will modify all shapes without having to re-append them
-          map.geomap( "option", "shapeStyle", {
-            color: "rgb( " + Math.floor( 255 * red / 100 )  + ", " + Math.floor( 255 * green / 100 ) + ", " + Math.floor( 255 * blue / 100 ) + " )",
-            opacity: alpha / 100
-          } , false );
-        }
-      } );
-
-      // jQuery UI for pretty radio buttons
-      $( "#demographic" ).buttonset( );
-
-      $( "#demographic input" ).click( function( ) {
-        // when a demographic radio button changes,
-        // generate new demographic shapes from the existing data
-        showData( data, $(this).val() );
-      } );
-
-      // download the voting district shapes and demographics
-      $.ajax( {
-        url: "http://data.jquerygeo.com/ma-voting-districts.geojson",
-        dataType: "json",
-        success: function( result ) {
-          // save a copy
-          data = result;
-          // generate new demographic shapes based on whichever input is checked
-          showData( data, $( "#demographic input:checked" ).val( ) );
-
-          $( "#demographic img" ).remove();
-        },
-        error: function( xhr ) {
-          // uh oh
-          alert( xhr.statusText );
-        }
-      } );
-
-      function showData( data, demoIndex ) {
-        // clear any existing demographic shapes
-        map.geomap( "empty" );
-
-        if ( data && data.type == "FeatureCollection" ) {
-          $.each( data.features, function( ) {
-            // for each voting district, extract the requested demographic row, demoIndex
-            // and compare it to the total population row, 0
-            var infoTable = $( this.properties.Description ),
-                pop = parseInt( infoTable.find( "tr:eq(0) td:eq(1)" ).text() ),
-                demo = parseInt( infoTable.find( "tr:eq(" + demoIndex + ") td:eq(1)" ).text() ),
-                pct = demo / pop;
-
-                // append a shape for the voting district,
-                // its fillOpacity is set to the demographic's relationship to total population
-                // for performance, don't refresh while adding these, that ending false
-                map.geomap( "append", this, { fillOpacity: 1 - pct } , false );
-          } );
-
-          if ( selection ) {
-            // if there's an existing selection highlight shape,
-            // append it with a thick red border
-            map.geomap( "append", selection, { opacity: 1, fillOpacity: 0, color: "red", strokeWidth: "4px" }, false );
-          }
-
-          // refresh the map after appending all the new shapes
-          map.geomap( "refresh" );
-        }
-      }
-    } );  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/wkt.html b/libs/js/jquery-geo-1.0b2/docs/examples/wkt.html
deleted file mode 100755 (executable)
index 20a05c3..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>WKT parse/stringify example</title>
-  <meta charset="utf-8">
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of WKT parse/stringify">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <a href="../" class="docLink">&lt; docs</a>
-      <h1>WKT parse &amp; stringify</h1>
-      <p>This example uses $.geo.WKT.stringify to turn your drawn GeoJSON objects into WKT. The Parse button uses $.geo.WKT.parse to read valid WKT from the text box and add shapes to the map.</p>
-<pre class="notmobile">
-POINT (-71.070554128125 42.36859979580157)
-LINESTRING (-71.570554128125 42.36859979580157, -71.63097893281248 42.47605758571917, -71.3645604757813 42.50036207893463)
-POLYGON ((-71.070554128125 42.36859979580157, -71.13097893281248 42.47605758571917, -70.8645604757813 42.50036207893463))
-MULTIPOINT (-71.070554128125 42.36859979580157, -71.13097893281248 42.47605758571917, -70.8645604757813 42.50036207893463)
-MULTIPOINT ((-71.070554128125 42.36859979580157),(-71.13097893281248 42.47605758571917),(-70.8645604757813 42.50036207893463))
-MULTIPOLYGON (((-71.070554128125 42.36859979580157, -71.13097893281248 42.47605758571917, -70.8645604757813 42.50036207893463)))
-MULTILINESTRING ((-71.070554128125 42.36859979580157, -71.13097893281248 42.47605758571917, -70.8645604757813 42.50036207893463))
-GEOMETRYCOLLECTION (POINT (-71.070554128125 42.36859979580157),LINESTRING (-71.570554128125 42.36859979580157, -71.63097893281248 42.47605758571917, -71.3645604757813 42.50036207893463),POLYGON ((-71.070554128125 42.86859979580157, -71.13097893281248 42.97605758571917, -70.8645604757813 43.00036207893463)))
-</pre>
-      <textarea id="wkt" rows="4" cols="32"></textarea>
-      <button id="parse" type="button">Parse</button>
-      <button id="clear" type="button">Reset</button>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      var map = $("#map").geomap({
-        center: [-71.0595678, 42.3604823],
-        zoom: 8,
-        click: function (e, geo) {
-          $("#wkt").val($.geo._WKT.stringify(geo));
-          map.geomap("append", geo);
-        }
-      });
-
-      $("#parse").button().click(function (e) {
-        var geo = $.geo._WKT.parse($("textarea").val());
-        if (geo) {
-          map.geomap("append", geo, false);
-          map.geomap( "option", "bbox", $.geo.scaleBy( $.geo.bbox( geo ), 2 ) );
-        }
-      });
-
-      $("#clear").button().click(function (e) {
-        $("textarea").val("");
-        map.geomap("empty");
-      });
-    });  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/xkcd.html b/libs/js/jquery-geo-1.0b2/docs/examples/xkcd.html
deleted file mode 100755 (executable)
index 2967172..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>xkcd - Click and Drag</title>
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="Click and Drag comic from xkcd in jQuery Geo">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info not-mobile">
-      <div class="links">
-        <a href="../" class="docLink">&lt; docs</a>
-        <a href="http://jsfiddle.net/ryanttb/Qweu3/embedded/" class="fiddleLink"><img src="img/jsfiddle.png" alt="" /> jsFiddle &gt;</a>
-      </div>
-      <h1>Click and Drag</h1>
-      <p>The <a href="http://xkcd.com/1110/">xkcd comic</a> as a jQuery Geo map.</p>
-      <p>Tiles created by <a href="https://twitter.com/dividuum">@dividuum</a></p>
-    </div>
-  </div>
-  <script src="http://code.jquery.com/jquery-1.8.1.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $( function ( ) {
-      // create a map and point the service to an xkcd tileset
-      var map = $( "#map" ).geomap( {
-        zoom: 10,
-        center: [ 0.5503, 0.9406 ],
-        zoomMax: 10,
-        services: [ {
-          type: "tiled",
-          src: "http://xkcd-static.rent-a-geek.de/converted/{{:zoom}}-{{:tile.column}}-{{:tile.row}}.png",
-          attr: "&copy; xkcd"
-        } ]
-      } );
-    } );  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/examples/zoom.html b/libs/js/jquery-geo-1.0b2/docs/examples/zoom.html
deleted file mode 100755 (executable)
index aa5d5f9..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <title>zoom example</title>
-  <meta charset="utf-8">
-  <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
-  <meta name="description" content="An example of zoom">
-  <meta name="author" content="Ryan Westphal">
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <link rel="stylesheet" type="text/css" href="css/style.css" />
-  <style type="text/css">
-    #map
-    {
-      position: fixed;
-      left: 0;
-      top: 0;
-      right: 0;
-      bottom: 0;
-    }
-  </style>
-</head>
-<body>
-  <div>
-    <div id="map">
-    </div>
-    <div class="info">
-      <a href="../" class="docLink">&lt; docs</a>
-      <h1>
-        zoom</h1>
-      <p>
-        This example uses the zoom method (as opposed to the zoom option) to change the zoom by relative amounts. Input a number of levels by which to change and click zoom. Negative values zoom out.</p>
-      <input type="number" id="zoom" value="1" /><button type="button">zoom</button>
-    </div>
-  </div>
-  <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
-  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script src="../jquery.geo-test.min.js"></script>
-  <script>
-    $(function () {
-      var map = $("#map").geomap({
-        center: [-71.0595678, 42.3604823],
-        zoom: 8
-      });
-
-      $("button").button().click(function () {
-        var value = parseInt($("input").val());
-        if (value) {
-          map.geomap("zoom", value);
-        }
-      });
-    });  
-  </script>
-
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/geo/area.html b/libs/js/jquery-geo-1.0b2/docs/geo/area.html
deleted file mode 100755 (executable)
index 6b0eb2d..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>area | $.geo</title>
-  <meta name="description" content="jQuery Geo area method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="area" data-role="page">
-    <div data-role="header" data-theme="b">
-      <h1>area</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>Number</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>$.geo.area( Object shape ( <a href="http://geojson.org/geojson-spec.html" rel="external">GeoJSON object</a> ) )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>var area = $.geo.area( {
-      type: &quot;Polygon&quot;,
-      coordinates: [[
-        [-75, 39.7],
-        [-74.8, 39.3],
-        [-75.2, 39.3],
-        [-75, 39.7]
-      ]]
-} )</pre></code></td>
-        </tr>
-      </table>
-      <p>The area method calculates the area of a basic GeoJSON geometry object and returns it in non-geodetic units. The basic shapes are Point, LineString and Polygon. If you are using geomap with its default map service, the area is in square meters because the default projection is web mercator meters.</p>
-      <p>While you can pass any basic geometry, this function returns the area of Polygon objects and 0 for objects of other shape types.</p>
-      <p>If the argument is not a basic GeoJSON geometry object, this function returns undefined.</p>
-      <p>This function is similar to Geometry.getArea in JTS.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geo/bbox.html b/libs/js/jquery-geo-1.0b2/docs/geo/bbox.html
deleted file mode 100755 (executable)
index 8ac16c2..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>bbox | $.geo</title>
-  <meta name="description" content="jQuery Geo bbox method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="bbox" data-role="page">
-    <div data-role="header" data-theme="b">
-      <h1>bbox</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>Array ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> )</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>$.geo.bbox( Object shape ( <a href="http://geojson.org/geojson-spec.html" rel="external">GeoJSON object</a> ) )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>var bbox = $.geo.bbox( {
-  type: &quot;LineString&quot;, coordinates: [
-    [ -71, 40 ], [ -70.5, 41 ]
-  ]
-} )</code></pre></td>
-        </tr>
-      </table>
-      <p>The bbox method calculates the smallest box that will contain all the positions in the passed-in shape. The shape can be any GeoJSON geometry object from Point to GeometryCollection.</p>
-      <p>The GeoJSON spec allows for each geometry type to have a bbox property. The $.geo.bbox method will honor that property and assume it is accurate. It will return the value of that property before attempting to calculate the bbox itself. If you wish to force $.geo.bbox to calculate the bbox, you will have to manually delete the bbox property from the geometry object.</p>
-      <pre><code>var shape = {
-  type: &quot;LineString&quot;, coordinates: [
-    [ -71, 40 ], [ -70.5, 41 ]
-  ],
-  bbox: [ -71, 40, -70.5, 41 ]
-};
-var bboxFromProperty = $.geo.bbox(shape);
-delete shape.bbox;
-var calculatedBbox = $.geo.bbox(shape);
-</code></pre>
-      <p>If the argument is not a basic GeoJSON geometry object, this function returns undefined.</p>
-      <!--<p>Due to the liberties taken by web mercator to display a round Earth on a single 
-        flat plane, when working in geodetic (lon/lat) coordinates, the result of the 
-        $.geo.bbox function may not be exactly what you expect based on your input 
-        geodetic geometry.</p>-->
-      <p>This function is similar to Geometry.getEnvelope in JTS.</p>
-     </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geo/center.html b/libs/js/jquery-geo-1.0b2/docs/geo/center.html
deleted file mode 100755 (executable)
index 71fe04c..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>center | $.geo</title>
-  <meta name="description" content="jQuery Geo center method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="center" data-role="page">
-    <div data-role="header" data-theme="b">
-      <h1>center</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>Array ( <a href="http://geojson.org/geojson-spec.html#positions" rel="external">GeoJSON position</a> ) </td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>$.geo.center( Array bbox ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> ) )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>var bboxCenter = $.geo.center( bbox )</code></pre></td>
-        </tr>
-      </table>
-      <p>The center method calculates the center of a bbox and returns it as a GeoJSON position.</p>
-      <p>It operates on bounding boxes and should not be confused with the centroid function, which operates on GeoJSON geometry objects.</p>
-      <p>This function is called Envelope.centre in JTS (I assume because JTS is built in British Columbia).</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geo/centroid.html b/libs/js/jquery-geo-1.0b2/docs/geo/centroid.html
deleted file mode 100755 (executable)
index 76fa16c..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>centroid | $.geo</title>
-  <meta name="description" content="jQuery Geo centroid method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="centroid" data-role="page">
-    <div data-role="header" data-theme="b">
-      <h1>centroid</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>Object ( <a href="http://geojson.org/geojson-spec.html#point" rel="external">GeoJSON Point</a> )</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>$.geo.centroid( Object shape ( <a href="http://geojson.org/geojson-spec.html" rel="external">GeoJSON object</a> ) )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>var centroid = $.geo.centroid( {
-      type: &quot;Polygon&quot;,
-      coordinates: [[
-        [-75, 39.7],
-        [-74.8, 39.3],
-        [-75.2, 39.3],
-        [-75, 39.7]
-      ]]
-} )</code></pre></td>
-        </tr>
-      </table>
-      <p>The centroid method calculates the <b>center of mass</b> for the passed-in basic GeoJSON geometry object. The basic geometry types are Point, LineString and Polygon.</p>
-      <p>Technically, only Polygons can be considered to have mass. However, a centroid can be calculated for other geometry types. This method operates on LineStrings as if they were closed polygons and the centroid will likely not lie along the line. The centroid of a Point is a clone of the Point.</p>
-      <!--<p>With GeometryCollections containing multiple geometry types, the centroid of the geometries of highest dimension will be returned. In other words, one Polygon will override any number of LineStrings in the collection and the centroid will simply be the centroid of that Polygon.</p>-->
-      <p>If the argument is not a basic GeoJSON geometry object, this function returns undefined.</p>
-      <p>This function is similar to Geometry.getCentroid in JTS.</p>
-     </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geo/contains.html b/libs/js/jquery-geo-1.0b2/docs/geo/contains.html
deleted file mode 100755 (executable)
index 0492f68..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>contains | $.geo</title>
-  <meta name="description" content="jQuery Geo contains method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="contains" data-role="page">
-    <div data-role="header" data-theme="b">
-      <h1>contains</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>Boolean</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>$.geo.contains( Object shape1 ( <a href="http://geojson.org/geojson-spec.html" rel="external">GeoJSON object</a> ), Object shape2 ( <a href="http://geojson.org/geojson-spec.html" rel="external">GeoJSON object</a> ) )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>var contains = $.geo.contains(
-  {
-    type: "Polygon", coordinates: [[
-      [-71.06, 42.3425],
-      [-71.06, 42.3475],
-      [-71.04, 42.3475],
-      [-71.04, 42.3425],
-      [-71.06, 42.3425]
-    ]]
-  },
-  { type: &quot;Point&quot;, &quot;coordinates&quot;: [ -71, 40 ] }
-)</pre></code></td>
-        </tr>
-      </table>
-      <p>The contains method determines if the first basic GeoJSON geometry completely contains a second one. The basic shapes are Point, LineString and Polygon however Point and LineString geometries cannot contain other geometries so the only situation that has a possibility of returning true is when the first argument is a Polygon.</p>
-      <p>If either argument is not a basic GeoJSON geometry object, this function returns undefined.</p>
-      <p>This function is similar to Geometry.contains in JTS.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geo/distance.html b/libs/js/jquery-geo-1.0b2/docs/geo/distance.html
deleted file mode 100755 (executable)
index 1041843..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>distance | $.geo</title>
-  <meta name="description" content="jQuery Geo distance method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="distance" data-role="page">
-    <div data-role="header" data-theme="b">
-      <h1>distance</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>Number</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>$.geo.distance( Object shape1 ( <a href="http://geojson.org/geojson-spec.html" rel="external">GeoJSON object</a> ), Object shape2 ( <a href="http://geojson.org/geojson-spec.html" rel="external">GeoJSON object</a> ) )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>var distanceBetween = $.geo.distance(
-  { type: &quot;Point&quot;, &quot;coordinates&quot;: [ -71, 40 ] },
-  { type: &quot;Point&quot;, &quot;coordinates&quot;: [ -70.5, 41 ] }
-)</pre></code></td>
-        </tr>
-      </table>
-      <p>The distance method calculates the distance between two basic GeoJSON geometry objects and returns it in non-geodetic units. The basic shapes are Point, LineString and Polygon. If you are using geomap with its default map service, the distance is in meters because the default projection is web mercator meters.</p>
-      <p>If either argument is not a basic GeoJSON geometry object, this function returns undefined.</p>
-      <p>This function is similar to Geometry.distance in JTS.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geo/expandBy.html b/libs/js/jquery-geo-1.0b2/docs/geo/expandBy.html
deleted file mode 100755 (executable)
index 21684f2..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>expandBy | $.geo</title>
-  <meta name="description" content="jQuery Geo expandBy method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="expandBy" data-role="page">
-    <div data-role="header" data-theme="b">
-      <h1>expandBy</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>Array ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> ) </td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>$.geo.expandBy( Array bbox ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> ), Number dx, Number dy )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>var largerBbox = $.geo.expandBy( bbox, 20, 20 )</pre></code></td>
-        </tr>
-      </table>
-      <p>The expandBy method creates a new bbox with the same center as the original but having a width and height that is modified by the dx and dy arguments respectively.</p>
-      <p>The dx and dy arguments are non-geodetic map units. If you are using geomap with its default map service, these are in meters because the default projection is web mercator meters. If, for example, you are working in a different projection such as NAD83 / New Jersey feet, this function will expand or contract the bbox by feet.</p>
-      <p>The dx and dy arguments can be positive, negative or zero and will modify the width or height of the bbox accordingly.</p>
-      <p>This function is similar to Envelope.expandBy in JTS.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geo/height.html b/libs/js/jquery-geo-1.0b2/docs/geo/height.html
deleted file mode 100755 (executable)
index eb5cf46..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>height | $.geo</title>
-  <meta name="description" content="jQuery Geo height method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="height" data-role="page">
-    <div data-role="header" data-theme="b">
-      <h1>height</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>Number</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>$.geo.height( Array bbox ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>var height = $.geo.height( [ -71.1, 42.3, -71.0, 42.4 ] )</pre></code></td>
-        </tr>
-      </table>
-      <p>The height method returns the true height of a bbox in non-geodetic map units. If you are using geomap with its default map service, the height is in meters because the default projection is web mercator meters.</p>
-      <p>This function is similar to Envelope.getHeight in JTS.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geo/include.html b/libs/js/jquery-geo-1.0b2/docs/geo/include.html
deleted file mode 100755 (executable)
index 8288a4c..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>include | $.geo</title>
-  <meta name="description" content="jQuery Geo include method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="include" data-role="page">
-    <div data-role="header" data-theme="b">
-      <h1>include</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>Array ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> ) </td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>$.geo.include( null | Array bbox ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> ),  Array position ( <a href="http://geojson.org/geojson-spec.html#positions" rel="external">GeoJSON position</a> ) | Array bbox ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> )  )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>var bboxOfCoord = $.geo.include( null, [ -70, 42 ] );
-var sameAsSecondArgument = $.geo.include( null, [ -71, 41, -69, 43 ] );
-var includeCoord = $.geo.include( bbox, [ -70, 42 ] );
-var includeBbox = $.geo.include( bbox, [ -71, 41, -69, 43 ] );</code></pre></td>
-        </tr>
-      </table>
-
-      <p>The include method expands a bbox to include either a coordinate or another bbox. The expanded bbox is returned.</p>
-
-      <p>If the first argument is null or undefined, the result is a new bbox and will contain the second argument.</p>
-
-      <p>For efficency, if the first argument is a valid bbox, it is modified in-place and a reference is returned.</p>
-
-      <p>If the second argument is not a coordinate or bbox, this function returns the first argument.</p>
-
-      <p>This function is similar to Envelope.expandToInclude in JTS.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geo/index.html b/libs/js/jquery-geo-1.0b2/docs/geo/index.html
deleted file mode 100755 (executable)
index c86e8cc..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>geo namespace | $.geo</title>
-  <meta name="description" content="$.geo namespace">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="geo" data-role="page">
-    <div data-role="header" data-theme="d">
-      <h1>geo namespace</h1>
-    </div>
-    
-    <div data-role="content">
-      <p>The $.geo namespace contains all geometry functions implemented in the plugin and an object having the plugin's four projection functions.</p>
-      <h2>projection</h2>
-      <p>The $.geo namespace has a property named proj which is a JavaScript object having four functions: fromGeodetic, fromGeodeticPos, toGeodetic, and toGeodeticPos. These four functions allow all $.geo static bbox/geometry functions, geomap widget properties, geomap widget events &amp; geomap widget methods (collectively referred to as plugin functions from now on) to work in geodetic (lon, lat) coordinates.</p>
-      <ul data-role="listview" data-inset="true">
-        <li><a href="proj.html">$.geo.proj</a></li>
-      </ul>
-      <h2>geometry operations</h2>
-      <p>Geometry isn't much fun if you can't do anything with it. These functions help you analyze and manipulate bounding boxes and GeoJSON geometry objects. You call them directly from the $.geo namespace:</p>
-      <pre><code>$.geo.distance( point1, point2 )</code></pre>
-
-      <p>Except for a few name changes and switching from an object-oriented API to a function-based one, jQuery Geo attempts to follow the names and behavior of the <a href="http://www.vividsolutions.com/jts/jtshome.htm">Java Topology Suite</a> (JTS), which is the de-facto standard for geometry library APIs. JTS itself is an implementation of the <a href="http://www.opengis.org/techno/specs.htm">OGC Simple Features</a> specification but has made design decisions that improve the API for developers. The most notable of which is having Envelope (called bbox in jQuery Geo and GeoJSON) be its own class type.</p>
-      <h3>bbox functions</h3>
-      <p>These functions operate on <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> array, i.e., a JavaScript array having four values:</p>
-      <ul>
-        <li>minimum x/longitude</li>
-        <li>minimum y/latitude</li>
-        <li>maximum x/longitude</li>
-        <li>maximum y/latitude</li>
-      </ul>
-      <ul data-role="listview" data-inset="true">
-        <li><a href="center.html">center</a></li>
-        <li><a href="height.html">height</a></li>
-        <li><a href="width.html">width</a></li>
-        <li><a href="expandBy.html">expandBy</a></li>
-        <li><a href="scaleBy.html">scaleBy</a></li>
-        <li><a href="include.html">include</a></li>
-        <li><a href="reaspect.html">reaspect</a></li>
-        <li><a href="recenter.html">recenter</a></li>
-        <li><a href="polygonize.html">polygonize</a></li>
-      </ul>
-      <h3>geometry object functions</h3>
-      <p>These functions operate on <a href="http://geojson.org/geojson-spec.html" rel="external">GeoJSON geometry objects</a>: Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, and GeometryCollection. They do not operate on Feature or FeatureCollection objects, you have to call these functions on the geometry properties of Feature objects.</p>
-      <p>The geometry functions allow you to analyze relationships between geometries such as their distance apart as well as obtain information about them such as bounding box and center point, called the centroid. This section will eventually expand to cover all of the important spatial operations available in the <a href="http://www.vividsolutions.com/jts/jtshome.htm">Java Topology Suite</a>.</p>
-      <ul data-role="listview" data-inset="true">
-        <li><a href="bbox.html">bbox</a></li>
-        <li><a href="distance.html">distance</a></li>
-        <li><a href="length.html">length</a></li>
-        <li><a href="area.html">area</a></li>
-        <li><a href="contains.html">contains</a></li>
-        <li><a href="centroid.html">centroid</a></li>
-        <li><a href="pointAlong.html">pointAlong</a></li>
-      </ul>
-    </div>
-  </div> <!-- end of #container -->
-
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geo/length.html b/libs/js/jquery-geo-1.0b2/docs/geo/length.html
deleted file mode 100755 (executable)
index 9dbd648..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>length | $.geo</title>
-  <meta name="description" content="jQuery Geo length method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="length" data-role="page">
-    <div data-role="header" data-theme="b">
-      <h1>length</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>Number</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>$.geo.length( Object shape ( <a href="http://geojson.org/geojson-spec.html" rel="external">GeoJSON object</a> ) )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>var length = $.geo.length( {
-      type: &quot;LineString&quot;,
-      coordinates: [[
-        [-75, 39.7],
-        [-74.8, 39.3],
-        [-75.2, 39.3]
-      ]]
-} )</pre></code></td>
-        </tr>
-      </table>
-      <p>The length method calculates the length of a basic GeoJSON geometry object and returns it in non-geodetic units. The basic shapes are Point, LineString and Polygon. If you are using geomap with its default map service, the length is in meters because the default projection is web mercator meters.</p>
-      <p>This function returns 0 for Point objects, the length of LineString objects and the perimeter of Polygon objects.</p>
-      <p>If the argument is not a basic GeoJSON geometry object, this function returns undefined.</p>
-      <p>This function is similar to Geometry.getLength in JTS.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geo/pointAlong.html b/libs/js/jquery-geo-1.0b2/docs/geo/pointAlong.html
deleted file mode 100755 (executable)
index b3c7614..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>pointAlong | $.geo</title>
-  <meta name="description" content="jQuery Geo pointAlong method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="pointAlong" data-role="page">
-    <div data-role="header" data-theme="b">
-      <h1>pointAlong</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>Object ( <a href="http://geojson.org/geojson-spec.html#point" rel="external">GeoJSON Point</a> )</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>$.geo.pointAlong( Object shape ( <a href="http://geojson.org/geojson-spec.html" rel="external">GeoJSON object</a> ), Number percentage )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>var pointAlong = $.geo.pointAlong( {
-      type: &quot;LineString&quot;,
-      coordinates: [[
-        [-75, 39.7],
-        [-74.8, 39.3],
-        [-75.2, 39.3]
-      ]]
-}, .5 )</code></pre></td>
-        </tr>
-      </table>
-      <p>The pointAlong method calculates a Point that lies a given fraction along the passed-in basic GeoJSON geometry object. The basic geometry types are Point, LineString and Polygon. A percentage of 0.0 returns the first Point; a percentage of 1.0 returns the last.</p>
-      <p>Technically, only LineStrings can be used properly in this calculation. However, pointAlong can be calculated for other geometry types. With Point objects, pointAlong will always return a copy of the original Point. For Polygon objects, pointAlong operates on the Polygon's perimeter (outer ring), i.e., myPolygon.coordinates[0]. For Polygons, percentage values of 0.0 and 1.0 will return the same Point.</p>
-      <p>If the argument is not a basic GeoJSON geometry object, this function returns undefined.</p>
-      <p>This function is similar to LineSegment.pointAlong in JTS.</p>
-     </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geo/polygonize.html b/libs/js/jquery-geo-1.0b2/docs/geo/polygonize.html
deleted file mode 100755 (executable)
index b0edade..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>polygonize | $.geo</title>
-  <meta name="description" content="jQuery Geo polygonize method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="polygonize" data-role="page">
-    <div data-role="header" data-theme="b">
-      <h1>polygonize</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>Array ( <a href="http://geojson.org/geojson-spec.html#polygon" rel="external">GeoJSON Polygon</a> ) </td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>$.geo.polygonize( Array bbox ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> ) )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>var polygon = $.geo.polygonize( bbox )</code></pre></td>
-        </tr>
-      </table>
-
-      <p>The polygonize method creates a new Polygon with an outer ring that matches the rectangle covered by the bbox. The Polygon is closed and will have five coordinates.</p>
-
-      <p>This function is a simplification/adaptation of the Polygonizer class in JTS. While the JTS object operates on the line work of geometry objects, this function operates on bounding boxes.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geo/proj.html b/libs/js/jquery-geo-1.0b2/docs/geo/proj.html
deleted file mode 100755 (executable)
index 4959f14..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>$.geo.proj object | jQuery Geo</title>
-  <meta name="description" content="$.geo.proj object">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="proj" data-role="page">
-    <div data-role="header" data-theme="d">
-      <h1>$.geo.proj object</h1>
-    </div>
-    
-    <div data-role="content">
-      <p>The $.geo namespace has a property named proj which is a JavaScript object having four functions: fromGeodetic, fromGeodeticPos, toGeodetic, and toGeodeticPos. These four functions allow all $.geo static bbox/geometry functions, geomap widget properties, geomap widget events &amp; geomap widget methods (collectively referred to as plugin functions from now on) to work in geodetic (lon, lat) coordinates.</p>
-      <p>Consider the following example:</p>
-      <ul>
-        <li>assume you are using the default map service</li>
-        <li>you call $.geo.distance passing two geodetic Point objects, i.e., the GeoJSON position in each point is an array where coordinates[0] is the longitude and coordinates[1] is latitude</li>
-      </ul>
-      <p>jQuery Geo will first convert the points to map units, a process called projection. jQuery Geo needs projected coordinates to properly calculate some relationships between shapes. After converting the points, $.geo.distance can then calculate the distance between them. This distance will be in meters because the default map service is web mercator meters.</p>
-      <p>In order to work directly in map units, you used to have to set $.geo.proj to null. While still valid, you no longer have to do this. You can leave $.geo.proj set to, e.g., web mercator meters and send either projected web mercator GeoJSON geometry objects or geodetic (lon, lat) objects to $.geo functions. The return value will depend on the type of arguments passed.</p>
-      <p>The geomap widget keeps track of how you set options. For example, if you set the map's center using geodetic coordinates, geodetic coordinates will then be returned when you ask for the center later. They will also be used when the geomap widget triggers events such as bboxchange or shape.</p>
-      <p>The default $.geo.proj object comes pre-built with functions that quickly convert between geodetic coordinates and web mercator meters so you can start using lon, lat right away with the default OpenStreetMap-based tiles. If your map service uses a different projection you can roll your own $.geo.proj object and continue to have the option to use geodetic coordinates. Read <a data-href="otherprojections" href="javascript:void(0);">Other projections</a> below for information on how to do that.</p>
-
-      <h3>Usage</h3>
-      <p>The two base functions, fromGeodetic and toGeodetic, can take and return: a single bounding box, a single GeoJSON position (Point.coordinates), an array of GeoJSON positions (MultiPoint.coordinates or LineString.coordinates), an array of arrays of positions (MultiLineString.coordinates or Polygon.coordinates) or an array of arrays of arrays of positions (MultiPolygon.coordinates). In other words, the $.geo.proj functions convert the coordinates property of any of the GeoJSON geometry types. For example, you can use the following to convert the position contained in a GeoJSON point object:</p>
-      <pre><code>var geodeticPoint = {
-  type: &quot;Point&quot;,
-  coordinates: [ -73.5100, 41.3500 ]
-};
-
-var projectedCoords = $.geo.proj.fromGeodetic( geodeticPoint.coordinates );</code></pre>
-
-      <p>However, a LineString's coordinates property is an array of positions which you can also pass to the fromGeodetic method to get an array converted positions</p>
-
-      <pre><code>var projectedLineStringCoords = $.geo.proj.fromGeodetic( geodeticLineString.coordinates );</code></pre>
-
-      <p>To convert a set of projected GeoJSON positions back to web mercator, call toGeodetic.</p>
-
-      <pre><code>var geodeticLineString = {
-  type: &quot;LineString&quot;,
-  coordinates: $.geo.proj.toGeodetic( projectedLineStringCoords  )
-};</code></pre>
-
-      <h3 id="otherprojections">Other projections</h3>
-
-      <p>The $.geo.proj object allows you to use geodetic coordinates with whichever coordinate system or projection you want in any plugin function. If you pass a geodetic Polygon to $.geo.bbox, the returned bounding box will be in geodetic coordinates.</p>
-
-      <p>If you are working in a projection other than the default web mercator meters but still wish to use geodetic coordinates, you will have to update the $.geo.proj object so that it can convert between geodetic coordinates and ones in your projection.</p>
-
-      <p>However, if you don't need to work in longitude, latitude at all, you can ignore $.geo.proj and use projected coordinates throughout your project. You also still have the option to set $.geo.proj to null for completeness and remind yourself that you are limited to projected coordinates. If you are working in Massachusetts Mainland State Plane meters for example, you can pass a Polygon of that projection to any plugin function and you will get results in that projection. This includes all $.geo functions and geomap options &amp; methods.</p>
-
-      <pre><code>$.geo.proj = null; <span class="comment">// not required but reminds us that jQuery Geo can't use lon, lat in this project</span>
-
-$('map').geomap( {
-  tilingScheme: null,
-  bboxMax: [ 31790, 790195, 337250, 961865 ],
-  bbox: [ 235644, 894775, 237775, 898523 ],
-  services: [ /* service object that supports MA State Plane */ ]
-} );</code></pre>
-
-      <p>jQuery Geo uses the four $.geo.proj functions throughout to convert between geodetic and projected coordinates. However, fromGeodeticPos and toGeodeticPos handle the conversion of individual GeoJSON positions and are used by fromGeodetic and toGeodetic. You can extend $.geo.proj with your own implementations of fromGeodeticPos and toGeodeticPos to change the internal projection used by all plugin functions and still use geodetic (lon, lat) coordinates as arguments and return values.</p>
-
-      <p><b>Please note</b> that you must extend $.geo.proj with new functionality instead of replacing it wholesale with a new object. You need to keep the original fromGeodetic and toGeodetic functions intact.</p>
-
-      <pre><code>$.extend($.geo.proj, {
-  fromGeodeticPos: function( coordinate ) {
-    var converted = [];
-    // convert the GeoJSON lon/lat position to MA State Plane
-    return converted;
-  },
-
-  toGeodeticPos: function( coordinate ) {
-    var converted = [];
-    // convert the GeoJSON MA State Plane position to lon/lat
-    return converted;
-  }
-});
-
-$('map').geomap( {
-  tilingScheme: null,
-
-  // notice that with a custom $.geo.proj object,
-  // these properties can be in geodetic coordinates
-  bboxMax: [ -73.5100, 41.3500, -69.8600, 42.8900 ],
-  bbox: [ -71.098709, 42.330322, -71.072617, 42.351608 ],
-
-  // the services option must still be in map coordinates
-  // see geomap's services property docs for more info
-  services: [ /* service object that supports MA State Plane */ ]
-} );</code></pre>
-      <p>Implementing custom from/to GeodeticPos functions is <i>currently</i> beyond the scope of this documentation but reading up on <a href="http://proj4js.org/" rel=external>Proj4js</a> is a good start.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geo/reaspect.html b/libs/js/jquery-geo-1.0b2/docs/geo/reaspect.html
deleted file mode 100755 (executable)
index 76c11d1..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>reaspect | $.geo</title>
-  <meta name="description" content="jQuery Geo reaspect method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="reaspect" data-role="page">
-    <div data-role="header" data-theme="b">
-      <h1>reaspect</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>Array ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> ) </td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>$.geo.reaspect( Array bbox ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> ), Number ratio )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>var widescreenBbox = $.geo.reaspect( bbox, 16 / 9 )</pre></code></td>
-        </tr>
-      </table>
-      <p>The reaspect method creates a new bbox with the same center as the original but forcing the ratio of width to height to a specific value.</p>
-      <p>If the original width is greater than the original height (think a landscape printout) then the width of the new bbox will be the same as the original but the new height will change to fit the ratio. If the original height is greater than the original width (think a portrait printout) then the new bbox height will remain unchanged but the width will to fit the ratio.</p>
-      <p>This function is not defined in JTS.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geo/recenter.html b/libs/js/jquery-geo-1.0b2/docs/geo/recenter.html
deleted file mode 100755 (executable)
index 7dfda39..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>recenter | $.geo</title>
-  <meta name="description" content="jQuery Geo recenter method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="recenter" data-role="page">
-    <div data-role="header" data-theme="b">
-      <h1>recenter</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>Array ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> ) </td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>$.geo.recenter( Array bbox ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> ), Array (<a href="http://geojson.org/geojson-spec.html#positions" rel="external">GeoJSON position</a>) )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>var moved = $.geo.recenter( bbox, [ -70, 42 ] )</pre></code></td>
-        </tr>
-      </table>
-
-      <p>The recenter method creates a new bbox with the same width and height as the original but moving the center to a new location.</p>
-
-      <p>This function is not defined in JTS.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geo/scaleBy.html b/libs/js/jquery-geo-1.0b2/docs/geo/scaleBy.html
deleted file mode 100755 (executable)
index 74bf39f..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>scaleBy | $.geo</title>
-  <meta name="description" content="jQuery Geo scaleBy method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="scaleBy" data-role="page">
-    <div data-role="header" data-theme="b">
-      <h1>scaleBy</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>Array ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> )</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>$.geo.scaleBy( Array bbox ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> ), Number scale )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>var twiceAsBig = $.geo.scaleBy( bbox, 2 )</code></pre></td>
-        </tr>
-      </table>
-      <p>The scaleBy method creates a new bbox with the same center as the original but having a width and height that are both multiplied by the scale argument.</p>
-      <p>The scale argument is a percentage increase or decrease. This means that supplying 2 will increase the size of the bbox by 200%, which if thinking in terms of a map's view, would zoom out. Supplying .5 will decrease the size of the bbox to half its original size.</p>
-      <p>The scale argument must be greater than zero.</p>
-      <p>This function is not defined in JTS.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geo/width.html b/libs/js/jquery-geo-1.0b2/docs/geo/width.html
deleted file mode 100755 (executable)
index 29cc308..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>width | $.geo</title>
-  <meta name="description" content="jQuery Geo width method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="width" data-role="page">
-    <div data-role="header" data-theme="b">
-      <h1>width</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>Number</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>$.geo.width( Array bbox ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>var width = $.geo.width( [ -71.1, 42.3, -71.0, 42.4 ] )</pre></code></td>
-        </tr>
-      </table>
-      <p>The width method returns the true width of a bbox in non-geodetic units. If you are using geomap with its default map service, the width is in meters because the default projection is web mercator meters.</p>
-      <p>This function is similar to Envelope.getWidth in JTS.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geographics/index.html b/libs/js/jquery-geo-1.0b2/docs/geographics/index.html
deleted file mode 100755 (executable)
index 70a31ec..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-
-  <title>geographics | $.geo</title>
-  <meta name="description" content="jQuery Geo geographics widget">
-  <meta name="author" content="Ryan Westphal">
-</head>
-
-<body>
-
-  <div id="geographics" data-role="page" data-theme="b">
-    <div data-role="header">
-      <h1>geographics widget</h1>
-    </div>
-    
-    <div data-role="content">
-      <p>The geographics widget in $.geo handles all shape drawing. The geomap widget uses it internally and you can use it outside of geomap to draw GeoJSON geometry that has already been converted to pixel coordinates onto any element.</p>
-      <pre><code>.geographics( options )</code></pre>
-      <h2>options</h2>
-      <p>The options argument is a JavaScript object that configures the graphics widget during the first instantiation on a div. No options are required. By default the graphics widget will draw all shapes with a dark red outline and mostly transparent red fill.</p>
-      <!--<ul data-role="listview" data-inset=true>
-        <li>
-          <a href="style.html">style</a>
-        </li>
-      </ul>-->
-      <h2>methods</h2>
-      <p>The geographics widget provides methods to draw various GeoJSON geometries on the canvas. Remember that the geometries must have either already been converted to pixel coordinates or created initially with a pixel coordinate system in mind.</p>
-      <ul data-role="listview" data-inset="true">
-        <li><a href="drawArc.html">drawArc</a></li>
-        <li><a href="drawPoint.html">drawArc</a></li>
-        <li><a href="drawLineString.html">drawLineString</a></li>
-        <li><a href="drawPolygon.html">drawPolygon</a></li>
-        <li><a href="drawBbox.html">drawBbox</a></li>
-        <li><a href="clear.html">clear</a></li>
-      </ul>
-    </div>
-  </div> <!-- end of #container -->
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/append.html b/libs/js/jquery-geo-1.0b2/docs/geomap/append.html
deleted file mode 100755 (executable)
index b411b78..0000000
+++ /dev/null
@@ -1,231 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>append | geomap</title>
-  <meta name="description" content="geomap append method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="append" data-role="page">
-    <div data-role="header" data-theme="e">
-      <h1>append</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>jQuery collection</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>.geomap( &quot;append&quot;, Object shape ( <a href="http://geojson.org/geojson-spec.html" rel="external">GeoJSON object</a> ) | Array&lt;Object&gt; shapes [ , Object style ( geomap style ) ] [ , String label ] [ , Boolean refresh ] )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code><span class="comment">// a single point, no style, no label, refresh immediately</span>
-$(<i>map or service selector</i>).geomap( &quot;append&quot;, { type: &quot;Point&quot;, coordinates: [ -71, 40 ] } )
-
-<span class="comment">// a single line, don't refresh yet</span>
-$(<i>map or service selector</i>).geomap( &quot;append&quot;, {
-  type: &quot;LineString&quot;,
-  coordinates: [ [ -71, 40 ], [ -71.5, 41 ] ]
-}, false )
-
-<span class="comment">// a polygon with a style</span>
-$(<i>map or service selector</i>).geomap( &quot;append&quot;, {
-  type: &quot;Polygon&quot;,
-  coordinates: [ [ 
-    [-75, 39.7],
-    [-74.8, 39.3],
-    [-75.2, 39.3],
-    [-75, 39.7]
-  ] ]
-}, { stroke: &quot;#11117f&quot;, strokeWidth: &quot;3px&quot; } )
-
-<span class="comment">// an array of geometry objects with a style, don't refresh yet</span>
-$(<i>map or service selector</i>).geomap( &quot;append&quot;, [ 
-  { type: &quot;Point&quot;, coordinates: [ -71, 40 ] },
-  { type: &quot;Point&quot;, coordinates: [ -70, 39.5 ] },
-], { color: &quot;green&quot;, strokeWidth: &quot;3px&quot; }, false )
-
-<span class="comment">// a point feature with a label</span>
-$(<i>map or service selector</i>).geomap( &quot;append&quot;, {
-  type: &quot;Feature&quot;,
-  geometry: {
-    type: &quot;Point&quot;,
-    coordinates: [ -71, 40 ]
-  }
-}, &quot;My Point&quot; )
-
-<span class="comment">// a point with a label, don't refresh yet</span>
-$(<i>map or service selector</i>).geomap( &quot;append&quot;, { type: &quot;Point&quot;, coordinates: [ -71, 40 ] }, &quot;My Point (don't refresh yet)&quot;, false )
-
-<span class="comment">// a point with a style &amp; label</span>
-$(<i>map or service selector</i>).geomap( &quot;append&quot;, { type: &quot;Point&quot;, coordinates: [ -71, 40 ] }, { color: &quot;#00f&quot; }, &quot;Blue Point&quot; )
-
-<span class="comment">// a collection of features with a style, each point will get a separate label, don't refresh yet</span>
-$(<i>map or service selector</i>).geomap( &quot;append&quot;, {
-    type: &quot;FeatureCollection&quot;
-    features: [ {
-      type: &quot;Feature&quot;,
-      geometry: {
-        type: &quot;Point&quot;,
-        coordinates: [ -71, 40 ]
-      }
-    }, {
-      type: &quot;Feature&quot;,
-      geometry: {
-        type: &quot;Point&quot;,
-        coordinates: [ -71.2, 40.3 ]
-      }
-    } ]
-  },
-  { color: &quot;#00f&quot; },
-  '&lt;span style=&quot;color: #44f;&quot;&gt;Blue Point&lt;/span&gt;',
-  false
-)</code></pre></td>
-        </tr>
-      </table>
-
-      <p>The append method adds one shape or an array of shapes to the map. In this documentation, the word shape means a GeoJSON geometry object or a GeoJSON Feature. A FeatureCollection is treated as an array of shapes.</p>
-      
-      <p>When you append more than one shape by using an array or a FeatureCollection, each shape in the array or FeatureCollection's features property is added as a separate shape whereas the other collection geometry types, e.g., MultiPoint, are added as a single shape. This is an important distinction when considering the find method and labels. The find method can potentially return only one shape from an array or one feature of a FeatureCollection but will return all shapes in a MultiPoint (as a reference to the original MultiPoint object supplied to append) even if only one of the coordinates in the MultiPoint intersects the find position. For labeling, each shape in an array and each feature in a FeatureCollection get their own label, however all polygons in a MultiPolygon will share the same label.</p>
-
-      <p>The geomap widget maintains a reference to your shape. You can use the same object in calls to remove in order to remove the shape from the map at any time.</p>
-
-      <p>The jQuery UI widget factory returns the original jQuery collection to maintain call chaining.</p>
-
-      <!--<p>geomap draws shapes ordered by geometry type and then by order of addition. It draws Polygon shapes first followed by LineString and finally Point shapes. </p>-->
-
-      <h2>styling</h2>
-
-      <p>The optional style argument modifies how geomap draws the specific geometry or feature you are adding. Properties supplied in this style will override ones of the same name in geomap&#39;s base shapeStyle. Properties not referenced are inheritied from the base style and can change with future changes to the shapeStyle option. Please see the shapeStyle method documentation for information about what properties are valid for this object.</p>
-
-      <h2>labeling</h2>
-
-      <p>The optional label argument will display a label near the shape. Labels are a powerful way to add text, pixel-based graphics, or other HTML and CSS effects to the map. The label string can be any text or HTML. For example, consider the following:</p>
-
-      <ul>
-        <li>
-          <span>you append a Point shape setting its style to have zero for width and height:</span>
-          <pre><code>{ width: &quot;0px&quot;, height: &quot;0px&quot; }</code></pre>
-        </li>
-
-        <li>
-          <span>you also supply a label of nothing more than a div element with a class:</span>
-          <pre><code>'&lt;div class=&quot;marker&quot;&gt;&lt;/div&gt;'</code></pre>
-        </li>
-
-        <li>
-          <span>in a CSS style sheet, you give the marker class a width, height, background image and negative relative position:</span>
-          <pre><code>.marker
-{
-  width: 8px;
-  height: 8px;
-  background: url(../img/marker.png);
-  position: relative;
-  left: -4px;
-  top: -4px;
-}</code></pre>
-        </li>
-      </ul>
-
-      <p>In the above example, marker.png will be centered on every point added with a similar label. The regular shape style will not show because the point style has no size.</p>
-
-      <p>For Point shapes, the top-left of the label is positioned at the Point's only coordinate. For LineString shapes, the label is usually positioned 50% along the shape but will be forced into view if its usual position is out of the map's current bbox. For Polygon shapes, the label is usually positioned at the centroid but will be forced into view if its usual position is out of the map's current bbox. All other non-basic shape types use the shape's centroid.</p>
-
-      <p>The geomap widget uses a div to position the labels. The div exists inside a container for the service. The div has the CSS class: geo-label. You can use this design to apply regular CSS style to all labels or all labels within a service. The following snippets show examples of using this, assuming the main map div has the id &quot;map&quot; and the default map service (which has the CSS class &quot;osm&quot;) has not been changed.</p>
-
-      <h3>JavaScript</h3>
-
-      <pre><code><span class="comment">/* add a point to the map itself */</span>
-$( &quot;#map&quot; ).geomap( &quot;append&quot;, { type: &quot;Point&quot;, coordinates: [ -71, 40 ] }, &quot;map point&quot; );
-
-<span class="comment">/* add a point to the default map service */</span>
-$( &quot;#map .osm&quot; ).geomap( &quot;append&quot;, { type: &quot;Point&quot;, coordinates: [ -70, 40 ] }, &quot;service point&quot; );
-</code></pre>
-
-      <h3>CSS</h3>
-
-      <pre><code><span class="comment">/* turn the color of all labels blue */</span>
-#map .geo-label { color: blue; }
-
-<span class="comment">/* make labels on the default basemap service bold */</span>
-#map .osm .geo-label { font-weight: bold; }</code></pre>
-
-      <p>One caveat is that, to keep performance high, jQuery Geo will not create the .geo-label container if you do not at least pass an empty string as the label. So, if you want to do something similar to the marker example above, but using the already provided .geo-label div, you will need to pass an empty string as the label.</p>
-      
-      <p>Each .geo-label div is absolutely positioned to the correct location in the map view. Please keep that in mind because changing the position, left or top CSS properties on the .geo-label class may affect your labels drastically.</p>
-
-      <h2>delaying refresh</h2>
-
-      <p>The optional refresh argument determines if geomap refreshes the map graphics after this call to append. It defaults to true. If you pass false, geomap will add the shape internally but not immediately redraw the graphics. The changes will display if the user moves the map or you call geomap's refresh method.</p>
-      <h2>service-level shapes</h2>
-      <p>The geomap widget allows you to append a shape to a specific service. You do this by targeting a service inside a map instead of the map itself for your call to geomap's append method. For example, the default map service has the CSS class: osm. We can append a shape to that service specifically by using jQuery to target the service:</p>
-      <pre><code>$( &quot;#map .osm&quot; ).geomap( &quot;append&quot;, shape );</code></pre>
-      <p>Some of the important advantages with this syntax are:</p>
-      <ul>
-        <li>you can show or hide shapes as you toggle a service because shapes attached to a service are only visible if the service is visible</li>
-        <li>service-level shapes draw in the order of their service in the <a href="services.html">services option</a> which gives you finer control over how they look</li>
-        <li>shapes on the map itself always draw above service-level shapes</li>
-        <li>you can style shapes differently depending on their service using a service-level <a href="shapeStyle.html">shapeStyle option</a></li>
-      </ul>
-      <h2>duplicate shapes</h2>
-      <p>You can add the same GeoJSON object to more than one service, which allows you to give the same object two different styles at the same time. To do this, call append twice with the same object. Once on one service (or the map itself) and a second time on a different service.</p>
-      <p>You can also do this at the same time by using the comma selector in one call to append:</p>
-      <pre><code><span class="comment">// set the basemap service's shapeStyle option to a white halo effect</span>
-$( &quot;#map .osm&quot; ).geomap( &quot;option&quot;, &quot;shapeStyle&quot;, { strokeWidth: &quot;8px&quot;, color: &quot;#dedede&quot; } );
-
-<span class="comment">// append the shape to both the map widget and basemap service</span>
-$( &quot;#map,#map .osm&quot; ).geomap( &quot;append&quot;, shape );</code></pre>
-      <h2>updating</h2>
-      <p>If you attempt to add a shape to the map or a service where it already exists, the shape will remain but you will update (or remove) the shape's style or label.</p>
-      <pre><code><span class="comment">// add the shape with a green color</span>
-$( &quot;#map&quot; ).append( shape, { color: &quot;green&quot; } );
-
-<span class="comment">// change the color to blue (shape is the same object as before in this case)</span>
-$( &quot;#map&quot; ).append( shape, { color: &quot;blue&quot; } );</code></pre>
-      <p>Changing the type of geometry, e.g., from Point to LineString, or coordinates of a shape you have appended is not recommended and geomap's behavior is currently undefined. If you wish to do either of these, you should first call remove on the original object and append on a new one.</p>
-      <!--<p>The following odd example will move the first coordinate of any clicked LineString 10 meters to the left. Notice it first removes the shape, then updates the first coordinate and finally appends the new shape.</p>
-      <pre><code>var map = $( &quot;#map&quot; ).geomap( {
-  click: function(e, geo) {
-    <span class="comment">// find any shapes within 4 pixels of the clicked point</span>
-    var shapes = map.geomap(&quot;find&quot;, geo, 4);
-    if (shapes.length &gt; 0 &amp;&amp; shapes[0].type == &quot;LineString&quot;) {
-      map.geomap("remove", shapes[0]);
-      <span class="comment">// move the first point in the line 10 meters to the left</span>
-      <span class="comment">// you can edit the coordinates directly since you've removed the shape</span>
-
-      <span class="comment">// we use proj because we want to temporarily work in meters</span>
-      var firstCoord = $.geo.proj.fromGeodetic(shapes[0].coordinates[0]);
-      <span class="comment">// firstCoord[0] is the x axis</span>
-      firstCoord[0] -= 10;
-      <span class="comment">// we need to convert it back to geodetic (lon/lat)</span>
-      shapes[0].coordinates[0] = $.geo.proj.toGeodetic(firstCoord);
-      <span class="comment">// re-append the shape</span>
-      map.geomap( &quot;append&quot;, shapes[0] );
-    }
-  }
-} );</code></pre>-->
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/axisLayout.html b/libs/js/jquery-geo-1.0b2/docs/geomap/axisLayout.html
deleted file mode 100755 (executable)
index c92ab81..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>axisLayout | geomap</title>
-  <meta name="description" content="geomap axisLayout option">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="axisLayout" data-role="page">
-    <div data-role="header" data-theme="f">
-      <h1>axisLayout</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>String</td>
-        </tr>
-        <tr>
-          <th>default</th>
-          <td>&quot;map&quot;</td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><pre><code>$( <i>selector</i> ).geomap( { axisLayout: &quot;map&quot; } );</code></pre></td>
-        </tr>
-        <tr>
-          <th>get</th>
-          <td><pre><code>var axisLayout = $( <i>selector</i> ).geomap( &quot;option&quot;, &quot;axisLayout&quot; );</code></pre></td>
-        </tr>
-        <tr>
-          <th>set</th>
-          <td><pre><code>$( <i>selector</i> ).geomap( &quot;option&quot;, &quot;axisLayout&quot;, &quot;image&quot; );</code></pre></td>
-        </tr>
-      </table>
-      <p>The axisLayout option determines direction of the coordinate system axes. It can be &quot;map&quot; or &quot;image&quot;.</p>
-      <p>Maps have a traditional mathematical coordinate system where the ordinate-axis (y-axis) points up. However, graphical images flip the y-axis so that moving down increases in value, which is appropriate in graphic contexts. This is important when you are connecting to a service supplying non-georeferenced (computer graphic) images and want your map control to match that coordinate system layout.</p>
-      <p>You will rarely have to change this unless you are using an graphic image server such as LizardTech Image Server or you just want to use the geomap widget to draw pixel-oriented graphics.</p>
-      <p>This option will affect pixel-to-map coordinate calculation for all service types, i.e., tiled &amp; shingled services.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/bbox.html b/libs/js/jquery-geo-1.0b2/docs/geomap/bbox.html
deleted file mode 100755 (executable)
index e93d803..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>bbox | geomap</title>
-  <meta name="description" content="geomap bbox property">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="bbox" data-role="page">
-    <div data-role="header" data-theme="f">
-      <h1>bbox</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>Array ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> )</td>
-        </tr>
-        <tr>
-          <th>default</th>
-          <td>[ -180, -85, 180, 85 ]</td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><code><pre>$( <i>selector</i> ).geomap( { bbox: [ -71, 40, -69, 44 ] } );</pre></code></td>
-        </tr>
-        <tr>
-          <th>get</th>
-          <td><code><pre>var bbox = $( <i>selector</i> ).geomap( &quot;option&quot;, &quot;bbox&quot; );</pre></code></td>
-        </tr>
-        <tr>
-          <th>set</th>
-          <td><code><pre>$( <i>selector</i> ).geomap( &quot;option&quot;, &quot;bbox&quot;, [ -122, 42, -118, 46 ] );</pre></code></td>
-        </tr>
-      </table>
-      <p>The bbox property calculates or modifies the bounding box of the map view the user currently sees. The geomap widget creates the bounding box based on the current center point, map zoom and size of the map view.</p>
-      <p>When you set a new bbox, the center and zoom properties are set as close as they can be based on the services you've added and the size of the map view.</p>
-      <p>For example, if you have a cached service with specific zoom levels, the map widget will have to pick a zoom level even though it may result in a bbox that is quite different from the one passed. When your services are fully dynamic, i.e., they allow arbitrary zoom levels, the final bbox will not likely match the one passed either due to ratio differences between the requested bbox and the map view's size. The map will attempt to pick a bounding box that best fits the one you request.</p>
-      <p>This property is a JavaScript array consisting of four values which can be thought of as: minx, miny, maxx and maxy of the current map view in map units and in that order. By default the values are in geodetic coordinates, e.g., bbox[0] is the longitude of the left of the current map view, bbox[1] is the latitude of the bottom, bbox[2] is the longitude of the right and bbox[3] is the latitude of the top. You can change the default when you initialize the widget by passing projected coordinates as the bbox option.</p>
-      <p>Setting a new bbox will refresh the map services.</p>
-      <p>If you attempt to initialize both center and bbox at the same time when creating a geomap widget, center will override bbox.</p>
-      <p>If you attempt to initialize both zoom and bbox at the same time when creating a geomap widget, bbox will be applied and zoom will modify the final bbox.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/bboxMax.html b/libs/js/jquery-geo-1.0b2/docs/geomap/bboxMax.html
deleted file mode 100755 (executable)
index dcf1cb9..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>bboxMax | geomap</title>
-  <meta name="description" content="geomap bboxMax option">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="bboxMax" data-role="page">
-    <div data-role="header" data-theme="f">
-      <h1>bboxMax</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>Array ( <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> )</td>
-        </tr>
-        <tr>
-          <th>default</th>
-          <td>[ -180, -85, 180, 85 ]</td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><code><pre>$( <i>selector</i> ).geomap( { bboxMax: [ -71, 40, -69, 44 ] } );</pre></code></td>
-        </tr>
-        <tr>
-          <th>get</th>
-          <td><code><pre>var bboxMax = $( <i>selector</i> ).geomap( &quot;option&quot;, &quot;bboxMax&quot; );</pre></code></td>
-        </tr>
-        <tr>
-          <th>set</th>
-          <td><code><pre>$( <i>selector</i> ).geomap( &quot;option&quot;, &quot;bboxMax&quot;, [ -75.696, 38.804, -73.696, 41.287 ] );</pre></code></td>
-        </tr>
-      </table>
-      <p>The bboxMax option defines a bounding box that surrounds all of the data you wish to show in non-tiled maps, i.e., you have set the <a href="tilingScheme.html">tilingScheme option</a> to null. Users can pan the map once they reach bboxMax but cannot zoom out further.</p>
-      <p>This option is a JavaScript array consisting of four values which can be thought of as: minx, miny, maxx and maxy of the maximum map view you wish to allow in map units and in that order.</p>
-      <p>A bboxMax option must be set properly for shingled (dynamic) services since the value of the map's zoom is based on a ratio between the current bbox and bboxMax.</p>
-      <p>Setting a new bboxMax will refresh the map services and reset what zoom level 0 means.</p>
-      <p><b>If you set <a href="tilingScheme.html">tilingScheme</a> to null, you must explicitly set bboxMax.</b></p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/center.html b/libs/js/jquery-geo-1.0b2/docs/geomap/center.html
deleted file mode 100755 (executable)
index d49739c..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>center | geomap</title>
-  <meta name="description" content="geomap center property">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="center" data-role="page">
-    <div data-role="header" data-theme="f">
-      <h1>center</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>Array (<a href="http://geojson.org/geojson-spec.html#positions" rel="external">GeoJSON position</a>)</td>
-        </tr>
-        <tr>
-          <th>default</th>
-          <td>[ 0, 0 ]</td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><code><pre>$( <i>selector</i> ).geomap( { center: [ 0, 0 ] } );</pre></code></td>
-        </tr>
-        <tr>
-          <th>get</th>
-          <td><code><pre>var center = $( <i>selector</i> ).geomap( &quot;option&quot;, &quot;center&quot; );</pre></code></td>
-        </tr>
-        <tr>
-          <th>set</th>
-          <td><code><pre>$( <i>selector</i> ).geomap( &quot;option&quot;, &quot;center&quot;, [ -71.037598, 42.363281 ] );</pre></code></td>
-        </tr>
-      </table>
-      <p>The center property gets or sets the center point of the map. By default the value is in geodetic coordinates, e.g., longitude, latitude. You can change the default when you initialize the widget by passing projected coordinates as the center option.</p>
-      <p>Setting a new center point will refresh the map services.</p>
-      <p>If you attempt to initialize both center and bbox at the same time when creating a geomap widget, center will override bbox.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/cursors.html b/libs/js/jquery-geo-1.0b2/docs/geomap/cursors.html
deleted file mode 100755 (executable)
index 44efa9e..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>cursors | geomap</title>
-  <meta name="description" content="geomap cursors property">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="cursors" data-role="page">
-    <div data-role="header" data-theme="f">
-      <h1>cursors</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>Object (map of geomap mode to CSS cursor)</td>
-        </tr>
-        <tr>
-          <th>default</th>
-          <td><pre><code>{
-  static: &quot;default&quot;,
-  pan: &quot;move&quot;,
-  zoom: &quot;crosshair&quot;,
-  drawPoint: &quot;crosshair&quot;,
-  drawLineString: &quot;crosshair&quot;,
-  drawPolygon: &quot;crosshair&quot;,
-  measureLength: &quot;crosshair&quot;,
-  measureArea: &quot;crosshair&quot;
-}</code></pre></td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><code><pre>$( <i>selector</i> ).geomap( { cursors: { pan: &quot;move&quot; } } );</pre></code></td>
-        </tr>
-        <tr>
-          <th>get</th>
-          <td><code><pre>var cursors = $( <i>selector</i> ).geomap( &quot;option&quot;, &quot;cursors&quot; );</pre></code></td>
-        </tr>
-        <tr>
-          <th>set</th>
-          <td><code><pre>$( <i>selector</i> ).geomap( &quot;option&quot;, &quot;cursors&quot;, { pan: &quot;pointer&quot; } );</pre></code></td>
-        </tr>
-      </table>
-      <p>The cursors property controls which cursors appear when users move the mouse over the geomap div in any given mode. <!--For example, if the developer switches the map widget to zoom mode the cursor will turn into a crosshair by default.--></p>
-      <p>The developer may change each geomap mode's cursor separately during both initialization of the widget or any time after.</p>
-      <p>Sometimes the geomap widget will override the selected mode's cursor, e.g., when a user starts panning in other modes the cursor will switch to the pan mode cursor temporarily.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/destroy.html b/libs/js/jquery-geo-1.0b2/docs/geomap/destroy.html
deleted file mode 100755 (executable)
index b667b11..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>destroy | geomap</title>
-  <meta name="description" content="geomap destroy method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="destroy" data-role="page">
-    <div data-role="header" data-theme="e">
-      <h1>destroy</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>undefined</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>.geomap( &quot;destroy&quot; )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>$(&quot;#map&quot;).geomap( &quot;destroy&quot; )</code></pre></td>
-        </tr>
-      </table>
-      <p>
-        Every good widget will clean up after itself. Call destroy to turn your interactive map back to a boring old div. Any content inside the div before you initialized geomap will remain intact.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/drawStyle.html b/libs/js/jquery-geo-1.0b2/docs/geomap/drawStyle.html
deleted file mode 100755 (executable)
index 7fae574..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>drawStyle | geomap</title>
-  <meta name="description" content="geomap drawStyle option">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="drawStyle" data-role="page">
-    <div data-role="header" data-theme="f">
-      <h1>drawStyle</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>Object ( geomap style )</td>
-        </tr>
-        <tr>
-          <th>default</th>
-          <td><pre><code>{
-  borderRadius: &quot;8px&quot;,
-  color: &quot;#7f0000&quot;,
-  fillOpacity: .2,
-  height: &quot;8px&quot;,
-  opacity: 1,
-  strokeOpacity: 1,
-  strokeWidth: &quot;2px&quot;,
-  visibility: &quot;visible&quot;,
-  width: &quot;8px&quot;
-}</code></pre>
-          </td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><pre><code>$( <i>map selector</i> ).geomap( { drawStyle: { color: &quot;green&quot; } } );</code></pre></td>
-        </tr>
-        <tr>
-          <th>get</th>
-          <td><pre><code>var drawStyle = $( <i>map selector</i> ).geomap( &quot;option&quot;, &quot;drawStyle&quot; );</code></pre></td>
-        </tr>
-        <tr>
-          <th>set</th>
-          <td><pre><code>$( <i>map selector</i> ).geomap( &quot;option&quot;, &quot;drawStyle&quot;, { strokeWidth: &quot;4px&quot; } );</code></pre></td>
-        </tr>
-      </table>
-      <p>The drawStyle option retrieves or updates the style of incomplete lines and polygons <b>as they are being drawn</b>. This differs from the shapeStyle option which updates the style of shapes that you've appended to the map.</p>
-      <p>This option affects both the draw modes (drawPoint, drawLineString, and drawPolygon) and the measure modes (measureLength, and measureArea).</p>
-      <p>This option changes specific properties of the internal style object. If you init or set an incomplete style object, only the style properties you reference are updated.</p>
-      <p>Please see the style section at the bottom of the <a href="#" onclick="javascript:window.history.back();">geomap widget</a> page for more information about the style object.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/empty.html b/libs/js/jquery-geo-1.0b2/docs/geomap/empty.html
deleted file mode 100755 (executable)
index 6dca203..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>empty | geomap</title>
-  <meta name="description" content="geomap empty method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="empty" data-role="page">
-    <div data-role="header" data-theme="e">
-      <h1>empty</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>jQuery collection</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>.geomap( &quot;empty&quot; [ , Boolean refresh ] )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>$( <i>map or service selector</i> ).geomap( &quot;empty&quot; )
-$( <i>map or service selector</i> ).geomap( &quot;empty&quot;, false )</code></pre></td>
-        </tr>
-      </table>
-      <p>The empty method removes all shapes previously added with the append method.</p>
-      <p>The jQuery UI widget factory returns the original jQuery collection to maintain call chaining.</p>
-      <h2>delaying refresh</h2>
-      <p>The optional refresh argument determines if geomap refreshes the map graphics after this call to empty. It defaults to true. If you pass false, geomap will remove all shapes internally but not immediately redraw the graphics. The changes will display if the user moves the map or you call geomap's refresh method.</p>
-      <h2>service-level shapes</h2>
-      <p>Similar to how you can remove shapes from specific services, you can empty specific services of all shapes as well.</p>
-      <p>You do this by targeting a service inside a map instead of the map itself for your call to geomap's empty method. For example, the default map service has the CSS class: osm. We can remove all shapes from that service specifically by using jQuery to target the service:</p>
-      <pre><code>$( &quot;#map .osm&quot; ).geomap( &quot;empty&quot; );</code></pre>
-      <p>Calling empty on the map widget will not remove shapes that have been appended to services.</p>
-      <p>To remove all shapes from the map and all services, you can use the comma selector and the built-in geo-service CSS class:</p>
-      <pre><code><span class="comment">// empty the map widget and any services</span>
-$( &quot;#map,#map .geo-service&quot; ).geomap( &quot;empty&quot; );</code></pre>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/find.html b/libs/js/jquery-geo-1.0b2/docs/geomap/find.html
deleted file mode 100755 (executable)
index 43bd251..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>find | geomap</title>
-  <meta name="description" content="geomap find method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="find" data-role="page">
-    <div data-role="header" data-theme="e">
-      <h1>find</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>Array&lt;Object&gt; ( <a href="http://geojson.org/geojson-spec.html" rel="external">GeoJSON objects</a> )</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>.geomap( &quot;find&quot;, Object point (<a href="http://geojson.org/geojson-spec.html#point" rel="external">GeoJSON Point</a>), Number pixelTolerance )</td>
-        </tr>
-        <tr>
-          <td></td>
-          <td>.geomap( &quot;find&quot;, <i>shape selector</i> )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>var existingShape = $( <i>map or service selector</i> ).geomap( &quot;find&quot;, { type: &quot;Point&quot;, coordinates: [ -71.098709, 42.330322 ] }, 8 )
-
-var allShapes = $( <i>map or service selector</i> ).geomap( &quot;find&quot;, &quot;*&quot; )</code></pre></td>
-        </tr>
-      </table>
-      <p>The find method allows you to search for shapes appended to the map and/or services. There are two distinct ways to call this method.</p>
-      <h2>geometry search</h2>
-
-      <p>The find method can take a single GeoJSON map point and return all shapes within a pixel radius of the given location that have been added with append. If there are no shapes at the location, this method returns an empty array.</p>
-
-      <p>The pixelTolerance argument is always in pixels. This allows for pixel-based searches regardless of the map's current zoom. A high-zoom search is finer than a low-zoom one because at lower zoom levels, i.e., the map is zoomed out more, the Earth-size of a pixel is greater causing this search to reach out farther from the supplied position.</p>
-
-      <p>Duplicate shape references <b>are</b> included in the return value. For example, if you have appended the same GeoJSON object to both the map and a specific service, and then call find at that location, the returned array will contain two, identical shape references.</p>
-
-      <h2>selector search</h2>
-
-      <p>The find method can also take a single string. The string is in CSS selector syntax but currently only one selector is supported: *. Use the * selector to return an array of all shapes that have been appended to the map or service. If there are no shapes on the map or service, this method returns an empty array. Searching for all shapes at the map level will return all shapes that have been appended to the map or any service.</p>
-
-      <p>Duplicate shape references <b>are</b> included in the return value. For example, if you have appended the same GeoJSON object to both the map and a specific service, and then call find( &quot;*&quot; ) at the map level, the returned array will contain two, identical shape references.</p>
-
-      <p>The shape selector cannot include service ids or classes. To search for shapes within a specific service, see below.</p>
-
-      <h2>service-level shapes</h2>
-
-      <p>Similar to how you can append shapes to specific services, you can find shapes in specific services as well.</p>
-
-      <p>You do this by targeting a service inside a map instead of the map itself for your call to geomap's find method. For example, the default map service has the CSS class: osm. We can find a shape from that service specifically by using jQuery to target the service:</p>
-
-      <pre><code>var osmShapes = $( &quot;#map .osm&quot; ).geomap( &quot;find&quot;, [ -71, 42 ], 8 );</code></pre>
-
-      <p>However, unlike the other three shape methods, shapes appended to a specific service <b>will be</b> returned by calling find on the map itself. In this way, calling find on the map is a deep search for shapes on all services. For example, after this sequence the shapes variable will contain the shape even though it was appended to a service specifically:<p>
-
-      <pre><code>var point = {
-      type: &quot;Point&quot;,
-      coordinates: [ -71, 42 ]
-    };
-
-<span class="comment">// add the shape to the osm service</span>
-$( &quot;#map .osm&quot; ).geomap( &quot;append&quot;, point );
-
-<span class="comment">// use the original point to search for shapes on the map widget</span>
-var shapes = $( &quot;#map&quot; ).geomap( &quot;find&quot;, point, 3 );</code></pre>
-
-      <p>Another difference between the find method and the append, remove, and empty methods, is that the find method cannot currently be used on multiple targets simultaneously. For example, the return value of the following is undefined:</p>
-
-      <pre><code><span class="comment">// attempt to search the osm service and a second service at the same time</span>
-var shapes = $( &quot;#map .osm,#map .massgis&quot; ).geomap( &quot;find&quot;, point, 8 );</code></pre>
-
-      <p>To find shapes in two specific services without searching all services you should use two find calls:</p>
-
-      <pre><code><span class="comment">// find shapes on the default service and a second service</span>
-var osmShapes = $( &quot;#map .osm&quot; ).geomap( &quot;find&quot;, point, 8 ),
-    massgisShapes = $( &quot;#map .massgis&quot; ).geomap( &quot;find&quot;, point, 8 );</code></pre>
-
-      <p>The selector-based version also follows this requirement. You cannot target more than one element with the initial selector and you cannot use the shape selector to search services. A multi-service selector-based search would be the same as above but with &quot;*&quot; instead of: point, 8.</p>
-
-      <pre><code><span class="comment">// the following are invalid and their return value is undefined</span>
-var multiTarget = $( &quot;#map .massgis,#map .osm&quot; ).geomap( &quot;find&quot;, &quot;*&quot; );
-var shapeSubSelector = $( &quot;#map&quot; ).geomap( &quot;find&quot;, &quot;.massgis *&quot; );
-
-<span class="comment">// proper way to get all shapes from multiple services</span>
-var osmShapes = $( &quot;#map .osm&quot; ).geomap( &quot;find&quot;, &quot;*&quot; ),
-    massgisShapes = $( &quot;#map .massgis&quot; ).geomap( &quot;find&quot;, &quot;*&quot; );</code></pre>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/geomapbbox.html b/libs/js/jquery-geo-1.0b2/docs/geomap/geomapbbox.html
deleted file mode 100755 (executable)
index 13ab744..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>bboxchange | geomap</title>
-  <meta name="description" content="geomap bboxchange event">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="bboxchange" data-role="page">
-    <div data-role="header" data-theme="a">
-      <h1>bboxchange</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>bboxchange</td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><code><pre>$( <i>selector</i> ).geomap( {
-  bboxchange: function( e, geo ) { }
-} );</pre></code></td>
-        </tr>
-        <tr>
-          <th>bind</th>
-          <td><code><pre>$( <i>selector</i> ).bind( &quot;geomapbboxchange&quot;, function( e, geo ) { } );
-} );</pre></code></td>
-        </tr>
-      </table>
-      <p>The bboxchange event triggers any time user interaction causes a change in the current bbox of the map widget. This includes pan, wheel zoom, double-click zoom, etc. The geomap does not trigger this event when you update the bbox programmatically.</p>
-      <p>The geo argument is an object containing a bbox property which the new bbox.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/geomapclick.html b/libs/js/jquery-geo-1.0b2/docs/geomap/geomapclick.html
deleted file mode 100755 (executable)
index 098a150..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>click | geomap</title>
-  <meta name="description" content="geomap click event">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="click" data-role="page">
-    <div data-role="header" data-theme="a">
-      <h1>click</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>position</td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><code><pre>$( <i>selector</i> ).geomap( {
-  click: function( e, geo ) { }
-} );</pre></code></td>
-        </tr>
-        <tr>
-          <th>bind</th>
-          <td><code><pre>$( <i>selector</i> ).bind( &quot;geomapclick&quot;, function( e, geo ) { } );
-} );</pre></code></td>
-        </tr>
-      </table>
-      <p>The click event triggers when the user clicks or taps a point on the map and then lets go at the same point within a short time threashold. However, it only triggers if the user is not currently performing some other action which might be handled internally by the widget.</p>
-      <p>The geo argument is a <a href="http://geojson.org/geojson-spec.html#point" rel="external">GeoJSON Point</a> object of the clicked location in map coordinates.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/geomapdblclick.html b/libs/js/jquery-geo-1.0b2/docs/geomap/geomapdblclick.html
deleted file mode 100755 (executable)
index 74eb0be..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>dblclick | geomap</title>
-  <meta name="description" content="geomap dblclick event">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="dblclick" data-role="page">
-    <div data-role="header" data-theme="a">
-      <h1>dblclick</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>position</td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><code><pre>$( <i>selector</i> ).geomap( {
-  dblclick: function( e, geo ) { }
-} );</pre></code></td>
-        </tr>
-        <tr>
-          <th>bind</th>
-          <td><code><pre>$( <i>selector</i> ).bind( &quot;geomapdblclick&quot;, function( e, geo ) { } );
-} );</pre></code></td>
-        </tr>
-      </table>
-      <p>The dblclick event triggers when the user double-clicks or double-taps a point on the map. However, it only triggers if the user is not currently performing some other action which might be handled internally by the widget.</p>
-      <p>The geo argument is a <a href="http://geojson.org/geojson-spec.html#point" rel="external">GeoJSON Point</a> object of the clicked location in map coordinates.</p>
-      <p>The default action for a double-click/tap is to zoom the map in one level. However, as a developer you can override this by calling e.preventDefault() in your callback.</p>
-      <code><pre>$( &quot;#map&quot; ).geomap( {
-  dblclick: function( e, geo ) { e.preventDefault(); }
-} );</pre></code>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/geomaploadend.html b/libs/js/jquery-geo-1.0b2/docs/geomap/geomaploadend.html
deleted file mode 100755 (executable)
index c61f026..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>loadend | geomap</title>
-  <meta name="description" content="geomap loadend event">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="loadend" data-role="page">
-    <div data-role="header" data-theme="a">
-      <h1>loadend</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>load</td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><pre><code>$( <i>map selector</i> ).geomap( {
-  loadend: function( e, geo ) { }
-} );</code></pre></td>
-        </tr>
-        <tr>
-          <th>bind</th>
-          <td><pre><code>$( <i>map selector</i> ).bind( &quot;geomaploadend&quot;, function( e, geo ) { } );
-} );</code></pre></td>
-        </tr>
-      </table>
-
-      <p>The loadend event triggers after a loadstart event when the geomap widget has finished loading all pending images. It only triggers once regardless of the number of images loaded. It will not be triggered again until after another loadstart event.</p>
-
-      <p>The geo argument is currently undefined for this event.</p>
-
-      <p>You can use this event to hide an indicator that your website is busy downloading images.</p> 
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/geomaploadstart.html b/libs/js/jquery-geo-1.0b2/docs/geomap/geomaploadstart.html
deleted file mode 100755 (executable)
index 46cee4c..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>loadstart | geomap</title>
-  <meta name="description" content="geomap loadstart event">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="loadstart" data-role="page">
-    <div data-role="header" data-theme="a">
-      <h1>loadstart</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>load</td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><pre><code>$( <i>map selector</i> ).geomap( {
-  loadstart: function( e, geo ) { }
-} );</code></pre></td>
-        </tr>
-        <tr>
-          <th>bind</th>
-          <td><pre><code>$( <i>map selector</i> ).bind( &quot;geomaploadstart&quot;, function( e, geo ) { } );
-} );</code></pre></td>
-        </tr>
-      </table>
-
-      <p>The loadstart event triggers when the geomap widget begins to load new images. It only triggers once regardless of the number of images about to be loaded. It will not be triggered again until after all pending images have been loaded (the image queue returns to zero) and a change in the map requires more images.</p>
-
-      <p>The geo argument is currently undefined for this event.</p>
-
-      <p>You can use this event to show an indicator that your website is busy downloading images.</p> 
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/geomapmove.html b/libs/js/jquery-geo-1.0b2/docs/geomap/geomapmove.html
deleted file mode 100755 (executable)
index 55da454..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>move | geomap</title>
-  <meta name="description" content="geomap move event">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="move" data-role="page">
-    <div data-role="header" data-theme="a">
-      <h1>move</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>position</td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><code><pre>$( <i>selector</i> ).geomap( {
-  move: function( e, geo ) { }
-} );</pre></code></td>
-        </tr>
-        <tr>
-          <th>bind</th>
-          <td><code><pre>$( <i>selector</i> ).bind( &quot;geomapmove&quot;, function( e, geo ) { } );
-} );</pre></code></td>
-        </tr>
-      </table>
-      <p>The move event triggers when the user moves the mouse cursor while the cursor is over the map. However, it only triggers if the user is not currently performing some other action such as panning.</p>
-      <p>The geo argument is a <a href="http://geojson.org/geojson-spec.html#point" rel="external">GeoJSON Point</a> object of the location under the mouse cursor in map coordinates.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/geomapshape.html b/libs/js/jquery-geo-1.0b2/docs/geomap/geomapshape.html
deleted file mode 100755 (executable)
index f2661dd..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>shape | jQuery Geo</title>
-  <meta name="description" content="jQuery Geo shape event">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="shape" data-role="page">
-    <div data-role="header" data-theme="a">
-      <h1>shape</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>shape</td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><code><pre>$( <i>selector</i> ).geomap( {
-  shape: function( e, geo ) { }
-} );</pre></code></td>
-        </tr>
-        <tr>
-          <th>bind</th>
-          <td><code><pre>$( <i>selector</i> ).bind( &quot;geomapshape&quot;, function( e, geo ) { } );
-} );</pre></code></td>
-        </tr>
-      </table>
-      <p>The shape event triggers when the user measures a length, or area, or draws a point, line or polygon. He or she does this by tapping the map in specific ways while the geomap mode property is set to: measureLength, measureArea, drawPoint, drawLineString or drawPolygon.</p>
-      <p>When mode is drawPoint, a single tap of the map triggers this event passing a <a href="http://geojson.org/geojson-spec.html#point" rel="external">GeoJSON Point</a> object of the tapped location in map coordinates.</p>
-      <p>When mode is measureLength or drawLineString, the first single tap begins a line. Subsequent single taps add points to the line. A double-tap on the map adds a final point and triggers this event passing a <a href="http://geojson.org/geojson-spec.html#linestring" rel="external">GeoJSON LineString</a> object of the measured length or sketched line in map coordinates.</p>
-      <p>When mode is measureArea or drawPolygon, the first single tap begins a polygon. Subsequent single taps add points to the polygon. A double-tap on the map adds a final point and triggers this event passing a <a href="http://geojson.org/geojson-spec.html#polygon" rel="external">GeoJSON Polygon</a> object of the measured area or sketched polygon in map coordinates.</p>
-      <p>While measuring or drawing a shape, the user can pan the map by dragging or zoom the map with the mouse wheel. This will not interrupt their current measuring or drawing.</p>
-      <p>If you allow users to both measure and draw in your app, be sure to check the <a href="mode.html">mode</a> option in your event handler to determine if this event was triggered by measuring or by drawing. For example, you may want to append the shape to the map during drawPolygon but not during measureArea.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/images/map.png b/libs/js/jquery-geo-1.0b2/docs/geomap/images/map.png
deleted file mode 100755 (executable)
index d41dc4d..0000000
Binary files a/libs/js/jquery-geo-1.0b2/docs/geomap/images/map.png and /dev/null differ
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/index.html b/libs/js/jquery-geo-1.0b2/docs/geomap/index.html
deleted file mode 100755 (executable)
index 4edeaee..0000000
+++ /dev/null
@@ -1,296 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>geomap | jQuery Geo</title>
-  <meta name="description" content="jQuery Geo geomap widget">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="geomap" data-role="page">
-    <div data-role="header" data-theme="d">
-      <h1>geomap widget</h1>
-    </div>
-    
-    <div data-role="content">
-      <p>Once you have an HTML element to target, you can call the geographic map widget's function.</p>
-
-      <pre><code>.geomap( options )</code></pre>
-
-      <h2>overview</h2>
-
-      <p>The widget creates an interactive map. Users can pan and zoom on desktop and mobile browsers against many different cached tile sets or dynamic map servers. Developers can handle events triggered by user action.</p>
-
-      <div class="geomap-indoc"></div>
-
-      <h2>options</h2>
-
-      <p>The options argument is a JavaScript object that configures the map widget during the first instantiation on a div. No options are required. By default the map will show the whole world using the <a href="http://open.mapquest.com/" rel="external" target="_blank">mapquest open</a> tile set.</p>
-
-      <p>After initializing a map with your first geomap call, you can get or set most of these options using the following syntax:</p>
-
-      <pre><code><span class="comment">// get the current value of a single option</span>
-var optionValue = $( <i>map selector</i> ).geomap( &quot;option&quot;, <i>optionName</i> );
-
-<span class="comment">// set a new value for a single option</span>
-$( <i>map selector</i> ).geomap( &quot;option&quot;, <i>optionName</i>, <i>newValue</i> );
-
-<span class="comment">// set new values for multiple options at the same time</span>
-$( <i>map selector</i> ).geomap( &quot;option&quot;, {
-  <i>optionName</i>: <i>newValue</i>,
-  <i>optionName</i>: <i>newValue</i>
-} );</code></pre>
-
-      <p>One exception is pixelSize, which is read-only.</p>
-
-      <p>The map view refreshes when you change these options: bbox, center, services, tilingScheme, bboxMax, &amp; zoom.</p>
-
-      <ul data-role="listview" data-inset="true">
-        <li><a href="bbox.html"><h3>bbox</h3><p>bounds of the currently visible viewport</p></a></li>
-        <li><a href="bboxMax.html"><h3>bboxMax</h3><p>bounds of maximum viewport for non-tiled maps</p></a></li>
-        <li><a href="center.html"><h3>center</h3><p>center of the currently visible viewport</p></a></li>
-        <li><a href="zoom.html"><h3>zoom</h3><p>zoom level of the currently visible viewport</p></a></li>
-        <li><a href="zoomMin.html"><h3>zoomMin</h3><p>minimum zoom level for all services in the map</p></a></li>
-        <li><a href="zoomMax.html"><h3>zoomMax</h3><p>maximum zoom level for all services in the map</p></a></li>
-        <li><a href="pixelSize.html"><h3>pixelSize</h3><p>read-only Earth-size of a pixel in the current map viewport</p></a></li>
-        <li><a href="mode.html"><h3>mode</h3><p class="ui-li-desc">determines how the map, user, &amp; developer interact</p></a></li>
-        <li><a href="pannable.html"><h3>pannable</h3><p class="ui-li-desc">allow or prohit map panning</p></a>
-        <li><a href="scroll.html"><h3>scroll</h3><p class="ui-li-desc">determines how the map reacts to a mouse wheel</p></a>
-        <li><a href="shift.html"><h3>shift</h3><p class="ui-li-desc">determines how holding the shift key affects the map</p></a>
-        <li><a href="cursors.html"><h3>cursors</h3><p>cursors to display for each mode</p></a></li>
-        <li><a href="measureLabels.html"><h3>measureLabels</h3><p>format to apply to label while measuring</p></a></li>
-        <li><a href="drawStyle.html"><h3>drawStyle</h3><p>when drawing shapes, defines how they look during drawing</p></a></li>
-        <li><a href="shapeStyle.html"><h3>shapeStyle</h3><p>defines how geomap draws shapes added via the append method</p></a></li>
-        <li><a href="services.html"><h3>services</h3><p>determine the content of the map</p></a></li>
-        <li><a href="tilingScheme.html"><h3>tilingScheme</h3><p>defines how tiles are placed in the viewport</p></a></li>
-        <li><a href="axisLayout.html"><h3>axisLayout</h3><p>&quot;map&quot; or &quot;image&quot;</p></a></li>
-      </ul>
-
-      <h2>projection</h2>
-
-      <p>The geomap widget will match how you use projection with map units. The map unit type (projected or geodetic) you used when you last set the <b>bbox</b>, <b>bboxMax</b>, or the <b>center</b> option will be used as output for options and as values for arguments. If you never set the bbox or center options, the geomap widget will return geodetic coordinates.</p>
-
-      <p>For example, if you set the map's center option using geodetic coordinates (a longitude, latitude array), future requests for the value of the map's center or bbox options will be returned in geodetic coordinates. However, if you later set the bbox option using web mercator, future requests for the center or bbox options will be returned in that projection.</p>
-
-      <p>Changing bbox or center will affect all options and arguments that use map units. The options and arguments involved are:</p>
-
-      <ul>
-        <li>bbox option</li>
-        <li>bboxMax option</li>
-        <li>center option</li>
-        <li>bbox property of the services object's src argument</li>
-        <li>GeoJSON objects passed as the geo argument in all events</li>
-        <li>return value of the toMap method</li>
-      </ul>
-
-      <p>To avoid confusion, it is recommended to stick to one map unit type for any single map widget.</p>
-
-      <p>The geomap widget will use the <a href="../geo/proj.html">$.geo.proj object</a> when needed to convert between geodetic and projected coordinates.</p>
-
-      <h2>events</h2>
-
-      <p>All event callbacks receive two arguments: the original browser event and an object specific to the map action.</p>
-
-      <p>The map unit type (projected or geodetic) of the map event arguments depends on the way you initialize the map widget. If you have set the center or bbox option using geodetic coordinates, the event arguments will also be in geodetic coordinates.</p>
-
-      <p>Like jQuery UI widgets, geomap triggers events directly on the original map div.</p>
-
-      <p>Programatic changes to options do not trigger events.</p>
-
-      <p>The dblclick event is special in that you can prevent the default action, zoom-in one level, by calling e.preventDefault() in your callback. This is currently the only geomap event that you can prevent the default action. Calling preventDefault in the callback of any other geomap event has undefined results.</p>
-
-      <p>There are four geomap event <i>types</i>. The type of event determines what is sent to your event handler as the second argument, geo.</p>
-
-      <h3>position events</h3>
-
-      <p>With position events the geo argument to your callback is a <a href="http://geojson.org/geojson-spec.html#point" rel="external">GeoJSON Point</a> object having two properties: type &amp; coordinates. The coordinates property is a single <a href="http://geojson.org/geojson-spec.html#positions" rel="external">GeoJSON position</a>, i.e., an array containing the x/longitude and y/latitude value.</p>
-
-      <p>The geo argument to your callback is a true GeoJSON object and you can pass this object directly to the append method. You can also send it directly to a database for storage knowing that there are no non-GeoJSON properties wasting space.</p>
-
-      <ul data-role="listview" data-inset="true">
-        <li>
-          <a href="geomapmove.html">move</a>
-        </li>
-        <li>
-          <a href="geomapclick.html">click</a>
-        </li>
-        <li>
-          <a href="geomapdblclick.html">dblclick</a>
-        </li>
-      </ul>
-
-      <h3>bbox events</h3>
-
-      <p>With bbox events the geo argument to your callback is an object with single property, bbox, which is a <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a>.</p>
-
-      <ul data-role="listview" data-inset="true">
-        <li>
-          <a href="geomapbbox.html">bboxchange</a>
-        </li>
-      </ul>
-
-      <h3>shape events</h3>
-
-      <p>With shape events, the geo argument to your callback is a GeoJSON geometry object having two properties: type &amp; coordinates. The object type will be either Point, LineString or Polygon depending on the current geomap mode: measureLength, measureArea, drawPoint, drawLineString, and drawPolygon.</p>
-
-      <p>The geo argument to your callback is a true GeoJSON object and you can pass this object directly to the append method. You can also send it directly to a database for storage knowing that there are no non-GeoJSON properties wasting space.</p>
-
-      <ul data-role="listview" data-inset="true">
-        <li>
-          <a href="geomapshape.html">shape</a>
-        </li>
-      </ul>
-
-      <h3>load events</h3>
-
-      <p>With load events, the geo argument is currently undefined. You can add the argument to your handler's argument list if you wish but attempting to access any property on it will cause a JavaScript error.</p>
-
-      <ul data-role="listview" data-inset="true">
-        <li>
-          <a href="geomaploadstart.html">loadstart</a>
-        </li>
-        <li>
-          <a href="geomaploadend.html">loadend</a>
-        </li>
-      </ul>
-
-      <h2>methods</h2>
-
-      <p>The geomap widget provides some methods to help make interacting map data a little easier.</p>
-
-      <h3>unit conversion</h3>
-
-      <p>Convert positions between pixel and map coordinates.</p>
-      <ul data-role="listview" data-inset="true">
-        <li>
-          <a href="toMap.html">toMap</a>
-        </li>
-        <li>
-          <a href="toPixel.html">toPixel</a>
-        </li>
-      </ul>
-      <h3>map methods</h3>
-      <p>These methods update the map widget as a whole.</p>
-      <ul data-role="listview" data-inset="true">
-        <li>
-          <a href="zoomMethod.html">zoom</a>
-        </li>
-        <li>
-          <a href="refresh.html">refresh</a>
-        </li>
-        <li>
-          <a href="resize.html">resize</a>
-        </li>
-        <li>
-          <a href="destroy.html">destroy</a>
-        </li>
-      </ul>
-      <h3>service modification</h3>
-      <p>Methods that help update objects in the services array.</p>
-      <ul data-role="listview" data-inset="true">
-        <li>
-          <a href="toggle.html">toggle</a>
-        </li>
-        <li>
-          <a href="opacity.html">opacity</a>
-        </li>
-      </ul>
-      <h3>shapes</h3>
-      <p>These methods manage geometry or features drawn on the geomap widget itself or on individual servies within the map.</p>
-      <ul data-role="listview" data-inset="true">
-        <li><a href="append.html">append</a></li>
-        <li><a href="remove.html">remove</a></li>
-        <li><a href="empty.html">empty</a></li>
-      </ul>
-      <p>The find method allows you to search for shapes appended to the map. Its syntax and service-level operation is slightly different than the other three shape methods so the link is visually broken out from the rest.</p>
-      <ul data-role="listview" data-inset="true">
-        <li><a href="find.html">find</a></li>
-      </ul>
-      <h2>style</h2>
-      <p>A geomap style is an object whose properties follow a subset of <a href="http://www.w3.org/TR/SVG/styling.html">SVG styling</a> properties. The specific styles that geomap recognizes and to which geometry they apply are listed below.</p>
-      <p>Use the drawStyle option of the geomap widget to define the style used on incomplete lines and polygons as they are being drawn when mode is drawLineString or drawPolygon.</p>
-      <p>Use the shapeStyle option to define the style of shapes drawn after being appended to the map via the append method.</p>
-      <p>Please note that in drawPoint mode, the shape event is triggered immediately and so no shape will appear until you append a point to the map at which time the shapeStyle will be used.</p>
-      <h3>geomap style properties</h3>
-      <table class="objectProperties">
-        <tr>
-          <th>property</th>
-          <th>default</th>
-          <th>description</th>
-        </tr>
-        <tr>
-          <td>borderRadius</td>
-          <td>&quot;8px&quot;</td>
-          <td>The radii of a quarter ellipse that defines the shape of the corner of the outer border of a box drawn around Point shapes, which means it turns your boxes into curved rectangles. If the width, height and borderRadius properties of a style are the same (the default), the point is drawn as a circle.</td>
-        </tr>
-        <tr>
-          <td>color</td>
-          <td>#7f0000</td>
-          <td>An indirect, fallback value for the fill and stroke properties if they are not set.</td>
-        </tr>
-        <tr>
-          <td>fill</td>
-          <td>undefined</td>
-          <td>Color to use when drawing the interior of a shape. The area to be drawn consists of any areas inside the outline of the shape. By default, fill will use the value of the color property.</td>
-        </tr>
-        <tr>
-          <td>fillOpacity</td>
-          <td>.2</td>
-          <td>Specifies the opacity of the drawing operation used to draw the interior of a shape. The final fill opacity also depends on the value of the opacity property.</td>
-        </tr>
-        <tr>
-          <td>height</td>
-          <td>&quot;8px&quot;</td>
-          <td>The height of a box drawn around Point shapes. Currently only pixel values are allowed. If either width or height are zero, no shape is drawn for the Point.</td>
-        </tr>
-        <tr>
-          <td>opacity</td>
-          <td>1</td>
-          <td>The object opacity of the entire shape. This is a multiplicative operation when determining the final fillOpacity and strokeOpacity where any fill or stroke operation is made even more translucent if this value is below 1.0.</td>
-        </tr>
-        <tr>
-          <td>stroke</td>
-          <td>undefined</td>
-          <td>Color to use when drawing along the outline of a shape. By default, stroke will use the value of the color property.</td>
-        </tr>
-        <tr>
-          <td>strokeOpacity</td>
-          <td>1</td>
-          <td>Specifies the opacity of the drawing operation used to draw the outline of a shape. The final stroke opacity also depends on the value of the opacity property.</td>
-        </tr>
-        <tr>
-          <td>strokeWidth</td>
-          <td>&quot;2px&quot;</td>
-          <td>The width of the stroke of a shape. A zero value causes no stroke to be drawn. Currently only pixel values are allowed.</td>
-        </tr>
-        <tr>
-          <td>visibility</td>
-          <td>&quot;visible&quot;</td>
-          <td>Determines if the shape is drawn (&quot;visible&quot;) or not drawn (&quot;hidden&quot;) on the map. Shapes that are hidden can still be returned by the find method.</td>
-        </tr>
-        <tr>
-          <td>width</td>
-          <td>&quot;8px&quot;</td>
-          <td>The width of a rounded rectangle drawn around Point shapes. Currently only pixel values are allowed. If either width or height are zero, no shape is drawn for the Point.</td>
-        </tr>
-      </table>
-      <p>All properties apply to Point shapes which means that you can adjust the stroke and fill of the box surrounding the point location.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/measureLabels.html b/libs/js/jquery-geo-1.0b2/docs/geomap/measureLabels.html
deleted file mode 100755 (executable)
index d9f65e7..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>measureLabels | geomap</title>
-  <meta name="description" content="geomap measureLabels option">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="measureLabels" data-role="page">
-    <div data-role="header" data-theme="f">
-      <h1>measureLabels</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>Object</td>
-        </tr>
-        <tr>
-          <th>default</th>
-          <td><pre><code>{
-  length: &quot;{{:length}} m&quot;,
-  area: &quot;{{:area}} sq m&quot;
-}</code></pre></td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><code><pre>$( <i>selector</i> ).geomap( { measureLabels: { length: &quot;{{:length}} meters&quot; } } );</pre></code></td>
-        </tr>
-        <tr>
-          <th>get</th>
-          <td><code><pre>var measureLabels = $( <i>selector</i> ).geomap( &quot;option&quot;, &quot;measureLabels&quot; );</pre></code></td>
-        </tr>
-        <tr>
-          <th>set</th>
-          <td><code><pre>$( <i>selector</i> ).geomap( &quot;option&quot;, &quot;measureLabels&quot;, { area: &quot;{{:area}} square meters&quot; } );</pre></code></td>
-        </tr>
-      </table>
-
-      <p>The measureLabels option controls how the length or area text is formatted when displayed on the map during measuring.</p>
-
-      <p>In the label strings, the {{: }} syntax is used as a placeholder for the current length or area. All other text is displayed verbatim.</p>
-      
-      <p><b>Note: Alpha releases used a {{= }} syntax but there is a breaking change in the beta version due to <a href="http://www.borismoore.com/2012/03/approaching-beta-whats-changing-in_06.html" rel="external">changes in jsRender</a>. Please use the new {{: }} syntax.</b></p>
-
-      <p>The developer may change each measureLabels option separately during both initialization of the widget or any time after.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/mode.html b/libs/js/jquery-geo-1.0b2/docs/geomap/mode.html
deleted file mode 100755 (executable)
index 93042d6..0000000
+++ /dev/null
@@ -1,391 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>mode | geomap</title>
-  <meta name="description" content="geomap mode option">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="mode" data-role="page">
-    <div data-role="header" data-theme="f">
-      <h1>mode</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>String</td>
-        </tr>
-        <tr>
-          <th>default</th>
-          <td>&quot;pan&quot;</td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><pre><code>$( <i>selector</i> ).geomap( { mode: &quot;pan&quot; } );</code></pre></td>
-        </tr>
-        <tr>
-          <th>get</th>
-          <td><pre><code>var mode = $( <i>selector</i> ).geomap( &quot;option&quot;, &quot;mode&quot; );</code></pre></td>
-        </tr>
-        <tr>
-          <th>set</th>
-          <td><pre><code>$( <i>selector</i> ).geomap( &quot;option&quot;, &quot;mode&quot;, &quot;drawPoint&quot; );</code></pre></td>
-        </tr>
-      </table>
-
-      <p>The mode option determines how the map responds to user interaction and which events jQuery Geo triggers for the developer.</p>
-
-      <p>jQuery Geo puts these modes into four small groups:</p>
-      
-      <h2>modes</h2>
-
-
-      <h3>basic</h3>
-
-      <p>Basic modes are most common to what people expect to be able to do with a map: drag it around, zoom it in and out, or just have it sit there an look pretty.</p>
-
-      <ul>
-        <li>static</li>
-        <li>pan</li>
-        <li>zoom</li>
-      </ul>
-
-      <h3>drag</h3>
-
-      <p>Drag modes disable panning and turn single swipes into shape events.</p>
-
-      <ul>
-        <li>dragBox</li>
-      </ul>
-
-      <h3>draw</h3>
-
-      <p>Draw modes turn user clicks into shape events, panning is allowed.</p>
-
-      <ul>
-        <li>drawPoint</li>
-        <li>drawLineString</li>
-        <li>drawPolygon</li>
-      </ul>
-
-      <h3>measure</h3>
-
-      <p>Measure modes display length and area based on clicks and drags.</p>
-
-      <ul>
-        <li>measureLength</li>
-        <li>measureArea</li>
-      </ul>
-
-      <p>You are free to set mode to any other string, this is called <a href="javascript:document.getElementById('custom-modes').scrollIntoView();" rel="external">custom modes</a> in jQuery Geo and described at the end of this page.</p>
-
-      <h2>related options</h2>
-
-      <p>Each mode has a matching property on the <a href="cursors.html">cursors</a> option. For example, to change the cursor for drawPoint mode to an I-beam, you can initialize the geomap widget like this:</p>
-
-      <pre><code>$( <i>selector</i> ).geomap( { cursors: { drawPoint: &quot;text&quot; } } )</code></pre>
-
-      <p>The <a href="drawStyle.html">drawStyle</a> option determines how shapes look while being drawn in all of the draw, drag, and measure modes.</p>
-
-      <p>The <a href="measureLabels.html">measureLabels</a> option determines how the text is formatted while using the measure modes.</p>
-
-      <p>You can remove a user's ability to pan the map by setting the <a href="panning.html">panning</a> option to false. Yes, you can disable panning even when mode is set to &quot;pan&quot;.<p>
-
-      <p>You can shut off mouse wheel scroll in any mode by setting the <a href="scroll.html">scroll</a> option to &quot;off&quot;.</p>
-
-      <p>However, when mode is static, setting panning to true or scroll to &quot;zoom&quot; will not enable panning or mouse wheel zoom. In static mode, the geomap widget ignores the panning and scroll options.</p>
-
-      <h2>style</h2>
-      <p>The label containing the measure length or area text has the geo-measure-label CSS class. To change how the measure text looks, you can update properties in that rule:</p>
-
-      <pre><code>.geo-measure-label { font-size: 1.5em; }</code></pre>
-
-      <h2>static</h2>
-
-      <h3>user experience</h3>
-      <p>The default cursor is the default arrow pointer.</p>
-
-      <p>The map widget displays tiles and map images as normal but the user cannot interact with them, e.g., the user can't pan or zoom in any way, even if the <a href="pannable.html">pannable</a> option is set to true.</p>
-
-      <p>As a developer, you can still call geomap methods and set options in order to change the static map's appearance. Events are not triggered when you change the map programmatically.</p>
-
-      <h3>events</h3>
-      <p>All regular browser events bubble up to parent elements and eventually the document. No widget-specific events trigger. You are free to handle events on the map div as normal events, e.g., click, but you won't get the geo argument. You can ask the map widget for information such as map locations based on the pixel arguments in the event. See the <a href="../examples/inset.html" rel="external">Inset example</a> for help with this.</p>
-
-      <h2>pan</h2>
-      <h3>user experience</h3>
-      <p>The default cursor is an open hand in browsers that support data URIs and a four point arrow otherwise.</p>
-
-      <p>The user can drag the map to pan. The map will continue panning a little after the user lets go. They can zoom in or out with the scroll wheel. They can also double-click or double-tap to zoom in one level. On some multitouch devices, users can use two fingers to &quot;pinch zoom&quot; (currently not available on Android).</p>
-
-      <p>The user can hold the shift key to temporarily switch to zoom mode.</p>
-
-      <h3>events</h3>
-      <p>In pan mode, the geomap widget triggers the following events on the original map div.</p>
-      <ul>
-        <li>move &ndash; when the user moves the mouse above the map but is not actively panning</li>
-        <li>click &ndash; when the user clicks or taps a point on the map without initiating a pan, i.e., they let go of the map at the same point and within a short time threshold</li>
-        <li>dblclick &ndash; when the user double-clicks or double-taps a point on the map</li>
-        <li>bboxchange &ndash; when the user changes the bbox by panning or zooming</li>
-      </ul>
-
-      <h2>zoom</h2>
-
-      <h3>user experience</h3>
-      <p>The default cursor is a crosshair.</p>
-
-      <p>In this mode the user can perform a marquee zoom by clicking and holding one point and dragging the mouse cursor. A box will form. When the user lets go of the mouse, the map will zoom to the closest approximation of the bbox of the drawn shape.</p>
-      <p>Shingled (dynamic) services are only limited by the ratio between the size of the drawn shape and the map div's current size. Cached services are limited to those as well but also specific map zoom levels so the final bbox will not be as close.</p>
-      <p>The user can also zoom in or out with the scroll wheel as well as double-click or double-tap to zoom in one level. On some multitouch devices, users can use two fingers to &quot;pinch zoom&quot; (currently not available on Android).</p>
-      <p>This is not a very useful mode for mobile applications but provides a more exact method of zooming into an area for desktop users who want it.</p>
-
-      <h3>events</h3>
-      <p>In zoom mode the geomap widget triggers the following events on the original map div.</p>
-      <ul>
-        <li>move &ndash; when the user moves the mouse above the map but is not actively performing a marquee zoom</li>
-        <li>click &ndash; when the user clicks or taps a point on the map without initiating a marquee zoom, i.e., they let go of the map at the same point and within a short time threshold</li>
-        <li>dblclick &ndash; when the user double-clicks or double-taps a point on the map</li>
-        <li>bboxchange &ndash; when the user changes the bbox by zooming</li>
-      </ul>
-
-      <h2>dragBox</h2>
-
-      <h3>user experience</h3>
-      <p>The default cursor is a crosshair.</p>
-
-      <p>Similar to zoom, in this mode the user can click and hold one point and then drag the mouse cursor. A box will form. When the user lets go of the mouse, jQuery Geo will trigger a shape event passing a GeoJSON Polygon representation of the dragged bbox as the geo argument. The Polygon object also has the GeoJSON the bbox property.</p>
-
-      <p>The user can also click the map instead of dragging a box. In this case, jQuery Geo will still trigger a shape event, but this time it will pass a GeoJSON Point representing the clicked location. The Point object will also have the bbox property with the min and max values matching each other, i.e., bbox[0] (minx) = bbox[2] (maxx) and bbox[1] (miny) = bbox[3] (maxy).</p>
-
-      <p>The user cannot pan the map while in dragBox mode. The user can zoom in or out with the scroll wheel as well as double-click or double-tap to zoom in one level. On some multitouch devices, users can use two fingers to &quot;pinch zoom&quot; (currently not available on Android).</p>
-
-      <p>The user can hold the shift key to temporarily switch to zoom mode.</p>
-
-      <h3>events</h3>
-      <p>In dragBox mode the geomap widget triggers the following events on the original map div.</p>
-      <ul>
-        <li>move &ndash; when the user moves the mouse above the map but is not actively dragging a bbox</li>
-        <li>dblclick &ndash; when the user double-clicks or double-taps a point on the map</li>
-        <li>bboxchange &ndash; when the user changes the bbox by zooming</li>
-        <li>shape &ndash; when the user lets go of the mouse after dragging to make a bbox, jQuery Geo will send a GeoJSON Polygon object to the developer; this Polygon object has a bbox property which is set to the bbox of the rectangle drawn</li>
-      </ul>
-
-      <h2>dragCircle</h2>
-
-      <h3>user experience</h3>
-      <p>The default cursor is a crosshair.</p>
-
-      <p>In this mode the user can click and hold one point and then drag the mouse cursor. A circle will form from the center outward. When the user lets go of the mouse, jQuery Geo will trigger a shape event passing a GeoJSON Polygon representation of the dragged circle as the geo argument. The Polygon object also has the GeoJSON the bbox property.</p>
-
-      <p>The user can also click the map instead of dragging a circle. In this case, jQuery Geo will still trigger a shape event, but this time it will pass a GeoJSON Point representing the clicked location. The Point object will also have the bbox property with the min and max values matching each other, i.e., bbox[0] (minx) = bbox[2] (maxx) and bbox[1] (miny) = bbox[3] (maxy).</p>
-
-      <p>The user cannot pan the map while in dragCircle mode. The user can zoom in or out with the scroll wheel as well as double-click or double-tap to zoom in one level. On some multitouch devices, users can use two fingers to &quot;pinch zoom&quot; (currently not available on Android).</p>
-
-      <p>The user can hold the shift key to temporarily switch to zoom mode.</p>
-
-      <h3>events</h3>
-      <p>In dragCircle mode the geomap widget triggers the following events on the original map div.</p>
-      <ul>
-        <li>move &ndash; when the user moves the mouse above the map but is not actively dragging a circle</li>
-        <li>dblclick &ndash; when the user double-clicks or double-taps a point on the map</li>
-        <li>bboxchange &ndash; when the user changes the bbox by zooming</li>
-        <li>shape &ndash; when the user lets go of the mouse after dragging to make a circle, jQuery Geo will send a GeoJSON Polygon object to the developer; this Polygon object has a bbox property which is set to the bbox of the circle drawn</li>
-      </ul>
-
-      <h2>drawPoint</h2>
-
-      <h3>user experience</h3>
-      <p>The default cursor is a crosshair.</p>
-
-      <p>In this mode the user can digitize a Point shape by single-clicking or tapping the map. Apart from the default cursor, this mode is similar to pan in that the user can drag the map to pan. However, to allow a user more accuracy during digitization, the map will not continue panning a little after the user lets go. They can zoom in or out with the scroll wheel. They can also double-click or double-tap to zoom in one level.</p>
-
-      <p>A visual point will appear temporarily until they either let go to draw the point or begin panning.</p>
-
-      <p>Similar to pan mode, the user can drag the map to pan. However, to allow a user more accuracy during digitization, the map will not continue panning a little after the user lets go. They can zoom in or out with the scroll wheel. They can also double-click or double-tap to zoom in one level. On some multitouch devices, users can use two fingers to &quot;pinch zoom&quot; (currently not available on Android).</p>
-
-      <p>The user can hold the shift key to temporarily switch to zoom mode.</p>
-
-      <h3>events</h3>
-      <p>In drawPoint mode, the geomap widget triggers the following events on the original map div. Note that the shape event replaces the click event.</p>
-      <ul>
-        <li>move &ndash; when the user moves the mouse above the map but is not actively panning</li>
-        <li>dblclick &ndash; when the user double-clicks or double-taps a point on the map</li>
-        <li>bboxchange &ndash; when the user changes the bbox by panning or zooming</li>
-        <li>shape &ndash; when the user clicks or taps a point on the map, this action will send a GeoJSON Point object to the developer</li>
-      </ul>
-
-      <h2>drawLineString</h2>
-
-      <h3>user experience</h3>
-      <p>The default cursor is a crosshair.</p>
-
-      <p>In this mode the user can digitize a LineString shape. The first single-click or tap on the map will begin the shape drawing. Once initialized, subsequent single-clicks will add points to the LineString. Finally, a double-click or tap will end the digitization and trigger the shape event.</p>
-
-      <p>On a non-touch device a visual line will follow the mouse cursor from the last point to show the user the next segment of the line they will draw. On all devices, the next segment becomes visible when the user confirms the next point location by clicking or tapping. At any point, the user can hit the escape key to remove one point or, if there is only one point, stop drawing the shape alltogether.</p>
-
-      <p>Similar to pan mode, the user can drag the map to pan, even while drawing a shape. However, to allow a user more accuracy during digitization, the map will not continue panning a little after the user lets go. They can zoom in or out with the scroll wheel. While not drawing, they can also double-click or double-tap to zoom in one level. On some multitouch devices, users can use two fingers to &quot;pinch zoom&quot; (currently not available on Android).</p>
-
-      <p>The user can hold the shift key to temporarily switch to zoom mode.</p>
-
-      <h3>events</h3>
-      <p>In drawLineString mode, the geomap widget triggers the following events on the original map div.</p>
-      <ul>
-        <li>move &ndash; when the user moves the mouse above the map but is not actively panning, this event triggers even while drawing a shape</li>
-        <li>click &ndash; when the user clicks or taps a point on the map without initiating a pan, this event triggers even while drawing a shape</li>
-        <li>dblclick &ndash; when the user double-clicks or double-taps a point on the map but is not actively drawing</li>
-        <li>bboxchange &ndash; when the user changes the bbox by panning or zooming</li>
-        <li>shape &ndash; when the user double-clicks or taps a point on the map after beginning a drawing operation with a single click, this action will send a GeoJSON LineString object to the developer</li>
-      </ul>
-
-      <h2>drawPolygon</h2>
-
-      <h3>user experience</h3>
-      <p>The default cursor is a crosshair.</p>
-
-      <p>In this mode the user can digitize a Polygon shape. The first single-click or tap on the map will begin the shape drawing. Once initialized, subsequent single-clicks will add points to the Polygon. Finally, a double-click or tap will end the digitization and trigger the shape event.</p>
-
-      <p>On a non-touch device two visual lines will follow the mouse cursor. One from the last point to show the user the next segment of the Polygon they will draw, the other from the first point to show the user an extra segment that will complete the Polygon. On all devices, the next segment becomes visible when the user confirms the next point location by clicking or tapping. At any point, the user can hit the escape key to remove one point or, if there is only one point, stop drawing the shape alltogether.</p>
-
-      <p>Similar to pan mode, the user can drag the map to pan, even while drawing a shape. However, to allow a user more accuracy during digitization, the map will not continue panning a little after the user lets go. They can zoom in or out with the scroll wheel. While not drawing, they can also double-click or double-tap to zoom in one level. On some multitouch devices, users can use two fingers to &quot;pinch zoom&quot; (currently not available on Android).</p>
-
-      <p>The user can hold the shift key to temporarily switch to zoom mode.</p>
-
-      <h3>events</h3>
-      <p>In drawPolygon mode, the geomap widget triggers the following events on the original map div.</p>
-      <ul>
-        <li>move &ndash; when the user moves the mouse above the map but is not actively panning, this event triggers even while drawing a shape</li>
-        <li>click &ndash; when the user clicks or taps a point on the map without initiating a pan, this event triggers even while drawing a shape</li>
-        <li>dblclick &ndash; when the user double-clicks or double-taps a point on the map but is not actively drawing</li>
-        <li>bboxchange &ndash; when the user changes the bbox by panning or zooming</li>
-        <li>shape &ndash; when the user double-clicks or taps a point on the map after beginning a drawing operation with a single click, this action will send a GeoJSON Polygon object to the developer</li>
-      </ul>
-
-      <h2>measureLength</h2>
-
-      <h3>user experience</h3>
-      <p>The default cursor is a crosshair.</p>
-
-      <p>In this mode the user can visually measure the length of lines on the map. The first single-click or tap on the map will begin the measurement. Once initialized, subsequent single-clicks or taps will add points to a LineString being measured. Whenever the mouse moves, a label follows the cursor which displays the total length so far. Touch devices will only see an updated measurment when they add a new point. A double-click or tap will end the measurement and remove all graphics and labels.</p>
-
-      <p>On a non-touch device a visual line will follow the mouse cursor from the last point to show the user the next segment of the line they are measuring and update the measurement. On all devices, the next segment becomes visible when the user confirms the next point location by clicking or tapping. At any point, the user can hit the escape key to remove one point or, if there is only one point, stop measuring alltogether.</p>
-
-      <p>Similar to pan mode, the user can drag the map to pan, even while measuring. The map will continue panning a little after the user lets go. They can zoom in or out with the scroll wheel. While not measuring, they can also double-click or double-tap to zoom in one level. On some multitouch devices, users can use two fingers to &quot;pinch zoom&quot; (currently not available on Android).</p>
-
-      <p>The user can hold the shift key to temporarily switch to zoom mode.</p>
-
-      <p>By default the unit of measurment is meters because the default projection is web mercator meters. If you change the tilingScheme (on tiled services) or switch to a shingled service, the unit of measurment will be based on your new service's units.</p>
-      <h3>events</h3>
-      <p>In measureLength mode, the geomap widget triggers the following events on the original map div.</p>
-      <ul>
-        <li>move &ndash; when the user moves the mouse above the map but is not actively panning, this event triggers even while measuring</li>
-        <li>click &ndash; when the user clicks or taps a point on the map without initiating a pan, this event triggers even while measuring</li>
-        <li>dblclick &ndash; when the user double-clicks or double-taps a point on the map but is not actively measuring</li>
-        <li>bboxchange &ndash; when the user changes the bbox by panning or zooming</li>
-        <li>shape &ndash; when the user double-clicks or taps a point on the map after beginning a measure operation with a single click, this action will send a GeoJSON LineString object to the developer</li>
-      </ul>
-
-      <h2>measureArea</h2>
-
-      <h3>user experience</h3>
-      <p>The default cursor is a crosshair.</p>
-
-      <p>In this mode the user can visually measure an area on the map. The first single-click or tap on the map will begin the measurement. Once initialized, subsequent single-clicks or taps will add points to a Polygon being measured. Whenever the mouse moves, a label follows the center of the polygon that displays the total area so far. Touch devices will only see an updated measurment when they add a new point. A double-click or tap will end the measurement and remove all graphics and labels.</p>
-
-      <p>On a non-touch device two visual lines will follow the mouse cursor. One from the last point to show the user the next segment of the Polygon they will draw, the other from the first point to show the user an extra segment that will complete the Polygon we need to calculate area. On all devices, the next segment becomes visible when the user confirms the next point location by clicking or tapping. At any point, the user can hit the escape key to remove one point or, if there is only one point, stop measuring alltogether.</p>
-
-      <p>Similar to pan mode, the user can drag the map to pan, even while measuring. The map will continue panning a little after the user lets go. They can zoom in or out with the scroll wheel. While not measuring, they can also double-click or double-tap to zoom in one level. On some multitouch devices, users can use two fingers to &quot;pinch zoom&quot; (currently not available on Android).</p>
-
-      <p>The user can hold the shift key to temporarily switch to zoom mode.</p>
-
-      <p>By default the unit of measurment is meters because the default projection is web mercator meters. If you change the tilingScheme (on tiled services) or switch to a shingled service, the unit of measurment will be based on your new service's units.</p>
-
-      <h3>events</h3>
-
-      <p>In measureArea mode, the geomap widget triggers the following events on the original map div.</p>
-      <ul>
-        <li>move &ndash; when the user moves the mouse above the map but is not actively panning, this event triggers even while measuring</li>
-        <li>click &ndash; when the user clicks or taps a point on the map without initiating a pan, this event triggers even while measuring</li>
-        <li>dblclick &ndash; when the user double-clicks or double-taps a point on the map but is not actively measuring</li>
-        <li>bboxchange &ndash; when the user changes the bbox by panning or zooming</li>
-        <li>shape &ndash; when the user double-clicks or taps a point on the map after beginning a measure operation with a single click, this action will send a GeoJSON Polygon object to the developer</li>
-      </ul>
-
-      <h2 id="custom-modes">custom modes</h2>
-
-      <p>As mentioned above, you can also set mode to any other string. It will behave exactly like pan mode. However, you can set a different cursor:</p>
-
-      <pre><code>var map = $( &quot;#map&quot; ).geomap( {
-  mode: &quot;click&quot;,
-  cursors: { click: &quot;crosshair&quot; }
-} );</code></pre>
-
-      <p>The above example creates a new custom mode, click, and sets the geomap widget to that mode during initialization. When the widget is in this mode, it will behave exactly like pan, but have a crosshair. This means you will get all the same events as pan: move, click, dblclick &amp; bboxchange. A mode like this is useful if you want to give users more accuracy when clicking the map.</p>
-
-      <p>Custom modes will still allow panning. While panning, the cursor will temporarily switch to the pan cursor. You can disable panning for your mode by setting the widget's panning option to false whenever you change the mode option.</p>
-
-      <pre><code>function setMode( mode ) {
-  map.geomap( &quot;option&quot;, {
-    mode: mode,
-    panning: mode !== &quot;click&quot;
-  } );
-}</code></pre>
-
-      <p>In this last example, we create a new map with two modes, find and remove. They both trigger the click event so we can check our current mode and behave differently depending on which one is set, or do nothing if we're not in find or remove mode.</p>
-
-      <pre><code>var map = $( &quot;#map&quot; ).geomap( {
-  mode: &quot;drawPoint&quot;,
-  cursors: {
-    find: &quot;crosshair&quot;,
-    remove: &quot;crosshair&quot;
-  },
-  shape: function( e, geo ) {
-    <span class="comment">// only the draw modes trigger this event</span>
-    map.geomap( &quot;append&quot;, geo );
-  },
-  click: function( e, geo ) {
-    switch( map.geomap( &quot;option&quot;, &quot;mode&quot; ) ) {
-      case &quot;find&quot;:
-        <span class="comment">// search for shapes but just alert the user</span>
-        var shapes = map.geomap( &quot;find&quot;, geo, 3 );
-        if ( shapes.length &gt; 0 ) {
-          alert( &quot;Found &quot; + shapes.length + &quot; shape(s) !&quot; );
-        }
-        break;
-
-      case &quot;remove&quot;:
-        <span class="comment">// search for shapes and remove one of them</span>
-        var shapes = map.geomap( &quot;find&quot;, geo, 3 );
-        if ( shapes.length &gt; 0 ) {
-          map.geomap( &quot;remove&quot;, shapes[ 0 ] );
-        }
-        break;
-
-      default:
-        <span class="comment">// ignore the click event for all other modes: pan, zoom, etc.</span>
-        break;
-    }
-  }
-} );</code></pre>
-
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/opacity.html b/libs/js/jquery-geo-1.0b2/docs/geomap/opacity.html
deleted file mode 100755 (executable)
index 6ba22b6..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>opacity | geomap</title>
-  <meta name="description" content="geomap opacity method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="opacity" data-role="page">
-    <div data-role="header" data-theme="e">
-      <h1>opacity</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>undefined</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>$( <i>map or service selector</i> ).geomap( &quot;opacity&quot;, Number opacity )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>$(&quot;#map&quot;).geomap( &quot;opacity&quot;, .5 )
-$(&quot;#map .osm&quot;).geomap( &quot;opacity&quot;, .7 )</code></pre>
-          </td>
-        </tr>
-      </table>
-      <p>This method sets the value of the opacity property of service objects in the services array.</p>
-      <p>It will also update the opacity of all images already requested by the service.</p>
-      <p>If you call opacity directly on geomap's div element, it will apply to all services. You can target individual services using a CSS selector based on the map div id and the class supplied for the service in its service object or just the id of the service if supplied in its service object.</p>
-      <pre><code>// for example, given the following as the map div
-&lt;div id=&quot;map&quot;&gt;&lt;/div&gt;
-
-// and initializing geomap with the following services
-$(&quot;#map&quot;).geomap({
-  services: [
-    {
-      id: &quot;water&quot;,
-      class: &quot;mass-gis&quot;,
-      type: &quot;shingled&quot;,
-      src: function ( view ) { return null; }
-    },
-    {
-      id: &quot;towns&quot;,
-      class: &quot;mass-gis&quot;,
-      type: &quot;shingled&quot;,
-      src: function ( view ) { return null; }
-    },
-    {
-      id: &quot;harbor-cruise&quot;,
-      type: &quot;shingled&quot;,
-      src: function ( view ) { return null; }
-    }
-  ]
-});
-
-// you can later change the opacity of all services
-$(&quot;#map&quot;).geomap(&quot;opacity&quot;, .8);
-
-// all mass-gis services
-$(&quot;#map .mass-gis&quot;).geomap(&quot;opacity&quot;, .5);
-
-// or a specific service
-$(&quot;#harbor-cruise&quot;).geomap(&quot;opacity&quot;, 1.0);</code></pre>
-      <p>This is much faster than changing a service object's opacity value yourself and updating geomap's services property.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/pannable.html b/libs/js/jquery-geo-1.0b2/docs/geomap/pannable.html
deleted file mode 100755 (executable)
index dcd4c4d..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>pannable | geomap</title>
-  <meta name="description" content="geomap pannable option">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="pannable" data-role="page">
-    <div data-role="header" data-theme="f">
-      <h1>pannable</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>Boolean</td>
-        </tr>
-        <tr>
-          <th>default</th>
-          <td>true</td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><pre><code>$( <i>map selector</i> ).geomap( { pannable: true } );</code></pre></td>
-        </tr>
-        <tr>
-          <th>get</th>
-          <td><pre><code>var pannable = $( <i>map selector</i> ).geomap( &quot;option&quot;, &quot;pannable&quot; );</code></pre></td>
-        </tr>
-        <tr>
-          <th>set</th>
-          <td><pre><code>$( <i>map selector</i> ).geomap( &quot;option&quot;, &quot;pannable&quot;, false );</code></pre></td>
-        </tr>
-      </table>
-
-      <p>The pannable option determines whether or not a user can pan the map.</p>
-      
-      <p>When true, the default, users can drag the map image or tiles to change the bbox in any <a href="mode.html">mode</a> except for &quot;static&quot;. For example, they can pan the map in the middle of drawing a polygon with the drawPolygon mode.</p>
-
-      <p>When false, a user's dragging of the map image will not cause it to move regardless of what mode the widget is in. Developers can still make programatic changes to the bbox, such as setting options and calling methods.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/pixelSize.html b/libs/js/jquery-geo-1.0b2/docs/geomap/pixelSize.html
deleted file mode 100755 (executable)
index f460454..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>pixelSize | geomap</title>
-  <meta name="description" content="geomap pixelSize option">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="pixelSize" data-role="page">
-    <div data-role="header" data-theme="f">
-      <h1>pixelSize</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>Number</td>
-        </tr>
-        <tr>
-          <th>default</th>
-          <td>156543.03392799936</td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><i>cannot be initialized</i></td>
-        </tr>
-        <tr>
-          <th>get</th>
-          <td><pre><code>var pixelSize = $( <i>selector</i> ).geomap( &quot;option&quot;, &quot;pixelSize&quot; );</code></pre></td>
-        </tr>
-        <tr>
-          <th>set</th>
-          <td><i>read only</i></td>
-        </tr>
-      </table>
-      <p>The pixel size is the number of map units a single pixel occupies in the current view. A more interesting way to think of it is the Earth-size of the pixel.</p>
-      <p>Because the default internal projection is web mercator meters, the default return value for pixelSize is in meters even if you set other map values in geodetic coordinates, e.g., lon/lat. The unit type will always match the type you set on tilingScheme for tiled maps or bboxMax for shingled (dynamic) maps. For more information on how the plugin handles projections, please read the geo section of this documentation.</p>
-      <p>The map's pixel size is read-only. To change it you will need to use one of the mutable properties such as bbox, center or zoom.</p>
-      <p>pixelSize is calculated based on tilingScheme &amp; zoom for tiled maps. It is based on the bbox/bboxMax ratio for shingled maps.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/refresh.html b/libs/js/jquery-geo-1.0b2/docs/geomap/refresh.html
deleted file mode 100755 (executable)
index ee604b3..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-
-  <title>refresh | geomap</title>
-  <meta name="description" content="geomap refresh method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="refresh" data-role="page">
-    <div data-role="header" data-theme="e">
-      <h1>refresh</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>undefined</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>$( <i>map or service selector</i> ).geomap( &quot;refresh&quot; [ , Boolean force ] )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>$(&quot;#map&quot;).geomap( &quot;refresh&quot; )
-
-$(&quot;#map&quot;).geomap( &quot;refresh&quot;, true )
-
-$(&quot;#map .my-dynamic-service&quot;).geomap( &quot;refresh&quot;, true )</code></pre></td>
-        </tr>
-      </table>
-
-      <p>This method refreshes one or more services and shapes in the map. Usually, changing geomap options or calling methods automatically refreshes the map appropriately. However, you can call this after you have added or removed shapes to geomap by passing false as the refresh argument to the append, remove, or empty methods. This method is also useful in the case of dynamic server data.</p>
-
-      <p>Without a service selector, all services on the map will be refreshed.</p>
-
-      <p>The force option will re-request images for tiles already in the map view. Keep in mind, though, that this does not guarantee you will get updated images. See the Dynamic Data section below for tips.</p>
-
-      <h2>Dynamic Data</h2>
-
-      <p>There are three factors that can prevent jQuery Geo from getting a fresh image from a web server.</p>
-      
-      <ul>
-        <li>if the user does not interact with the map and you do not call refresh, jQuery Geo will not request new images</li>
-        <li>if the user does interact with the map, you call refresh with no arguments, or you call .geomap( &quot;refresh&quot;, false ):
-          <ul>
-            <li>for tiled services: jQuery Geo will only request images for tiles that it does not already have</li>
-            <li>for shingeld services: a new image is always requested but the browser may supply a cached image</li>
-          </ul>
-        </li>
-        <li>if you call .geomap( &quot;refresh&quot;, true ), jQuery Geo will:
-          <ul>
-            <li>for tiled services: request a new image for existing tiles but the web browser is free to supply a cached image instead of retriving one from the web server</li>
-            <li>for shinged services: this is also true; if the final image URL is the same as a previous image URL the browser may supply a cached image</li>
-          </ul>
-        </li>
-      </ul>
-
-      <p>A web browser will normally cache images that have already been loaded. On top of that, jQuery Geo will not, by default, request images for tiles that it has already placed. In the case of dynamic data, where you want to update what's on the map without requiring a pan or zoom or also update tiles that have already been placed, you have a couple options.</p>
-
-      <h3>use uncachable URLs</h3>
-
-      <p>The first option is to use a function for the <a href="services.html">src property of your service object</a>. In that function, return a different URL every time even if all of the properties of the view object are the same as a previous call. If we were to use jQuery's implementation of the cache option in $.ajax as inspiration, our src function could look similar to:</p>
-
-      <pre><code>src: function( view ) {
-  return &quot;my.dynamic.tile.service/&quot; + view.zoom + &quot;/&quot; + view.tile.column + &quot;/&quot; + view.tile.row + &quot;.png?_=&quot; + $.now( );
-}</code></pre>
-
-      <p>The _ input in the query string will be a different number on every request, regardless of the value of zoom, column, and row. Most services will ignore extraneous query string inputs and the web browser will not be able to cache the image.</p>
-
-      <h3>use the Cache-Control HTTP header</h3>
-
-      <p>Another way to achieve the same result without modifying your image URLs is to use the HTTP header: Cache-Control. By returning this header with the no-cache value, you can tell the web browser to not cache the image. Then, when you call .geomap( &quot;refresh&quot;, true ), the web browser will re-request images for tiles even if it has done so one already. This option is only possible if you have some control over the web server that supplies map images. How to add the header is specific to your web server and beyond the scope of these docs. It can usually be done in the web server's configuration file or in the web service itself where you generate the images.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/remove.html b/libs/js/jquery-geo-1.0b2/docs/geomap/remove.html
deleted file mode 100755 (executable)
index dc19501..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>remove | geomap</title>
-  <meta name="description" content="geomap remove method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="remove" data-role="page">
-    <div data-role="header" data-theme="e">
-      <h1>remove</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>jQuery collection</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>.geomap( &quot;remove&quot;, Object shape ( <a href="http://geojson.org/geojson-spec.html" rel="external">GeoJSON object</a> ) | Array&lt;Object&gt; shapes [ , Boolean refresh ] )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>$( <i>map or service selector</i> ).geomap( &quot;remove&quot;, existingShape )
-$( <i>map or service selector</i> ).geomap( &quot;remove&quot;, existingShape, false )
-$( <i>map or service selector</i> ).geomap( &quot;remove&quot;, [ existingShape1, existingShape2 ] )</code></pre></td>
-        </tr>
-      </table>
-
-      <p>The remove method removes a shape (or array of shapes) that you have previously added with the append method. The existing shapes can be an object references used in a call to <a href="append.html">append</a> which you have held on to or ones that you retrieved by using the <a href="find.html">find</a> method.</p>
-
-      <p>The jQuery UI widget factory returns the original jQuery collection to maintain call chaining.</p>
-
-      <h2>delaying refresh</h2>
-      <p>The optional refresh argument determines if geomap refreshes the map graphics after this call to remove. It defaults to true. If you pass false, geomap will remove the shape internally but not immediately redraw the graphics. The changes will display if the user moves the map or you call geomap's refresh method.</p>
-      <p>If the shape is not found on the specified service, the map is not changed and will not be refreshed even if you pass true for the refresh argument.</p>
-      <h2>service-level shapes</h2>
-      <p>Similar to how you can append shapes to specific services, you can remove shapes from specific services as well.</p>
-      <p>You do this by targeting a service inside a map instead of the map itself for your call to geomap's remove method. For example, the default map service has the CSS class: osm. We can remove a shape from that service specifically by using jQuery to target the service:</p>
-      <pre><code>$( &quot;#map .osm&quot; ).geomap( &quot;remove&quot;, shape );</code></pre>
-      <p>Shapes appended to a specific service will not be removed by calling remove on the map itself. For example, the shape will remain after this sequence:<p>
-      <pre><code>$( &quot;#map .osm&quot; ).geomap( &quot;append&quot;, shape );
-$( &quot;#map&quot; ).geomap( &quot;remove&quot;, shape );</code></pre>
-      <p>To remove all references to a shape from the map and all services, you can use the comma selector and the built-in geo-service CSS class:</p>
-      <pre><code><span class="comment">// remove the shape from both the map widget and any services</span>
-$( &quot;#map,#map .geo-service&quot; ).geomap( &quot;remove&quot;, shape );</code></pre>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/resize.html b/libs/js/jquery-geo-1.0b2/docs/geomap/resize.html
deleted file mode 100755 (executable)
index c9336ab..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>resize | geomap</title>
-  <meta name="description" content="geomap resize method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="resize" data-role="page">
-    <div data-role="header" data-theme="e">
-      <h1>resize</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>undefined</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>.geomap( &quot;resize&quot; )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>$(&quot;#map&quot;).geomap( &quot;resize&quot; )</code></pre></td>
-        </tr>
-      </table>
-      <p>
-        This method tells the geomap widget to recalculate its frame and adjust its bbox to fit a new size. The map will maintain its center point and pixel size and expand or contract to fill the new surroundings.</p>
-      <p>
-        The geomap widget watches the browser window for you. If your map widget&#39;s div position is related to the window in some way, geomap will automatically resize to fit when the window size changes. If the map widget&#39;s div is not related to the window and you manually change its size, you need to call resize so that the map can adjust.</p>
-      <p>
-        This method refreshes the map.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/scroll.html b/libs/js/jquery-geo-1.0b2/docs/geomap/scroll.html
deleted file mode 100755 (executable)
index fbf91a1..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>scroll | geomap</title>
-  <meta name="description" content="geomap scroll option">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="scroll" data-role="page">
-    <div data-role="header" data-theme="f">
-      <h1>scroll</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>String</td>
-        </tr>
-        <tr>
-          <th>default</th>
-          <td>&quot;default&quot;</td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><pre><code>$( <i>map selector</i> ).geomap( { scroll: &quot;default&quot; } );</code></pre></td>
-        </tr>
-        <tr>
-          <th>get</th>
-          <td><pre><code>var scroll = $( <i>map selector</i> ).geomap( &quot;option&quot;, &quot;scroll&quot; );</code></pre></td>
-        </tr>
-        <tr>
-          <th>set</th>
-          <td><pre><code>$( <i>map selector</i> ).geomap( &quot;option&quot;, &quot;scroll&quot;, &quot;off&quot; );</code></pre></td>
-        </tr>
-      </table>
-
-      <p>The scroll option determines what the map widget does when the user rotates a mouse wheel. There are currently three values: default, zoom, and off. However, default is currently the same as zoom.</p>
-      
-      <p>When scroll is default or zoom, users can use a mouse wheel to zoom the map in or out.</p>
-
-      <p>When set to off, mouse wheel scrolling is ignored. This is useful when the document itself or a section that contains the map requires scrolling due to content. A desktop user will expect to be able to use the mouse wheel to scroll the document and you don't want the map to interfere. For example, if the user's mouse cursor is over a map that's part of a long document, there's a greater chance they will want the mouse wheel to scroll document instead of zooming the map. Set the scroll property to &quot;off&quot; to ensure the wheel will work as expected.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/services.html b/libs/js/jquery-geo-1.0b2/docs/geomap/services.html
deleted file mode 100755 (executable)
index e30e6bf..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>services | geomap</title>
-  <meta name="description" content="geomap services option">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="services" data-role="page">
-    <div data-role="header" data-theme="f">
-      <h1>services</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>Array</td>
-        </tr>
-        <tr>
-          <th>default</th>
-        </tr>
-        <tr>
-          <td colspan=2><code><pre>[ {
-  &quot;class&quot;: &quot;osm&quot;,
-  type: &quot;tiled&quot;,
-  src: function( view ) {
-    return &quot;http://otile&quot; + ((view.index % 4) + 1) + &quot;.mqcdn.com/tiles/1.0.0/osm/&quot; + view.zoom + &quot;/&quot; + view.tile.column + &quot;/&quot; + view.tile.row + &quot;.png&quot;;
-  },
-  attr: &quot;&lt;p&gt;Tiles Courtesy of &lt;a href='http://www.mapquest.com/' target='_blank'&gt;MapQuest&lt;/a&gt; &lt;img src='http://developer.mapquest.com/content/osm/mq_logo.png'&gt;&lt;/p&gt;&quot;
-} ] );</code></pre></td>
-        </tr>
-        <tr>
-          <th>init</th>
-        </tr>
-        <tr>
-          <td colspan=2><pre><code>$( <i>selector</i> ).geomap( { services: [ {
-  &quot;class&quot;: &quot;osm&quot;,
-  type: &quot;tiled&quot;,
-  src: function( view ) {
-    return &quot;http://tile.openstreetmap.org/&quot; + view.zoom + &quot;/&quot; + view.tile.column + &quot;/&quot; + view.tile.row + &quot;.png&quot;;
-  },
-  attr: &quot;&amp;copy; OpenStreetMap &amp;amp; contributors, CC-BY-SA&quot;,
-  style: {
-    visibility: &quot;visible&quot;,
-    opacity: 1.0
-  }
-} ] } );</code></pre></td>
-        </tr>
-        <tr>
-          <th>get</th>
-          <td><pre><code>var services = $( <i>selector</i> ).geomap( &quot;option&quot;, &quot;services&quot; );</code></pre></td>
-        </tr>
-        <tr>
-          <th>set</th>
-        </tr>
-        <tr>
-          <td colspan=2><pre><code>$( <i>selector</i> ).geomap( &quot;option&quot;, &quot;services&quot;, [ {
-  id: &quot;openstreetmap&quot;,
-  type: &quot;tiled&quot;,
-  src: function( view ) {
-    return &quot;http://tile.openstreetmap.org/&quot; + view.zoom + &quot;/&quot; + view.tile.column + &quot;/&quot; + view.tile.row + &quot;.png&quot;;
-  },
-  attr: &quot;&amp;copy; OpenStreetMap &amp;amp; contributors, CC-BY-SA&quot;
-} ]</pre></code></td>
-        </tr>
-      </table>
-
-      <p>The services option is an array of service objects. The service objects are JavaScript objects that control how the geomap widget displays map images.</p>
-
-      <h2>service object</h2>
-
-      <p>A service object has six properties, two of which are required. The id and class properties are optional but at least one is recommended so you can target specific services with the toggle and opacity methods.</p>
-      <h3>id</h3>
-      <p>Each service can have an id that distinguishes it from other service objects in the array. The id is a string and must be follow the HTML element id naming conditions. If present, the id must be unique across all services in all maps as well as unique from any other HTML element on the page. The default service object of a geomap widget does not have an id.</p>
-      <h3>class</h3>
-      <p>Each service can have a class as well. The class is a string and must be follow the CSS class naming conditions. You can consider this as the class of images the service will supply and usually name it after the service, such as osm, mass-gis, etc. The default service object of a geomap widget has the class: osm.</p>
-      <p>All services also get the class geo-service whether you supply a class to the service object or not. Therefore, the default service is both .osm (as part of its service object) and .geo-service (as added by the widget).</p>
-      <p>Unfortunately, class is a reserved word in JavaScript. When you specify class in your service object, you must quote the word class. This is exactly how it's done in jQuery itself when applying attributes to an element based on an object. To quote the jQuery API:</p>
-      <blockquote>The name &quot;class&quot; must be quoted since it is a JavaScript reserved word, and &quot;className&quot; cannot be used since it is not the correct attribute name.</blockquote>
-      <h3>type</h3>
-      <p>A service object has a type property which is either &quot;tiled&quot; or &quot;shingled&quot;. Tiled servies will get one image request per tile needed to fill a given view when the map refreshes. The tile request's bbox will only be the size of the given tile. Shingled services will get only one image request each time the map refreshes and the bbox will be the extent of the whole map view.</p>
-      <h3>src</h3>
-      <p>The src property of a service object can be one of the following three options:</p>
-      <ul>
-        <li>a function that accepts an object specifying information about the current image request which <b>returns a URL to an image</b> or null to indicate that no image is available or required</li>
-        <li>a function that accepts an object specifying information about the current image request which <b>returns a jQuery Promise object</b> and, later, calls either resolve passing a URL to an image or reject to indicate that no image is available</li>
-        <li>a template string that the geomap widget can use to build a URL itself</li>
-      </ul>
-      <p>For tiled services, the image is placed at the tile location specified. For shingled services, the image will fill the whole map view.</p>
-      <p>If the browser's request of the image results in a 404 status the map will not show that tile or image.</p>
-      <p>When src is a function, the argument to that function has the following properties:</p>
-      <table>
-        <tr>
-          <th>bbox (Array)</th><td>A <a href="http://geojson.org/geojson-spec.html#bounding-boxes" rel="external">GeoJSON bounding box</a> of the current tile or image in map units. The map unit type (projected or geodetic) depends on how you last set the bbox or center options on the geomap widget.</td>
-        </tr>
-        <tr>
-          <th>width (Number)</th><td>The width of the tile or image in pixels.</td>
-        </tr>
-        <tr>
-          <th>height (Number)</th><td>The height of the tile or image in pixels.</td>
-        </tr>
-        <tr>
-          <th>zoom (Number)</th><td>The current zoom level of the map during this request.</td>
-        </tr>
-        <tr>
-          <th>tile (Object)</th><td>If the service is tiled, this object has column and row properties specifying the location of the tile of this request in the current zoom, otherwise it is null.</td>
-        </tr>
-        <tr>
-          <th>index (Number)</th><td>A whole number which is usually incremented between requests that you can use to cycle image URLs to different index, e.g., if there are four servers hosting the same tile images named tile0, tile1, tile2 and tile3 you can target them in your src function with the string: &quot;tile&quot; + (view.index % 4).</td>
-        </tr>
-      </table>
-      <p>You can use the properties of this argument to build and return a URL (or initiate an AJAX request and return a Promise).</p>
-      <p>For more infomration about returning a jQuery Promise, please read the section on <a href="http://api.jquery.com/category/deferred-object/" rel="external">Deferred Objects</a> in the jQuery API documentation. It might useful to know that, as of jQuery 1.5, the <a href="http://api.jquery.com/jQuery.ajax/" rel="external">$.ajax method</a> returns a Promise object. If your ajax call returns a URL to an image, your src function can look something like this:</p>
-      <pre><code>src: function ( view ) { return $.ajax( { ... } ); }</code></pre>
-      <p>When src is a string, those same properties can be used in the template by surrounding each property with: {{:propertyName}}.</p>
-
-      <p>The default value for src is a function because it is slightly faster than rendering a template and we have better control of the view.index property. However, as an example, we can rewrite the default src function as a template string:</p>
-
-      <p><b>Note: Alpha releases used a {{= }} syntax but there is a breaking change in the beta version due to <a href="http://www.borismoore.com/2012/03/approaching-beta-whats-changing-in_06.html" rel="external">changes in jsRender</a>. Please use the new {{: }} syntax.</b></p>
-
-      <pre><code>src: &quot;http://otile1.mqcdn.com/tiles/1.0.0/osm/{{:zoom}}/{{:tile.column}}/{{:tile.row}}.png&quot;</code></pre>
-
-      <p>A couple advantages of using a string are that it is more concise and, unlike a function, can be stored as JSON.</p>
-
-      <p>You do not have to have template parameters in the string, so if you want a static map image, you can set src to a static URL.</p>
-
-      <h3>attr</h3>
-
-      <p>The attr property is optional. It stands for attribution and is a way to give credit to the source of your map imagery. It defaults to an empty string if not specified in a service object. When present, the map widget displays the HTML provided on the bottom-left corner of the map when the service is visible. Users can click links but cannot interact with all other text or images.</p>
-      <h3>style</h3>
-      <p>The style property is optional. It contains presentation options for the service.</p>
-
-      <p>The visibility property defaults to &quot;visible&quot;. It determines whether or not the map will show images from this service while refreshing. You can change the visibility of a service either by changing the visibility property of the service object to &quot;visible&quot; or &quot;hidden&quot; and then setting geomap's services option or by using the toggle method of the geomap widget. The latter is recommended because it is a lot faster and does not cause services to be recreated.</p>
-
-      <p>The opacity defaults to 1.0. It determines how transparent a service is when it is visible. Valid values are floating point numbers between 0 and 1 inclusive. Services with an opacity of 0 will not show on the map even if visible is true. You can change the opacity of a service either by changing the opacity property of the service object and then setting geomap's services option or by using the opacity method of the geomap widget. The latter is recommended because it is a lot faster and does not cause services to be recreated.</p>
-
-      <h2>modifying services</h2>
-
-      <p>By default, the geomap widget starts with one service object in the services array. The default service object will display OpenStreetMap data via <a href="http://open.mapquest.com/" rel="external" target="_blank">mapquest open</a> tiles. Setting the services option will replace all existing services with a new set that you specify. You can set a specific part of of a specific service by getting the current array, modifying, adding, or deleting one of the service objects and then re-setting the services option with the modified array.</p>
-
-      <p><b>Note: It is always better to set the services option once, during init, rather than adding or modifying services after the map has been created.</b> Some of the following samples show that it is possible to modify the services option after map initialization through the services option even though it's not recommended.</p>
-
-      <pre><code><span class="comment">// create a map</span>
-var map = $( &quot;#map&quot; ).geomap( );
-
-<span class="comment">// get the current services array</span>
-var services = map.geomap( &quot;option&quot;, &quot;services&quot; );
-
-<span class="comment">// add a service</span>
-services.push( {
-  id: &quot;Ortho_MapQuest&quot;,
-  type: &quot;tiled&quot;,
-  src: function (view) {
-    return &quot;http://oatile&quot; + ((view.index % 4) + 1) + &quot;.mqcdn.com/naip/&quot; + view.zoom + &quot;/&quot; + view.tile.column + &quot;/&quot; + view.tile.row + &quot;.png&quot;;
-  },
-  attr: &quot;&lt;p&gt;Tiles Courtesy of &lt;a href='http://www.mapquest.com/' target='_blank'&gt;MapQuest&lt;a&gt; &lt;img src='http://developer.mapquest.com/content/osm/mq_logo.png'&gt;&lt;p&gt;&quot;
-} );
-
-<span class="comment">// hide the first service in the services array</span>
-services[ 0 ].style.visibility = &quot;hidden&quot;;
-
-<span class="comment">// re-set the services option</span>
-map.geomap( &quot;option&quot;, &quot;services&quot;, services );</code></pre>
-
-      <p>The following code is more efficient than the last sample:</p>
-
-      <pre><code><span class="comment">// build an array of service objects ahead of time</span>
-var services = [ {
-  id: &quot;OSM&quot;,
-  type: &quot;tiled&quot;,
-  src: &quot;http://tile.openstreetmap.org/{{:zoom}}/{{:tile.column}}/{{:tile.row}}.png&quot;,
-  attr: &quot;&amp;copy; OpenStreetMap &amp;amp; contributors, CC-BY-SA&quot;
-  style: { visibility: &quot;hidden&quot; } <span class="comment">// default to hidden</span>
-}, {
-  id: &quot;Ortho_MapQuest&quot;,
-  type: &quot;tiled&quot;,
-  src: function (view) {
-    return &quot;http://oatile&quot; + ((view.index % 4) + 1) + &quot;.mqcdn.com/naip/&quot; + view.zoom + &quot;/&quot; + view.tile.column + &quot;/&quot; + view.tile.row + &quot;.png&quot;;
-  },
-  attr: &quot;&lt;p&gt;Tiles Courtesy of &lt;a href='http://www.mapquest.com/' target='_blank'&gt;MapQuest&lt;a&gt; &lt;img src='http://developer.mapquest.com/content/osm/mq_logo.png'&gt;&lt;p&gt;&quot;
-} ];
-
-<span class="comment">// create a map with all services in place</span>
-var map = $( &quot;#map&quot; ).geomap( { services: services } );</code></pre>
-
-      <p>To change visibility or opacity of a service after you have created the map, you should use the <a href="toggle.html">toggle</a> or <a href="opacity.html">opacity</a> methods.
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/shapeStyle.html b/libs/js/jquery-geo-1.0b2/docs/geomap/shapeStyle.html
deleted file mode 100755 (executable)
index 7a77baa..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>shapeStyle | geomap</title>
-  <meta name="description" content="geomap shapeStyle option">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="shapeStyle" data-role="page">
-    <div data-role="header" data-theme="f">
-      <h1>shapeStyle</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>Object ( geomap style )</td>
-        </tr>
-        <tr>
-          <th>default</th>
-          <td><pre><code>{
-  borderRadius: &quot;8px&quot;,
-  color: &quot;#7f0000&quot;,
-  fillOpacity: .2,
-  height: &quot;8px&quot;,
-  opacity: 1,
-  strokeOpacity: 1,
-  strokeWidth: &quot;2px&quot;,
-  visibility: &quot;visible&quot;,
-  width: &quot;8px&quot;
-}</code></pre>
-          </td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><pre><code>$( <i>map or service selector</i> ).geomap( { shapeStyle: { color: &quot;green&quot; } } );</code></pre></td>
-        </tr>
-        <tr>
-          <th>get</th>
-          <td><pre><code>var shapeStyle = $( <i>map or service selector</i> ).geomap( &quot;option&quot;, &quot;shapeStyle&quot; );</code></pre></td>
-        </tr>
-        <tr>
-          <th>set</th>
-          <td><pre><code>$( <i>map or service selector</i> ).geomap( &quot;option&quot;, &quot;shapeStyle&quot;, { strokeWidth: &quot;4px&quot; } );</code></pre></td>
-        </tr>
-      </table>
-      <p>The shapeStyle option retrieves or updates the <i>base</i> style of shapes appended to the map.</p>
-      <p>This differs from the drawStyle option which defines the style of incomplete lines and polygons as they are being drawn.</p>
-      <p>Two extra color properties, stroke and fill, are not defined by default and use the value of the color property until they are defined individually.</p>
-      <p>This option changes specific properties of the internal base style. If you send an incomplete style object, only the style properties you reference are updated.</p>
-      <p>Similar to CSS, you can override this style on a per-shape basis by passing a different style to the append method.</p>
-      <p>Changing this base style will update how geomap draws existing shapes that do not have their own style. For shapes that do have their own style, changing the base shapeStyle will update any style properties not referenced in the shape-specific style. For example, assume the following:</p>
-      <ol>
-        <li>
-          <span>the base shapeStyle starts with its initial style having a red stroke color and strokeWidth of 2px</span>
-          <pre><code>$( &quot;#map&quot; ).geomap( );</code></pre>
-        </li>
-        <li>
-          <span>you call append with a style that increases the stroke width to 4px but does not supply a stroke color</span>
-          <pre><code>$( &quot;#map&quot; ).geomap(
-  &quot;append&quot;,
-  { type: &quot;Point&quot;, coordinates: [ -71, 42 ] },
-  { strokeWidth: &quot;4px&quot; }
-);</code></pre>
-        </li>
-        <li>
-          <span>you later change the base shapeStyle's stroke color to blue</span>
-          <pre><code>$( &quot;#map&quot; ).geomap( &quot;option&quot;, &quot;shapeStyle&quot;, { stroke: &quot;#00f&quot; } );</code></pre>
-        </li>
-      </ol>
-      <p>The shape described in the above example will draw with a blue stroke color and a strokeWidth of 4px.</p>
-      <p>You can also set a base style for a specific service. These are called service-level styles and apply only to service-level shapes. To do this, target a service inside a map instead of the map itself for your call to geomap's shapeStyle option. To expand upon the above example, consider the following additional steps:</p>
-      <ol start="4">
-        <li>
-          <span>you change the shapeStyle option of the default service specifically so that points are twice as long as usual; the default service has the CSS class: osm</span>
-          <pre><code>$( &quot;#map .osm&quot; ).geomap( &quot;option&quot;, &quot;shapeStyle&quot;, { width: &quot;16px&quot; } )</code></pre>
-        </li>
-        <li>
-          <span>you append a second point directly to the default .osm service</span>
-          <pre><code>$( &quot;#map .osm&quot; ).geomap( 
-  &quot;append&quot;,
-  { type: &quot;Point&quot;, coordinates: [ -70.5, 42.5 ] }
-);</code></pre>
-        </li>
-      </ol>
-      <p>This second point will:</p>
-      <ul>
-        <li>have a blue stroke color because it cascades from the base shapeStyle for the map as a whole (which you set with your first call to shapeStyle)</li>
-        <li>have a strokeWidth of only 2px because it is unaffected by the style applied to the first shape during the first append call</li>
-        <li>have a width of 16px which it gets from the shapeStyle of the service where it was appended</li>
-      </ul>
-      <p>This is the only option that can be applied to services. All other options require a reference to the original map element.</p>
-      <p>When called with a second argument to set the shapeStyle, the jQuery UI widget factory returns the original jQuery collection to maintain call chaining.</p>
-      <p>Please see the style section at the bottom of the <a href="#" onclick="javascript:window.history.back();">geomap widget</a> page for more information about the style object.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/shift.html b/libs/js/jquery-geo-1.0b2/docs/geomap/shift.html
deleted file mode 100755 (executable)
index 8580bc3..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>shift | geomap</title>
-  <meta name="description" content="geomap shift option">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="shift" data-role="page">
-    <div data-role="header" data-theme="f">
-      <h1>shift</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>String</td>
-        </tr>
-        <tr>
-          <th>default</th>
-          <td>&quot;default&quot;</td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><pre><code>$( <i>map selector</i> ).geomap( { shift: &quot;default&quot; } );</code></pre></td>
-        </tr>
-        <tr>
-          <th>get</th>
-          <td><pre><code>var shift = $( <i>map selector</i> ).geomap( &quot;option&quot;, &quot;shift&quot; );</code></pre></td>
-        </tr>
-        <tr>
-          <th>set</th>
-          <td><pre><code>$( <i>map selector</i> ).geomap( &quot;option&quot;, &quot;shift&quot;, &quot;off&quot; );</code></pre></td>
-        </tr>
-      </table>
-
-      <p>The shift option determines how the shift key affects the map during drag operations in different modes. There are currently four values: zoom, dragBox, default, and off.</p>
-      
-      <h2>zoom</h2>
-
-      <p>When shift is set to zoom and a user holds the shift key before holding the mouse button down, the map temporarily switches to zoom mode. In this state the user can perform a marquee zoom by clicking and holding one point and dragging the mouse cursor. A box will form. When the user lets go of the mouse, the map will zoom to the closest approximation of the bbox of the drawn shape.</p>
-
-      <h2>dragBox</h2>
-
-      <p>When shift is set to dragBox and a user holds the shift key before holding the mouse button down, the map temporarily switches to dragBox mode. In this state the user can click and hold one point and then drag the mouse cursor. A box will form. When the user lets go of the mouse, jQuery Geo will trigger a shape event passing a GeoJSON Polygon representation of the dragged bbox as the geo argument. The Polygon object also has the GeoJSON the bbox property.</p>
-
-      <h2>default</h2>
-
-      <p>When shift is set to default, it behaves like dragBox when the mode option is dragBox and behaves like zoom in all other modes. For example, a shift-drag in pan mode will temporarily switch the map to zoom mode (thus zooming the map and triggering a bboxchange event) while a shift-drag in dragBox mode will stay in dragBox mode (thus triggering a shape event).</p>
-
-      <h2>off</h2>
-
-      <p>When shift is set to off, the shift key is ignored. For example, if mode is pan and the user holds the shift key and begins to drag, the map will pan as normal.</p>
-
-      <h2>static maps</h2>
-
-      <p>When the map's mode option is set to static, the map ignores all user interaction so the shift key is also ignored.</p>
-
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/tilingScheme.html b/libs/js/jquery-geo-1.0b2/docs/geomap/tilingScheme.html
deleted file mode 100755 (executable)
index 440819d..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>tilingScheme | geomap</title>
-  <meta name="description" content="geomap tilingScheme property">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="tilingScheme" data-role="page">
-    <div data-role="header" data-theme="f">
-      <h1>tilingScheme</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>Object</td>
-        </tr>
-        <tr>
-          <th>default</th>
-          <td><pre><code>{
-  tileWidth: 256,
-  tileHeight: 256,
-  levels: 18,
-  basePixelSize: 156543.03392799936,
-  pixelSizes: null,
-  origin: [ -20037508.342787, 20037508.342787 ]
-}</code></pre></td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><code><pre>$( <i>selector</i> ).geomap( { tilingScheme: {
-  tileWidth: 256,
-  tileHeight: 256,
-  levels: 18,
-  basePixelSize: 156543.03392799936,
-  pixelSizes: null,
-  origin: [ -20037508.342787, 20037508.342787 ]
-} } );</pre></code></td>
-        </tr>
-        <tr>
-          <th>get</th>
-          <td><code><pre>var tilingScheme = $( <i>selector</i> ).geomap( &quot;option&quot;, &quot;tilingScheme&quot; );</pre></code></td>
-        </tr>
-        <tr>
-          <th>set</th>
-          <td><code><pre>$( <i>selector</i> ).geomap( &quot;option&quot;, &quot;tilingScheme&quot;, null );</pre></code></td>
-        </tr>
-      </table>
-
-      <p>The tilingScheme property defines a grid that the geomap widget can use to build a map view as adjacent tiles instead of a single, full image each time.</p>
-
-      <p>Only tiled services will get a non-null tile property as an argument to their src method or template. Shingled services, even when layered on top of a tiled map will only get bbox data.</p>
-
-      <p>When a tilingScheme is set, the geomap widget will limit the user to specific zoom levels defined by the tiling scheme.</p>
-
-      <p><b>If you set tilingScheme to null, you must explicitly set <a href="bboxMax.html">bboxMax</a>.</b></p>
-
-      <p><b>Also, if you are using only shingled services you must set tilingScheme to null, and therefore explicitly set bboxMax.</b></p>
-
-      <p>You can set the map widget to be fully dynamic and allow any arbitrary zoom level by setting the tilingScheme to null. This is only useful if all of your services are backed by live spatial data and can produce map images at any scale.</p>
-
-      <p>This is one of the few places where you must use non-geodetic (i.e., non-lon/lat) units even if you are using longitude &amp; latitude for properties such as center or bbox. You must use projected units when defining a tiling scheme. The default map tiles use web mercator meters.</p>
-
-      <p>All tilingScheme objects have the first three of the following properties. Apart from those, a tilingScheme object must have either <b>just</b> the pixelSizes property or <b>both</b> basePixelSize &amp; levels.</p>
-
-      <table>
-        <tr><th>tileWidth (Number)</th><td>the width in pixels of a single tile</td></tr>
-        <tr><th>tileHeight (Number)</th><td>the height in pixels of a single tile</td></tr>
-        <tr><th>origin (Array&lt;Number&gt;)</th><td>a <a href="http://geojson.org/geojson-spec.html#positions" rel="external">GeoJSON position</a> for the top-left corner of the map tiles in map units, this is used to correctly position tiles into the map view</td></tr>
-        <tr><th>pixelSizes (Array&lt;Number&gt;)</th><td>an array of all pixel sizes (called resolutions on Esri's products) hosted by the map service, each one represents a zoom level therefore the total number of zoom levels equals the length of the pixelSizes array</td></tr>
-        <tr><th>basePixelSize (Number)</th><td>the pixelSize represented by the tiles on zoom level 0, used when each pixelSize is a power of two smaller than the previous one</td></tr>
-        <tr><th>levels (Number)</th><td>the total number of pixelSizes allowed, used in conjuction with basePixelSize to determine how far a user is allowed to zoom</td></tr>
-      </table>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/toMap.html b/libs/js/jquery-geo-1.0b2/docs/geomap/toMap.html
deleted file mode 100755 (executable)
index 8b334ea..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>toMap | geomap</title>
-  <meta name="description" content="geomap toMap method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="toMap" data-role="page">
-    <div data-role="header" data-theme="e">
-      <h1>toMap</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>Array (<a href="http://geojson.org/geojson-spec.html#positions" rel="external">GeoJSON positions</a>)</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>.geomap( &quot;toMap&quot;, Array pixelPositions )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>var mapPos = $(&quot;#map&quot;).geomap( &quot;toMap&quot;, [ 120, 240 ] )
-var mapPositions = $(&quot;#map&quot;).geomap( &quot;toMap&quot;, [ [ 120, 240 ], [ 192, 48 ] ] )</code></pre></td>
-        </tr>
-      </table>
-      <p>The toMap method takes a single pixel position (which is an array of two values: the left and top of the pixel), an array of pixel positions, an array of arrays of pixel positions, or an array of arrays of arrays of pixel positions. In other words, it accepts the pixel representation of the coordinates of any geometry up to MultiPolygon. It returns the map coordinates for all of the pixel positions.</p>
-      <p>The return coordinates are in projected map units if you have previously set the bbox or center options using projected coordinates. Otherwise, they are in geodetic (lon, lat) coordinates.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/toPixel.html b/libs/js/jquery-geo-1.0b2/docs/geomap/toPixel.html
deleted file mode 100755 (executable)
index 1ec09b0..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>toPixel | geomap</title>
-  <meta name="description" content="geomap toPixel method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="toPixel" data-role="page">
-    <div data-role="header" data-theme="e">
-      <h1>toPixel</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>Array (<a href="http://geojson.org/geojson-spec.html#positions" rel="external">GeoJSON positions</a>)</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>.geomap( &quot;toPixel&quot;, Array mapPositions )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>var pixelPos = $(&quot;#map&quot;).geomap( &quot;toPixel&quot;, [ -71.098709, 42.330322 ] )
-var pixelPositions = $(&quot;#map&quot;).geomap( &quot;toPixel&quot;, [ [ -71.098709, 42.330322 ], [ -71.072617, 42.351608 ] ] )</code></pre></td>
-        </tr>
-      </table>
-      <p>The toPixel method takes a single GeoJSON position (Point.coordinates), an array of GeoJSON positions (MultiPoint.coordinates or LineString.coordinates), an array of arrays of positions (MultiLineString.coordinates or Polygon.coordinates) or an array of arrays of arrays of positions (MultiPolygon.coordinates). It returns the pixel coordinates for all of the map positions.</p>
-      <p>You can pass geodetic (lon, lat) or projected coordinates regardless of how you last set the bbox or center options.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/toggle.html b/libs/js/jquery-geo-1.0b2/docs/geomap/toggle.html
deleted file mode 100755 (executable)
index 5fed83c..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>toggle | geomap</title>
-  <meta name="description" content="geomap toggle method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="toggle" data-role="page">
-    <div data-role="header" data-theme="e">
-      <h1>toggle</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>undefined</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>$( <i>map or service selector</i> ).geomap( &quot;toggle&quot; [ , Boolean show_or_hide ] )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>$(&quot;#map&quot;).geomap( &quot;toggle&quot; )
-$(&quot;#map .osm&quot;).geomap( &quot;toggle&quot;, false )</code></pre>
-          </td>
-        </tr>
-      </table>
-      <p>This method toggles or sets the visibility property of service objects in the services array.</p>
-      <p>If you call toggle directly on geomap's div element, it will apply to all services. You can target individual services using a CSS selector based on the map div id and the class supplied for the service in its service object or just the id of the service if supplied in its service object.</p>
-      <pre><code>// for example, given the following as the map div
-&lt;div id=&quot;map&quot;&gt;&lt;/div&gt;
-
-// and initializing geomap with the following services
-$(&quot;#map&quot;).geomap({
-  services: [
-    {
-      id: &quot;water&quot;,
-      class: &quot;mass-gis&quot;,
-      type: &quot;shingled&quot;,
-      src: function ( view ) { return null; }
-    },
-    {
-      id: &quot;towns&quot;,
-      class: &quot;mass-gis&quot;,
-      type: &quot;shingled&quot;,
-      src: function ( view ) { return null; }
-    },
-    {
-      id: &quot;harbor-cruise&quot;,
-      type: &quot;shingled&quot;,
-      src: function ( view ) { return null; }
-    }
-  ]
-});
-
-// you can later hide all services
-$(&quot;#map&quot;).geomap(&quot;toggle&quot;, false);
-
-// all mass-gis services
-$(&quot;#map .mass-gis&quot;).geomap(&quot;toggle&quot;, false);
-
-// or a specific service
-$(&quot;#harbor-cruise&quot;).geomap(&quot;toggle&quot;, false);</code></pre>
-      <p>If the optional boolean value is not supplied, the visibility of the services will be toggled.</p>
-      <p>The change will happen immediately and you do not need to call refresh. This is recommended over manually changing the visibility property of the service object as it does not cause other services to refresh.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/zoom.html b/libs/js/jquery-geo-1.0b2/docs/geomap/zoom.html
deleted file mode 100755 (executable)
index ee62611..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>zoom | geomap</title>
-  <meta name="description" content="geomap zoom option">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="zoom" data-role="page">
-    <div data-role="header" data-theme="f">
-      <h1>zoom</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>Number</td>
-        </tr>
-        <tr>
-          <th>default</th>
-          <td>0</td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><pre><code>$( <i>selector</i> ).geomap( { zoom: 0 } );</code></pre></td>
-        </tr>
-        <tr>
-          <th>get</th>
-          <td><pre><code>var zoom = $( <i>selector</i> ).geomap( &quot;option&quot;, &quot;zoom&quot; );</code></pre></td>
-        </tr>
-        <tr>
-          <th>set</th>
-          <td><pre><code>$( <i>selector</i> ).geomap( &quot;option&quot;, &quot;zoom&quot;, 7 );</code></pre></td>
-        </tr>
-      </table>
-
-      <p>The zoom option gets or sets the current zoom of the map view.</p>
-
-      <p>For tiled maps, the zoom option's range starts at zero and goes to either the current geomap tilingScheme's levels property minus one or the length of the tilingScheme's pixelSize array (depending on how the tilingScheme option is declared).</p>
-      
-
-      <p>For non-tiled maps, i.e., tilingScheme is null and you're using all shingled services, the zoom option is based on the ratio between sizes of the bbox and bboxMax properties. If they are equal, the zoom option is 0. Smaller bbox areas will have larger zoom values.</p>
-
-      <p>If you attempt to initialize both zoom and bbox at the same time when creating a geomap widget, bbox will be applied and zoom will modify the final bbox.</p>
-
-      <p>Apart from setting the zoom option directly, you can use the <a href="zoommethod.html">zoom method</a> to change the zoom by relative amounts.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/zoomMax.html b/libs/js/jquery-geo-1.0b2/docs/geomap/zoomMax.html
deleted file mode 100755 (executable)
index eec3e55..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>zoomMax | geomap</title>
-  <meta name="description" content="geomap zoomMax option">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="zoomMax" data-role="page">
-    <div data-role="header" data-theme="f">
-      <h1>zoomMax</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>Number</td>
-        </tr>
-        <tr>
-          <th>default</th>
-          <td>Number.POSITIVE_INFINITY</td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><pre><code>$( <i>selector</i> ).geomap( { zoomMax: 17 } );</code></pre></td>
-        </tr>
-        <tr>
-          <th>get</th>
-          <td><pre><code>var zoomMax = $( <i>selector</i> ).geomap( &quot;option&quot;, &quot;zoomMax&quot; );</code></pre></td>
-        </tr>
-        <tr>
-          <th>set</th>
-          <td><pre><code>$( <i>selector</i> ).geomap( &quot;option&quot;, &quot;zoomMax&quot;, 7 );</code></pre></td>
-        </tr>
-      </table>
-
-      <p>The zoomMax option gets or sets the maximum value of the <a href="zoom.html">zoom option</a> for the map.</p>
-
-      <p>For tiled maps, this option overrides the <a href="tilingScheme.html">tilingScheme option</a> when it is smaller than what you've specified in the tilingScheme. For example, if the tilingScheme has a total of 18 levels but you set the zoomMax option to 7, the user will not be able to zoom in past level 7.</p>
-
-      <p>For non-tiled maps, i.e., tilingScheme is null and you're using all shingled services, this option determines the maximum zoom (and therefore minimum pixelSize) a user can achieve. Without setting this option for non-tiled maps, users will be able to infinitely zoom in to fully dynamic maps which is likely not what you want. Non-tiled maps require the <a href="bboxMax.html">bboxMax option</a> to determine what zoom level 0 means. This option represents the other side of the zoom range.</p>
-
-      <p>This option also overrides programmatic changes. If zoomMax is 7 and you try to set the zoom option to 8 using JavaScript, it will be set to 7 instead.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/zoomMethod.html b/libs/js/jquery-geo-1.0b2/docs/geomap/zoomMethod.html
deleted file mode 100755 (executable)
index 8f13e22..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>zoom | geomap</title>
-  <meta name="description" content="geomap zoom method">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="zoomMethod" data-role="page">
-    <div data-role="header" data-theme="e">
-      <h1>zoom</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>return type</th>
-          <td>undefined</td>
-        </tr>
-        <tr>
-          <th>syntax</th>
-          <td>.geomap( &quot;zoom&quot;, Number numberOfLevels )</td>
-        </tr>
-        <tr>
-          <th>usage</th>
-          <td><pre><code>$(&quot;#map&quot;).geomap( &quot;zoom&quot;, 1 )
-$(&quot;#map&quot;).geomap( &quot;zoom&quot;, -2 )</code></pre></td>
-        </tr>
-      </table>
-      <p>The zoom method can zoom the map in or out by a given number of zoom levels. Positive values zoom the map in, negative values zoom the map out.</p>
-      <p>This method will not zoom out beyond zoom level 0. If you are using a tiling scheme, this method will not zoom in past the maximum number of zoom levels defined in the tilingScheme property.</p>
-      <p>This method accepts values <b>relative</b> to the map's current zoom level. This is different than the zoom property, which <b>is</b> the map's current zoom level.
-        It might be useful to add an explicit plus sign when using this zoom method.</p>
-      <pre><code>// set the map to zoom level 2
-$(&quot;#map&quot;).geomap( &quot;option&quot;, &quot;zoom&quot;, 2 );
-
-// zoom the map in 2 levels from its current zoom
-$(&quot;#map&quot;).geomap( &quot;zoom&quot;, +2 );</code></pre>
-      <p>This method does not trigger events, not even bboxchange.</p>
-      <p>There is no default value. Passing null or undefined will not change the map's zoom.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/geomap/zoomMin.html b/libs/js/jquery-geo-1.0b2/docs/geomap/zoomMin.html
deleted file mode 100755 (executable)
index ecbc812..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>zoomMin | geomap</title>
-  <meta name="description" content="geomap zoomMin option">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="zoomMin" data-role="page">
-    <div data-role="header" data-theme="f">
-      <h1>zoomMin</h1>
-    </div>
-    
-    <div data-role="content">
-      <table>
-        <tr>
-          <th>type</th>
-          <td>Number</td>
-        </tr>
-        <tr>
-          <th>default</th>
-          <td>0</td>
-        </tr>
-        <tr>
-          <th>init</th>
-          <td><pre><code>$( <i>selector</i> ).geomap( { zoomMin: 5 } );</code></pre></td>
-        </tr>
-        <tr>
-          <th>get</th>
-          <td><pre><code>var zoomMin = $( <i>selector</i> ).geomap( &quot;option&quot;, &quot;zoomMin&quot; );</code></pre></td>
-        </tr>
-        <tr>
-          <th>set</th>
-          <td><pre><code>$( <i>selector</i> ).geomap( &quot;option&quot;, &quot;zoomMin&quot;, 7 );</code></pre></td>
-        </tr>
-      </table>
-
-      <p>The zoomMin option gets or sets the smallest allowed value of the <a href="zoom.html">zoom option</a> for the map.</p>
-
-      <p>For tiled maps, this option overrides the <a href="tilingScheme.html">tilingScheme option</a> when it is larger than zero. For example, a tilingScheme always defines what zoom level 0 is, but if you set the zoomMin option to 7, the user will not be able to zoom out past level 7.</p>
-
-      <p>For non-tiled maps, i.e., tilingScheme is null and you're using all shingled services, this option determines the minimum zoom (and therefore maximum pixelSize) a user can achieve. Non-tiled maps require the <a href="bboxMax.html">bboxMax option</a> to determine what zoom level 0 means. This option overrides the map's ability to get to zoom level 0. It is not so useful for non-tiled maps, as you can just set a smaller bboxMax and continue using 0 as the minimum zoom.</p>
-
-      <p>This option also overrides programmatic changes. If zoomMin is 2 and you try to set the zoom option to 0 using JavaScript, it will be set to 2 instead.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/html/index.html b/libs/js/jquery-geo-1.0b2/docs/html/index.html
deleted file mode 100755 (executable)
index 0ee93d9..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>html | jQuery Geo</title>
-  <meta name="description" content="jQuery Geo html requirements">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="html" data-role="page">
-    <div data-role="header" data-theme="b">
-      <h1>html</h1>
-    </div>
-    
-    <div data-role="content">
-      <p>Our geospatial plugin's only widget is a geographic map that you can create on any div with a computable width and height.</p>
-      <pre><code>&lt;div style=&quot;width: 640px; height: 480px;&quot;&gt;&lt;/div&gt;</code></pre>
-      <p>If the div is not already in relative, absolute or fixed position, the widget will force relative positioning.</p>
-      <h2>fullscreen</h2>
-      <p>The div size does not have to be so specific.</p>
-      <pre><code>&lt;div style=&quot;position: fixed; top: 0; right: 0; bottom: 0; left: 0;&quot;&gt;&lt;/div&gt;</code></pre>
-      <p>As in the above example, you can have the map fill the window by setting position to either absolute or fixed and the top, right, bottom and left properties to all zero. The map will follow the size of the window and recenter when the size of the window changes.</p>
-      <p>Fixed position is preferred because it will not create scroll bars when making the window smaller. However, keep in mind that fixed position is not supported by IE6 and can be odd on some mobile browsers. If you do use absolute position, you can set the overflow style property on the body element to hidden and avoid scroll bars.</p>
-      <pre><code>&lt;body style=&quot;overflow: hidden;&quot;&gt;
-  &lt;div style=&quot;position: absolute; top: 0; right: 0; bottom: 0; left: 0;&quot;&gt;&lt;/div&gt;
-&lt;/body&gt;</code></pre>
-      <h2>box model</h2>
-      <p>The map supports divs that have padding, borders and margins. The plugin will create the map where text would normally go in such a situation, i.e., the map content will be inset from the border by the padding amount.</p>
-      <pre><code>&lt;style&gt;
-  #map {
-    width: 90%;
-    max-width: 640px;
-    height: 480px;
-    padding: 8px;
-    border: solid 3px #444;
-    margin: .5em;
-    background: #ddf;
-  }
-&lt;/style&gt;
-&lt;div id=&quot;map&quot;&gt;O HAI&lt;/div&gt;</code></pre>
-      <div style="width: 90%; max-width: 640px; height: 128px; padding: 8px; border: solid 3px #444; margin: .5em; background: #ddf;">O HAI</div>
-      <h2>inner elements</h2>
-      <p>Any elements inside the map div can be absolutely positioned and will not interfere with map operation. Map images will appear beneath them. This is useful if you want to layout a scale bar for example.</p>
-      <pre><code>&lt;style&gt;
-  #bar {
-    position: absolute;
-    top: 10px;
-    right: 10px;
-    padding: 16px;
-    background: red;
-    opacity: .8;
-    border-radius: 8px;
-    text-align: center;
-    font-size: 10px;
-  }
-  #bar div {
-    width: 96px;
-    height: 2px;
-    margin-bottom: 8px;
-    background: #444;
-    color: #444;
-  }
-&lt;/style&gt;
-&lt;div id=&quot;map&quot;&gt;&lt;div id=&quot;bar&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;span&gt;1134 meters&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;</code></pre>
-
-      <div class="geomap-indoc" style="position: relative; width: 90%; max-width: 640px; height: 128px; padding: 8px; border: solid 3px #444; margin: .5em; background: red;"><div style="position: absolute; top: 10px; right: 10px; padding: 16px; background: #ccc; opacity: .8; border-radius: 8px; text-align: center; font-size: 10px;"><div style="width: 96px; height: 2px; margin-bottom: 8px; background: #444; color: #444;"></div><span>1134 meters</span></div></div>
-
-      <p>This rather large scale bar will not interfere with a user trying to pan the map. Ignore the scale bar value in this example, it's static text.</p>
-
-      <h2>mobile</h2>
-      <p>The geomap widget works on modern mobile browsers without any additional JavaScript. However, some web design is necessary. For starters, as with any mobile development you should add a viewport meta tag into your head element. This should appear above most other tags so the mobile browser can get ready for a mobile page before doing any other work.</p>
-
-      <pre><code>&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, minimum-scale=1&quot;&gt;</code></pre>
-
-      <p>For a fullscreen map, you can also add a maximum-scale attribute.</p>
-
-      <pre><code>&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, minimum-scale=1, maximum-scale=1&quot;&gt;</code></pre>
-
-      <p>If you have done any other mobile web developement, you're probably frowning at my decision to disable the default zoom capability of the device's web browser. If you haven't done much with mobile, I am disabling double-tap to zoom a page by setting the min and max scale to 1.</p>
-
-      <p>In almost all other cases, I would agree that disabling browser zoom is a bad user experience, however for a full-screen mapping application, double-tap has a whole new meaning and users expect it to zoom the map itself, not the page. It is in this case only that I suggest you disable browser page zoom. If you are targeting modern mobile browsers such as iOS, Android, Windows Phone 7 or Opera Mobile, you can used fixed positioning and the HTML for the full screen mobile app would look like the first fullscreen example:</p>
-
-      <pre><code>&lt;div style=&quot;position: fixed; top: 0; right: 0; bottom: 0; left: 0;&quot;&gt;&lt;/div&gt;</code></pre>
-
-      <p>Other mobile browsers are currently untested.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/images/$.geo-logo-large.png b/libs/js/jquery-geo-1.0b2/docs/images/$.geo-logo-large.png
deleted file mode 100755 (executable)
index db2ecf1..0000000
Binary files a/libs/js/jquery-geo-1.0b2/docs/images/$.geo-logo-large.png and /dev/null differ
diff --git a/libs/js/jquery-geo-1.0b2/docs/images/$.geo-logo-small.png b/libs/js/jquery-geo-1.0b2/docs/images/$.geo-logo-small.png
deleted file mode 100755 (executable)
index 1a9ad85..0000000
Binary files a/libs/js/jquery-geo-1.0b2/docs/images/$.geo-logo-small.png and /dev/null differ
diff --git a/libs/js/jquery-geo-1.0b2/docs/images/$.geo-logo.png b/libs/js/jquery-geo-1.0b2/docs/images/$.geo-logo.png
deleted file mode 100755 (executable)
index 983402e..0000000
Binary files a/libs/js/jquery-geo-1.0b2/docs/images/$.geo-logo.png and /dev/null differ
diff --git a/libs/js/jquery-geo-1.0b2/docs/images/bostonbuilt.png b/libs/js/jquery-geo-1.0b2/docs/images/bostonbuilt.png
deleted file mode 100755 (executable)
index aa18993..0000000
Binary files a/libs/js/jquery-geo-1.0b2/docs/images/bostonbuilt.png and /dev/null differ
diff --git a/libs/js/jquery-geo-1.0b2/docs/images/map.png b/libs/js/jquery-geo-1.0b2/docs/images/map.png
deleted file mode 100755 (executable)
index d41dc4d..0000000
Binary files a/libs/js/jquery-geo-1.0b2/docs/images/map.png and /dev/null differ
diff --git a/libs/js/jquery-geo-1.0b2/docs/index.html b/libs/js/jquery-geo-1.0b2/docs/index.html
deleted file mode 100755 (executable)
index 1c2dab7..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-<!doctype html>  
-
-<html lang="en">
-<head>
-  <meta charset="utf-8">
-
-  <title>jQuery Geo docs</title>
-  <meta name="description" content="Documentation for jQuery Geo, a JavaScript geospatial mapping plugin from Applied Geographics">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="index" data-role="page" data-theme="b">
-    <div data-role="header">
-      <h1><img src="images/$.geo-logo.png" alt="" />jQuery Geo docs</h1>
-    </div>
-    
-    <div data-role="content">
-      <h2>Welcome!</h2>
-
-      <p>jQuery Geo is an open-source, geospatial mapping jQuery plugin from Applied Geographics developed with the intention of making spatial web mapping significantly simpler than it may initially seem. We would like to point out the term &quot;open-source&quot; to explictly state that Google, Bing, &amp; Esri are generally free but not open.</p>
-
-      <ul data-role="listview" data-inset="true">
-        <li><a href="http://github.com/AppGeo/geo" rel="external">project source on GitHub</a></li>
-      </ul>
-
-      <p>Please read the following sections for more information and examples, and thank you for considering us! If you have any questions feel free to ask the lead developer on Twitter.</p>
-
-      <ul data-role="listview" data-inset="true">
-        <li><a href="https://twitter.com/ryanttb" rel="external">ryanttb on Twitter</a></li>
-      </ul>
-
-      <p>If you would like only release notifications, you can follow the project itself on Twitter.</p>
-
-      <ul data-role="listview" data-inset="true">
-        <li><a href="https://twitter.com/jquerygeo" rel="external">jQueryGeo on Twitter</a></li>
-      </ul>
-
-      <h2>docs</h2>
-
-      <ul data-role="listview" data-inset="true">
-        <li><a href="what/index.html">what?</a></li>
-        <li><a href="quickstart/index.html">quickstart</a></li>
-        <li><a href="html/index.html">html</a></li>
-        <li><a href="geomap/index.html">geomap widget</a></li>
-        <li><a href="geo/index.html">geo namespace</a></li>
-      </ul>
-
-      <p>This project takes pride in having easy-to-use, up-to-date documentation. Before any code is committed, these docs are updated with any public API changes and sometimes internal design decisions. The side effect is that the documenation may be ahead of the code at times. Also, any undocumented features you find in the source should be ignored or asked about.</p>
-
-      <h2>support</h2>
-
-      <p>jQuery Geo supports the following devices and browsers and may work in other un-tested environments.</p>
-
-      <ul>
-        <li>Microsoft Internet Explorer &ndash; IE8 and up</li>
-        <li>Mozilla Firefox &ndash; latest</li>
-        <li>Google Chrome &ndash; latest</li>
-        <li>Apple Safari &ndash; latest</li>
-        <li>Apple Mobile Safari &ndash; latest</li>
-        <li>Google Android Browser &ndash; various; difficult to test all</li>
-      </ul>
-
-      <h2>examples</h2>
-
-      <p>Now that that's out of the way, here are some code examples! Use these as a suppliment to reading the above sections but above all, have fun!</p>
-
-      <h3>&quot;everything&quot; examples</h3>
-
-      <p>These first two examples attempt to let you test as many of jQuery Geo's features as possible on one page. The first link is a tiled map, i.e., it has a tilingScheme, set-in-stone zoom levels, and uses at least one tiled map service object. The second link is a dynamic map, i.e., it does not have a tilingScheme, displays fully dynamic data from MassGIS, and uses all shingled map service objects. The second type of map usually redraws slower but allows for more accurate zooming.</p>
-
-      <ul data-role="listview" data-inset="true">
-        <li><a href="examples/all-tiled.html" rel="external">tiled</a></li>
-        <li><a href="examples/all-shingled.html" rel="external">shingled</a></li>
-      </ul>
-
-      <p>You can find isolated examples of individual jQuery Geo features in the <a href="javascript:document.getElementById('component-examples').scrollIntoView();">component examples</a> section at the bottom of this page.<p>
-
-      <h3>showcase</h3>
-
-      <p>This third set are more complete examples using jQuery Geo. These try to implement slimmed-down versions of an existing applications and test how jQuery Geo can be used in real-world situations.</p>
-
-      <ul data-role="listview" data-inset=true>
-        <li><a href="http://twheat.jquerygeo.com/" rel="external"><h3>Twheat !</h3><p>full implementation of our Twitter heat map demo</p></a></li>
-        <li><a href="examples/utah/index.html" rel="external"><h3>Atlas Utah!</h3><p>implementation of Utah map cache viewer</p></a></li>
-      </ul>
-
-      <h3>demos</h3>
-
-      <p>The examples in this second set of use the features of jQuery Geo in a more interesting way. They attempt to show &amp; test how you can use different parts jQuery Geo together to build apps and how we can integrate with external data and libraries.</p>
-
-      <ul data-role="listview" data-inset=true>
-        <li><a href="examples/inset.html" rel="external">Inset map</a></li>
-        <li><a href="examples/basemaps.html" rel="external">basemap switcher</a></li>
-        <li><a href="examples/logo.html" rel="external">jQuery Geo logos!</a></li>
-        <li><a href="examples/usastates.html" rel="external">USA states</a></li>
-        <li><a href="examples/twitter-heat.html" rel="external">Twitter heat map</a></li>
-        <li><a href="examples/tracking.html" rel="external">GPS tracking</a></li>
-        <li><a href="examples/hurricane.html" rel="external">Hurricane tracking</a></li>
-        <li><a href="examples/image.html" rel="external">Olympic Volleyball GigaPan</a></li>
-        <li><a href="examples/voting.html" rel="external">MA Voting District Demographics</a></li>
-      </ul>
-
-      <h3 id="component-examples">component examples</h3>
-
-      <p>This last set of examples attempts to test various components of jQuery Geo in an insolated way.</p>
-
-      <ul data-role="listview" data-inset="true">
-        <li><a href="examples/simplest.html" rel="external">simplest</a></li>
-        <li><a href="examples/mobile.html" rel="external">mobile</a></li>
-        <li><a href="examples/proj.html" rel="external">proj</a></li>
-        <li><a href="examples/bbox.html" rel="external">bbox</a></li>
-        <li><a href="examples/center.html" rel="external">center, zoom, &amp; pixelSize options</a></li>
-        <li><a href="examples/static.html" rel="external">static mode</a></li>
-        <li><a href="examples/mode-zoom.html" rel="external">zoom mode</a></li>
-        <li><a href="examples/zoom.html" rel="external">zoom method</a></li>
-        <li><a href="examples/panscroll.html" rel="external">pannable &amp; scroll options</a></li>
-        <li><a href="examples/refresh.html" rel="external">refresh</a></li>
-        <li><a href="examples/defer.html" rel="external">deferred tiles</a></li>
-        <li><a href="examples/destroy.html" rel="external">destroy</a></li>
-        <li><a href="examples/insetmap.html" rel="external">another inset map</a></li>
-        <li><a href="examples/tiledservices.html" rel="external">tiled services</a></li>
-        <li><a href="examples/shingled.html" rel="external">shingled (dynamic) services</a></li>
-        <li><a href="examples/stringsrc.html" rel="external">string service src</a></li>
-        <li><a href="examples/tilingScheme.html" rel="external">tilingScheme</a></li>
-        <li><a href="examples/opacity.html" rel="external">opacity &amp; toggle</a></li>
-        <li><a href="examples/events.html" rel="external">events</a></li>
-        <li><a href="examples/append.html" rel="external">append</a></li>
-        <li><a href="examples/shapeStyle.html" rel="external">shapeStyle</a></li>
-        <li><a href="examples/markers.html" rel="external">markers</a></li>
-        <li><a href="examples/kml.html" rel="external">KML points</a></li>
-        <li><a href="examples/find.html" rel="external">find</a></li>
-        <li><a href="examples/remove.html" rel="external">remove</a></li>
-        <li><a href="examples/empty.html" rel="external">empty</a></li>
-        <li><a href="examples/drag.html" rel="external">drag</a></li>
-        <li><a href="examples/draw.html" rel="external">draw</a></li>
-        <li><a href="examples/measure.html" rel="external">measure</a></li>
-        <li><a href="examples/drawStyle.html" rel="external">drawStyle</a></li>
-        <li><a href="examples/label.html" rel="external">label</a></li>
-        <li><a href="examples/geo-geometry.html" rel="external">geometry functions</a></li>
-      </ul>
-
-      <h2>internals</h2>
-
-      <p>Lastly, short of looking through the source code you can read a bit about the internal design decisions we made in the following section.</p>
-
-      <ul data-role="listview" data-inset=true>
-        <li><a href="internals/index.html">internals</a></li>
-      </ul>
-
-      <img src="images/bostonbuilt.png" alt="Boston Built badge"/>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-    
-  <script>
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/docs/internals/index.html b/libs/js/jquery-geo-1.0b2/docs/internals/index.html
deleted file mode 100755 (executable)
index c9143a2..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
-
-  <title>internals | jQuery Geo</title>
-  <meta name="description" content="jQuery Geo internals">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="internals" data-role="page" data-theme="b">
-    <div data-role="header">
-      <h1>internals</h1>
-    </div>
-    
-    <div data-role="content">
-      <p>We keep some plugin design decisions here.</p>
-      <h2>jQuery UI widget factory</h2>
-      <p>The geomap widget uses the same widget factory that all other jQuery UI and jQuery Mobile widgets use. Like jQuery Mobile, we include a copy of jquery.ui.widget.js in the project. While this adds 3k to the final compressed build it allows us to easilly follow the patterns designed by UI and better integrate into the jQuery plugin community.</p>
-      <pre><code>$.widget( "geo.geomap", { } );</code></pre>
-      <h2>Virtual state</h2>
-      <p>The public properties bbox, bboxMax and center do not always match the internal state of the map widget. In fact internally, geomap only tracks center and pixelSize. The bbox and bboxMax properties are calculated based on the current or max center and pixelSize. In the code, you will see two properties each for each of these. One is public, the other is private. For center, the internal position (_center) is always in internal map units (web mercator meters by default) even if the developer sets the public bbox or center by longitude &amp; latitude.</p>
-      <h2>Initialization options</h2>
-      <p>You may notice that we override jQuery UI's _createWidget function in order to capture the options passed in by the user. <a href="http://twitter.com/ryanttb">Let us know</a> if there's a better way to do that. At the end of _create, we iterate over the passed options and set certain internal state values before creating services and refreshing the map. This insures that we handle supplied bbox or center properly. Since bbox and center can potentially conflict, only supply one. If both are supplied the behavior is technically undefined but currently center will override bbox.</p>
-      <h2>bbox cache</h2>
-      <p>When you append a shape to the map, the geomap widget will cache the shape&#39;s bounding box (in non-geodetic 
-        coordinates) for faster searches when you call find. When you remove a shape from the map, the cache will be cleared. When you use the $.geo.bbox method on a shape after it has been appended to the map, the cached bounding box will be returned.</p>
-      <pre><code><span class="comment">// the bbox of an appended shape is cached while it is on the map</span>
-var calculatedBbox = $.geo.bbox(shape);
-$(&quot;#map&quot;).geomap(&quot;append&quot;, shape);
-var cachedBbox = $.geo.bbox(shape);
-$(&quot;#map&quot;).geomap(&quot;remove&quot;, shape);
-var calculatedAgain = $.geo.bbox(shape);</code></pre>
-      <p>jQuery Geo caches the bbox using jQuery's data function under the name geoBbox. Though I can&#39;t think of a reason to do so, you can remove this cache by calling removeData directly on the shape object:</p>
-      <pre><code>$.removeData(shape, &quot;geoBbox&quot;);</code></pre>
-      <p>jQuery Geo's caching will not alter your geometry object so you don't have to worry about unintentionally storing or sending extra data to a server.</p>
-      <h2>External libraries</h2>
-      <p>Apart from the jQuery UI widget factory, geomap includes a couple external libraries.</p>
-      <h3>Mouse wheel extension 3.0.2</h3>
-      <a href="http://plugins.jquery.com/node/7146">http://plugins.jquery.com/node/7146</a>
-      <p>We've found this to be a very stable mousewheel special event plugin and are using it to handle mouse wheel interaction. This plugin's license comment and source are included intact in the minified releases of jQuery Geo.</p>
-      <h3>Google excanvas</h3>
-      <p>We include parts of Google's excanvas library to support graphic drawing in IE6-8. Only functions required to support jQuery Geo's feature list are included. This library&#39;s license comment and source are included intact in the non-minified releases of jQuery Geo. The license comment and partial source are included intact in the minified releases of jQuery Geo.</p>
-      <h3>jsRender</h3>
-      <a href="https://github.com/BorisMoore/jsrender">https://github.com/BorisMoore/jsrender</a>
-      <p>jQuery Geo includes a snapshot of jsRender, the next-generation templating engine from the jQuery team. This is used for measure text templates and src string templates.</p>
-      <h2>Service types</h2>
-      <p>Developers can set the services array used by the geomap widget. When it comes time to draw map images, the geomap widget uses an internal _serviceTypes object. The object contains one property for each service type geomap supports, e.g., tiled and shingled. The type property on each service object determines which serviceType object geomap uses to refresh the service. The following code snippet is a simplification of the relationship.</p>
-      <pre><code>options: {
-  services: [
-    {
-      &quot;class&quot;: &quot;osm&quot;,
-      type: &quot;tiled&quot;
-      /* ,... */
-    }
-  ]
-},
-
-_serviceTypes: {
-  tiled: {
-    refresh: function (map, service) {
-    }
-    /* ,... */
-  }
-}</code></pre>
-      <p>In the future the _serviceTypes property will be public and developers can extend the service types geomap supports.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0a3.js b/libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0a3.js
deleted file mode 100755 (executable)
index 3552d4c..0000000
+++ /dev/null
@@ -1,4826 +0,0 @@
-// excanvas
-// Copyright 2006 Google Inc.
-//
-// 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.
-
-/* 
- * AppGeo/geo 
- * (c) 2007-2011, Applied Geographics, Inc. All rights reserved. 
- * Dual licensed under the MIT or GPL Version 2 licenses. 
- * http://jquery.org/license 
- */ 
-
-// Copyright 2006 Google Inc.
-//
-// 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.
-
-
-// Known Issues:
-//
-// * Patterns only support repeat.
-// * Radial gradient are not implemented. The VML version of these look very
-//   different from the canvas one.
-// * Clipping paths are not implemented.
-// * Coordsize. The width and height attribute have higher priority than the
-//   width and height style values which isn't correct.
-// * Painting mode isn't implemented.
-// * Canvas width/height should is using content-box by default. IE in
-//   Quirks mode will draw the canvas using border-box. Either change your
-//   doctype to HTML5
-//   (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype)
-//   or use Box Sizing Behavior from WebFX
-//   (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html)
-// * Non uniform scaling does not correctly scale strokes.
-// * Optimize. There is always room for speed improvements.
-
-// Only add this code if we do not already have a canvas implementation
-if (!document.createElement('canvas').getContext) {
-
-  (function () {
-
-    // alias some functions to make (compiled) code shorter
-    var m = Math;
-    var mr = m.round;
-    var ms = m.sin;
-    var mc = m.cos;
-    var abs = m.abs;
-    var sqrt = m.sqrt;
-
-    // this is used for sub pixel precision
-    var Z = 10;
-    var Z2 = Z / 2;
-
-    var IE_VERSION = +navigator.userAgent.match(/MSIE ([\d.]+)?/)[1];
-
-    /**
-    * This funtion is assigned to the <canvas> elements as element.getContext().
-    * @this {HTMLElement}
-    * @return {CanvasRenderingContext2D_}
-    */
-    function getContext() {
-      return this.context_ ||
-        (this.context_ = new CanvasRenderingContext2D_(this));
-    }
-
-    var slice = Array.prototype.slice;
-
-    /**
-    * Binds a function to an object. The returned function will always use the
-    * passed in {@code obj} as {@code this}.
-    *
-    * Example:
-    *
-    *   g = bind(f, obj, a, b)
-    *   g(c, d) // will do f.call(obj, a, b, c, d)
-    *
-    * @param {Function} f The function to bind the object to
-    * @param {Object} obj The object that should act as this when the function
-    *     is called
-    * @param {*} var_args Rest arguments that will be used as the initial
-    *     arguments when the function is called
-    * @return {Function} A new function that has bound this
-    */
-    function bind(f, obj, var_args) {
-      var a = slice.call(arguments, 2);
-      return function () {
-        return f.apply(obj, a.concat(slice.call(arguments)));
-      };
-    }
-
-    function encodeHtmlAttribute(s) {
-      return String(s).replace(/&/g, '&amp;').replace(/"/g, '&quot;');
-    }
-
-    function addNamespace(doc, prefix, urn) {
-      if (!doc.namespaces[prefix]) {
-        doc.namespaces.add(prefix, urn, '#default#VML');
-      }
-    }
-
-    function addNamespacesAndStylesheet(doc) {
-      addNamespace(doc, 'g_vml_', 'urn:schemas-microsoft-com:vml');
-      addNamespace(doc, 'g_o_', 'urn:schemas-microsoft-com:office:office');
-
-      // Setup default CSS.  Only add one style sheet per document
-      if (!doc.styleSheets['ex_canvas_']) {
-        var ss = doc.createStyleSheet();
-        ss.owningElement.id = 'ex_canvas_';
-        ss.cssText = 'canvas{display:inline-block;overflow:hidden;' +
-        // default size is 300x150 in Gecko and Opera
-          'text-align:left;width:300px;height:150px}';
-      }
-    }
-
-    // Add namespaces and stylesheet at startup.
-    addNamespacesAndStylesheet(document);
-
-    var G_vmlCanvasManager_ = {
-      init: function (opt_doc) {
-        var doc = opt_doc || document;
-        // Create a dummy element so that IE will allow canvas elements to be
-        // recognized.
-        doc.createElement('canvas');
-        doc.attachEvent('onreadystatechange', bind(this.init_, this, doc));
-      },
-
-      init_: function (doc) {
-        // find all canvas elements
-        var els = doc.getElementsByTagName('canvas');
-        for (var i = 0; i < els.length; i++) {
-          this.initElement(els[i]);
-        }
-      },
-
-      /**
-      * Public initializes a canvas element so that it can be used as canvas
-      * element from now on. This is called automatically before the page is
-      * loaded but if you are creating elements using createElement you need to
-      * make sure this is called on the element.
-      * @param {HTMLElement} el The canvas element to initialize.
-      * @return {HTMLElement} the element that was created.
-      */
-      initElement: function (el) {
-        if (!el.getContext) {
-          el.getContext = getContext;
-
-          // Add namespaces and stylesheet to document of the element.
-          addNamespacesAndStylesheet(el.ownerDocument);
-
-          // Remove fallback content. There is no way to hide text nodes so we
-          // just remove all childNodes. We could hide all elements and remove
-          // text nodes but who really cares about the fallback content.
-          el.innerHTML = '';
-
-          // do not use inline function because that will leak memory
-          el.attachEvent('onpropertychange', onPropertyChange);
-          el.attachEvent('onresize', onResize);
-
-          var attrs = el.attributes;
-          if (attrs.width && attrs.width.specified) {
-            // TODO: use runtimeStyle and coordsize
-            // el.getContext().setWidth_(attrs.width.nodeValue);
-            el.style.width = attrs.width.nodeValue + 'px';
-          } else {
-            el.width = el.clientWidth;
-          }
-          if (attrs.height && attrs.height.specified) {
-            // TODO: use runtimeStyle and coordsize
-            // el.getContext().setHeight_(attrs.height.nodeValue);
-            el.style.height = attrs.height.nodeValue + 'px';
-          } else {
-            el.height = el.clientHeight;
-          }
-          //el.getContext().setCoordsize_()
-        }
-        return el;
-      }
-    };
-
-    function onPropertyChange(e) {
-      var el = e.srcElement;
-
-      switch (e.propertyName) {
-        case 'width':
-          el.getContext().clearRect();
-          el.style.width = el.attributes.width.nodeValue + 'px';
-          // In IE8 this does not trigger onresize.
-          el.firstChild.style.width = el.clientWidth + 'px';
-          break;
-        case 'height':
-          el.getContext().clearRect();
-          el.style.height = el.attributes.height.nodeValue + 'px';
-          el.firstChild.style.height = el.clientHeight + 'px';
-          break;
-      }
-    }
-
-    function onResize(e) {
-      var el = e.srcElement;
-      if (el.firstChild) {
-        el.firstChild.style.width = el.clientWidth + 'px';
-        el.firstChild.style.height = el.clientHeight + 'px';
-      }
-    }
-
-    G_vmlCanvasManager_.init();
-
-    // precompute "00" to "FF"
-    var decToHex = [];
-    for (var i = 0; i < 16; i++) {
-      for (var j = 0; j < 16; j++) {
-        decToHex[i * 16 + j] = i.toString(16) + j.toString(16);
-      }
-    }
-
-    function createMatrixIdentity() {
-      return [
-      [1, 0, 0],
-      [0, 1, 0],
-      [0, 0, 1]
-    ];
-    }
-
-    function matrixMultiply(m1, m2) {
-      var result = createMatrixIdentity();
-
-      for (var x = 0; x < 3; x++) {
-        for (var y = 0; y < 3; y++) {
-          var sum = 0;
-
-          for (var z = 0; z < 3; z++) {
-            sum += m1[x][z] * m2[z][y];
-          }
-
-          result[x][y] = sum;
-        }
-      }
-      return result;
-    }
-
-    function copyState(o1, o2) {
-      o2.fillStyle     = o1.fillStyle;
-      o2.lineCap       = o1.lineCap;
-      o2.lineJoin      = o1.lineJoin;
-      o2.lineWidth     = o1.lineWidth;
-      o2.miterLimit    = o1.miterLimit;
-      o2.shadowBlur    = o1.shadowBlur;
-      o2.shadowColor   = o1.shadowColor;
-      o2.shadowOffsetX = o1.shadowOffsetX;
-      o2.shadowOffsetY = o1.shadowOffsetY;
-      o2.strokeStyle   = o1.strokeStyle;
-      o2.globalAlpha   = o1.globalAlpha;
-      o2.font          = o1.font;
-      o2.textAlign     = o1.textAlign;
-      o2.textBaseline  = o1.textBaseline;
-      o2.arcScaleX_    = o1.arcScaleX_;
-      o2.arcScaleY_    = o1.arcScaleY_;
-      o2.lineScale_    = o1.lineScale_;
-    }
-
-    //  var colorData = {
-    //    aliceblue: '#F0F8FF',
-    //    antiquewhite: '#FAEBD7',
-    //    aquamarine: '#7FFFD4',
-    //    azure: '#F0FFFF',
-    //    beige: '#F5F5DC',
-    //    bisque: '#FFE4C4',
-    //    black: '#000000',
-    //    blanchedalmond: '#FFEBCD',
-    //    blueviolet: '#8A2BE2',
-    //    brown: '#A52A2A',
-    //    burlywood: '#DEB887',
-    //    cadetblue: '#5F9EA0',
-    //    chartreuse: '#7FFF00',
-    //    chocolate: '#D2691E',
-    //    coral: '#FF7F50',
-    //    cornflowerblue: '#6495ED',
-    //    cornsilk: '#FFF8DC',
-    //    crimson: '#DC143C',
-    //    cyan: '#00FFFF',
-    //    darkblue: '#00008B',
-    //    darkcyan: '#008B8B',
-    //    darkgoldenrod: '#B8860B',
-    //    darkgray: '#A9A9A9',
-    //    darkgreen: '#006400',
-    //    darkgrey: '#A9A9A9',
-    //    darkkhaki: '#BDB76B',
-    //    darkmagenta: '#8B008B',
-    //    darkolivegreen: '#556B2F',
-    //    darkorange: '#FF8C00',
-    //    darkorchid: '#9932CC',
-    //    darkred: '#8B0000',
-    //    darksalmon: '#E9967A',
-    //    darkseagreen: '#8FBC8F',
-    //    darkslateblue: '#483D8B',
-    //    darkslategray: '#2F4F4F',
-    //    darkslategrey: '#2F4F4F',
-    //    darkturquoise: '#00CED1',
-    //    darkviolet: '#9400D3',
-    //    deeppink: '#FF1493',
-    //    deepskyblue: '#00BFFF',
-    //    dimgray: '#696969',
-    //    dimgrey: '#696969',
-    //    dodgerblue: '#1E90FF',
-    //    firebrick: '#B22222',
-    //    floralwhite: '#FFFAF0',
-    //    forestgreen: '#228B22',
-    //    gainsboro: '#DCDCDC',
-    //    ghostwhite: '#F8F8FF',
-    //    gold: '#FFD700',
-    //    goldenrod: '#DAA520',
-    //    grey: '#808080',
-    //    greenyellow: '#ADFF2F',
-    //    honeydew: '#F0FFF0',
-    //    hotpink: '#FF69B4',
-    //    indianred: '#CD5C5C',
-    //    indigo: '#4B0082',
-    //    ivory: '#FFFFF0',
-    //    khaki: '#F0E68C',
-    //    lavender: '#E6E6FA',
-    //    lavenderblush: '#FFF0F5',
-    //    lawngreen: '#7CFC00',
-    //    lemonchiffon: '#FFFACD',
-    //    lightblue: '#ADD8E6',
-    //    lightcoral: '#F08080',
-    //    lightcyan: '#E0FFFF',
-    //    lightgoldenrodyellow: '#FAFAD2',
-    //    lightgreen: '#90EE90',
-    //    lightgrey: '#D3D3D3',
-    //    lightpink: '#FFB6C1',
-    //    lightsalmon: '#FFA07A',
-    //    lightseagreen: '#20B2AA',
-    //    lightskyblue: '#87CEFA',
-    //    lightslategray: '#778899',
-    //    lightslategrey: '#778899',
-    //    lightsteelblue: '#B0C4DE',
-    //    lightyellow: '#FFFFE0',
-    //    limegreen: '#32CD32',
-    //    linen: '#FAF0E6',
-    //    magenta: '#FF00FF',
-    //    mediumaquamarine: '#66CDAA',
-    //    mediumblue: '#0000CD',
-    //    mediumorchid: '#BA55D3',
-    //    mediumpurple: '#9370DB',
-    //    mediumseagreen: '#3CB371',
-    //    mediumslateblue: '#7B68EE',
-    //    mediumspringgreen: '#00FA9A',
-    //    mediumturquoise: '#48D1CC',
-    //    mediumvioletred: '#C71585',
-    //    midnightblue: '#191970',
-    //    mintcream: '#F5FFFA',
-    //    mistyrose: '#FFE4E1',
-    //    moccasin: '#FFE4B5',
-    //    navajowhite: '#FFDEAD',
-    //    oldlace: '#FDF5E6',
-    //    olivedrab: '#6B8E23',
-    //    orange: '#FFA500',
-    //    orangered: '#FF4500',
-    //    orchid: '#DA70D6',
-    //    palegoldenrod: '#EEE8AA',
-    //    palegreen: '#98FB98',
-    //    paleturquoise: '#AFEEEE',
-    //    palevioletred: '#DB7093',
-    //    papayawhip: '#FFEFD5',
-    //    peachpuff: '#FFDAB9',
-    //    peru: '#CD853F',
-    //    pink: '#FFC0CB',
-    //    plum: '#DDA0DD',
-    //    powderblue: '#B0E0E6',
-    //    rosybrown: '#BC8F8F',
-    //    royalblue: '#4169E1',
-    //    saddlebrown: '#8B4513',
-    //    salmon: '#FA8072',
-    //    sandybrown: '#F4A460',
-    //    seagreen: '#2E8B57',
-    //    seashell: '#FFF5EE',
-    //    sienna: '#A0522D',
-    //    skyblue: '#87CEEB',
-    //    slateblue: '#6A5ACD',
-    //    slategray: '#708090',
-    //    slategrey: '#708090',
-    //    snow: '#FFFAFA',
-    //    springgreen: '#00FF7F',
-    //    steelblue: '#4682B4',
-    //    tan: '#D2B48C',
-    //    thistle: '#D8BFD8',
-    //    tomato: '#FF6347',
-    //    turquoise: '#40E0D0',
-    //    violet: '#EE82EE',
-    //    wheat: '#F5DEB3',
-    //    whitesmoke: '#F5F5F5',
-    //    yellowgreen: '#9ACD32'
-    //  };
-
-
-    function getRgbHslContent(styleString) {
-      var start = styleString.indexOf('(', 3);
-      var end = styleString.indexOf(')', start + 1);
-      var parts = styleString.substring(start + 1, end).split(',');
-      // add alpha if needed
-      if (parts.length != 4 || styleString.charAt(3) != 'a') {
-        parts[3] = 1;
-      }
-      return parts;
-    }
-
-    function percent(s) {
-      return parseFloat(s) / 100;
-    }
-
-    function clamp(v, min, max) {
-      return Math.min(max, Math.max(min, v));
-    }
-
-    function hslToRgb(parts) {
-      var r, g, b, h, s, l;
-      h = parseFloat(parts[0]) / 360 % 360;
-      if (h < 0)
-        h++;
-      s = clamp(percent(parts[1]), 0, 1);
-      l = clamp(percent(parts[2]), 0, 1);
-      if (s == 0) {
-        r = g = b = l; // achromatic
-      } else {
-        var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
-        var p = 2 * l - q;
-        r = hueToRgb(p, q, h + 1 / 3);
-        g = hueToRgb(p, q, h);
-        b = hueToRgb(p, q, h - 1 / 3);
-      }
-
-      return '#' + decToHex[Math.floor(r * 255)] +
-        decToHex[Math.floor(g * 255)] +
-        decToHex[Math.floor(b * 255)];
-    }
-
-    function hueToRgb(m1, m2, h) {
-      if (h < 0)
-        h++;
-      if (h > 1)
-        h--;
-
-      if (6 * h < 1)
-        return m1 + (m2 - m1) * 6 * h;
-      else if (2 * h < 1)
-        return m2;
-      else if (3 * h < 2)
-        return m1 + (m2 - m1) * (2 / 3 - h) * 6;
-      else
-        return m1;
-    }
-
-    var processStyleCache = {};
-
-    function processStyle(styleString) {
-      if (styleString in processStyleCache) {
-        return processStyleCache[styleString];
-      }
-
-      var str, alpha = 1;
-
-      styleString = String(styleString);
-      if (styleString.charAt(0) == '#') {
-        str = styleString;
-      } else if (/^rgb/.test(styleString)) {
-        var parts = getRgbHslContent(styleString);
-        var str = '#', n;
-        for (var i = 0; i < 3; i++) {
-          if (parts[i].indexOf('%') != -1) {
-            n = Math.floor(percent(parts[i]) * 255);
-          } else {
-            n = +parts[i];
-          }
-          str += decToHex[clamp(n, 0, 255)];
-        }
-        alpha = +parts[3];
-      } else if (/^hsl/.test(styleString)) {
-        var parts = getRgbHslContent(styleString);
-        str = hslToRgb(parts);
-        alpha = parts[3];
-      } else {
-        str = /*colorData[styleString] ||*/styleString;
-      }
-      return processStyleCache[styleString] = { color: str, alpha: alpha };
-    }
-
-    var DEFAULT_STYLE = {
-      style: 'normal',
-      variant: 'normal',
-      weight: 'normal',
-      size: 10,
-      family: 'sans-serif'
-    };
-
-    // Internal text style cache
-    //  var fontStyleCache = {};
-
-    //  function processFontStyle(styleString) {
-    //    if (fontStyleCache[styleString]) {
-    //      return fontStyleCache[styleString];
-    //    }
-
-    //    var el = document.createElement('div');
-    //    var style = el.style;
-    //    try {
-    //      style.font = styleString;
-    //    } catch (ex) {
-    //      // Ignore failures to set to invalid font.
-    //    }
-
-    //    return fontStyleCache[styleString] = {
-    //      style: style.fontStyle || DEFAULT_STYLE.style,
-    //      variant: style.fontVariant || DEFAULT_STYLE.variant,
-    //      weight: style.fontWeight || DEFAULT_STYLE.weight,
-    //      size: style.fontSize || DEFAULT_STYLE.size,
-    //      family: style.fontFamily || DEFAULT_STYLE.family
-    //    };
-    //  }
-
-    //  function getComputedStyle(style, element) {
-    //    var computedStyle = {};
-
-    //    for (var p in style) {
-    //      computedStyle[p] = style[p];
-    //    }
-
-    //    // Compute the size
-    //    var canvasFontSize = parseFloat(element.currentStyle.fontSize),
-    //        fontSize = parseFloat(style.size);
-
-    //    if (typeof style.size == 'number') {
-    //      computedStyle.size = style.size;
-    //    } else if (style.size.indexOf('px') != -1) {
-    //      computedStyle.size = fontSize;
-    //    } else if (style.size.indexOf('em') != -1) {
-    //      computedStyle.size = canvasFontSize * fontSize;
-    //    } else if(style.size.indexOf('%') != -1) {
-    //      computedStyle.size = (canvasFontSize / 100) * fontSize;
-    //    } else if (style.size.indexOf('pt') != -1) {
-    //      computedStyle.size = fontSize / .75;
-    //    } else {
-    //      computedStyle.size = canvasFontSize;
-    //    }
-
-    //    // Different scaling between normal text and VML text. This was found using
-    //    // trial and error to get the same size as non VML text.
-    //    computedStyle.size *= 0.981;
-
-    //    return computedStyle;
-    //  }
-
-    //  function buildStyle(style) {
-    //    return style.style + ' ' + style.variant + ' ' + style.weight + ' ' +
-    //        style.size + 'px ' + style.family;
-    //  }
-
-    var lineCapMap = {
-      'butt': 'flat',
-      'round': 'round'
-    };
-
-    function processLineCap(lineCap) {
-      return lineCapMap[lineCap] || 'square';
-    }
-
-    /**
-    * This class implements CanvasRenderingContext2D interface as described by
-    * the WHATWG.
-    * @param {HTMLElement} canvasElement The element that the 2D context should
-    * be associated with
-    */
-    function CanvasRenderingContext2D_(canvasElement) {
-      this.m_ = createMatrixIdentity();
-
-      this.mStack_ = [];
-      this.aStack_ = [];
-      this.currentPath_ = [];
-
-      // Canvas context properties
-      this.strokeStyle = '#000';
-      this.fillStyle = '#000';
-
-      this.lineWidth = 1;
-      this.lineJoin = 'miter';
-      this.lineCap = 'butt';
-      this.miterLimit = Z * 1;
-      this.globalAlpha = 1;
-      //this.font = '10px sans-serif';
-      //this.textAlign = 'left';
-      //this.textBaseline = 'alphabetic';
-      this.canvas = canvasElement;
-
-      var cssText = 'width:' + canvasElement.clientWidth + 'px;height:' +
-        canvasElement.clientHeight + 'px;overflow:hidden;position:absolute';
-      var el = canvasElement.ownerDocument.createElement('div');
-      el.style.cssText = cssText;
-      canvasElement.appendChild(el);
-
-      var overlayEl = el.cloneNode(false);
-      // Use a non transparent background.
-      overlayEl.style.backgroundColor = 'red';
-      overlayEl.style.filter = 'alpha(opacity=0)';
-      canvasElement.appendChild(overlayEl);
-
-      this.element_ = el;
-      this.arcScaleX_ = 1;
-      this.arcScaleY_ = 1;
-      this.lineScale_ = 1;
-    }
-
-    var contextPrototype = CanvasRenderingContext2D_.prototype;
-    contextPrototype.clearRect = function () {
-      if (this.textMeasureEl_) {
-        this.textMeasureEl_.removeNode(true);
-        this.textMeasureEl_ = null;
-      }
-      this.element_.innerHTML = '';
-    };
-
-    contextPrototype.beginPath = function () {
-      // TODO: Branch current matrix so that save/restore has no effect
-      //       as per safari docs.
-      this.currentPath_ = [];
-    };
-
-    contextPrototype.moveTo = function (aX, aY) {
-      var p = getCoords(this, aX, aY);
-      this.currentPath_.push({ type: 'moveTo', x: p.x, y: p.y });
-      this.currentX_ = p.x;
-      this.currentY_ = p.y;
-    };
-
-    contextPrototype.lineTo = function (aX, aY) {
-      var p = getCoords(this, aX, aY);
-      this.currentPath_.push({ type: 'lineTo', x: p.x, y: p.y });
-
-      this.currentX_ = p.x;
-      this.currentY_ = p.y;
-    };
-
-    contextPrototype.bezierCurveTo = function(aCP1x, aCP1y,
-                                              aCP2x, aCP2y,
-                                              aX, aY) {
-      var p = getCoords(this, aX, aY);
-      var cp1 = getCoords(this, aCP1x, aCP1y);
-      var cp2 = getCoords(this, aCP2x, aCP2y);
-      bezierCurveTo(this, cp1, cp2, p);
-    };
-
-    // Helper function that takes the already fixed cordinates.
-    function bezierCurveTo(self, cp1, cp2, p) {
-      self.currentPath_.push({
-        type: 'bezierCurveTo',
-        cp1x: cp1.x,
-        cp1y: cp1.y,
-        cp2x: cp2.x,
-        cp2y: cp2.y,
-        x: p.x,
-        y: p.y
-      });
-      self.currentX_ = p.x;
-      self.currentY_ = p.y;
-    }
-
-    contextPrototype.quadraticCurveTo = function(aCPx, aCPy, aX, aY) {
-      // the following is lifted almost directly from
-      // http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes
-
-      var cp = getCoords(this, aCPx, aCPy);
-      var p = getCoords(this, aX, aY);
-
-      var cp1 = {
-        x: this.currentX_ + 2.0 / 3.0 * (cp.x - this.currentX_),
-        y: this.currentY_ + 2.0 / 3.0 * (cp.y - this.currentY_)
-      };
-      var cp2 = {
-        x: cp1.x + (p.x - this.currentX_) / 3.0,
-        y: cp1.y + (p.y - this.currentY_) / 3.0
-      };
-
-      bezierCurveTo(this, cp1, cp2, p);
-    };
-
-    contextPrototype.arc = function (aX, aY, aRadius,
-                                  aStartAngle, aEndAngle, aClockwise) {
-      aRadius *= Z;
-      var arcType = aClockwise ? 'at' : 'wa';
-
-      var xStart = aX + mc(aStartAngle) * aRadius - Z2;
-      var yStart = aY + ms(aStartAngle) * aRadius - Z2;
-
-      var xEnd = aX + mc(aEndAngle) * aRadius - Z2;
-      var yEnd = aY + ms(aEndAngle) * aRadius - Z2;
-
-      // IE won't render arches drawn counter clockwise if xStart == xEnd.
-      if (xStart == xEnd && !aClockwise) {
-        xStart += 0.125; // Offset xStart by 1/80 of a pixel. Use something
-        // that can be represented in binary
-      }
-
-      var p = getCoords(this, aX, aY);
-      var pStart = getCoords(this, xStart, yStart);
-      var pEnd = getCoords(this, xEnd, yEnd);
-
-      this.currentPath_.push({ type: arcType,
-        x: p.x,
-        y: p.y,
-        radius: aRadius,
-        xStart: pStart.x,
-        yStart: pStart.y,
-        xEnd: pEnd.x,
-        yEnd: pEnd.y
-      });
-
-    };
-
-    //  contextPrototype.rect = function(aX, aY, aWidth, aHeight) {
-    //    this.moveTo(aX, aY);
-    //    this.lineTo(aX + aWidth, aY);
-    //    this.lineTo(aX + aWidth, aY + aHeight);
-    //    this.lineTo(aX, aY + aHeight);
-    //    this.closePath();
-    //  };
-
-    //  contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) {
-    //    var oldPath = this.currentPath_;
-    //    this.beginPath();
-
-    //    this.moveTo(aX, aY);
-    //    this.lineTo(aX + aWidth, aY);
-    //    this.lineTo(aX + aWidth, aY + aHeight);
-    //    this.lineTo(aX, aY + aHeight);
-    //    this.closePath();
-    //    this.stroke();
-
-    //    this.currentPath_ = oldPath;
-    //  };
-
-    //  contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) {
-    //    var oldPath = this.currentPath_;
-    //    this.beginPath();
-
-    //    this.moveTo(aX, aY);
-    //    this.lineTo(aX + aWidth, aY);
-    //    this.lineTo(aX + aWidth, aY + aHeight);
-    //    this.lineTo(aX, aY + aHeight);
-    //    this.closePath();
-    //    this.fill();
-
-    //    this.currentPath_ = oldPath;
-    //  };
-
-    //  contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) {
-    //    var gradient = new CanvasGradient_('gradient');
-    //    gradient.x0_ = aX0;
-    //    gradient.y0_ = aY0;
-    //    gradient.x1_ = aX1;
-    //    gradient.y1_ = aY1;
-    //    return gradient;
-    //  };
-
-    //  contextPrototype.createRadialGradient = function(aX0, aY0, aR0,
-    //                                                   aX1, aY1, aR1) {
-    //    var gradient = new CanvasGradient_('gradientradial');
-    //    gradient.x0_ = aX0;
-    //    gradient.y0_ = aY0;
-    //    gradient.r0_ = aR0;
-    //    gradient.x1_ = aX1;
-    //    gradient.y1_ = aY1;
-    //    gradient.r1_ = aR1;
-    //    return gradient;
-    //  };
-
-    //  contextPrototype.drawImage = function(image, var_args) {
-    //    var dx, dy, dw, dh, sx, sy, sw, sh;
-
-    //    // to find the original width we overide the width and height
-    //    var oldRuntimeWidth = image.runtimeStyle.width;
-    //    var oldRuntimeHeight = image.runtimeStyle.height;
-    //    image.runtimeStyle.width = 'auto';
-    //    image.runtimeStyle.height = 'auto';
-
-    //    // get the original size
-    //    var w = image.width;
-    //    var h = image.height;
-
-    //    // and remove overides
-    //    image.runtimeStyle.width = oldRuntimeWidth;
-    //    image.runtimeStyle.height = oldRuntimeHeight;
-
-    //    if (arguments.length == 3) {
-    //      dx = arguments[1];
-    //      dy = arguments[2];
-    //      sx = sy = 0;
-    //      sw = dw = w;
-    //      sh = dh = h;
-    //    } else if (arguments.length == 5) {
-    //      dx = arguments[1];
-    //      dy = arguments[2];
-    //      dw = arguments[3];
-    //      dh = arguments[4];
-    //      sx = sy = 0;
-    //      sw = w;
-    //      sh = h;
-    //    } else if (arguments.length == 9) {
-    //      sx = arguments[1];
-    //      sy = arguments[2];
-    //      sw = arguments[3];
-    //      sh = arguments[4];
-    //      dx = arguments[5];
-    //      dy = arguments[6];
-    //      dw = arguments[7];
-    //      dh = arguments[8];
-    //    } else {
-    //      throw Error('Invalid number of arguments');
-    //    }
-
-    //    var d = getCoords(this, dx, dy);
-
-    //    var w2 = sw / 2;
-    //    var h2 = sh / 2;
-
-    //    var vmlStr = [];
-
-    //    var W = 10;
-    //    var H = 10;
-
-    //    // For some reason that I've now forgotten, using divs didn't work
-    //    vmlStr.push(' <g_vml_:group',
-    //                ' coordsize="', Z * W, ',', Z * H, '"',
-    //                ' coordorigin="0,0"' ,
-    //                ' style="width:', W, 'px;height:', H, 'px;position:absolute;');
-
-    //    // If filters are necessary (rotation exists), create them
-    //    // filters are bog-slow, so only create them if abbsolutely necessary
-    //    // The following check doesn't account for skews (which don't exist
-    //    // in the canvas spec (yet) anyway.
-
-    //    if (this.m_[0][0] != 1 || this.m_[0][1] ||
-    //        this.m_[1][1] != 1 || this.m_[1][0]) {
-    //      var filter = [];
-
-    //      // Note the 12/21 reversal
-    //      filter.push('M11=', this.m_[0][0], ',',
-    //                  'M12=', this.m_[1][0], ',',
-    //                  'M21=', this.m_[0][1], ',',
-    //                  'M22=', this.m_[1][1], ',',
-    //                  'Dx=', mr(d.x / Z), ',',
-    //                  'Dy=', mr(d.y / Z), '');
-
-    //      // Bounding box calculation (need to minimize displayed area so that
-    //      // filters don't waste time on unused pixels.
-    //      var max = d;
-    //      var c2 = getCoords(this, dx + dw, dy);
-    //      var c3 = getCoords(this, dx, dy + dh);
-    //      var c4 = getCoords(this, dx + dw, dy + dh);
-
-    //      max.x = m.max(max.x, c2.x, c3.x, c4.x);
-    //      max.y = m.max(max.y, c2.y, c3.y, c4.y);
-
-    //      vmlStr.push('padding:0 ', mr(max.x / Z), 'px ', mr(max.y / Z),
-    //                  'px 0;filter:progid:DXImageTransform.Microsoft.Matrix(',
-    //                  filter.join(''), ", sizingmethod='clip');");
-
-    //    } else {
-    //      vmlStr.push('top:', mr(d.y / Z), 'px;left:', mr(d.x / Z), 'px;');
-    //    }
-
-    //    vmlStr.push(' ">' ,
-    //                '<g_vml_:image src="', image.src, '"',
-    //                ' style="width:', Z * dw, 'px;',
-    //                ' height:', Z * dh, 'px"',
-    //                ' cropleft="', sx / w, '"',
-    //                ' croptop="', sy / h, '"',
-    //                ' cropright="', (w - sx - sw) / w, '"',
-    //                ' cropbottom="', (h - sy - sh) / h, '"',
-    //                ' />',
-    //                '</g_vml_:group>');
-
-    //    this.element_.insertAdjacentHTML('BeforeEnd', vmlStr.join(''));
-    //  };
-
-    contextPrototype.stroke = function (aFill) {
-      var lineStr = [];
-      var lineOpen = false;
-
-      var W = 10;
-      var H = 10;
-
-      lineStr.push('<g_vml_:shape',
-                 ' filled="', !!aFill, '"',
-                 ' style="position:absolute;width:', W, 'px;height:', H, 'px;"',
-                 ' coordorigin="0,0"',
-                 ' coordsize="', Z * W, ',', Z * H, '"',
-                 ' stroked="', !aFill, '"',
-                 ' path="');
-
-      var newSeq = false;
-      var min = { x: null, y: null };
-      var max = { x: null, y: null };
-
-      for (var i = 0; i < this.currentPath_.length; i++) {
-        var p = this.currentPath_[i];
-        var c;
-
-        switch (p.type) {
-          case 'moveTo':
-            c = p;
-            lineStr.push(' m ', mr(p.x), ',', mr(p.y));
-            break;
-          case 'lineTo':
-            lineStr.push(' l ', mr(p.x), ',', mr(p.y));
-            break;
-          case 'close':
-            lineStr.push(' x ');
-            p = null;
-            break;
-          case 'bezierCurveTo':
-            lineStr.push(' c ',
-                       mr(p.cp1x), ',', mr(p.cp1y), ',',
-                       mr(p.cp2x), ',', mr(p.cp2y), ',',
-                       mr(p.x), ',', mr(p.y));
-            break;
-          case 'at':
-          case 'wa':
-            lineStr.push(' ', p.type, ' ',
-                       mr(p.x - this.arcScaleX_ * p.radius), ',',
-                       mr(p.y - this.arcScaleY_ * p.radius), ' ',
-                       mr(p.x + this.arcScaleX_ * p.radius), ',',
-                       mr(p.y + this.arcScaleY_ * p.radius), ' ',
-                       mr(p.xStart), ',', mr(p.yStart), ' ',
-                       mr(p.xEnd), ',', mr(p.yEnd));
-            break;
-        }
-
-
-        // TODO: Following is broken for curves due to
-        //       move to proper paths.
-
-        // Figure out dimensions so we can do gradient fills
-        // properly
-        if (p) {
-          if (min.x == null || p.x < min.x) {
-            min.x = p.x;
-          }
-          if (max.x == null || p.x > max.x) {
-            max.x = p.x;
-          }
-          if (min.y == null || p.y < min.y) {
-            min.y = p.y;
-          }
-          if (max.y == null || p.y > max.y) {
-            max.y = p.y;
-          }
-        }
-      }
-      lineStr.push(' ">');
-
-      if (!aFill) {
-        appendStroke(this, lineStr);
-      } else {
-        appendFill(this, lineStr, min, max);
-      }
-
-      lineStr.push('</g_vml_:shape>');
-
-      this.element_.insertAdjacentHTML('beforeEnd', lineStr.join(''));
-    };
-
-    function appendStroke(ctx, lineStr) {
-      var a = processStyle(ctx.strokeStyle);
-      var color = a.color;
-      var opacity = a.alpha * ctx.globalAlpha;
-      var lineWidth = ctx.lineScale_ * ctx.lineWidth;
-
-      // VML cannot correctly render a line if the width is less than 1px.
-      // In that case, we dilute the color to make the line look thinner.
-      if (lineWidth < 1) {
-        opacity *= lineWidth;
-      }
-
-      lineStr.push(
-      '<g_vml_:stroke',
-      ' opacity="', opacity, '"',
-      ' joinstyle="', ctx.lineJoin, '"',
-      ' miterlimit="', ctx.miterLimit, '"',
-      ' endcap="', processLineCap(ctx.lineCap), '"',
-      ' weight="', lineWidth, 'px"',
-      ' color="', color, '" />'
-    );
-    }
-
-    function appendFill(ctx, lineStr, min, max) {
-      var fillStyle = ctx.fillStyle;
-      var arcScaleX = ctx.arcScaleX_;
-      var arcScaleY = ctx.arcScaleY_;
-      var width = max.x - min.x;
-      var height = max.y - min.y;
-      //    if (fillStyle instanceof CanvasGradient_) {
-      //      // TODO: Gradients transformed with the transformation matrix.
-      //      var angle = 0;
-      //      var focus = {x: 0, y: 0};
-
-      //      // additional offset
-      //      var shift = 0;
-      //      // scale factor for offset
-      //      var expansion = 1;
-
-      //      if (fillStyle.type_ == 'gradient') {
-      //        var x0 = fillStyle.x0_ / arcScaleX;
-      //        var y0 = fillStyle.y0_ / arcScaleY;
-      //        var x1 = fillStyle.x1_ / arcScaleX;
-      //        var y1 = fillStyle.y1_ / arcScaleY;
-      //        var p0 = getCoords(ctx, x0, y0);
-      //        var p1 = getCoords(ctx, x1, y1);
-      //        var dx = p1.x - p0.x;
-      //        var dy = p1.y - p0.y;
-      //        angle = Math.atan2(dx, dy) * 180 / Math.PI;
-
-      //        // The angle should be a non-negative number.
-      //        if (angle < 0) {
-      //          angle += 360;
-      //        }
-
-      //        // Very small angles produce an unexpected result because they are
-      //        // converted to a scientific notation string.
-      //        if (angle < 1e-6) {
-      //          angle = 0;
-      //        }
-      //      } else {
-      //        var p0 = getCoords(ctx, fillStyle.x0_, fillStyle.y0_);
-      //        focus = {
-      //          x: (p0.x - min.x) / width,
-      //          y: (p0.y - min.y) / height
-      //        };
-
-      //        width  /= arcScaleX * Z;
-      //        height /= arcScaleY * Z;
-      //        var dimension = m.max(width, height);
-      //        shift = 2 * fillStyle.r0_ / dimension;
-      //        expansion = 2 * fillStyle.r1_ / dimension - shift;
-      //      }
-
-      //      // We need to sort the color stops in ascending order by offset,
-      //      // otherwise IE won't interpret it correctly.
-      //      var stops = fillStyle.colors_;
-      //      stops.sort(function(cs1, cs2) {
-      //        return cs1.offset - cs2.offset;
-      //      });
-
-      //      var length = stops.length;
-      //      var color1 = stops[0].color;
-      //      var color2 = stops[length - 1].color;
-      //      var opacity1 = stops[0].alpha * ctx.globalAlpha;
-      //      var opacity2 = stops[length - 1].alpha * ctx.globalAlpha;
-
-      //      var colors = [];
-      //      for (var i = 0; i < length; i++) {
-      //        var stop = stops[i];
-      //        colors.push(stop.offset * expansion + shift + ' ' + stop.color);
-      //      }
-
-      //      // When colors attribute is used, the meanings of opacity and o:opacity2
-      //      // are reversed.
-      //      lineStr.push('<g_vml_:fill type="', fillStyle.type_, '"',
-      //                   ' method="none" focus="100%"',
-      //                   ' color="', color1, '"',
-      //                   ' color2="', color2, '"',
-      //                   ' colors="', colors.join(','), '"',
-      //                   ' opacity="', opacity2, '"',
-      //                   ' g_o_:opacity2="', opacity1, '"',
-      //                   ' angle="', angle, '"',
-      //                   ' focusposition="', focus.x, ',', focus.y, '" />');
-      //    } else if (fillStyle instanceof CanvasPattern_) {
-      //      if (width && height) {
-      //        var deltaLeft = -min.x;
-      //        var deltaTop = -min.y;
-      //        lineStr.push('<g_vml_:fill',
-      //                     ' position="',
-      //                     deltaLeft / width * arcScaleX * arcScaleX, ',',
-      //                     deltaTop / height * arcScaleY * arcScaleY, '"',
-      //                     ' type="tile"',
-      //                     // TODO: Figure out the correct size to fit the scale.
-      //                     //' size="', w, 'px ', h, 'px"',
-      //                     ' src="', fillStyle.src_, '" />');
-      //       }
-      //    } else {
-      var a = processStyle(ctx.fillStyle);
-      var color = a.color;
-      var opacity = a.alpha * ctx.globalAlpha;
-      lineStr.push('<g_vml_:fill color="', color, '" opacity="', opacity,
-                   '" />');
-      //     }
-    }
-
-    contextPrototype.fill = function () {
-      this.stroke(true);
-    };
-
-    contextPrototype.closePath = function () {
-      this.currentPath_.push({ type: 'close' });
-    };
-
-    function getCoords(ctx, aX, aY) {
-      var m = ctx.m_;
-      return {
-        x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2,
-        y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2
-      };
-    };
-
-    contextPrototype.save = function () {
-      var o = {};
-      copyState(this, o);
-      this.aStack_.push(o);
-      this.mStack_.push(this.m_);
-      this.m_ = matrixMultiply(createMatrixIdentity(), this.m_);
-    };
-
-    contextPrototype.restore = function () {
-      if (this.aStack_.length) {
-        copyState(this.aStack_.pop(), this);
-        this.m_ = this.mStack_.pop();
-      }
-    };
-
-    function matrixIsFinite(m) {
-      return isFinite(m[0][0]) && isFinite(m[0][1]) &&
-        isFinite(m[1][0]) && isFinite(m[1][1]) &&
-        isFinite(m[2][0]) && isFinite(m[2][1]);
-    }
-
-    function setM(ctx, m, updateLineScale) {
-      if (!matrixIsFinite(m)) {
-        return;
-      }
-      ctx.m_ = m;
-
-      if (updateLineScale) {
-        // Get the line scale.
-        // Determinant of this.m_ means how much the area is enlarged by the
-        // transformation. So its square root can be used as a scale factor
-        // for width.
-        var det = m[0][0] * m[1][1] - m[0][1] * m[1][0];
-        ctx.lineScale_ = sqrt(abs(det));
-      }
-    }
-
-    contextPrototype.translate = function (aX, aY) {
-      var m1 = [
-      [1, 0, 0],
-      [0, 1, 0],
-      [aX, aY, 1]
-    ];
-
-      setM(this, matrixMultiply(m1, this.m_), false);
-    };
-
-    //  contextPrototype.rotate = function(aRot) {
-    //    var c = mc(aRot);
-    //    var s = ms(aRot);
-
-    //    var m1 = [
-    //      [c,  s, 0],
-    //      [-s, c, 0],
-    //      [0,  0, 1]
-    //    ];
-
-    //    setM(this, matrixMultiply(m1, this.m_), false);
-    //  };
-
-    contextPrototype.scale = function (aX, aY) {
-      this.arcScaleX_ *= aX;
-      this.arcScaleY_ *= aY;
-      var m1 = [
-      [aX, 0, 0],
-      [0, aY, 0],
-      [0, 0, 1]
-    ];
-
-      setM(this, matrixMultiply(m1, this.m_), true);
-    };
-
-    //  contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) {
-    //    var m1 = [
-    //      [m11, m12, 0],
-    //      [m21, m22, 0],
-    //      [dx,  dy,  1]
-    //    ];
-
-    //    setM(this, matrixMultiply(m1, this.m_), true);
-    //  };
-
-    //  contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) {
-    //    var m = [
-    //      [m11, m12, 0],
-    //      [m21, m22, 0],
-    //      [dx,  dy,  1]
-    //    ];
-
-    //    setM(this, m, true);
-    //  };
-
-    /**
-    * The text drawing function.
-    * The maxWidth argument isn't taken in account, since no browser supports
-    * it yet.
-    */
-    //  contextPrototype.drawText_ = function(text, x, y, maxWidth, stroke) {
-    //    var m = this.m_,
-    //        delta = 1000,
-    //        left = 0,
-    //        right = delta,
-    //        offset = {x: 0, y: 0},
-    //        lineStr = [];
-
-    //    var fontStyle = getComputedStyle(processFontStyle(this.font),
-    //                                     this.element_);
-
-    //    var fontStyleString = buildStyle(fontStyle);
-
-    //    var elementStyle = this.element_.currentStyle;
-    //    var textAlign = this.textAlign.toLowerCase();
-    //    switch (textAlign) {
-    //      case 'left':
-    //      case 'center':
-    //      case 'right':
-    //        break;
-    //      case 'end':
-    //        textAlign = elementStyle.direction == 'ltr' ? 'right' : 'left';
-    //        break;
-    //      case 'start':
-    //        textAlign = elementStyle.direction == 'rtl' ? 'right' : 'left';
-    //        break;
-    //      default:
-    //        textAlign = 'left';
-    //    }
-
-    //    // 1.75 is an arbitrary number, as there is no info about the text baseline
-    //    switch (this.textBaseline) {
-    //      case 'hanging':
-    //      case 'top':
-    //        offset.y = fontStyle.size / 1.75;
-    //        break;
-    //      case 'middle':
-    //        break;
-    //      default:
-    //      case null:
-    //      case 'alphabetic':
-    //      case 'ideographic':
-    //      case 'bottom':
-    //        offset.y = -fontStyle.size / 2.25;
-    //        break;
-    //    }
-
-    //    switch(textAlign) {
-    //      case 'right':
-    //        left = delta;
-    //        right = 0.05;
-    //        break;
-    //      case 'center':
-    //        left = right = delta / 2;
-    //        break;
-    //    }
-
-    //    var d = getCoords(this, x + offset.x, y + offset.y);
-
-    //    lineStr.push('<g_vml_:line from="', -left ,' 0" to="', right ,' 0.05" ',
-    //                 ' coordsize="100 100" coordorigin="0 0"',
-    //                 ' filled="', !stroke, '" stroked="', !!stroke,
-    //                 '" style="position:absolute;width:1px;height:1px;">');
-
-    //    if (stroke) {
-    //      appendStroke(this, lineStr);
-    //    } else {
-    //      // TODO: Fix the min and max params.
-    //      appendFill(this, lineStr, {x: -left, y: 0},
-    //                 {x: right, y: fontStyle.size});
-    //    }
-
-    //    var skewM = m[0][0].toFixed(3) + ',' + m[1][0].toFixed(3) + ',' +
-    //                m[0][1].toFixed(3) + ',' + m[1][1].toFixed(3) + ',0,0';
-
-    //    var skewOffset = mr(d.x / Z) + ',' + mr(d.y / Z);
-
-    //    lineStr.push('<g_vml_:skew on="t" matrix="', skewM ,'" ',
-    //                 ' offset="', skewOffset, '" origin="', left ,' 0" />',
-    //                 '<g_vml_:path textpathok="true" />',
-    //                 '<g_vml_:textpath on="true" string="',
-    //                 encodeHtmlAttribute(text),
-    //                 '" style="v-text-align:', textAlign,
-    //                 ';font:', encodeHtmlAttribute(fontStyleString),
-    //                 '" /></g_vml_:line>');
-
-    //    this.element_.insertAdjacentHTML('beforeEnd', lineStr.join(''));
-    //  };
-
-    //  contextPrototype.fillText = function(text, x, y, maxWidth) {
-    //    this.drawText_(text, x, y, maxWidth, false);
-    //  };
-
-    //  contextPrototype.strokeText = function(text, x, y, maxWidth) {
-    //    this.drawText_(text, x, y, maxWidth, true);
-    //  };
-
-    //  contextPrototype.measureText = function(text) {
-    //    if (!this.textMeasureEl_) {
-    //      var s = '<span style="position:absolute;' +
-    //          'top:-20000px;left:0;padding:0;margin:0;border:none;' +
-    //          'white-space:pre;"></span>';
-    //      this.element_.insertAdjacentHTML('beforeEnd', s);
-    //      this.textMeasureEl_ = this.element_.lastChild;
-    //    }
-    //    var doc = this.element_.ownerDocument;
-    //    this.textMeasureEl_.innerHTML = '';
-    //    this.textMeasureEl_.style.font = this.font;
-    //    // Don't use innerHTML or innerText because they allow markup/whitespace.
-    //    this.textMeasureEl_.appendChild(doc.createTextNode(text));
-    //    return {width: this.textMeasureEl_.offsetWidth};
-    //  };
-
-    /******** STUBS ********/
-    //  contextPrototype.clip = function() {
-    //    // TODO: Implement
-    //  };
-
-    //  contextPrototype.arcTo = function() {
-    //    // TODO: Implement
-    //  };
-
-    //  contextPrototype.createPattern = function(image, repetition) {
-    //    return new CanvasPattern_(image, repetition);
-    //  };
-
-    //  // Gradient / Pattern Stubs
-    //  function CanvasGradient_(aType) {
-    //    this.type_ = aType;
-    //    this.x0_ = 0;
-    //    this.y0_ = 0;
-    //    this.r0_ = 0;
-    //    this.x1_ = 0;
-    //    this.y1_ = 0;
-    //    this.r1_ = 0;
-    //    this.colors_ = [];
-    //  }
-
-    //  CanvasGradient_.prototype.addColorStop = function(aOffset, aColor) {
-    //    aColor = processStyle(aColor);
-    //    this.colors_.push({offset: aOffset,
-    //                       color: aColor.color,
-    //                       alpha: aColor.alpha});
-    //  };
-
-    //  function CanvasPattern_(image, repetition) {
-    //    assertImageIsValid(image);
-    //    switch (repetition) {
-    //      case 'repeat':
-    //      case null:
-    //      case '':
-    //        this.repetition_ = 'repeat';
-    //        break
-    //      case 'repeat-x':
-    //      case 'repeat-y':
-    //      case 'no-repeat':
-    //        this.repetition_ = repetition;
-    //        break;
-    //      default:
-    //        throwException('SYNTAX_ERR');
-    //    }
-
-    //    this.src_ = image.src;
-    //    this.width_ = image.width;
-    //    this.height_ = image.height;
-    //  }
-
-    function throwException(s) {
-      throw new DOMException_(s);
-    }
-
-    //  function assertImageIsValid(img) {
-    //    if (!img || img.nodeType != 1 || img.tagName != 'IMG') {
-    //      throwException('TYPE_MISMATCH_ERR');
-    //    }
-    //    if (img.readyState != 'complete') {
-    //      throwException('INVALID_STATE_ERR');
-    //    }
-    //  }
-
-    function DOMException_(s) {
-      this.code = this[s];
-      this.message = s + ': DOM Exception ' + this.code;
-    }
-    var p = DOMException_.prototype = new Error;
-    p.INDEX_SIZE_ERR = 1;
-    p.DOMSTRING_SIZE_ERR = 2;
-    p.HIERARCHY_REQUEST_ERR = 3;
-    p.WRONG_DOCUMENT_ERR = 4;
-    p.INVALID_CHARACTER_ERR = 5;
-    p.NO_DATA_ALLOWED_ERR = 6;
-    p.NO_MODIFICATION_ALLOWED_ERR = 7;
-    p.NOT_FOUND_ERR = 8;
-    p.NOT_SUPPORTED_ERR = 9;
-    p.INUSE_ATTRIBUTE_ERR = 10;
-    p.INVALID_STATE_ERR = 11;
-    p.SYNTAX_ERR = 12;
-    p.INVALID_MODIFICATION_ERR = 13;
-    p.NAMESPACE_ERR = 14;
-    p.INVALID_ACCESS_ERR = 15;
-    p.VALIDATION_ERR = 16;
-    p.TYPE_MISMATCH_ERR = 17;
-
-    // set up externs
-    G_vmlCanvasManager = G_vmlCanvasManager_;
-    CanvasRenderingContext2D = CanvasRenderingContext2D_;
-    //CanvasGradient = CanvasGradient_;
-    //CanvasPattern = CanvasPattern_;
-    DOMException = DOMException_;
-  })();
-
-} // if
-/* Copyright (c) 2009 Brandon Aaron (http://brandonaaron.net)
- * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
- * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
- * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
- * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
- *
- * Version: 3.0.2
- * 
- * Requires: 1.2.2+
- */
-(function(c){var a=["DOMMouseScroll","mousewheel"];c.event.special.mousewheel={setup:function(){if(this.addEventListener){for(var d=a.length;d;){this.addEventListener(a[--d],b,false)}}else{this.onmousewheel=b}},teardown:function(){if(this.removeEventListener){for(var d=a.length;d;){this.removeEventListener(a[--d],b,false)}}else{this.onmousewheel=null}}};c.fn.extend({mousewheel:function(d){return d?this.bind("mousewheel",d):this.trigger("mousewheel")},unmousewheel:function(d){return this.unbind("mousewheel",d)}});function b(f){var d=[].slice.call(arguments,1),g=0,e=true;f=c.event.fix(f||window.event);f.type="mousewheel";if(f.wheelDelta){g=f.wheelDelta/120}if(f.detail){g=-f.detail/3}d.unshift(f,g);return c.event.handle.apply(this,d)}})(jQuery);
-
-/*!
- * jQuery UI Widget @VERSION
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Widget
- */
-if (!$.widget) {
-(function( $, undefined ) {
-
-var slice = Array.prototype.slice;
-
-var _cleanData = $.cleanData;
-$.cleanData = function( elems ) {
-       for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
-               $( elem ).triggerHandler( "remove" );
-       }
-       _cleanData( elems );
-};
-
-$.widget = function( name, base, prototype ) {
-       var namespace = name.split( "." )[ 0 ],
-               fullName;
-       name = name.split( "." )[ 1 ];
-       fullName = namespace + "-" + name;
-
-       if ( !prototype ) {
-               prototype = base;
-               base = $.Widget;
-       }
-
-       // create selector for plugin
-       $.expr[ ":" ][ fullName ] = function( elem ) {
-               return !!$.data( elem, name );
-       };
-
-       $[ namespace ] = $[ namespace ] || {};
-       // create the constructor using $.extend() so we can carry over any
-       // static properties stored on the existing constructor (if there is one)
-       $[ namespace ][ name ] = $.extend( function( options, element ) {
-               // allow instantiation without "new" keyword
-               if ( !this._createWidget ) {
-                       return new $[ namespace ][ name ]( options, element );
-               }
-
-               // allow instantiation without initializing for simple inheritance
-               // must use "new" keyword (the code above always passes args)
-               if ( arguments.length ) {
-                       this._createWidget( options, element );
-               }
-       }, $[ namespace ][ name ] );
-
-       var basePrototype = new base();
-       // we need to make the options hash a property directly on the new instance
-       // otherwise we'll modify the options hash on the prototype that we're
-       // inheriting from
-       basePrototype.options = $.extend( true, {}, basePrototype.options );
-       $.each( prototype, function( prop, value ) {
-               if ( $.isFunction( value ) ) {
-                       prototype[ prop ] = (function() {
-                               var _super = function( method ) {
-                                       return base.prototype[ method ].apply( this, slice.call( arguments, 1 ) );
-                               };
-                               var _superApply = function( method, args ) {
-                                       return base.prototype[ method ].apply( this, args );
-                               };
-                               return function() {
-                                       var __super = this._super,
-                                               __superApply = this._superApply,
-                                               returnValue;
-
-                                       this._super = _super;
-                                       this._superApply = _superApply;
-
-                                       returnValue = value.apply( this, arguments );
-
-                                       this._super = __super;
-                                       this._superApply = __superApply;
-
-                                       return returnValue;
-                               };
-                       }());
-               }
-       });
-       $[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
-               namespace: namespace,
-               widgetName: name,
-               widgetEventPrefix: name,
-               widgetBaseClass: fullName
-       }, prototype );
-
-       $.widget.bridge( name, $[ namespace ][ name ] );
-};
-
-$.widget.bridge = function( name, object ) {
-       $.fn[ name ] = function( options ) {
-               var isMethodCall = typeof options === "string",
-                       args = slice.call( arguments, 1 ),
-                       returnValue = this;
-
-               // allow multiple hashes to be passed on init
-               options = !isMethodCall && args.length ?
-                       $.extend.apply( null, [ true, options ].concat(args) ) :
-                       options;
-
-               if ( isMethodCall ) {
-                       this.each(function() {
-                               var instance = $.data( this, name );
-                               if ( !instance ) {
-                                       return $.error( "cannot call methods on " + name + " prior to initialization; " +
-                                               "attempted to call method '" + options + "'" );
-                               }
-                               if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
-                                       return $.error( "no such method '" + options + "' for " + name + " widget instance" );
-                               }
-                               var methodValue = instance[ options ].apply( instance, args );
-                               if ( methodValue !== instance && methodValue !== undefined ) {
-                                       returnValue = methodValue;
-                                       return false;
-                               }
-                       });
-               } else {
-                       this.each(function() {
-                               var instance = $.data( this, name );
-                               if ( instance ) {
-                                       instance.option( options || {} )._init();
-                               } else {
-                                       object( options, this );
-                               }
-                       });
-               }
-
-               return returnValue;
-       };
-};
-
-$.Widget = function( options, element ) {
-       // allow instantiation without "new" keyword
-       if ( !this._createWidget ) {
-               return new $[ namespace ][ name ]( options, element );
-       }
-
-       // allow instantiation without initializing for simple inheritance
-       // must use "new" keyword (the code above always passes args)
-       if ( arguments.length ) {
-               this._createWidget( options, element );
-       }
-};
-
-$.Widget.prototype = {
-       widgetName: "widget",
-       widgetEventPrefix: "",
-       defaultElement: "<div>",
-       options: {
-               disabled: false
-       },
-       _createWidget: function( options, element ) {
-               element = $( element || this.defaultElement || this )[ 0 ];
-               this.element = $( element );
-               this.options = $.extend( true, {},
-                       this.options,
-                       this._getCreateOptions(),
-                       options );
-
-               this.bindings = $();
-               this.hoverable = $();
-               this.focusable = $();
-
-               if ( element !== this ) {
-                       $.data( element, this.widgetName, this );
-                       this._bind({ remove: "destroy" });
-               }
-
-               this._create();
-               this._trigger( "create" );
-               this._init();
-       },
-       _getCreateOptions: function() {
-               return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];
-       },
-       _create: $.noop,
-       _init: $.noop,
-
-       destroy: function() {
-               this._destroy();
-               // we can probably remove the unbind calls in 2.0
-               // all event bindings should go through this._bind()
-               this.element
-                       .unbind( "." + this.widgetName )
-                       .removeData( this.widgetName );
-               this.widget()
-                       .unbind( "." + this.widgetName )
-                       .removeAttr( "aria-disabled" )
-                       .removeClass(
-                               this.widgetBaseClass + "-disabled " +
-                               "ui-state-disabled" );
-
-               // clean up events and states
-               this.bindings.unbind( "." + this.widgetName );
-               this.hoverable.removeClass( "ui-state-hover" );
-               this.focusable.removeClass( "ui-state-focus" );
-       },
-       _destroy: $.noop,
-
-       widget: function() {
-               return this.element;
-       },
-
-       option: function( key, value ) {
-               var options = key;
-
-               if ( arguments.length === 0 ) {
-                       // don't return a reference to the internal hash
-                       return $.extend( {}, this.options );
-               }
-
-               if  (typeof key === "string" ) {
-                       if ( value === undefined ) {
-                               return this.options[ key ];
-                       }
-                       options = {};
-                       options[ key ] = value;
-               }
-
-               this._setOptions( options );
-
-               return this;
-       },
-       _setOptions: function( options ) {
-               var self = this;
-               $.each( options, function( key, value ) {
-                       self._setOption( key, value );
-               });
-
-               return this;
-       },
-       _setOption: function( key, value ) {
-               this.options[ key ] = value;
-
-               if ( key === "disabled" ) {
-                       this.widget()
-                               .toggleClass( this.widgetBaseClass + "-disabled ui-state-disabled", !!value )
-                               .attr( "aria-disabled", value );
-                       this.hoverable.removeClass( "ui-state-hover" );
-                       this.focusable.removeClass( "ui-state-focus" );
-               }
-
-               return this;
-       },
-
-       enable: function() {
-               return this._setOption( "disabled", false );
-       },
-       disable: function() {
-               return this._setOption( "disabled", true );
-       },
-
-       _bind: function( element, handlers ) {
-               // no element argument, shuffle and use this.element
-               if ( !handlers ) {
-                       handlers = element;
-                       element = this.element;
-               } else {
-                       // accept selectors, DOM elements
-                       element = $( element );
-                       this.bindings = this.bindings.add( element );
-               }
-               var instance = this;
-               $.each( handlers, function( event, handler ) {
-                       element.bind( event + "." + instance.widgetName, function() {
-                               // allow widgets to customize the disabled handling
-                               // - disabled as an array instead of boolean
-                               // - disabled class as method for disabling individual parts
-                               if ( instance.options.disabled === true ||
-                                               $( this ).hasClass( "ui-state-disabled" ) ) {
-                                       return;
-                               }
-                               return ( typeof handler === "string" ? instance[ handler ] : handler )
-                                       .apply( instance, arguments );
-                       });
-               });
-       },
-
-       _hoverable: function( element ) {
-               this.hoverable = this.hoverable.add( element );
-               this._bind( element, {
-                       mouseenter: function( event ) {
-                               $( event.currentTarget ).addClass( "ui-state-hover" );
-                       },
-                       mouseleave: function( event ) {
-                               $( event.currentTarget ).removeClass( "ui-state-hover" );
-                       }
-               });
-       },
-
-       _focusable: function( element ) {
-               this.focusable = this.focusable.add( element );
-               this._bind( element, {
-                       focusin: function( event ) {
-                               $( event.currentTarget ).addClass( "ui-state-focus" );
-                       },
-                       focusout: function( event ) {
-                               $( event.currentTarget ).removeClass( "ui-state-focus" );
-                       }
-               });
-       },
-
-       _trigger: function( type, event, data ) {
-               var callback = this.options[ type ],
-                       args;
-
-               event = $.Event( event );
-               event.type = ( type === this.widgetEventPrefix ?
-                       type :
-                       this.widgetEventPrefix + type ).toLowerCase();
-               data = data || {};
-
-               // copy original event properties over to the new event
-               // this would happen if we could call $.event.fix instead of $.Event
-               // but we don't have a way to force an event to be fixed multiple times
-               if ( event.originalEvent ) {
-                       for ( var i = $.event.props.length, prop; i; ) {
-                               prop = $.event.props[ --i ];
-                               event[ prop ] = event.originalEvent[ prop ];
-                       }
-               }
-
-               this.element.trigger( event, data );
-
-               args = $.isArray( data ) ?
-                       [ event ].concat( data ) :
-                       [ event, data ];
-
-               return !( $.isFunction( callback ) &&
-                       callback.apply( this.element[0], args ) === false ||
-                       event.isDefaultPrevented() );
-       }
-};
-
-})( jQuery );
-}(function ($, window, undefined) {
-  var pos_oo = Number.POSITIVE_INFINITY,
-      neg_oo = Number.NEGATIVE_INFINITY;
-
-  $.geo = {
-    //
-    // utility functions
-    //
-
-    _allCoordinates: function (geom) {
-      // return array of all positions in all geometries of geom
-      // not in JTS
-      var geometries = this._flatten(geom),
-          curGeom = 0,
-          result = [];
-
-      for (; curGeom < geometries.length; curGeom++) {
-        var coordinates = geometries[curGeom].coordinates,
-            isArray = coordinates && $.isArray(coordinates[0]),
-            isDblArray = isArray && $.isArray(coordinates[0][0]),
-            isTriArray = isDblArray && $.isArray(coordinates[0][0][0]),
-            i, j, k;
-
-        if (!isTriArray) {
-          if (!isDblArray) {
-            if (!isArray) {
-              coordinates = [coordinates];
-            }
-            coordinates = [coordinates];
-          }
-          coordinates = [coordinates];
-        }
-
-        for (i = 0; i < coordinates.length; i++) {
-          for (j = 0; j < coordinates[i].length; j++) {
-            for (k = 0; k < coordinates[i][j].length; k++) {
-              result.push(coordinates[i][j][k]);
-            }
-          }
-        }
-      }
-      return result;
-    },
-
-    //
-    // bbox functions
-    //
-
-    center: function (bbox, _ignoreGeo /* Internal Use Only */) {
-      // Envelope.centre in JTS
-      // bbox only, use centroid for geom
-      if (!_ignoreGeo && $.geo.proj) {
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-      var center = [(bbox[0] + bbox[2]) / 2, (bbox[1] + bbox[3]) / 2];
-      return !_ignoreGeo && $.geo.proj ? $.geo.proj.toGeodetic(center) : center;
-    },
-
-    expandBy: function (bbox, dx, dy) {
-      if ($.geo.proj) {
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-      bbox = [bbox[0] - dx, bbox[1] - dy, bbox[2] + dx, bbox[3] + dy];
-      return $.geo.proj ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    height: function (bbox, _ignoreGeo /* Internal Use Only */ ) {
-      if (!_ignoreGeo && $.geo.proj) {
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-      return bbox[3] - bbox[1];
-    },
-
-    _in: function(bbox1, bbox2) {
-      return bbox1[0] <= bbox2[0] &&
-             bbox1[1] <= bbox2[1] &&
-             bbox1[2] >= bbox2[2] &&
-             bbox1[3] >= bbox2[3];
-    },
-
-    _bboxDisjoint: function( bbox1, bbox2 ) {
-      return bbox2[ 0 ] > bbox1[ 2 ] || 
-             bbox2[ 2 ] < bbox1[ 0 ] || 
-             bbox2[ 1 ] > bbox1[ 3 ] ||
-             bbox2[ 3 ] < bbox1[ 1 ];
-    },
-
-    reaspect: function (bbox, ratio, _ignoreGeo /* Internal Use Only */ ) {
-      // not in JTS
-      if (!_ignoreGeo && $.geo.proj) {
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-      var width = this.width(bbox, true),
-          height = this.height(bbox, true),
-          center = this.center(bbox, true),
-          dx, dy;
-
-      if (width != 0 && height != 0 && ratio > 0) {
-        if (width / height > ratio) {
-          dx = width / 2;
-          dy = dx / ratio;
-        } else {
-          dy = height / 2;
-          dx = dy * ratio;
-        }
-
-        bbox = [center[0] - dx, center[1] - dy, center[0] + dx, center[1] + dy];
-      }
-      return $.geo.proj ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    scaleBy: function ( bbox, scale, _ignoreGeo /* Internal Use Only */ ) {
-      // not in JTS
-      if (!_ignoreGeo && $.geo.proj) {
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-      var c = this.center(bbox, true),
-          dx = (bbox[2] - bbox[0]) * scale / 2,
-          dy = (bbox[3] - bbox[1]) * scale / 2;
-      bbox = [c[0] - dx, c[1] - dy, c[0] + dx, c[1] + dy];
-      return !_ignoreGeo && $.geo.proj ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    width: function (bbox, _ignoreGeo /* Internal Use Only */ ) {
-      if (!_ignoreGeo && $.geo.proj) {
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-      return bbox[2] - bbox[0];
-    },
-
-    //
-    // geometry functions
-    //
-
-    // bbox (Geometry.getEnvelope in JTS)
-
-    bbox: function ( geom, _ignoreGeo /* Internal Use Only */ ) {
-      if ( !geom ) {
-        return undefined;
-      } else if ( geom.bbox ) {
-        result = !_ignoreGeo && $.geo.proj ? $.geo.proj.fromGeodetic( geom.bbox ) : geom.bbox;
-      } else {
-        result = [ pos_oo, pos_oo, neg_oo, neg_oo ];
-
-        var coordinates = this._allCoordinates( geom ),
-            curCoord = 0;
-
-        if ( coordinates.length == 0 ) {
-          return undefined;
-        }
-
-        if ( $.geo.proj ) {
-          coordinates = $.geo.proj.fromGeodetic( coordinates );
-        }
-
-        for ( ; curCoord < coordinates.length; curCoord++ ) {
-          result[0] = Math.min(coordinates[curCoord][0], result[0]);
-          result[1] = Math.min(coordinates[curCoord][1], result[1]);
-          result[2] = Math.max(coordinates[curCoord][0], result[2]);
-          result[3] = Math.max(coordinates[curCoord][1], result[3]);
-        }
-      }
-
-      return $.geo.proj ? $.geo.proj.toGeodetic(result) : result;
-    },
-
-    // centroid
-    
-    centroid: function( geom, _ignoreGeo /* Internal Use Only */ ) {
-      switch (geom.type) {
-        case "Point":
-          return $.extend({}, geom);
-
-        case "LineString":
-        case "Polygon":
-          var a = 0,
-              c = [0, 0],
-              coords = $.merge( [ ], geom.type == "Polygon" ? geom.coordinates[0] : geom.coordinates ),
-              i = 1, j, n;
-
-          if ( !_ignoreGeo && $.geo.proj ) {
-            coords = $.geo.proj.fromGeodetic(coords);
-          }
-
-          //if (coords[0][0] != coords[coords.length - 1][0] || coords[0][1] != coords[coords.length - 1][1]) {
-          //  coords.push(coords[0]);
-          //}
-
-          for (; i <= coords.length; i++) {
-            j = i % coords.length;
-            n = (coords[i - 1][0] * coords[j][1]) - (coords[j][0] * coords[i - 1][1]);
-            a += n;
-            c[0] += (coords[i - 1][0] + coords[j][0]) * n;
-            c[1] += (coords[i - 1][1] + coords[j][1]) * n;
-          }
-
-          if (a == 0) {
-            if (coords.length > 0) {
-              c[0] = coords[0][0];
-              c[1] = coords[0][1];
-              return { type: "Point", coordinates: !_ignoreGeo && $.geo.proj ? $.geo.proj.toGeodetic(c) : c };
-            } else {
-              return undefined;
-            }
-          }
-
-          a *= 3;
-          c[0] /= a;
-          c[1] /= a;
-
-          return { type: "Point", coordinates: !_ignoreGeo && $.geo.proj ? $.geo.proj.toGeodetic(c) : c };
-      }
-      return undefined;
-    },
-
-    // contains
-
-    contains: function (geom1, geom2) {
-      if (geom1.type != "Polygon") {
-        return false;
-      }
-
-      switch (geom2.type) {
-        case "Point":
-          return this._containsPolygonPoint(geom1.coordinates, geom2.coordinates);
-
-        case "LineString":
-          return this._containsPolygonLineString(geom1.coordinates, geom2.coordinates);
-
-        case "Polygon":
-          return this._containsPolygonLineString(geom1.coordinates, geom2.coordinates[0]);
-
-        default:
-          return false;
-      }
-    },
-
-    _containsPolygonPoint: function (polygonCoordinates, pointCoordinate) {
-      if (polygonCoordinates.length == 0 || polygonCoordinates[0].length < 4) {
-        return false;
-      }
-
-      var rayCross = 0,
-          a = polygonCoordinates[0][0],
-          i = 1,
-          b,
-          x;
-
-      for (; i < polygonCoordinates[0].length; i++) {
-        b = polygonCoordinates[0][i];
-
-        if ((a[1] <= pointCoordinate[1] && pointCoordinate[1] < b[1]) || (b[1] <= pointCoordinate[1] && pointCoordinate[1] < a[1]) && (pointCoordinate[0] < a[0] || pointCoordinate[0] < b[0])) {
-          x = a[0] + (b[0] - a[0]) * (pointCoordinate[1] - a[1]) / (b[1] - a[1]);
-
-          if (x > pointCoordinate[0]) {
-            rayCross++;
-          }
-        }
-
-        a = b;
-      }
-
-      return rayCross % 2 == 1;
-    },
-
-    _containsPolygonLineString: function (polygonCoordinates, lineStringCoordinates) {
-      for (var i = 0; i < lineStringCoordinates.length; i++) {
-        if (!this._containsPolygonPoint(polygonCoordinates, lineStringCoordinates[i])) {
-          return false;
-        }
-      }
-      return true;
-    },
-
-    // distance
-
-    distance: function ( geom1, geom2, _ignoreGeo /* Internal Use Only */ ) {
-      var geom1CoordinatesProjected = !_ignoreGeo && $.geo.proj ? $.geo.proj.fromGeodetic(geom1.coordinates) : geom1.coordinates,
-          geom2CoordinatesProjected = !_ignoreGeo && $.geo.proj ? $.geo.proj.fromGeodetic(geom2.coordinates) : geom2.coordinates;
-
-      switch (geom1.type) {
-        case "Point":
-          switch (geom2.type) {
-            case "Point":
-              return this._distancePointPoint(geom2CoordinatesProjected, geom1CoordinatesProjected);
-            case "LineString":
-              return this._distanceLineStringPoint(geom2CoordinatesProjected, geom1CoordinatesProjected);
-            case "Polygon":
-              return this._containsPolygonPoint(geom2CoordinatesProjected, geom1CoordinatesProjected) ? 0 : this._distanceLineStringPoint(geom2CoordinatesProjected[0], geom1CoordinatesProjected);
-            default:
-              return undefined;
-          }
-          break;
-
-        case "LineString":
-          switch (geom2.type) {
-            case "Point":
-              return this._distanceLineStringPoint(geom1CoordinatesProjected, geom2CoordinatesProjected);
-            case "LineString":
-              return this._distanceLineStringLineString(geom1CoordinatesProjected, geom2CoordinatesProjected);
-            case "Polygon":
-              return this._containsPolygonLineString(geom2CoordinatesProjected, geom1CoordinatesProjected) ? 0 : this._distanceLineStringLineString(geom2CoordinatesProjected[0], geom1CoordinatesProjected);
-            default:
-              return undefined;
-          }
-          break;
-
-        case "Polygon":
-          switch (geom2.type) {
-            case "Point":
-              return this._containsPolygonPoint(geom1CoordinatesProjected, geom2CoordinatesProjected) ? 0 : this._distanceLineStringPoint(geom1CoordinatesProjected[0], geom2CoordinatesProjected);
-            case "LineString":
-              return this._containsPolygonLineString(geom1CoordinatesProjected, geom2CoordinatesProjected) ? 0 : this._distanceLineStringLineString(geom1CoordinatesProjected[0], geom2CoordinatesProjected);
-            case "Polygon":
-              return this._containsPolygonLineString(geom1CoordinatesProjected, geom2CoordinatesProjected[0]) ? 0 : this._distanceLineStringLineString(geom1CoordinatesProjected[0], geom2CoordinatesProjected[0]);
-            default:
-              return undefined;
-          }
-          break;
-      }
-    },
-
-    _distancePointPoint: function (coordinate1, coordinate2) {
-      var dx = coordinate2[0] - coordinate1[0],
-          dy = coordinate2[1] - coordinate1[1];
-      return Math.sqrt((dx * dx) + (dy * dy));
-    },
-
-    _distanceLineStringPoint: function (lineStringCoordinates, pointCoordinate) {
-      var minDist = pos_oo;
-
-      if (lineStringCoordinates.length > 0) {
-        var a = lineStringCoordinates[0],
-
-            apx = pointCoordinate[0] - a[0],
-            apy = pointCoordinate[1] - a[1];
-
-        if (lineStringCoordinates.length == 1) {
-          return Math.sqrt(apx * apx + apy * apy);
-        } else {
-          for (var i = 1; i < lineStringCoordinates.length; i++) {
-            var b = lineStringCoordinates[i],
-
-                abx = b[0] - a[0],
-                aby = b[1] - a[1],
-                bpx = pointCoordinate[0] - b[0],
-                bpy = pointCoordinate[1] - b[1],
-
-                d = this._distanceSegmentPoint(abx, aby, apx, apy, bpx, bpy);
-
-            if (d == 0) {
-              return 0;
-            }
-
-            if (d < minDist) {
-              minDist = d;
-            }
-
-            a = b;
-            apx = bpx;
-            apy = bpy;
-          }
-        }
-      }
-
-      return Math.sqrt(minDist);
-    },
-
-    _distanceSegmentPoint: function (abx, aby, apx, apy, bpx, bpy) {
-      var dot1 = abx * apx + aby * apy;
-
-      if (dot1 <= 0) {
-        return apx * apx + apy * apy;
-      }
-
-      var dot2 = abx * abx + aby * aby;
-
-      if (dot1 >= dot2) {
-        return bpx * bpx + bpy * bpy;
-      }
-
-      return apx * apx + apy * apy - dot1 * dot1 / dot2;
-    },
-
-    _distanceLineStringLineString: function (lineStringCoordinates1, lineStringCoordinates2) {
-      var minDist = pos_oo;
-      for (var i = 0; i < lineStringCoordinates2.length; i++) {
-        minDist = Math.min(minDist, this._distanceLineStringPoint(lineStringCoordinates1, lineStringCoordinates2[i]));
-      }
-      return minDist;
-    },
-
-    //
-    // feature
-    //
-
-    _flatten: function (geom) {
-      // return an array of all basic geometries
-      // not in JTS
-      var geometries = [],
-          curGeom = 0;
-      switch (geom.type) {
-        case "Feature":
-          $.merge(geometries, this._flatten(geom.geometry));
-          break;
-
-        case "FeatureCollection":
-          for (; curGeom < geom.features.length; curGeom++) {
-            $.merge(geometries, this._flatten(geom.features[curGeom].geometry));
-          }
-          break;
-
-        case "GeometryCollection":
-          for (; curGeom < geom.geometries.length; curGeom++) {
-            $.merge(geometries, this._flatten(geom.geometries[curGeom]));
-          }
-          break;
-
-        default:
-          geometries[0] = geom;
-          break;
-      }
-      return geometries;
-    },
-
-    //
-    // WKT functions
-    //
-
-    _WKT: (function () {
-      function pointToString(value) {
-        return "POINT " + pointToUntaggedString(value.coordinates);
-      }
-
-      function pointToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMPTY";
-        } else {
-          return "(" + coordinates.join(" ") + ")";
-        }
-      }
-
-      function lineStringToString(value) {
-        return "LINESTRING " + lineStringToUntaggedString(value.coordinates);
-      }
-
-      function lineStringToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMPTY";
-        } else {
-          var points = []
-
-          for (var i = 0; i < coordinates.length; i++) {
-            points.push(coordinates[i].join(" "));
-          }
-
-          return "(" + points + ")";
-        }
-      }
-
-      function polygonToString(value) {
-        return "POLYGON " + polygonToUntaggedString(value.coordinates);
-      }
-
-      function polygonToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMTPY";
-        } else {
-          var lineStrings = [];
-
-          for (var i = 0; i < coordinates.length; i++) {
-            lineStrings.push(lineStringToUntaggedString(coordinates[i]));
-          }
-
-          return "(" + lineStrings + ")";
-        }
-      }
-
-      function multiPointToString(value) {
-        return "MULTIPOINT " + lineStringToUntaggedString(value.coordinates);
-      }
-
-      function multiLineStringToString(value) {
-        return "MULTILINSTRING " + polygonToUntaggedString(value.coordinates);
-      }
-
-      function multiPolygonToString(value) {
-        return "MULTIPOLYGON " + multiPolygonToUntaggedString(value.coordinates);
-      }
-
-      function multiPolygonToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMPTY";
-        } else {
-          var polygons = [];
-          for (var i = 0; i < coordinates.length; i++) {
-            polygons.push(polygonToUntaggedString(coordinates[i]));
-          }
-          return "(" + polygons + ")";
-        }
-      }
-
-      function geometryCollectionToString(value) {
-        return "GEOMETRYCOLLECTION " + geometryCollectionToUntaggedString(value.geometries);
-      }
-
-      function geometryCollectionToUntaggedString(geometries) {
-        if (!(geometries && geometries.length)) {
-          return "EMPTY";
-        } else {
-          var geometryText = [];
-          for (var i = 0; i < geometries.length; i++) {
-            geometryText.push(stringify(geometries[i]));
-          }
-          return "(" + geometries + ")";
-        }
-      }
-
-      function stringify(value) {
-        if (!(value && value.type)) {
-          return "";
-        } else {
-          switch (value.type) {
-            case "Point":
-              return pointToString(value);
-
-            case "LineString":
-              return lineStringToString(value);
-
-            case "Polygon":
-              return polygonToString(value);
-
-            case "MultiPoint":
-              return multiPointToString(value);
-
-            case "MultiLineString":
-              return multiLineStringToString(value);
-
-            case "MultiPolygon":
-              return multiPolygonToString(value);
-
-            case "GeometryCollection":
-              return geometryCollectionToString(value);
-
-            default:
-              return "";
-          }
-        }
-      }
-
-      function pointParseUntagged(wkt) {
-        var pointString = wkt.match(/\(\s*([\d\.-]+)\s+([\d\.-]+)\s*\)/);
-        return pointString && pointString.length >= 2 ? {
-          type: "Point",
-          coordinates: [
-            parseFloat(pointString[1]),
-            parseFloat(pointString[2])
-          ]
-        } : null;
-      }
-
-      function parse(wkt) {
-        wkt = $.trim(wkt);
-
-        var typeIndex = wkt.indexOf(" ");
-
-        switch (wkt.substr(0, typeIndex).toUpperCase()) {
-          case "POINT":
-            return pointParseUntagged(wkt.substr(typeIndex + 1));
-        }
-      }
-
-      return {
-        stringify: stringify,
-
-        parse: parse
-      };
-    })(),
-
-    //
-    // projection functions
-    //
-
-    proj: (function () {
-      var halfPi = 1.5707963267948966192,
-          quarterPi = 0.7853981633974483096,
-          radiansPerDegree = 0.0174532925199432958,
-          degreesPerRadian = 57.295779513082320877,
-          semiMajorAxis = 6378137;
-
-      return {
-        fromGeodeticPos: function (coordinate) {
-          if (!coordinate) {
-            debugger;
-          }
-          return [
-            semiMajorAxis * coordinate[ 0 ] * radiansPerDegree,
-            semiMajorAxis * Math.log(Math.tan(quarterPi + coordinate[ 1 ] * radiansPerDegree / 2))
-          ];
-        },
-
-        fromGeodetic: function (coordinates) {
-          var isMultiPointOrLineString = $.isArray(coordinates[ 0 ]),
-              fromGeodeticPos = this.fromGeodeticPos;
-
-          if (!isMultiPointOrLineString && coordinates.length == 4) {
-            // bbox
-            var min = fromGeodeticPos([ coordinates[ 0 ], coordinates[ 1 ] ]),
-                max = fromGeodeticPos([ coordinates[ 2 ], coordinates[ 3 ] ]);
-            return [ min[ 0 ], min[ 1 ], max[ 0 ], max[ 1 ] ];
-          } else {
-            // geometry
-            var isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray(coordinates[ 0 ][ 0 ]),
-                isMultiPolygon = isMultiLineStringOrPolygon && $.isArray(coordinates[ 0 ][ 0 ][ 0 ]),
-                result = [ ],
-                i, j, k;
-
-            if (!isMultiPolygon) {
-              if (!isMultiLineStringOrPolygon) {
-                if (!isMultiPointOrLineString) {
-                  coordinates = [ coordinates ];
-                }
-                coordinates = [ coordinates ];
-              }
-              coordinates = [ coordinates ];
-            }
-
-            for ( i = 0; i < coordinates.length; i++ ) {
-              result[ i ] = [ ];
-              for ( j = 0; j < coordinates[ i ].length; j++ ) {
-                result[ i ][ j ] = [ ];
-                for ( k = 0; k < coordinates[ i ][ j ].length; k++ ) {
-                  result[ i ][ j ][ k ] = fromGeodeticPos(coordinates[ i ][ j ][ k ]);
-                }
-              }
-            }
-
-            return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-          }
-        },
-
-        toGeodeticPos: function (coordinate) {
-          return [
-            (coordinate[ 0 ] / semiMajorAxis) * degreesPerRadian,
-            (halfPi - 2 * Math.atan(1 / Math.exp(coordinate[ 1 ] / semiMajorAxis))) * degreesPerRadian
-          ];
-        },
-
-        toGeodetic: function (coordinates) {
-          var isMultiPointOrLineString = $.isArray(coordinates[ 0 ]),
-              toGeodeticPos = this.toGeodeticPos;
-
-          if (!isMultiPointOrLineString && coordinates.length == 4) {
-            // bbox
-            var min = toGeodeticPos([ coordinates[ 0 ], coordinates[ 1 ] ]),
-                max = toGeodeticPos([ coordinates[ 2 ], coordinates[ 3 ] ]);
-            return [ min[ 0 ], min[ 1 ], max[ 0 ], max[ 1 ] ];
-          } else {
-            // geometry
-            var isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray(coordinates[ 0 ][ 0 ]),
-                isMultiPolygon = isMultiLineStringOrPolygon && $.isArray(coordinates[ 0 ][ 0 ][ 0 ]),
-                result = [ ];
-
-            if (!isMultiPolygon) {
-              if (!isMultiLineStringOrPolygon) {
-                if (!isMultiPointOrLineString) {
-                  coordinates = [ coordinates ];
-                }
-                coordinates = [ coordinates ];
-              }
-              coordinates = [ coordinates ];
-            }
-
-            for ( i = 0; i < coordinates.length; i++ ) {
-              result[ i ] = [ ];
-              for ( j = 0; j < coordinates[ i ].length; j++ ) {
-                result[ i ][ j ] = [ ];
-                for ( k = 0; k < coordinates[ i ][ j ].length; k++ ) {
-                  result[ i ][ j ][ k ] = toGeodeticPos(coordinates[ i ][ j ][ k ]);
-                }
-              }
-            }
-
-            return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-          }
-        }
-      }
-    })(),
-
-    //
-    // service types (defined in other files)
-    //
-
-    _serviceTypes: {}
-  }
-})(jQuery, this);
-(function ($, undefined) {
-
-  var _ieVersion = (function () {
-    var v = 5, div = document.createElement("div"), a = div.all || [];
-    while (div.innerHTML = "<!--[if gt IE " + (++v) + "]><br><![endif]-->", a[0]) { }
-    return v > 6 ? v : !v;
-  } ());
-
-  $.widget("geo.geographics", {
-    _$elem: undefined,
-    _options: {},
-    _trueCanvas: true,
-
-    _width: 0,
-    _height: 0,
-
-    _$canvas: undefined,
-    _context: undefined,
-
-    options: {
-      style: {
-        borderRadius: "8px",
-        color: "#7f0000",
-        //fill: undefined,
-        fillOpacity: .2,
-        height: "8px",
-        opacity: 1,
-        //stroke: undefined,
-        strokeOpacity: 1,
-        strokeWidth: "2px",
-        visibility: "visible",
-        width: "8px"
-      }
-    },
-
-    _create: function () {
-      this._$elem = this.element;
-      this._options = this.options;
-
-      this._$elem.css({ display: "inline-block", overflow: "hidden", textAlign: "left" });
-
-      if (this._$elem.css("position") == "static") {
-        this._$elem.css("position", "relative");
-      }
-
-      this._width = this._$elem.width();
-      this._height = this._$elem.height();
-
-      if (!(this._width && this._height)) {
-        this._width = parseInt(this._$elem.css("width"));
-        this._height = parseInt(this._$elem.css("height"));
-      }
-
-      if (document.createElement('canvas').getContext) {
-        this._$elem.append('<canvas width="' + this._width + '" height="' + this._height + '" style="position:absolute; left:0; top:0; width:' + this._width + 'px; height:' + this._height + 'px;"></canvas>');
-        this._$canvas = this._$elem.children(':last');
-        this._context = this._$canvas[0].getContext("2d");
-      } else if (_ieVersion <= 8) {
-        this._trueCanvas = false;
-        this._$elem.append('<div width="' + this._width + '" height="' + this._height + '" style="position:absolute; left:0; top:0; width:' + this._width + 'px; height:' + this._height + 'px; margin:0; padding:0;"></div>');
-        this._$canvas = this._$elem.children(':last');
-
-        G_vmlCanvasManager.initElement(this._$canvas[0]);
-        this._context = this._$canvas[0].getContext("2d");
-        this._$canvas.children().css({ backgroundColor: "transparent", width: this._width, height: this._height });
-      }
-    },
-
-    _setOption: function (key, value) {
-      if (key == "style") {
-        value = $.extend({}, this._options.style, value);
-      }
-      $.Widget.prototype._setOption.apply(this, arguments);
-    },
-
-    destroy: function () {
-      $.Widget.prototype.destroy.apply(this, arguments);
-      this._$elem.html("");
-    },
-
-    clear: function () {
-      this._context.clearRect(0, 0, this._width, this._height);
-    },
-
-    drawArc: function (coordinates, startAngle, sweepAngle, style) {
-      style = this._getGraphicStyle(style);
-
-      if (style.visibility != "hidden" && style.opacity > 0 && style.widthValue > 0 && style.heightValue > 0) {
-        var r = Math.min(style.widthValue, style.heightValue) / 2;
-
-        startAngle = (startAngle * Math.PI / 180);
-        sweepAngle = (sweepAngle * Math.PI / 180);
-
-        this._context.save();
-        this._context.translate(coordinates[0], coordinates[1]);
-        if (style.widthValue > style.heightValue) {
-          this._context.scale(style.widthValue / style.heightValue, 1);
-        } else {
-          this._context.scale(1, style.heightValue / style.widthValue);
-        }
-
-        this._context.beginPath();
-        this._context.arc(0, 0, r, startAngle, sweepAngle, false);
-
-        if (this._trueCanvas) {
-          this._context.restore();
-        }
-
-        if (style.doFill) {
-          this._context.fillStyle = style.fill;
-          this._context.globalAlpha = style.opacity * style.fillOpacity;
-          this._context.fill();
-        }
-
-        if (style.doStroke) {
-          this._context.lineJoin = "round";
-          this._context.lineWidth = style.strokeWidthValue;
-          this._context.strokeStyle = style.stroke;
-
-          this._context.globalAlpha = style.opacity * style.strokeOpacity;
-          this._context.stroke();
-        }
-
-        if (!this._trueCanvas) {
-          this._context.restore();
-        }
-      }
-    },
-
-    drawPoint: function (coordinates, style) {
-      var style = this._getGraphicStyle(style);
-      if (style.widthValue == style.heightValue && style.heightValue == style.borderRadiusValue) {
-        this.drawArc(coordinates, 0, 360, style);
-      } else if (style.visibility != "hidden" && style.opacity > 0) {
-        style.borderRadiusValue = Math.min(Math.min(style.widthValue, style.heightValue) / 2, style.borderRadiusValue);
-        coordinates[0] -= style.widthValue / 2;
-        coordinates[1] -= style.heightValue / 2;
-        this._context.beginPath();
-        this._context.moveTo(coordinates[0] + style.borderRadiusValue, coordinates[1]);
-        this._context.lineTo(coordinates[0] + style.widthValue - style.borderRadiusValue, coordinates[1]);
-        this._context.quadraticCurveTo(coordinates[0] + style.widthValue, coordinates[1], coordinates[0] + style.widthValue, coordinates[1] + style.borderRadiusValue);
-        this._context.lineTo(coordinates[0] + style.widthValue, coordinates[1] + style.heightValue - style.borderRadiusValue);
-        this._context.quadraticCurveTo(coordinates[0] + style.widthValue, coordinates[1] + style.heightValue, coordinates[0] + style.widthValue - style.borderRadiusValue, coordinates[1] + style.heightValue);
-        this._context.lineTo(coordinates[0] + style.borderRadiusValue, coordinates[1] + style.heightValue);
-        this._context.quadraticCurveTo(coordinates[0], coordinates[1] + style.heightValue, coordinates[0], coordinates[1] + style.heightValue - style.borderRadiusValue);
-        this._context.lineTo(coordinates[0], coordinates[1] + style.borderRadiusValue);
-        this._context.quadraticCurveTo(coordinates[0], coordinates[1], coordinates[0] + style.borderRadiusValue, coordinates[1]);
-        this._context.closePath();
-
-        if (style.doFill) {
-          this._context.fillStyle = style.fill;
-          this._context.globalAlpha = style.opacity * style.fillOpacity;
-          this._context.fill();
-        }
-
-        if (style.doStroke) {
-          this._context.lineJoin = "round";
-          this._context.lineWidth = style.strokeWidthValue;
-          this._context.strokeStyle = style.stroke;
-
-          this._context.globalAlpha = style.opacity * style.strokeOpacity;
-
-          this._context.stroke();
-        }
-      }
-    },
-
-    drawLineString: function (coordinates, style) {
-      this._drawLines([coordinates], false, style);
-    },
-
-    drawPolygon: function (coordinates, style) {
-      this._drawLines(coordinates, true, style);
-    },
-
-    drawBbox: function (bbox, style) {
-      this._drawLines([[
-        [bbox[0], bbox[1]],
-        [bbox[0], bbox[3]],
-        [bbox[2], bbox[3]],
-        [bbox[2], bbox[1]],
-        [bbox[0], bbox[1]]
-      ]], true, style);
-    },
-
-    _getGraphicStyle: function (style) {
-      function safeParse(value) {
-        value = parseInt(value);
-        return (+value + '') === value ? +value : value;
-      }
-
-      style = $.extend({}, this._options.style, style);
-      style.borderRadiusValue = safeParse(style.borderRadius);
-      style.fill = style.fill || style.color;
-      style.doFill = style.fill && style.fillOpacity > 0;
-      style.stroke = style.stroke || style.color;
-      style.strokeWidthValue = safeParse(style.strokeWidth);
-      style.doStroke = style.stroke && style.strokeOpacity > 0 && style.strokeWidthValue > 0;
-      style.widthValue = safeParse(style.width);
-      style.heightValue = safeParse(style.height);
-      return style;
-    },
-
-    _drawLines: function (coordinates, close, style) {
-      if (!coordinates || !coordinates.length || coordinates[0].length < 2) {
-        return;
-      }
-
-      var style = this._getGraphicStyle(style),
-          i, j;
-
-      if (style.visibility != "hidden" && style.opacity > 0) {
-        this._context.beginPath();
-        this._context.moveTo(coordinates[0][0][0], coordinates[0][0][1]);
-
-        for (i = 0; i < coordinates.length; i++) {
-          for (j = 0; j < coordinates[i].length; j++) {
-            this._context.lineTo(coordinates[i][j][0], coordinates[i][j][1]);
-          }
-        }
-
-        if (close) {
-          this._context.closePath();
-        }
-
-        if (close && style.doFill) {
-          this._context.fillStyle = style.fill;
-          this._context.globalAlpha = style.opacity * style.fillOpacity;
-          this._context.fill();
-        }
-
-        if (style.doStroke) {
-          this._context.lineCap = this._context.lineJoin = "round";
-          this._context.lineWidth = style.strokeWidthValue;
-          this._context.strokeStyle = style.stroke;
-
-          this._context.globalAlpha = style.opacity * style.strokeOpacity;
-          this._context.stroke();
-        }
-      }
-    }
-  });
-
-
-})(jQuery);
-
-(function ($, undefined) {
-  var _ieVersion = (function () {
-    var v = 5, div = document.createElement("div"), a = div.all || [];
-    while (div.innerHTML = "<!--[if gt IE " + (++v) + "]><br><![endif]-->", a[0]) { }
-    return v > 6 ? v : !v;
-  } ()),
-
-      _defaultOptions = {
-        bbox: [-180, -85, 180, 85],
-        bboxMax: [-180, -85, 180, 85],
-        center: [0, 0],
-        cursors: {
-          pan: "move",
-          zoom: "crosshair",
-          drawPoint: "crosshair",
-          drawLineString: "crosshair",
-          drawPolygon: "crosshair"
-        },
-        drawStyle: {},
-        shapeStyle: {},
-        mode: "pan",
-        services: [
-            {
-              "class": "osm",
-              type: "tiled",
-              getUrl: function (view) {
-                return "http://tile.openstreetmap.org/" + view.zoom + "/" + view.tile.column + "/" + view.tile.row + ".png";
-              },
-              attr: "&copy; OpenStreetMap &amp; contributors, CC-BY-SA"
-            }
-          ],
-        tilingScheme: {
-          tileWidth: 256,
-          tileHeight: 256,
-          levels: 18,
-          basePixelSize: 156543.03392799936,
-          origin: [-20037508.342787, 20037508.342787]
-        },
-        zoom: 0,
-        pixelSize: 0
-      };
-
-  $.widget("geo.geomap", {
-    // private widget members
-    _$elem: undefined,
-    _created: false,
-
-    _contentBounds: {},
-
-    _$contentFrame: undefined,
-    _$existingChildren: undefined,
-    _$servicesContainer: undefined,
-    _$drawContainer: undefined,
-    _$shapesContainer: undefined,
-    _$textContainer: undefined,
-    _$textContent: undefined,
-    _$eventTarget: undefined,
-
-    _dpi: 96,
-
-    _currentServices: [], //< internal copy
-
-    _center: undefined,
-    _pixelSize: undefined,
-    _centerMax: undefined,
-    _pixelSizeMax: undefined,
-
-    _wheelZoomFactor: 1.18920711500273,
-    _wheelTimeout: null,
-    _wheelLevel: 0,
-
-    _zoomFactor: 2,
-
-    _mouseDown: undefined,
-    _inOp: undefined,
-    _toolPan: undefined,
-    _shiftZoom: undefined,
-    _anchor: undefined,
-    _current: undefined,
-    _downDate: undefined,
-    _moveDate: undefined,
-    _clickDate: undefined,
-    _lastMove: undefined,
-    _lastDrag: undefined,
-
-    _windowHandler: null,
-    _resizeTimeout: null,
-
-    _panning: undefined,
-    _velocity: undefined,
-    _friction: undefined,
-
-    _supportTouch: undefined,
-    _softDblClick: undefined,
-    _isTap: undefined,
-    _isDbltap: undefined,
-
-    _drawTimeout: null, //< used in drawPoint mode so we don't send two shape events on dbltap
-    _drawPixels: [], //< an array of coordinate arrays for drawing lines & polygons, in pixel coordinates
-    _drawCoords: [],
-
-    _graphicShapes: [], //< an array of objects containing style object refs & GeoJSON object refs
-
-    _initOptions: {},
-
-    _options: {},
-
-    options: $.extend({}, _defaultOptions),
-
-    _createWidget: function (options, element) {
-      this._$elem = $(element);
-
-      if (this._$elem.is("[data-geo-service]")) {
-        $.Widget.prototype._createWidget.apply(this, arguments);
-        return;
-      }
-
-      this._$elem.attr("data-geo-map", "data-geo-map");
-
-      this._graphicShapes = [];
-
-      this._initOptions = options || {};
-
-      this._forcePosition(this._$elem);
-
-      this._$elem.css("text-align", "left");
-
-      var size = this._findMapSize();
-      this._contentBounds = {
-        x: parseInt(this._$elem.css("padding-left")),
-        y: parseInt(this._$elem.css("padding-top")),
-        width: size["width"],
-        height: size["height"]
-      };
-
-      this._createChildren();
-
-      this._center = this._centerMax = [0, 0];
-
-      this.options["pixelSize"] = this._pixelSize = this._pixelSizeMax = 156543.03392799936;
-
-      this._mouseDown =
-          this._inOp =
-          this._toolPan =
-          this._shiftZoom =
-          this._panning =
-          this._isTap =
-          this._isDbltap = false;
-
-      this._anchor =
-          this._current =
-          this._lastMove =
-          this._lastDrag =
-          this._velocity = [0, 0];
-
-      this._friction = [.8, .8];
-
-      this._downDate =
-          this._moveDate =
-          this._clickDate = 0;
-
-      $.Widget.prototype._createWidget.apply(this, arguments);
-    },
-
-    _create: function () {
-      if (this._$elem.is("[data-geo-service]")) {
-        return;
-      }
-
-      this._options = this.options;
-
-      this._supportTouch = "ontouchend" in document;
-      this._softDblClick = this._supportTouch || _ieVersion == 7;
-
-      var touchStartEvent = this._supportTouch ? "touchstart" : "mousedown",
-            touchStopEvent = this._supportTouch ? "touchend touchcancel" : "mouseup",
-            touchMoveEvent = this._supportTouch ? "touchmove" : "mousemove";
-
-      $(document).keydown($.proxy(this._document_keydown, this));
-
-      this._$eventTarget.dblclick($.proxy(this._eventTarget_dblclick, this));
-
-      this._$eventTarget.bind(touchStartEvent, $.proxy(this._eventTarget_touchstart, this));
-
-      var dragTarget = (this._$eventTarget[0].setCapture) ? this._$eventTarget : $(document);
-      dragTarget.bind(touchMoveEvent, $.proxy(this._dragTarget_touchmove, this));
-      dragTarget.bind(touchStopEvent, $.proxy(this._dragTarget_touchstop, this));
-
-      this._$eventTarget.mousewheel($.proxy(this._eventTarget_mousewheel, this));
-
-      var geomap = this;
-      this._windowHandler = function () {
-        if (geomap._resizeTimeout) {
-          clearTimeout(geomap._resizeTimeout);
-        }
-        this._resizeTimeout = setTimeout(function () {
-          if (geomap._created) {
-            geomap._$elem.geomap("resize");
-          }
-        }, 500);
-      };
-
-      $(window).resize(this._windowHandler);
-
-      this._$drawContainer.geographics({ style: this._initOptions.drawStyle || {} });
-      this._options["drawStyle"] = this._$drawContainer.geographics("option", "style");
-
-      this._$shapesContainer.geographics( { style: this._initOptions.shapeStyle || { } } );
-      this._options["shapeStyle"] = this._$shapesContainer.geographics("option", "style");
-
-      if (this._initOptions) {
-        if (this._initOptions.bbox) {
-          this._setOption("bbox", this._initOptions.bbox, false);
-        }
-        if (this._initOptions.center) {
-          this._setOption("center", this._initOptions.center, false);
-        }
-        if (this._initOptions.zoom) {
-          this._setZoom(this._initOptions.zoom, false, false);
-        }
-      }
-
-      this._$eventTarget.css("cursor", this._options["cursors"][this._options["mode"]]);
-
-      this._createServices();
-
-      this._refresh();
-
-      this._created = true;
-    },
-
-    _setOption: function (key, value, refresh) {
-      if ( this._$elem.is( "[data-geo-service]" ) || key == "pixelSize" ) {
-        return;
-      }
-
-      refresh = (refresh === undefined || refresh);
-
-      switch (key) {
-        case "bbox":
-          if ($.geo.proj) {
-            value = $.geo.proj.fromGeodetic([[value[0], value[1]], [value[2], value[3]]]);
-            value = [value[0][0], value[0][1], value[1][0], value[1][1]];
-          }
-
-          this._setBbox(value, false, refresh);
-          value = this._getBbox();
-
-          if ($.geo.proj) {
-            value = $.geo.proj.toGeodetic([[value[0], value[1]], [value[2], value[3]]]);
-            value = [value[0][0], value[0][1], value[1][0], value[1][1]];
-          }
-          break;
-
-        case "center":
-          this._setCenterAndSize($.geo.proj ? $.geo.proj.fromGeodetic([[value[0], value[1]]])[0] : value, this._pixelSize, false, refresh);
-          break;
-
-        case "drawStyle":
-          if (this._$drawContainer) {
-            this._$drawContainer.geographics("option", "style", value);
-            value = this._$drawContainer.geographics("option", "style");
-          }
-          break;
-
-        case "shapeStyle":
-          if (this._$shapesContainer) {
-            this._$shapesContainer.geographics("option", "style", value);
-            value = this._$shapesContainer.geographics("option", "style");
-          }
-          break;
-
-        case "mode":
-          this._$drawContainer.geographics("clear");
-          this._$eventTarget.css("cursor", this._options["cursors"][value]);
-          break;
-
-        case "zoom":
-          this._setZoom(value, false, refresh);
-          break;
-      }
-
-      $.Widget.prototype._setOption.apply(this, arguments);
-
-      switch (key) {
-        case "services":
-          this._createServices();
-          if (refresh) {
-            this._refresh();
-          }
-          break;
-
-        case "shapeStyle":
-          if ( refresh ) {
-            this._$shapesContainer.geographics("clear");
-            this._refreshShapes( this._$shapesContainer, this._graphicShapes, this._graphicShapes );
-          }
-          break;
-      }
-    },
-
-    destroy: function () {
-      if (this._$elem.is("[data-geo-map]")) {
-        this._created = false;
-
-        $(window).unbind("resize", this._windowHandler);
-
-        for ( var i = 0; i < this._currentServices.length; i++ ) {
-          this._currentServices[i].serviceContainer.geomap("destroy");
-          $.geo["_serviceTypes"][this._currentServices[i].type].destroy(this, this._$servicesContainer, this._currentServices[i]);
-        }
-
-        this._$shapesContainer.geographics("destroy");
-        this._$drawContainer.geographics("destroy");
-
-        this._$existingChildren.detach();
-        this._$elem.html("");
-        this._$elem.append(this._$existingChildren);
-        this._$elem.removeAttr("data-geo-map");
-      }
-      $.Widget.prototype.destroy.apply(this, arguments);
-    },
-
-    toMap: function (p) {
-      p = this._toMap(p);
-      return $.geo.proj ? $.geo.proj.toGeodetic(p) : p;
-    },
-
-    toPixel: function ( p, _center /* Internal Use Only */, _pixelSize /* Internal Use Only */ ) {
-      p = $.geo.proj ? $.geo.proj.fromGeodetic(p) : p;
-      return this._toPixel(p, _center, _pixelSize);
-    },
-
-    opacity: function (value, _serviceContainer) {
-      if (this._$elem.is("[data-geo-service]")) {
-        this._$elem.closest("[data-geo-map]").geomap("opacity", value, this._$elem);
-      } else {
-        if (value >= 0 || value <= 1) {
-          for ( var i = 0; i < this._currentServices.length; i++ ) {
-            var service = this._currentServices[i];
-            if ( !_serviceContainer || service.serviceContainer[0] == _serviceContainer[0] ) {
-              this._options["services"][i].opacity = service.opacity = value;
-              $.geo["_serviceTypes"][service.type].opacity(this, service);
-            }
-          }
-        }
-      }
-    },
-
-    toggle: function (value, _serviceContainer) {
-      if (this._$elem.is("[data-geo-service]")) {
-        this._$elem.closest("[data-geo-map]").geomap("toggle", value, this._$elem);
-      } else {
-        for (var i = 0; i < this._currentServices.length; i++) {
-          var service = this._currentServices[i];
-          if (!_serviceContainer || service.serviceContainer[0] == _serviceContainer[0]) {
-            if (value === undefined) {
-              value = (service.visibility === undefined || service.visibility === "visible" ? false : true);
-            }
-
-            this._options["services"][i].visibility = service.visibility = ( value ? "visible" : "hidden" );
-            $.geo["_serviceTypes"][service.type].toggle(this, service);
-
-            if (value) {
-              $.geo["_serviceTypes"][service.type].refresh(this, service);
-            }
-          }
-        }
-      }
-    },
-
-    zoom: function (numberOfLevels) {
-      if (numberOfLevels != null) {
-        this._setZoom(this._options["zoom"] + numberOfLevels, false, true);
-      }
-    },
-
-    refresh: function () {
-      this._refresh();
-    },
-
-    resize: function () {
-      var size = this._findMapSize(),
-          dx = size["width"]/2 - this._contentBounds.width/2,
-          dy = size["height"]/2 - this._contentBounds.height/2,
-          i;
-
-      this._contentBounds = {
-        x: parseInt(this._$elem.css("padding-left")),
-        y: parseInt(this._$elem.css("padding-top")),
-        width: size["width"],
-        height: size["height"]
-      };
-
-      this._$contentFrame.css({
-        width: size["width"],
-        height: size["height"]
-      });
-
-      this._$servicesContainer.css({
-        width: size["width"],
-        height: size["height"]
-      });
-
-      this._$eventTarget.css({
-        width: size["width"],
-        height: size["height"]
-      });
-
-      var shapeStyle = this._$shapesContainer.geographics("option", "style");
-
-      this._$shapesContainer.geographics("destroy");
-      this._$drawContainer.geographics("destroy");
-
-      for (i = 0; i < this._currentServices.length; i++) {
-        $.geo["_serviceTypes"][this._currentServices[i].type].resize(this, this._currentServices[i]);
-      }
-
-
-      this._$drawContainer.css({
-        width: size.width,
-        height: size.height
-      });
-      this._$drawContainer.geographics();
-
-      this._$shapesContainer.css({
-        width: size.width,
-        height: size.height
-      });
-      this._$shapesContainer.geographics( { style: shapeStyle } );
-
-      for (i = 0; i < this._drawPixels.length; i++) {
-        this._drawPixels[i][0] += dx;
-        this._drawPixels[i][1] += dy;
-      }
-
-      this._setCenterAndSize(this._center, this._pixelSize, false, true);
-    },
-
-    append: function ( shape, style, refresh ) {
-      if ( shape ) {
-        var shapes, i = 0;
-        if ( shape.type == "FeatureCollection" ) {
-          shapes = shape.features;
-        } else {
-          shapes = $.isArray( shape ) ? shape : [ shape ];
-        }
-
-        if ( typeof style === "boolean" ) {
-          refresh = style;
-          style = null;
-        }
-
-        for ( ; i < shapes.length; i++ ) {
-          if ( shapes[ i ].type != "Point" ) {
-            var bbox = $.geo.bbox( shapes[ i ] );
-            if ( $.geo.proj ) {
-              bbox = $.geo.proj.fromGeodetic( bbox );
-            }
-            $.data( shapes[ i ], "geoBbox", bbox );
-          }
-
-          this._graphicShapes.push( {
-            shape: shapes[ i ],
-            style: style
-          } );
-        }
-
-        if ( refresh === undefined || refresh ) {
-          this._refresh( );
-        }
-      }
-    },
-
-    empty: function ( refresh ) {
-      $.each( this._graphicShapes, function( ) {
-        $.removeData( this, "geoBbox" );
-      } );
-      this._graphicShapes = [];
-      if ( refresh === undefined || refresh ) {
-        this._refresh();
-      }
-    },
-
-    find: function (point, pixelTolerance) {
-      var searchPixel = this.toPixel( point.coordinates ),
-          mapTol = this._pixelSize * pixelTolerance,
-          result = [],
-          curGeom;
-
-      $.each( this._graphicShapes, function ( i ) {
-        if ( this.shape.type == "Point" ) {
-          if ( $.geo.distance(this.shape, point) <= mapTol ) {
-            result.push( this.shape );
-          }
-        } else {
-          var bbox = $.data( this.shape, "geoBbox" ),
-              bboxPolygon = {
-                type: "Polygon",
-                coordinates: [ [
-                  [bbox[0], bbox[1]],
-                  [bbox[0], bbox[3]],
-                  [bbox[2], bbox[3]],
-                  [bbox[2], bbox[1]],
-                  [bbox[0], bbox[1]]
-                ] ]
-              },
-              projectedPoint = {
-                type: "Point",
-                coordinates: $.geo.proj ? $.geo.proj.fromGeodetic( point.coordinates ) : point.coordinates
-              };
-
-          if ( $.geo.distance( bboxPolygon, projectedPoint, true ) <= mapTol ) {
-            var geometries = $.geo._flatten( this.shape );
-            for ( curGeom = 0; curGeom < geometries.length; curGeom++ ) {
-              if ( $.geo.distance( geometries[curGeom], point ) <= mapTol ) {
-                result.push( this.shape );
-                break;
-              }
-            }
-          }
-        }
-      });
-
-      return result;
-    },
-
-    remove: function ( shape, refresh ) {
-      var geomap = this;
-      $.each( this._graphicShapes, function ( i ) {
-        if ( this.shape == shape ) {
-          $.removeData( shape, "geoBbox" );
-          var rest = geomap._graphicShapes.slice( i + 1 );
-          geomap._graphicShapes.length = i;
-          geomap._graphicShapes.push.apply(geomap._graphicShapes, rest);
-          return false;
-        }
-      });
-
-      if ( refresh === undefined || refresh ) {
-        this._refresh();
-      }
-    },
-
-    _getBbox: function (center, pixelSize) {
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-      // calculate the internal bbox
-      var halfWidth = this._contentBounds["width"] / 2 * pixelSize,
-          halfHeight = this._contentBounds["height"] / 2 * pixelSize;
-      return [center[0] - halfWidth, center[1] - halfHeight, center[0] + halfWidth, center[1] + halfHeight];
-    },
-
-    _setBbox: function (value, trigger, refresh) {
-      var center = [value[0] + (value[2] - value[0]) / 2, value[1] + (value[3] - value[1]) / 2],
-          pixelSize = Math.max($.geo.width(value, true) / this._contentBounds.width, $.geo.height(value, true) / this._contentBounds.height);
-
-      if (this._options["tilingScheme"]) {
-        var zoom = this._getTiledZoom(pixelSize);
-        pixelSize = this._getTiledPixelSize(zoom);
-      }
-      this._setCenterAndSize(center, pixelSize, trigger, refresh);
-    },
-
-    _getBboxMax: function () {
-      // calculate the internal bboxMax
-      var halfWidth = this._contentBounds["width"] / 2 * this._pixelSizeMax,
-        halfHeight = this._contentBounds["height"] / 2 * this._pixelSizeMax;
-      return [this._centerMax[0] - halfWidth, this._centerMax[1] - halfHeight, this._centerMax[0] + halfWidth, this._centerMax[1] + halfHeight];
-    },
-
-    _getCenter: function () {
-      return this._center;
-    },
-
-    _getContentBounds: function () {
-      return this._contentBounds;
-    },
-
-    _getServicesContainer: function () {
-      return this._$servicesContainer;
-    },
-
-    _getZoom: function () {
-      // calculate the internal zoom level, vs. public zoom property
-      if (this._options["tilingScheme"]) {
-        return this._getTiledZoom(this._pixelSize);
-      } else {
-        var ratio = this._contentBounds["width"] / this._contentBounds["height"],
-            bbox = $.geo.reaspect(this._getBbox(), ratio, true),
-            bboxMax = $.geo.reaspect(this._getBboxMax(), ratio, true);
-
-        return Math.log($.geo.width(bboxMax, true) / $.geo.width(bbox, true)) / Math.log(this._zoomFactor);
-      }
-    },
-
-    _setZoom: function (value, trigger, refresh) {
-      value = Math.max(value, 0);
-
-      if (this._options["tilingScheme"]) {
-        this._setCenterAndSize(this._center, this._getTiledPixelSize(value), trigger, refresh);
-      } else {
-        var bbox = $.geo.scaleBy(this._getBboxMax(), 1 / Math.pow(this._zoomFactor, value), true),
-            pixelSize = Math.max($.geo.width(bbox, true) / this._contentBounds.width, $.geo.height(bbox, true) / this._contentBounds.height);
-        this._setCenterAndSize(this._center, pixelSize, trigger, refresh);
-      }
-    },
-
-    _createChildren: function () {
-      this._$existingChildren = this._$elem.children().detach();
-
-      this._forcePosition(this._$existingChildren);
-
-      this._$existingChildren.css("-moz-user-select", "none");
-
-      this._$elem.prepend("<div style='position:absolute; left:" + this._contentBounds.x + "px; top:" + this._contentBounds.y + "px; width:" + this._contentBounds["width"] + "px; height:" + this._contentBounds["height"] + "px; margin:0; padding:0; overflow:hidden; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none;' unselectable='on'></div>");
-      this._$eventTarget = this._$contentFrame = this._$elem.children(':first');
-
-      this._$contentFrame.append('<div style="position:absolute; left:0; top:0; width:' + this._contentBounds["width"] + 'px; height:' + this._contentBounds["height"] + 'px; margin:0; padding:0;"></div>');
-      this._$servicesContainer = this._$contentFrame.children(':last');
-
-      this._$contentFrame.append('<div style="position:absolute; left:0; top:0; width:' + this._contentBounds["width"] + 'px; height:' + this._contentBounds["height"] + 'px; margin:0; padding:0;"></div>');
-      this._$shapesContainer = this._$contentFrame.children(':last');
-
-      this._$contentFrame.append('<div style="position:absolute; left:0; top:0; width:' + this._contentBounds["width"] + 'px; height:' + this._contentBounds["height"] + 'px; margin:0; padding:0;"></div>');
-      this._$drawContainer = this._$contentFrame.children(':last');
-
-      this._$contentFrame.append('<div class="ui-widget ui-widget-content ui-corner-all" style="position:absolute; left:0; top:0px; max-width:128px; display:none;"><div style="margin:.2em;"></div></div>');
-      this._$textContainer = this._$contentFrame.children(':last');
-      this._$textContent = this._$textContainer.children();
-
-      this._$contentFrame.append(this._$existingChildren);
-    },
-
-    _createServices: function () {
-      var i;
-
-      for (i = 0; i < this._currentServices.length; i++) {
-        this._currentServices[i].serviceContainer.geomap("destroy");
-        $.geo["_serviceTypes"][this._currentServices[i].type].destroy(this, this._$servicesContainer, this._currentServices[i]);
-      }
-
-      this._currentServices = [];
-      for (i = 0; i < this._options["services"].length; i++) {
-        this._currentServices[i] = this._options["services"][i];
-        this._currentServices[i].serviceContainer = $.geo["_serviceTypes"][this._currentServices[i].type].create(this, this._$servicesContainer, this._currentServices[i], i).geomap();
-      }
-    },
-
-    _refreshDrawing: function () {
-      this._$drawContainer.geographics("clear");
-
-      if ( this._drawPixels.length > 0 ) {
-        var mode = this._options[ "mode" ],
-            coords = this._drawPixels;
-
-        if ( mode == "drawPolygon" ) {
-          coords = [ coords ];
-        }
-
-        this._$drawContainer.geographics( mode, coords );
-      }
-    },
-
-    _resetDrawing: function () {
-      //this._$textContainer.hide();
-      this._drawPixels = [];
-      this._drawCoords = [];
-      this._$drawContainer.geographics("clear");
-    },
-
-    _refreshShapes: function (geographics, shapes, styles, center, pixelSize) {
-      var i,
-          mgi,
-          shape,
-          shapeBbox,
-          style,
-          pixelPositions,
-          bbox = this._getBbox(center, pixelSize),
-          geomap = this;
-
-      for (i = 0; i < shapes.length; i++) {
-        shape = shapes[i].shape || shapes[i];
-        shape = shape.geometry || shape;
-        shapeBbox = $.data(shape, "geoBbox");
-
-        if ( shapeBbox && $.geo._bboxDisjoint( bbox, shapeBbox ) ) {
-          continue;
-        }
-
-        style = $.isArray(styles) ? styles[i].style : styles;
-
-         switch (shape.type) {
-          case "Point":
-            this._$shapesContainer.geographics("drawPoint", this.toPixel(shape.coordinates, center, pixelSize), style);
-            break;
-          case "LineString":
-            this._$shapesContainer.geographics("drawLineString", this.toPixel(shape.coordinates, center, pixelSize), style);
-            break;
-          case "Polygon":
-            pixelPositions = [];
-            $.each(shape.coordinates, function (i) {
-              pixelPositions[i] = geomap.toPixel(this, center, pixelSize);
-            });
-            this._$shapesContainer.geographics("drawPolygon", pixelPositions, style);
-            break;
-          case "MultiPoint":
-            for (mgi = 0; mgi < shape.coordinates; mgi++) {
-              this._$shapesContainer.geographics("drawPoint", this.toPixel(shape.coordinates[mgi], center, pixelSize), style);
-            }
-            break;
-          case "MultiLineString":
-            for (mgi = 0; mgi < shape.coordinates; mgi++) {
-              this._$shapesContainer.geographics("drawLineString", this.toPixel(shape.coordinates[mgi], center, pixelSize), style);
-            }
-            break;
-          case "MultiPolygon":
-            for (mgi = 0; mgi < shape.coordinates; mgi++) {
-              pixelPositions = [];
-              $.each(shape.coordinates[mgi], function (i) {
-                pixelPositions[i] = geomap.toPixel(this, center, pixelSize);
-              });
-              this._$shapesContainer.geographics("drawPolygon", pixelPositions, style);
-            }
-            break;
-
-          case "GeometryCollection":
-            geomap._refreshShapes(geographics, shape.geometries, style, center, pixelSize);
-            break;
-        }
-      }
-    },
-
-    _findMapSize: function () {
-      // really, really attempt to find a size for this thing
-      // even if it's hidden (look at parents)
-      var size = { width: 0, height: 0 },
-        sizeContainer = this._$elem;
-
-      while (sizeContainer.size() && !(size["width"] > 0 && size["height"] > 0)) {
-        size = { width: sizeContainer.width(), height: sizeContainer.height() };
-        if (size["width"] <= 0 || size["height"] <= 0) {
-          size = { width: parseInt(sizeContainer.css("width")), height: parseInt(sizeContainer.css("height")) };
-        }
-        sizeContainer = sizeContainer.parent();
-      }
-      return size;
-    },
-
-    _forcePosition: function (elem) {
-      var cssPosition = elem.css("position");
-      if (cssPosition != "relative" && cssPosition != "absolute" && cssPosition != "fixed") {
-        elem.css("position", "relative");
-      }
-    },
-
-    _getTiledPixelSize: function (zoom) {
-      var tilingScheme = this._options["tilingScheme"];
-      if (tilingScheme != null) {
-        if (zoom === 0) {
-          return tilingScheme.pixelSizes != null ? tilingScheme.pixelSizes[0] : tilingScheme.basePixelSize;
-        }
-
-        zoom = Math.round(zoom);
-        zoom = Math.max(zoom, 0);
-        var levels = tilingScheme.pixelSizes != null ? tilingScheme.pixelSizes.length : tilingScheme.levels;
-        zoom = Math.min(zoom, levels - 1);
-
-        if (tilingScheme.pixelSizes != null) {
-          return tilingScheme.pixelSizes[zoom];
-        } else {
-          return tilingScheme.basePixelSize / Math.pow(2, zoom);
-        }
-      } else {
-        return NaN;
-      }
-    },
-
-    _getTiledZoom: function (pixelSize) {
-      var tilingScheme = this._options["tilingScheme"];
-      if (tilingScheme.pixelSizes != null) {
-        var roundedPixelSize = Math.floor(pixelSize * 1000),
-          levels = tilingScheme.pixelSizes != null ? tilingScheme.pixelSizes.length : tilingScheme.levels;
-        for (var i = levels - 1; i >= 0; i--) {
-          if (Math.floor(tilingScheme.pixelSizes[i] * 1000) >= roundedPixelSize) {
-            return i;
-          }
-        }
-        return 0;
-      } else {
-        return Math.max(Math.round(Math.log(tilingScheme.basePixelSize / pixelSize) / Math.log(2)), 0);
-      }
-    },
-
-    _getZoomCenterAndSize: function (anchor, zoomDelta, zoomFactor) {
-      var pixelSize, zoomLevel, scale;
-      if (this._options["tilingScheme"]) {
-        zoomLevel = this._getTiledZoom(this._pixelSize) + zoomDelta;
-        pixelSize = this._getTiledPixelSize(zoomLevel);
-      } else {
-        scale = Math.pow(zoomFactor, -zoomDelta);
-        pixelSize = this._pixelSize * scale;
-      }
-
-      var 
-        ratio = pixelSize / this._pixelSize,
-        anchorMapCoord = this._toMap(anchor),
-        centerDelta = [(this._center[0] - anchorMapCoord[0]) * ratio, (this._center[1] - anchorMapCoord[1]) * ratio],
-        scaleCenter = [anchorMapCoord[0] + centerDelta[0], anchorMapCoord[1] + centerDelta[1]];
-
-      return { pixelSize: pixelSize, center: scaleCenter };
-    },
-
-    _mouseWheelFinish: function () {
-      this._wheelTimeout = null;
-
-      if (this._wheelLevel != 0) {
-        var wheelCenterAndSize = this._getZoomCenterAndSize(this._anchor, this._wheelLevel, this._wheelZoomFactor);
-
-        this._setCenterAndSize(wheelCenterAndSize.center, wheelCenterAndSize.pixelSize, true, true);
-
-        this._wheelLevel = 0;
-      } else {
-        this._refresh();
-      }
-    },
-
-    _panEnd: function () {
-      this._velocity = [
-        (this._velocity[0] > 0 ? Math.floor(this._velocity[0] * this._friction[0]) : Math.ceil(this._velocity[0] * this._friction[0])),
-        (this._velocity[1] > 0 ? Math.floor(this._velocity[1] * this._friction[1]) : Math.ceil(this._velocity[1] * this._friction[1]))
-      ];
-
-      if (Math.abs(this._velocity[0]) < 4 && Math.abs(this._velocity[1]) < 4) {
-        this._panFinalize();
-      } else {
-        this._current = [
-          this._current[0] + this._velocity[0],
-          this._current[1] + this._velocity[1]
-        ];
-
-        this._panMove();
-        setTimeout($.proxy(this._panEnd, this), 30);
-      }
-    },
-
-    _panFinalize: function () {
-      if (this._panning) {
-        this._velocity = [0, 0];
-
-        var dx = this._current[0] - this._anchor[0],
-            dy = this._current[1] - this._anchor[1],
-            dxMap = -dx * this._pixelSize,
-            dyMap = dy * this._pixelSize;
-
-        this._$shapesContainer.css({ left: 0, top: 0 });
-
-        this._setCenterAndSize([this._center[0] + dxMap, this._center[1] + dyMap], this._pixelSize, true, true);
-
-        this._inOp = false;
-        this._anchor = this._current;
-        this._toolPan = this._panning = false;
-
-        this._$eventTarget.css("cursor", this._options["cursors"][this._options["mode"]]);
-      }
-    },
-
-    _panMove: function () {
-      var dx = this._current[0] - this._lastDrag[0],
-          dy = this._current[1] - this._lastDrag[1],
-          i = 0,
-          service;
-
-      if (this._toolPan || dx > 3 || dx < -3 || dy > 3 || dy < -3) {
-        if (!this._toolPan) {
-          this._toolPan = true;
-          this._$eventTarget.css("cursor", this._options["cursors"]["pan"]);
-        }
-
-        if (this._mouseDown) {
-          this._velocity = [dx, dy];
-        }
-
-        if (dx != 0 || dy != 0) {
-          this._panning = true;
-          this._lastDrag = this._current;
-
-          for (i = 0; i < this._options["services"].length; i++) {
-            service = this._options["services"][i];
-            $.geo["_serviceTypes"][service.type].interactivePan(this, service, dx, dy);
-          }
-
-          this._$shapesContainer.css({
-            left: function (index, value) {
-              return parseInt(value) + dx;
-            },
-            top: function (index, value) {
-              return parseInt(value) + dy;
-            }
-          });
-
-          for (i = 0; i < this._drawPixels.length; i++) {
-            this._drawPixels[i][0] += dx;
-            this._drawPixels[i][1] += dy;
-          }
-
-          this._refreshDrawing();
-        }
-      }
-    },
-
-    _refresh: function () {
-      for (var i = 0; i < this._options["services"].length; i++) {
-        var service = this._options["services"][i];
-        if (!this._mouseDown && $.geo["_serviceTypes"][service.type] != null) {
-          $.geo["_serviceTypes"][service.type].refresh(this, service);
-        }
-      }
-
-      if (this._$shapesContainer) {
-        this._$shapesContainer.geographics("clear");
-        if (this._graphicShapes.length > 0) {
-          this._refreshShapes(this._$shapesContainer, this._graphicShapes, this._graphicShapes);
-        }
-      }
-    },
-
-    _setCenterAndSize: function (center, pixelSize, trigger, refresh) {
-      // the final call during any extent change
-      if (this._pixelSize != pixelSize) {
-        this._$shapesContainer.geographics("clear");
-        for (var i = 0; i < this._options["services"].length; i++) {
-          var service = this._options["services"][i];
-          $.geo["_serviceTypes"][service.type].interactiveScale(this, service, center, pixelSize);
-        }
-      }
-
-      this._center = center;
-      this.options["pixelSize"] = this._pixelSize = pixelSize;
-
-      if ($.geo.proj) {
-        var bbox = this._getBbox();
-        bbox = $.geo.proj.toGeodetic([[bbox[0], bbox[1]], [bbox[2], bbox[3]]]);
-        bbox = [bbox[0][0], bbox[0][1], bbox[1][0], bbox[1][1]];
-        this._options["bbox"] = bbox;
-
-        this._options["center"] = $.geo.proj.toGeodetic([[this._center[0], this._center[1]]])[0];
-      } else {
-        this._options["bbox"] = this._getBbox();
-
-        this._options["center"] = this._center;
-      }
-
-      this._options["zoom"] = this._getZoom();
-
-      if (this._drawCoords.length > 0) {
-        this._drawPixels = this._toPixel(this._drawCoords);
-      }
-
-      if (trigger) {
-        this._trigger("bboxchange", window.event, { bbox: this._options["bbox"] });
-      }
-
-      if (refresh) {
-        this._refresh();
-        this._refreshDrawing();
-      }
-    },
-
-    _toMap: function (p, center, pixelSize) {
-      // ignores $.geo.proj
-      var isArray = $.isArray(p[0]);
-      if (!isArray) {
-        p = [p];
-      }
-
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      var width = this._contentBounds["width"],
-          height = this._contentBounds["height"],
-          halfWidth = width / 2 * pixelSize,
-          halfHeight = height / 2 * pixelSize,
-          bbox = [center[0] - halfWidth, center[1] - halfHeight, center[0] + halfWidth, center[1] + halfHeight],
-          xRatio = $.geo.width(bbox, true) / width,
-          yRatio = $.geo.height(bbox, true) / height,
-          result = [];
-
-      $.each(p, function (i) {
-        var yOffset = (this[1] * yRatio);
-        result[i] = [bbox[0] + (this[0] * xRatio), bbox[3] - yOffset];
-      });
-
-      return isArray ? result : result[0];
-    },
-
-    _toPixel: function (p, center, pixelSize) {
-      // ignores $.geo.proj
-      var isArray = $.isArray(p[0]);
-      if (!isArray) {
-        p = [p];
-      }
-
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      var 
-        width = this._contentBounds["width"],
-        height = this._contentBounds["height"],
-        halfWidth = width / 2 * pixelSize,
-        halfHeight = height / 2 * pixelSize,
-        bbox = [center[0] - halfWidth, center[1] - halfHeight, center[0] + halfWidth, center[1] + halfHeight],
-        bboxWidth = $.geo.width(bbox, true),
-        bboxHeight = $.geo.height(bbox, true),
-        result = [];
-
-      $.each(p, function (i) {
-        result[i] = [
-            Math.round((this[0] - bbox[0]) * width / bboxWidth),
-            Math.round((bbox[3] - this[1]) * height / bboxHeight)
-          ];
-      });
-
-      return isArray ? result : result[0];
-    },
-
-    _zoomTo: function (coord, zoom, trigger, refresh) {
-      zoom = zoom < 0 ? 0 : zoom;
-
-      var tiledPixelSize = this._getTiledPixelSize(zoom);
-
-      if (!isNaN(tiledPixelSize)) {
-        this._setCenterAndSize(coord, tiledPixelSize, trigger, refresh);
-      } else {
-        var bboxMax = $.geo._scaleBy(this._getBboxMax(), 1 / Math.pow(this._zoomFactor, zoom), true),
-            pixelSize = Math.max($.geo.width(bboxMax, true) / this._contentBounds["width"], $.geo.height(bboxMax, true) / this._contentBounds["height"]);
-
-        this._setCenterAndSize(coord, pixelSize, trigger, refresh);
-      }
-    },
-
-    _document_keydown: function (e) {
-      var len = this._drawCoords.length;
-      if (len > 0 && e.which == 27) {
-        if (len <= 2) {
-          this._resetDrawing();
-          this._inOp = false;
-        } else {
-          this._drawCoords[len - 2] = $.merge( [], this._drawCoords[ len - 1 ] );
-          this._drawPixels[len - 2] = $.merge( [], this._drawPixels[ len - 1 ] );
-
-          this._drawCoords.length--;
-          this._drawPixels.length--;
-
-          this._refreshDrawing();
-        }
-      }
-    },
-
-    _eventTarget_dblclick_zoom: function(e) {
-      this._trigger("dblclick", e, { type: "Point", coordinates: this.toMap(this._current) });
-      if (!e.isDefaultPrevented()) {
-        var centerAndSize = this._getZoomCenterAndSize(this._current, 1, this._zoomFactor);
-        this._setCenterAndSize(centerAndSize.center, centerAndSize.pixelSize, true, true);
-      }
-    },
-
-    _eventTarget_dblclick: function (e) {
-      this._panFinalize();
-
-      if (this._drawTimeout) {
-        window.clearTimeout(this._drawTimeout);
-        this._drawTimeout = null;
-      }
-
-      var offset = $(e.currentTarget).offset();
-
-      switch (this._options["mode"]) {
-        case "pan":
-        case "drawPoint":
-          this._eventTarget_dblclick_zoom(e);
-          break;
-
-        case "drawLineString":
-          if ( this._drawCoords.length > 1 && ! ( this._drawCoords[0][0] == this._drawCoords[1][0] &&
-                                                  this._drawCoords[0][1] == this._drawCoords[1][1] ) ) {
-              this._drawCoords.length--;
-              this._trigger( "shape", e, {
-                type: "LineString",
-                coordinates: $.geo.proj ? $.geo.proj.toGeodetic(this._drawCoords) : this._drawCoords
-              } );
-          } else {
-            this._eventTarget_dblclick_zoom(e);
-          }
-          this._resetDrawing();
-          break;
-
-        case "drawPolygon":
-          if ( this._drawCoords.length > 1 && ! ( this._drawCoords[0][0] == this._drawCoords[1][0] &&
-                                                  this._drawCoords[0][1] == this._drawCoords[1][1] ) ) {
-            var endIndex = this._drawCoords.length - 1;
-            if (endIndex > 2) {
-              this._drawCoords[endIndex] = $.merge( [], this._drawCoords[0] );
-              this._trigger( "shape", e, {
-                type: "Polygon",
-                coordinates: [ $.geo.proj ? $.geo.proj.toGeodetic(this._drawCoords) : this._drawCoords ]
-              } );
-            }
-          } else {
-            this._eventTarget_dblclick_zoom(e);
-          }
-          this._resetDrawing();
-          break;
-      }
-
-      this._inOp = false;
-    },
-
-    _eventTarget_touchstart: function (e) {
-      if (!this._supportTouch && e.which != 1) {
-        return;
-      }
-
-      this._panFinalize();
-      this._mouseWheelFinish();
-
-      var offset = $(e.currentTarget).offset();
-
-      if (this._supportTouch) {
-        this._current = [e.originalEvent.changedTouches[0].pageX - offset.left, e.originalEvent.changedTouches[0].pageY - offset.top];
-      } else {
-        this._current = [e.pageX - offset.left, e.pageY - offset.top];
-      }
-
-      if (this._softDblClick) {
-        var downDate = $.now();
-        if (downDate - this._downDate < 750) {
-          if (this._isTap) {
-            var dx = this._current[0] - this._anchor[0],
-                dy = this._current[1] - this._anchor[1],
-                distance = Math.sqrt((dx * dx) + (dy * dy));
-            if (distance > 10) {
-              this._isTap = false;
-            } else {
-              this._current = this._anchor;
-            }
-          }
-
-          if (this._isDbltap) {
-            this._isDbltap = false;
-          } else {
-            this._isDbltap = this._isTap;
-          }
-        } else {
-          this._isDbltap = false;
-        }
-        this._isTap = true;
-        this._downDate = downDate;
-      }
-
-
-      this._mouseDown = true;
-      this._anchor = this._current;
-
-      if (!this._inOp && e.shiftKey) {
-        this._shiftZoom = true;
-        this._$eventTarget.css("cursor", this._options["cursors"]["zoom"]);
-      } else {
-        this._inOp = true;
-
-        switch (this._options["mode"]) {
-          case "pan":
-          case "drawPoint":
-          case "drawLineString":
-          case "drawPolygon":
-            this._lastDrag = this._current;
-
-            if (e.currentTarget.setCapture) {
-              e.currentTarget.setCapture();
-            }
-
-            break;
-        }
-      }
-
-      if ( this._inOp ) {
-        e.preventDefault();
-        return false;
-      }
-    },
-
-    _dragTarget_touchmove: function (e) {
-      var offset = this._$eventTarget.offset(),
-          drawCoordsLen = this._drawCoords.length,
-          current;
-
-      if (this._supportTouch) {
-        current = [e.originalEvent.changedTouches[0].pageX - offset.left, e.originalEvent.changedTouches[0].pageY - offset.top];
-      } else {
-        current = [e.pageX - offset.left, e.pageY - offset.top];
-      }
-
-      if (current[0] === this._lastMove[0] && current[1] === this._lastMove[1]) {
-        if ( this._inOp ) {
-          e.preventDefault();
-          return false;
-        }
-      }
-
-      if (this._softDblClick) {
-        this._isDbltap = this._isTap = false;
-      }
-
-      if (this._mouseDown) {
-        this._current = current;
-        this._moveDate = $.now();
-      }
-
-      var mode = this._shiftZoom ? "zoom" : this._options["mode"];
-
-      switch (mode) {
-        case "zoom":
-          if ( this._mouseDown ) {
-            this._$drawContainer.geographics( "clear" );
-            this._$drawContainer.geographics( "drawBbox", [
-              this._anchor[ 0 ],
-              this._anchor[ 1 ],
-              current[ 0 ],
-              current[ 1 ]
-            ] );
-          } else {
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-
-        case "pan":
-        case "drawPoint":
-          if (this._mouseDown || this._toolPan) {
-            this._panMove();
-          } else {
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-
-        case "drawLineString":
-        case "drawPolygon":
-          if (this._mouseDown || this._toolPan) {
-            this._panMove();
-          } else {
-            if (drawCoordsLen > 0) {
-              this._drawCoords[drawCoordsLen - 1] = this._toMap(current);
-              this._drawPixels[drawCoordsLen - 1] = current;
-
-              this._refreshDrawing();
-            }
-
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-      }
-
-      this._lastMove = current;
-
-      if ( this._inOp ) {
-        e.preventDefault();
-        return false;
-      }
-    },
-
-    _dragTarget_touchstop: function (e) {
-      if (!this._mouseDown && _ieVersion == 7) {
-        // ie7 doesn't appear to trigger dblclick on this._$eventTarget,
-        // we fake regular click here to cause soft dblclick
-        this._eventTarget_touchstart(e);
-      }
-
-      var mouseWasDown = this._mouseDown,
-          wasToolPan = this._toolPan,
-          offset = this._$eventTarget.offset(),
-          mode = this._shiftZoom ? "zoom" : this._options["mode"],
-          current, i, clickDate,
-          dx, dy;
-
-      if (this._supportTouch) {
-        current = [e.originalEvent.changedTouches[0].pageX - offset.left, e.originalEvent.changedTouches[0].pageY - offset.top];
-      } else {
-        current = [e.pageX - offset.left, e.pageY - offset.top];
-      }
-
-      dx = current[0] - this._anchor[0];
-      dy = current[1] - this._anchor[1];
-
-      this._$eventTarget.css("cursor", this._options["cursors"][this._options["mode"]]);
-
-      this._shiftZoom = this._mouseDown = this._toolPan = false;
-
-      if (document.releaseCapture) {
-        document.releaseCapture();
-      }
-
-      if (mouseWasDown) {
-        clickDate = $.now();
-        this._current = current;
-
-        switch (mode) {
-          case "zoom":
-            if ( dx > 0 || dy > 0 ) {
-              var minSize = this._pixelSize * 6,
-                  bboxCoords = this._toMap( [ [
-                      Math.min( this._anchor[ 0 ], current[ 0 ] ),
-                      Math.max( this._anchor[ 1 ], current[ 1 ] )
-                    ], [
-                      Math.max( this._anchor[ 0 ], current[ 0 ] ),
-                      Math.min( this._anchor[ 1 ], current[ 1 ] )
-                    ]
-                  ] ),
-                  bbox = [
-                    bboxCoords[0][0],
-                    bboxCoords[0][1],
-                    bboxCoords[1][0],
-                    bboxCoords[1][1]
-                  ];
-
-              if ( ( bbox[2] - bbox[0] ) < minSize && ( bbox[3] - bbox[1] ) < minSize ) {
-                bbox = $.geo.scaleBy( this._getBbox( $.geo.center( bbox, true ) ), .5, true );
-              }
-
-              this._setBbox(bbox, true, true);
-            }
-
-            this._resetDrawing();
-            break;
-
-          case "pan":
-            if (wasToolPan) {
-              this._panEnd();
-            } else {
-              if (clickDate - this._clickDate > 100) {
-                this._trigger("click", e, { type: "Point", coordinates: this.toMap(current) });
-                this._inOp = false;
-              }
-            }
-            break;
-
-          case "drawPoint":
-            if (this._drawTimeout) {
-              window.clearTimeout(this._drawTimeout);
-              this._drawTimeout = null;
-            }
-
-            if (wasToolPan) {
-              this._panFinalize();
-            } else {
-              if (clickDate - this._clickDate > 100) {
-                var geomap = this;
-                this._drawTimeout = setTimeout(function () {
-                  if (geomap._drawTimeout) {
-                    geomap._trigger("shape", e, { type: "Point", coordinates: geomap.toMap(current) });
-                    geomap._inOp = false;
-                    geomap._drawTimeout = false;
-                  }
-                }, 250);
-              }
-            }
-            break;
-
-          case "drawLineString":
-          case "drawPolygon":
-            if (wasToolPan) {
-              this._panFinalize();
-            } else {
-              i = (this._drawCoords.length == 0 ? 0 : this._drawCoords.length - 1);
-
-              this._drawCoords[i] = this._toMap(current);
-              this._drawPixels[i] = current;
-
-              if (i < 2 || !(this._drawCoords[i][0] == this._drawCoords[i-1][0] &&
-                             this._drawCoords[i][1] == this._drawCoords[i-1][1])) {
-                this._drawCoords[i + 1] = this._toMap(current);
-                this._drawPixels[i + 1] = current;
-              }
-
-              this._refreshDrawing();
-            }
-            break;
-        }
-
-        this._clickDate = clickDate;
-
-        if (this._softDblClick && this._isDbltap) {
-          this._isDbltap = this._isTap = false;
-          this._$eventTarget.trigger("dblclick", e);
-        }
-      }
-
-      if ( this._inOp ) {
-        e.preventDefault();
-        return false;
-      }
-    },
-
-    _eventTarget_mousewheel: function (e, delta) {
-      e.preventDefault();
-
-      this._panFinalize();
-
-      if (this._mouseDown) {
-        return false;
-      }
-
-      if (delta != 0) {
-        if (this._wheelTimeout) {
-          window.clearTimeout(this._wheelTimeout);
-          this._wheelTimeout = null;
-        } else {
-          var offset = $(e.currentTarget).offset();
-          this._anchor = [e.pageX - offset.left, e.pageY - offset.top];
-        }
-
-        this._wheelLevel += delta;
-
-        var wheelCenterAndSize = this._getZoomCenterAndSize(this._anchor, this._wheelLevel, this._wheelZoomFactor);
-
-        this._$shapesContainer.geographics("clear");
-
-        for (i = 0; i < this._options["services"].length; i++) {
-          var service = this._options["services"][i];
-          $.geo["_serviceTypes"][service.type].interactiveScale(this, service, wheelCenterAndSize.center, wheelCenterAndSize.pixelSize);
-        }
-
-        this._$shapesContainer.geographics("clear");
-        if (this._graphicShapes.length > 0 && this._graphicShapes.length < 256) {
-          this._refreshShapes(this._$shapesContainer, this._graphicShapes, this._graphicShapes, wheelCenterAndSize.center, wheelCenterAndSize.pixelSize);
-        }
-
-        if (this._drawCoords.length > 0) {
-          this._drawPixels = this._toPixel(this._drawCoords, wheelCenterAndSize.center, wheelCenterAndSize.pixelSize);
-          this._refreshDrawing();
-        }
-
-        var geomap = this;
-        this._wheelTimeout = window.setTimeout(function () {
-          geomap._mouseWheelFinish();
-        }, 1000);
-      }
-
-      return false;
-    }
-  }
-  );
-})(jQuery);
-
-(function ($, undefined) {
-  $.geo._serviceTypes.tiled = (function () {
-    return {
-      create: function (map, servicesContainer, service, index) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( !serviceState ) {
-          serviceState = {
-            loadCount: 0,
-            reloadTiles: false
-          };
-
-          var idString = service.id ? ' id="' + service.id + '"' : "",
-              classString = service["class"] ? ' class="' + service["class"] + '"' : "",
-              scHtml = '<div data-geo-service="tiled"' + idString + classString + ' style="position:absolute; left:0; top:0; width:8px; height:8px; margin:0; padding:0; display:' + (service.visibility === undefined || service.visibility === "visible" ? "block" : "none") + ';"></div>';
-
-          servicesContainer.append(scHtml);
-
-          serviceState.serviceContainer = servicesContainer.children(":last");
-          $.data(service, "geoServiceState", serviceState);
-        }
-
-        return serviceState.serviceContainer;
-      },
-
-      destroy: function (map, servicesContainer, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        serviceState.serviceContainer.remove();
-
-        $.removeData(service, "geoServiceState");
-      },
-
-      interactivePan: function ( map, service, dx, dy ) {
-        var serviceState = $.data( service, "geoServiceState" );
-
-        if ( serviceState ) {
-          this._cancelUnloaded( map, service );
-
-          serviceState.serviceContainer.children( ).css( {
-            left: function ( index, value ) {
-              return parseInt( value ) + dx;
-            },
-            top: function ( index, value ) {
-              return parseInt( value ) + dy;
-            }
-          });
-
-          if ( service && ( service.visibility === undefined || service.visibility === "visible" ) ) {
-            var pixelSize = map._pixelSize,
-
-                serviceContainer = serviceState.serviceContainer,
-                scaleContainer = serviceContainer.children("[data-pixelSize='" + pixelSize + "']"),
-
-                /* same as refresh 1 */
-                contentBounds = map._getContentBounds(),
-                mapWidth = contentBounds["width"],
-                mapHeight = contentBounds["height"],
-
-                tilingScheme = map.options["tilingScheme"],
-                tileWidth = tilingScheme.tileWidth,
-                tileHeight = tilingScheme.tileHeight,
-                /* end same as refresh 1 */
-
-                halfWidth = mapWidth / 2 * pixelSize,
-                halfHeight = mapHeight / 2 * pixelSize,
-
-                currentPosition = scaleContainer.position(),
-                scaleOriginParts = scaleContainer.data("scaleOrigin").split(","),
-                totalDx = parseInt(scaleOriginParts[0]) - currentPosition.left,
-                totalDy = parseInt(scaleOriginParts[1]) - currentPosition.top,
-
-                mapCenterOriginal = map._getCenter(),
-                mapCenter = [mapCenterOriginal[0] + totalDx * pixelSize, mapCenterOriginal[1] - totalDy * pixelSize],
-
-                /* same as refresh 2 */
-                tileX = Math.floor(((mapCenter[0] - halfWidth) - tilingScheme.origin[0]) / (pixelSize * tileWidth)),
-                tileY = Math.floor((tilingScheme.origin[1] - (mapCenter[1] + halfHeight)) / (pixelSize * tileHeight)),
-                tileX2 = Math.ceil(((mapCenter[0] + halfWidth) - tilingScheme.origin[0]) / (pixelSize * tileWidth)),
-                tileY2 = Math.ceil((tilingScheme.origin[1] - (mapCenter[1] - halfHeight)) / (pixelSize * tileHeight)),
-
-                bboxMax = map._getBboxMax(),
-                pixelSizeAtZero = map._getTiledPixelSize(0),
-                ratio = pixelSizeAtZero / pixelSize,
-                fullXAtScale = Math.floor((bboxMax[0] - tilingScheme.origin[0]) / (pixelSizeAtZero * tileWidth)) * ratio,
-                fullYAtScale = Math.floor((tilingScheme.origin[1] - bboxMax[3]) / (pixelSizeAtZero * tileHeight)) * ratio,
-
-                fullXMinX = tilingScheme.origin[0] + (fullXAtScale * tileWidth) * pixelSize,
-                fullYMaxY = tilingScheme.origin[1] - (fullYAtScale * tileHeight) * pixelSize,
-                /* end same as refresh 2 */
-
-                serviceLeft = Math.round((fullXMinX - (mapCenterOriginal[0] - halfWidth)) / pixelSize),
-                serviceTop = Math.round(((mapCenterOriginal[1] + halfHeight) - fullYMaxY) / pixelSize),
-
-                opacity = (service.opacity === undefined ? 1 : service.opacity),
-
-                x, y;
-
-            for ( x = tileX; x < tileX2; x++ ) {
-              for ( y = tileY; y < tileY2; y++ ) {
-                var tileStr = "" + x + "," + y,
-                    $img = scaleContainer.children("[data-tile='" + tileStr + "']").removeAttr("data-dirty");
-
-                if ( $img.size( ) === 0 ) {
-                  /* same as refresh 3 */
-                  var bottomLeft = [
-                        tilingScheme.origin[0] + (x * tileWidth) * pixelSize,
-                        tilingScheme.origin[1] - (y * tileHeight) * pixelSize
-                      ],
-
-                      topRight = [
-                        tilingScheme.origin[0] + ((x + 1) * tileWidth - 1) * pixelSize,
-                        tilingScheme.origin[1] - ((y + 1) * tileHeight - 1) * pixelSize
-                      ],
-
-                      tileBbox = [bottomLeft[0], bottomLeft[1], topRight[0], topRight[1]],
-
-                      imageUrl = service.getUrl( {
-                        bbox: tileBbox,
-                        width: tileWidth,
-                        height: tileHeight,
-                        zoom: map._getZoom(),
-                        tile: {
-                          row: y,
-                          column: x
-                        },
-                        index: Math.abs(y + x)
-                      } );
-                  /* end same as refresh 3 */
-
-                  serviceState.loadCount++;
-                  //this._map._requestQueued();
-
-                  if ( serviceState.reloadTiles && $img.size() > 0 ) {
-                    $img.attr( "src", imageUrl );
-                  } else {
-                    /* same as refresh 4 */
-                    var imgMarkup = "<img style='position:absolute; " +
-                          "left:" + (((x - fullXAtScale) * 100) + (serviceLeft - (serviceLeft % tileWidth)) / tileWidth * 100) + "%; " +
-                          "top:" + (((y - fullYAtScale) * 100) + (serviceTop - (serviceTop % tileHeight)) / tileHeight * 100) + "%; ";
-
-                    if ($("body")[0].filters === undefined) {
-                      imgMarkup += "width: 100%; height: 100%;";
-                    }
-
-                    imgMarkup += "margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;' unselectable='on' data-tile='" + tileStr + "' />";
-
-                    scaleContainer.append( imgMarkup );
-                    $img = scaleContainer.children(":last");
-                    $img.load(function (e) {
-                      if (opacity < 1) {
-                        $(e.target).fadeTo(0, opacity);
-                      } else {
-                        $(e.target).show();
-                      }
-
-                      serviceState.loadCount--;
-
-                      if (serviceState.loadCount <= 0) {
-                        serviceContainer.children(":not([data-pixelSize='" + pixelSize + "'])").remove();
-                        serviceState.loadCount = 0;
-                      }
-                    }).error(function (e) {
-                      $(e.target).remove();
-                      serviceState.loadCount--;
-
-                      if (serviceState.loadCount <= 0) {
-                        serviceContainer.children(":not([data-pixelSize='" + pixelSize + "'])").remove();
-                        serviceState.loadCount = 0;
-                      }
-                    }).attr("src", imageUrl);
-                    /* end same as refresh 4 */
-                  }
-                }
-              }
-            }
-          }
-        }
-      },
-
-      interactiveScale: function (map, service, center, pixelSize) {
-        var serviceState = $.data( service, "geoServiceState" );
-
-        if ( serviceState && service && ( service.visibility === undefined || service.visibility === "visible" ) ) {
-          this._cancelUnloaded(map, service);
-
-          var serviceContainer = serviceState.serviceContainer,
-
-              tilingScheme = map.options["tilingScheme"],
-              tileWidth = tilingScheme.tileWidth,
-              tileHeight = tilingScheme.tileHeight;
-
-
-          serviceContainer.children( ).each( function ( i ) {
-            var $scaleContainer = $(this),
-                scaleRatio = $scaleContainer.attr("data-pixelSize") / pixelSize;
-
-            scaleRatio = Math.round(scaleRatio * 1000) / 1000;
-
-            var scaleOriginParts = $scaleContainer.data("scaleOrigin").split(","),
-                oldMapCoord = map._toMap([scaleOriginParts[0], scaleOriginParts[1]]),
-                newPixelPoint = map._toPixel(oldMapCoord, center, pixelSize);
-
-            $scaleContainer.css( {
-              left: Math.round(newPixelPoint[0]) + "px",
-              top: Math.round(newPixelPoint[1]) + "px",
-              width: tileWidth * scaleRatio,
-              height: tileHeight * scaleRatio
-            } );
-
-            if ( $("body")[0].filters !== undefined ) {
-              $scaleContainer.children().each( function ( i ) {
-                $( this ).css( "filter", "progid:DXImageTransform.Microsoft.Matrix(FilterType=bilinear,M11=" + scaleRatio + ",M22=" + scaleRatio + ",sizingmethod='auto expand')" );
-              } );
-            }
-          });
-        }
-      },
-
-      refresh: function (map, service) {
-        var serviceState = $.data( service, "geoServiceState" );
-
-        if ( serviceState && service && ( service.visibility === undefined || service.visibility === "visible" ) ) {
-          this._cancelUnloaded(map, service);
-
-          var bbox = map._getBbox(),
-              pixelSize = map._pixelSize,
-
-              $serviceContainer = serviceState.serviceContainer,
-
-              contentBounds = map._getContentBounds(),
-              mapWidth = contentBounds["width"],
-              mapHeight = contentBounds["height"],
-
-              tilingScheme = map.options["tilingScheme"],
-              tileWidth = tilingScheme.tileWidth,
-              tileHeight = tilingScheme.tileHeight,
-
-              tileX = Math.floor((bbox[0] - tilingScheme.origin[0]) / (pixelSize * tileWidth)),
-              tileY = Math.floor((tilingScheme.origin[1] - bbox[3]) / (pixelSize * tileHeight)),
-              tileX2 = Math.ceil((bbox[2] - tilingScheme.origin[0]) / (pixelSize * tileWidth)),
-              tileY2 = Math.ceil((tilingScheme.origin[1] - bbox[1]) / (pixelSize * tileHeight)),
-
-              bboxMax = map._getBboxMax(),
-              pixelSizeAtZero = map._getTiledPixelSize(0),
-              ratio = pixelSizeAtZero / pixelSize,
-              fullXAtScale = Math.floor((bboxMax[0] - tilingScheme.origin[0]) / (pixelSizeAtZero * tileWidth)) * ratio,
-              fullYAtScale = Math.floor((tilingScheme.origin[1] - bboxMax[3]) / (pixelSizeAtZero * tileHeight)) * ratio,
-
-              fullXMinX = tilingScheme.origin[0] + (fullXAtScale * tileWidth) * pixelSize,
-              fullYMaxY = tilingScheme.origin[1] - (fullYAtScale * tileHeight) * pixelSize,
-
-              serviceLeft = Math.round((fullXMinX - bbox[0]) / pixelSize),
-              serviceTop = Math.round((bbox[3] - fullYMaxY) / pixelSize),
-
-              scaleContainers = $serviceContainer.children().show(),
-              scaleContainer = scaleContainers.filter("[data-pixelSize='" + pixelSize + "']").appendTo($serviceContainer),
-
-              opacity = (service.opacity === undefined ? 1 : service.opacity),
-
-              x, y;
-
-          if (serviceState.reloadTiles) {
-            scaleContainers.find("img").attr("data-dirty", "true");
-          }
-
-          if (!scaleContainer.size()) {
-            $serviceContainer.append("<div style='position:absolute; left:" + serviceLeft % tileWidth + "px; top:" + serviceTop % tileHeight + "px; width:" + tileWidth + "px; height:" + tileHeight + "px; margin:0; padding:0;' data-pixelSize='" + pixelSize + "'></div>");
-            scaleContainer = $serviceContainer.children(":last").data("scaleOrigin", (serviceLeft % tileWidth) + "," + (serviceTop % tileHeight));
-          } else {
-            scaleContainer.css({
-              left: (serviceLeft % tileWidth) + "px",
-              top: (serviceTop % tileHeight) + "px"
-            }).data("scaleOrigin", (serviceLeft % tileWidth) + "," + (serviceTop % tileHeight));
-
-            scaleContainer.children().each(function (i) {
-              var 
-              $img = $(this),
-              tile = $img.attr("data-tile").split(",");
-
-              $img.css({
-                left: Math.round(((parseInt(tile[0]) - fullXAtScale) * 100) + (serviceLeft - (serviceLeft % tileWidth)) / tileWidth * 100) + "%",
-                top: Math.round(((parseInt(tile[1]) - fullYAtScale) * 100) + (serviceTop - (serviceTop % tileHeight)) / tileHeight * 100) + "%"
-              });
-
-              if (opacity < 1) {
-                $img.fadeTo(0, opacity);
-              }
-            });
-          }
-
-          for (x = tileX; x < tileX2; x++) {
-            for (y = tileY; y < tileY2; y++) {
-              var 
-              tileStr = "" + x + "," + y,
-              $img = scaleContainer.children("[data-tile='" + tileStr + "']").removeAttr("data-dirty");
-
-              if ($img.size() === 0 || serviceState.reloadTiles) {
-                var bottomLeft = [
-                  tilingScheme.origin[0] + (x * tileWidth) * pixelSize,
-                  tilingScheme.origin[1] - (y * tileHeight) * pixelSize
-                ],
-
-                topRight = [
-                  tilingScheme.origin[0] + ((x + 1) * tileWidth - 1) * pixelSize,
-                  tilingScheme.origin[1] - ((y + 1) * tileHeight - 1) * pixelSize
-                ],
-
-                tileBbox = [bottomLeft[0], bottomLeft[1], topRight[0], topRight[1]],
-
-                imageUrl = service.getUrl({
-                  bbox: tileBbox,
-                  width: tileWidth,
-                  height: tileHeight,
-                  zoom: map._getZoom(),
-                  tile: {
-                    row: y,
-                    column: x
-                  },
-                  index: Math.abs(y + x)
-                });
-
-                serviceState.loadCount++;
-                //this._map._requestQueued();
-
-                if (serviceState.reloadTiles && $img.size() > 0) {
-                  $img.attr("src", imageUrl);
-                } else {
-                  var imgMarkup = "<img style='position:absolute; " +
-                    "left:" + (((x - fullXAtScale) * 100) + (serviceLeft - (serviceLeft % tileWidth)) / tileWidth * 100) + "%; " +
-                    "top:" + (((y - fullYAtScale) * 100) + (serviceTop - (serviceTop % tileHeight)) / tileHeight * 100) + "%; ";
-
-                  if ($("body")[0].filters === undefined) {
-                    imgMarkup += "width: 100%; height: 100%;";
-                  }
-
-                  imgMarkup += "margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;' unselectable='on' data-tile='" + tileStr + "' />";
-
-                  scaleContainer.append(imgMarkup);
-                  $img = scaleContainer.children(":last");
-                  $img.load(function (e) {
-                    if (opacity < 1) {
-                      $(e.target).fadeTo(0, opacity);
-                    } else {
-                      $(e.target).show();
-                    }
-
-                    serviceState.loadCount--;
-
-                    if (serviceState.loadCount <= 0) {
-                      $serviceContainer.children(":not([data-pixelSize='" + pixelSize + "'])").remove();
-                      serviceState.loadCount = 0;
-                    }
-                  }).error(function (e) {
-                    $(e.target).remove();
-                    serviceState.loadCount--;
-
-                    if (serviceState.loadCount <= 0) {
-                      $serviceContainer.children(":not([data-pixelSize='" + pixelSize + "'])").remove();
-                      serviceState.loadCount = 0;
-                    }
-                  }).attr("src", imageUrl);
-                }
-              }
-            }
-          }
-
-          scaleContainers.find("[data-dirty]").remove();
-          serviceState.reloadTiles = false;
-        }
-      },
-
-      resize: function (map, service) {
-      },
-
-      opacity: function (map, service) {
-        var serviceState = $.data( service, "geoServiceState" );
-        serviceState.serviceContainer.find("img").stop(true).fadeTo("fast", service.opacity);
-      },
-
-      toggle: function (map, service) {
-        var serviceState = $.data( service, "geoServiceState" );
-        serviceState.serviceContainer.css("display", service.visibility === "visible" ? "block" : "none");
-      },
-
-      _cancelUnloaded: function (map, service) {
-        var serviceState = $.data( service, "geoServiceState" );
-
-        if (serviceState && serviceState.loadCount > 0) {
-          serviceState.serviceContainer.find("img:hidden").remove();
-          while (serviceState.loadCount > 0) {
-            serviceState.loadCount--;
-          }
-        }
-      }
-    };
-  })();
-})(jQuery);
-(function ($, undefined) {
-  $.geo._serviceTypes.shingled = (function () {
-    return {
-      create: function (map, servicesContainer, service, index) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( !serviceState ) {
-          serviceState = {
-            loadCount: 0
-          };
-
-          var idString = service.id ? ' id="' + service.id + '"' : "",
-              classString = service["class"] ? ' class="' + service["class"] + '"' : "",
-              scHtml = '<div data-geo-service="shingled"' + idString + classString + ' style="position:absolute; left:0; top:0; width:16px; height:16px; margin:0; padding:0; display:' + (service.visibility === undefined || service.visibility === "visible" ? "block" : "none") + ';"></div>';
-
-          servicesContainer.append(scHtml);
-
-          serviceState.serviceContainer = servicesContainer.children(":last");
-          $.data(service, "geoServiceState", serviceState);
-        }
-
-        return serviceState.serviceContainer;
-      },
-
-      destroy: function (map, servicesContainer, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        serviceState.serviceContainer.remove();
-
-        $.removeData(service, "geoServiceState");
-      },
-
-      interactivePan: function (map, service, dx, dy) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( serviceState ) {
-          this._cancelUnloaded(map, service);
-
-          var serviceContainer = serviceState.serviceContainer,
-              pixelSize = map._pixelSize,
-              scaleContainer = serviceContainer.children("[data-pixelSize='" + pixelSize + "']"),
-              panContainer = scaleContainer.children("div");
-
-          if ( !panContainer.length ) {
-            scaleContainer.children("img").wrap('<div style="position:absolute; left:0; top:0; width:100%; height:100%;"></div>');
-            panContainer = scaleContainer.children("div");
-          }
-
-          panContainer.css( {
-            left: function (index, value) {
-              return parseInt(value) + dx;
-            },
-            top: function (index, value) {
-              return parseInt(value) + dy;
-            }
-          } );
-        }
-      },
-
-      interactiveScale: function (map, service, center, pixelSize) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( serviceState ) {
-          this._cancelUnloaded(map, service);
-
-          var serviceContainer = serviceState.serviceContainer,
-
-              contentBounds = map._getContentBounds(),
-              mapWidth = contentBounds["width"],
-              mapHeight = contentBounds["height"],
-
-              halfWidth = mapWidth / 2,
-              halfHeight = mapHeight / 2,
-
-              bbox = [center[0] - halfWidth, center[1] - halfHeight, center[0] + halfWidth, center[1] + halfHeight];
-
-          serviceContainer.children().each(function (i) {
-            var $scaleContainer = $(this),
-                scalePixelSize = $scaleContainer.attr("data-pixelSize"),
-                ratio = scalePixelSize / pixelSize;
-
-            $scaleContainer.css({ width: mapWidth * ratio, height: mapHeight * ratio }).children("img").each(function (i) {
-              var $img = $(this),
-                  imgCenter = $img.data("center"),
-                  x = (Math.round((imgCenter[0] - center[0]) / scalePixelSize) - halfWidth) * ratio,
-                  y = (Math.round((center[1] - imgCenter[1]) / scalePixelSize) - halfHeight) * ratio;
-
-              $img.css({ left: x + "px", top: y + "px" });
-            });
-          });
-        }
-      },
-
-      refresh: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if (serviceState && service && (service.visibility === undefined || service.visibility === "visible")) {
-          this._cancelUnloaded(map, service);
-
-          var bbox = map._getBbox(),
-              pixelSize = map._pixelSize,
-
-              serviceContainer = serviceState.serviceContainer,
-
-              contentBounds = map._getContentBounds(),
-              mapWidth = contentBounds["width"],
-              mapHeight = contentBounds["height"],
-
-              halfWidth = mapWidth / 2,
-              halfHeight = mapHeight / 2,
-
-              scaleContainer = serviceContainer.children('[data-pixelSize="' + pixelSize + '"]'),
-
-              opacity = (service.opacity === undefined ? 1 : service.opacity),
-
-              $img;
-
-          if ( !scaleContainer.size() ) {
-            serviceContainer.append('<div style="position:absolute; left:' + halfWidth + 'px; top:' + halfHeight + 'px; width:' + mapWidth + 'px; height:' + mapHeight + 'px; margin:0; padding:0;" data-pixelSize="' + pixelSize + '"></div>');
-            scaleContainer = serviceContainer.children(":last");
-          }
-
-          scaleContainer.children("img").each(function (i) {
-            var $thisimg = $(this),
-                imgCenter = $thisimg.data("center"),
-                center = map._getCenter(),
-                x = Math.round((imgCenter[0] - center[0]) / pixelSize) - halfWidth,
-                y = Math.round((center[1] - imgCenter[1]) / pixelSize) - halfHeight;
-
-            $thisimg.css({ left: x + "px", top: y + "px" });
-          });
-
-          if (opacity < 1) {
-            serviceContainer.find("img").attr("data-keepAlive", "0");
-          }
-
-          var imageUrl = service.getUrl({
-                bbox: bbox,
-                width: mapWidth,
-                height: mapHeight,
-                zoom: map._getZoom(),
-                tile: null,
-                index: 0
-              });
-
-          serviceState.loadCount++;
-          //this._map._requestQueued();
-
-          scaleContainer.append('<img style="position:absolute; left:-' + halfWidth + 'px; top:-' + halfHeight + 'px; width:100%; height:100%; margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;" unselectable="on" />');
-          $img = scaleContainer.children(":last").data("center", map._getCenter());
-          $img.load(function (e) {
-            if (opacity < 1) {
-              $(e.target).fadeTo(0, opacity);
-            } else {
-              $(e.target).show();
-            }
-
-            serviceState.loadCount--;
-
-            if (serviceState.loadCount <= 0) {
-              serviceContainer.children(':not([data-pixelSize="' + pixelSize + '"])').remove();
-
-              var panContainer = serviceContainer.find('[data-pixelSize="' + pixelSize + '"]>div');
-              if (panContainer.size() > 0) {
-                var panContainerPos = panContainer.position();
-
-                panContainer.children("img").each(function (i) {
-                  var $thisimg = $(this),
-                      x = panContainerPos.left + parseInt($thisimg.css("left")),
-                      y = panContainerPos.top + parseInt($thisimg.css("top"));
-
-                  $thisimg.css({ left: x + "px", top: y + "px" });
-                }).unwrap();
-
-                panContainer.remove();
-              }
-
-              serviceState.loadCount = 0;
-            }
-          }).error(function (e) {
-            $(e.target).remove();
-            serviceState.loadCount--;
-
-            if (serviceState.loadCount <= 0) {
-              serviceContainer.children(":not([data-pixelSize='" + pixelSize + "'])").remove();
-              serviceState.loadCount = 0;
-            }
-          }).attr("src", imageUrl);
-        }
-      },
-
-      resize: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( serviceState && service && (service.visibility === undefined || service.visibility === "visible")) {
-          this._cancelUnloaded(map, service);
-
-          var serviceState = shingledServicesState[service.id],
-              serviceContainer = serviceState.serviceContainer,
-
-              contentBounds = map._getContentBounds(),
-              mapWidth = contentBounds["width"],
-              mapHeight = contentBounds["height"],
-
-              halfWidth = mapWidth / 2,
-              halfHeight = mapHeight / 2,
-
-              scaleContainer = serviceContainer.children();
-
-          scaleContainer.attr("data-pixelSize", "0");
-          scaleContainer.css({
-            left: halfWidth + 'px',
-            top: halfHeight + 'px'
-          });
-        }
-      },
-
-      opacity: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-        serviceState.serviceContainer.find("img").stop(true).fadeTo("fast", service.opacity);
-      },
-
-      toggle: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-        serviceState.serviceContainer.css("display", service.visibility === "visible" ? "block" : "none");
-      },
-
-      _cancelUnloaded: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if (serviceState && serviceState.loadCount > 0) {
-          serviceState.serviceContainer.find("img:hidden").remove();
-          while (serviceState.loadCount > 0) {
-            serviceState.loadCount--;
-          }
-        }
-      }
-    }
-  })();
-})(jQuery);
diff --git a/libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0a3.min.js b/libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0a3.min.js
deleted file mode 100755 (executable)
index c7bf3b2..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-document.createElement("canvas").getContext||function(){function e(){return this.context_||(this.context_=new s(this))}function r(h,n){var q=K.call(arguments,2);return function(){return h.apply(n,q.concat(K.call(arguments)))}}function p(h){h.namespaces.g_vml_||h.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML");h.namespaces.g_o_||h.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML");if(!h.styleSheets.ex_canvas_){h=h.createStyleSheet();h.owningElement.id=
-"ex_canvas_";h.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function a(h){var n=h.srcElement;switch(h.propertyName){case "width":n.getContext().clearRect();n.style.width=n.attributes.width.nodeValue+"px";n.firstChild.style.width=n.clientWidth+"px";break;case "height":n.getContext().clearRect();n.style.height=n.attributes.height.nodeValue+"px";n.firstChild.style.height=n.clientHeight+"px"}}function c(h){h=h.srcElement;if(h.firstChild){h.firstChild.style.width=
-h.clientWidth+"px";h.firstChild.style.height=h.clientHeight+"px"}}function b(){return[[1,0,0],[0,1,0],[0,0,1]]}function d(h,n){for(var q=b(),u=0;u<3;u++)for(var z=0;z<3;z++){for(var v=0,L=0;L<3;L++)v+=h[u][L]*n[L][z];q[u][z]=v}return q}function g(h,n){n.fillStyle=h.fillStyle;n.lineCap=h.lineCap;n.lineJoin=h.lineJoin;n.lineWidth=h.lineWidth;n.miterLimit=h.miterLimit;n.shadowBlur=h.shadowBlur;n.shadowColor=h.shadowColor;n.shadowOffsetX=h.shadowOffsetX;n.shadowOffsetY=h.shadowOffsetY;n.strokeStyle=h.strokeStyle;
-n.globalAlpha=h.globalAlpha;n.font=h.font;n.textAlign=h.textAlign;n.textBaseline=h.textBaseline;n.arcScaleX_=h.arcScaleX_;n.arcScaleY_=h.arcScaleY_;n.lineScale_=h.lineScale_}function f(h){var n=h.indexOf("(",3),q=h.indexOf(")",n+1);n=h.substring(n+1,q).split(",");if(n.length!=4||h.charAt(3)!="a")n[3]=1;return n}function m(h,n,q){return Math.min(q,Math.max(n,h))}function l(h,n,q){q<0&&q++;q>1&&q--;return 6*q<1?h+(n-h)*6*q:2*q<1?n:3*q<2?h+(n-h)*(2/3-q)*6:h}function o(h){if(h in O)return O[h];var n,
-q=1;h=String(h);if(h.charAt(0)=="#")n=h;else if(/^rgb/.test(h)){q=f(h);n="#";for(var u,z=0;z<3;z++){u=q[z].indexOf("%")!=-1?Math.floor(parseFloat(q[z])/100*255):+q[z];n+=F[m(u,0,255)]}q=+q[3]}else if(/^hsl/.test(h)){z=q=f(h);n=parseFloat(z[0])/360%360;n<0&&n++;u=m(parseFloat(z[1])/100,0,1);z=m(parseFloat(z[2])/100,0,1);if(u==0)u=z=n=z;else{var v=z<0.5?z*(1+u):z+u-z*u,L=2*z-v;u=l(L,v,n+1/3);z=l(L,v,n);n=l(L,v,n-1/3)}n="#"+F[Math.floor(u*255)]+F[Math.floor(z*255)]+F[Math.floor(n*255)];q=q[3]}else n=
-h;return O[h]={color:n,alpha:q}}function s(h){this.m_=b();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.fillStyle=this.strokeStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=D*1;this.globalAlpha=1;this.canvas=h;var n="width:"+h.clientWidth+"px;height:"+h.clientHeight+"px;overflow:hidden;position:absolute",q=h.ownerDocument.createElement("div");q.style.cssText=n;h.appendChild(q);n=q.cloneNode(false);n.style.backgroundColor="red";n.style.filter="alpha(opacity=0)";
-h.appendChild(n);this.element_=q;this.lineScale_=this.arcScaleY_=this.arcScaleX_=1}function x(h,n,q,u){h.currentPath_.push({type:"bezierCurveTo",cp1x:n.x,cp1y:n.y,cp2x:q.x,cp2y:q.y,x:u.x,y:u.y});h.currentX_=u.x;h.currentY_=u.y}function t(h,n,q){h=h.m_;return{x:D*(n*h[0][0]+q*h[1][0]+h[2][0])-J,y:D*(n*h[0][1]+q*h[1][1]+h[2][1])-J}}function A(h,n,q){if(isFinite(n[0][0])&&isFinite(n[0][1])&&isFinite(n[1][0])&&isFinite(n[1][1])&&isFinite(n[2][0])&&isFinite(n[2][1])){h.m_=n;if(q)h.lineScale_=E(G(n[0][0]*
-n[1][1]-n[0][1]*n[1][0]))}}function B(h){this.code=this[h];this.message=h+": DOM Exception "+this.code}var C=Math,y=C.round,H=C.sin,I=C.cos,G=C.abs,E=C.sqrt,D=10,J=D/2;navigator.userAgent.match(/MSIE ([\d.]+)?/);var K=Array.prototype.slice;p(document);C={init:function(h){h=h||document;h.createElement("canvas");h.attachEvent("onreadystatechange",r(this.init_,this,h))},init_:function(h){h=h.getElementsByTagName("canvas");for(var n=0;n<h.length;n++)this.initElement(h[n])},initElement:function(h){if(!h.getContext){h.getContext=
-e;p(h.ownerDocument);h.innerHTML="";h.attachEvent("onpropertychange",a);h.attachEvent("onresize",c);var n=h.attributes;if(n.width&&n.width.specified)h.style.width=n.width.nodeValue+"px";else h.width=h.clientWidth;if(n.height&&n.height.specified)h.style.height=n.height.nodeValue+"px";else h.height=h.clientHeight}return h}};C.init();for(var F=[],w=0;w<16;w++)for(var M=0;M<16;M++)F[w*16+M]=w.toString(16)+M.toString(16);var O={},P={butt:"flat",round:"round"};w=s.prototype;w.clearRect=function(){if(this.textMeasureEl_){this.textMeasureEl_.removeNode(true);
-this.textMeasureEl_=null}this.element_.innerHTML=""};w.beginPath=function(){this.currentPath_=[]};w.moveTo=function(h,n){var q=t(this,h,n);this.currentPath_.push({type:"moveTo",x:q.x,y:q.y});this.currentX_=q.x;this.currentY_=q.y};w.lineTo=function(h,n){var q=t(this,h,n);this.currentPath_.push({type:"lineTo",x:q.x,y:q.y});this.currentX_=q.x;this.currentY_=q.y};w.bezierCurveTo=function(h,n,q,u,z,v){z=t(this,z,v);h=t(this,h,n);q=t(this,q,u);x(this,h,q,z)};w.quadraticCurveTo=function(h,n,q,u){h=t(this,
-h,n);q=t(this,q,u);u={x:this.currentX_+2/3*(h.x-this.currentX_),y:this.currentY_+2/3*(h.y-this.currentY_)};x(this,u,{x:u.x+(q.x-this.currentX_)/3,y:u.y+(q.y-this.currentY_)/3},q)};w.arc=function(h,n,q,u,z,v){q*=D;var L=v?"at":"wa",N=h+I(u)*q-J,Q=n+H(u)*q-J;u=h+I(z)*q-J;z=n+H(z)*q-J;if(N==u&&!v)N+=0.125;h=t(this,h,n);N=t(this,N,Q);u=t(this,u,z);this.currentPath_.push({type:L,x:h.x,y:h.y,radius:q,xStart:N.x,yStart:N.y,xEnd:u.x,yEnd:u.y})};w.stroke=function(h){var n=[];n.push("<g_vml_:shape",' filled="',
-!!h,'"',' style="position:absolute;width:',10,"px;height:",10,'px;"',' coordorigin="0,0"',' coordsize="',D*10,",",D*10,'"',' stroked="',!h,'"',' path="');for(var q={x:null,y:null},u={x:null,y:null},z=0;z<this.currentPath_.length;z++){var v=this.currentPath_[z];switch(v.type){case "moveTo":n.push(" m ",y(v.x),",",y(v.y));break;case "lineTo":n.push(" l ",y(v.x),",",y(v.y));break;case "close":n.push(" x ");v=null;break;case "bezierCurveTo":n.push(" c ",y(v.cp1x),",",y(v.cp1y),",",y(v.cp2x),",",y(v.cp2y),
-",",y(v.x),",",y(v.y));break;case "at":case "wa":n.push(" ",v.type," ",y(v.x-this.arcScaleX_*v.radius),",",y(v.y-this.arcScaleY_*v.radius)," ",y(v.x+this.arcScaleX_*v.radius),",",y(v.y+this.arcScaleY_*v.radius)," ",y(v.xStart),",",y(v.yStart)," ",y(v.xEnd),",",y(v.yEnd))}if(v){if(q.x==null||v.x<q.x)q.x=v.x;if(u.x==null||v.x>u.x)u.x=v.x;if(q.y==null||v.y<q.y)q.y=v.y;if(u.y==null||v.y>u.y)u.y=v.y}}n.push(' ">');if(h){h=o(this.fillStyle);n.push('<g_vml_:fill color="',h.color,'" opacity="',h.alpha*this.globalAlpha,
-'" />')}else{q=o(this.strokeStyle);h=q.color;q=q.alpha*this.globalAlpha;u=this.lineScale_*this.lineWidth;if(u<1)q*=u;n.push("<g_vml_:stroke",' opacity="',q,'"',' joinstyle="',this.lineJoin,'"',' miterlimit="',this.miterLimit,'"',' endcap="',P[this.lineCap]||"square",'"',' weight="',u,'px"',' color="',h,'" />')}n.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",n.join(""))};w.fill=function(){this.stroke(true)};w.closePath=function(){this.currentPath_.push({type:"close"})};w.save=
-function(){var h={};g(this,h);this.aStack_.push(h);this.mStack_.push(this.m_);this.m_=d(b(),this.m_)};w.restore=function(){if(this.aStack_.length){g(this.aStack_.pop(),this);this.m_=this.mStack_.pop()}};w.translate=function(h,n){A(this,d([[1,0,0],[0,1,0],[h,n,1]],this.m_),false)};w.scale=function(h,n){this.arcScaleX_*=h;this.arcScaleY_*=n;A(this,d([[h,0,0],[0,n,0],[0,0,1]],this.m_),true)};w=B.prototype=Error();w.INDEX_SIZE_ERR=1;w.DOMSTRING_SIZE_ERR=2;w.HIERARCHY_REQUEST_ERR=3;w.WRONG_DOCUMENT_ERR=
-4;w.INVALID_CHARACTER_ERR=5;w.NO_DATA_ALLOWED_ERR=6;w.NO_MODIFICATION_ALLOWED_ERR=7;w.NOT_FOUND_ERR=8;w.NOT_SUPPORTED_ERR=9;w.INUSE_ATTRIBUTE_ERR=10;w.INVALID_STATE_ERR=11;w.SYNTAX_ERR=12;w.INVALID_MODIFICATION_ERR=13;w.NAMESPACE_ERR=14;w.INVALID_ACCESS_ERR=15;w.VALIDATION_ERR=16;w.TYPE_MISMATCH_ERR=17;G_vmlCanvasManager=C;CanvasRenderingContext2D=s;DOMException=B}();
-(function(e){function r(a){var c=[].slice.call(arguments,1),b=0;a=e.event.fix(a||window.event);a.type="mousewheel";if(a.wheelDelta)b=a.wheelDelta/120;if(a.detail)b=-a.detail/3;c.unshift(a,b);return e.event.handle.apply(this,c)}var p=["DOMMouseScroll","mousewheel"];e.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=p.length;a;)this.addEventListener(p[--a],r,false);else this.onmousewheel=r},teardown:function(){if(this.removeEventListener)for(var a=p.length;a;)this.removeEventListener(p[--a],
-r,false);else this.onmousewheel=null}};e.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
-$.widget||function(e,r){var p=Array.prototype.slice,a=e.cleanData;e.cleanData=function(c){for(var b=0,d;(d=c[b])!=null;b++)e(d).triggerHandler("remove");a(c)};e.widget=function(c,b,d){var g=c.split(".")[0],f;c=c.split(".")[1];f=g+"-"+c;if(!d){d=b;b=e.Widget}e.expr[":"][f]=function(l){return!!e.data(l,c)};e[g]=e[g]||{};e[g][c]=e.extend(function(l,o){if(!this._createWidget)return new e[g][c](l,o);arguments.length&&this._createWidget(l,o)},e[g][c]);var m=new b;m.options=e.extend(true,{},m.options);e.each(d,
-function(l,o){if(e.isFunction(o))d[l]=function(){var s=function(t){return b.prototype[t].apply(this,p.call(arguments,1))},x=function(t,A){return b.prototype[t].apply(this,A)};return function(){var t=this._super,A=this._superApply,B;this._super=s;this._superApply=x;B=o.apply(this,arguments);this._super=t;this._superApply=A;return B}}()});e[g][c].prototype=e.extend(true,m,{namespace:g,widgetName:c,widgetEventPrefix:c,widgetBaseClass:f},d);e.widget.bridge(c,e[g][c])};e.widget.bridge=function(c,b){e.fn[c]=
-function(d){var g=typeof d==="string",f=p.call(arguments,1),m=this;d=!g&&f.length?e.extend.apply(null,[true,d].concat(f)):d;g?this.each(function(){var l=e.data(this,c);if(!l)return e.error("cannot call methods on "+c+" prior to initialization; attempted to call method '"+d+"'");if(!e.isFunction(l[d])||d.charAt(0)==="_")return e.error("no such method '"+d+"' for "+c+" widget instance");var o=l[d].apply(l,f);if(o!==l&&o!==r){m=o;return false}}):this.each(function(){var l=e.data(this,c);l?l.option(d||
-{})._init():b(d,this)});return m}};e.Widget=function(c,b){if(!this._createWidget)return new e[namespace][name](c,b);arguments.length&&this._createWidget(c,b)};e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:false},_createWidget:function(c,b){b=e(b||this.defaultElement||this)[0];this.element=e(b);this.options=e.extend(true,{},this.options,this._getCreateOptions(),c);this.bindings=e();this.hoverable=e();this.focusable=e();if(b!==this){e.data(b,this.widgetName,
-this);this._bind({remove:"destroy"})}this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return e.metadata&&e.metadata.get(this.element[0])[this.widgetName]},_create:e.noop,_init:e.noop,destroy:function(){this._destroy();this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled ui-state-disabled");this.bindings.unbind("."+this.widgetName);this.hoverable.removeClass("ui-state-hover");
-this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(c,b){var d=c;if(arguments.length===0)return e.extend({},this.options);if(typeof c==="string"){if(b===r)return this.options[c];d={};d[c]=b}this._setOptions(d);return this},_setOptions:function(c){var b=this;e.each(c,function(d,g){b._setOption(d,g)});return this},_setOption:function(c,b){this.options[c]=b;if(c==="disabled"){this.widget().toggleClass(this.widgetBaseClass+"-disabled ui-state-disabled",
-!!b).attr("aria-disabled",b);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")}return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_bind:function(c,b){if(b){c=e(c);this.bindings=this.bindings.add(c)}else{b=c;c=this.element}var d=this;e.each(b,function(g,f){c.bind(g+"."+d.widgetName,function(){if(!(d.options.disabled===true||e(this).hasClass("ui-state-disabled")))return(typeof f===
-"string"?d[f]:f).apply(d,arguments)})})},_hoverable:function(c){this.hoverable=this.hoverable.add(c);this._bind(c,{mouseenter:function(b){e(b.currentTarget).addClass("ui-state-hover")},mouseleave:function(b){e(b.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(c){this.focusable=this.focusable.add(c);this._bind(c,{focusin:function(b){e(b.currentTarget).addClass("ui-state-focus")},focusout:function(b){e(b.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(c,b,d){var g=
-this.options[c];b=e.Event(b);b.type=(c===this.widgetEventPrefix?c:this.widgetEventPrefix+c).toLowerCase();d=d||{};if(b.originalEvent){c=e.event.props.length;for(var f;c;){f=e.event.props[--c];b[f]=b.originalEvent[f]}}this.element.trigger(b,d);d=e.isArray(d)?[b].concat(d):[b,d];return!(e.isFunction(g)&&g.apply(this.element[0],d)===false||b.isDefaultPrevented())}}}(jQuery);
-(function(e,r,p){var a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;e.geo={_allCoordinates:function(b){b=this._flatten(b);for(var d=0,g=[];d<b.length;d++){var f=b[d].coordinates,m=f&&e.isArray(f[0]),l=m&&e.isArray(f[0][0]),o;if(!(l&&e.isArray(f[0][0][0]))){if(!l){m||(f=[f]);f=[f]}f=[f]}for(m=0;m<f.length;m++)for(l=0;l<f[m].length;l++)for(o=0;o<f[m][l].length;o++)g.push(f[m][l][o])}return g},center:function(b,d){if(!d&&e.geo.proj)b=e.geo.proj.fromGeodetic(b);var g=[(b[0]+b[2])/2,(b[1]+b[3])/
-2];return!d&&e.geo.proj?e.geo.proj.toGeodetic(g):g},expandBy:function(b,d,g){if(e.geo.proj)b=e.geo.proj.fromGeodetic(b);b=[b[0]-d,b[1]-g,b[2]+d,b[3]+g];return e.geo.proj?e.geo.proj.toGeodetic(b):b},height:function(b,d){if(!d&&e.geo.proj)b=e.geo.proj.fromGeodetic(b);return b[3]-b[1]},_in:function(b,d){return b[0]<=d[0]&&b[1]<=d[1]&&b[2]>=d[2]&&b[3]>=d[3]},_bboxDisjoint:function(b,d){return d[0]>b[2]||d[2]<b[0]||d[1]>b[3]||d[3]<b[1]},reaspect:function(b,d,g){if(!g&&e.geo.proj)b=e.geo.proj.fromGeodetic(b);
-var f=this.width(b,true),m=this.height(b,true);g=this.center(b,true);if(f!=0&&m!=0&&d>0){if(f/m>d){b=f/2;f=b/d}else{f=m/2;b=f*d}b=[g[0]-b,g[1]-f,g[0]+b,g[1]+f]}return e.geo.proj?e.geo.proj.toGeodetic(b):b},scaleBy:function(b,d,g){if(!g&&e.geo.proj)b=e.geo.proj.fromGeodetic(b);var f=this.center(b,true),m=(b[2]-b[0])*d/2;b=(b[3]-b[1])*d/2;b=[f[0]-m,f[1]-b,f[0]+m,f[1]+b];return!g&&e.geo.proj?e.geo.proj.toGeodetic(b):b},width:function(b,d){if(!d&&e.geo.proj)b=e.geo.proj.fromGeodetic(b);return b[2]-b[0]},
-bbox:function(b,d){if(b)if(b.bbox)result=!d&&e.geo.proj?e.geo.proj.fromGeodetic(b.bbox):b.bbox;else{result=[a,a,c,c];var g=this._allCoordinates(b),f=0;if(g.length==0)return p;if(e.geo.proj)g=e.geo.proj.fromGeodetic(g);for(;f<g.length;f++){result[0]=Math.min(g[f][0],result[0]);result[1]=Math.min(g[f][1],result[1]);result[2]=Math.max(g[f][0],result[2]);result[3]=Math.max(g[f][1],result[3])}}else return p;return e.geo.proj?e.geo.proj.toGeodetic(result):result},centroid:function(b,d){switch(b.type){case "Point":return e.extend({},
-b);case "LineString":case "Polygon":var g=0,f=[0,0],m=e.merge([],b.type=="Polygon"?b.coordinates[0]:b.coordinates),l=1,o,s;if(!d&&e.geo.proj)m=e.geo.proj.fromGeodetic(m);for(;l<=m.length;l++){o=l%m.length;s=m[l-1][0]*m[o][1]-m[o][0]*m[l-1][1];g+=s;f[0]+=(m[l-1][0]+m[o][0])*s;f[1]+=(m[l-1][1]+m[o][1])*s}if(g==0)if(m.length>0){f[0]=m[0][0];f[1]=m[0][1];return{type:"Point",coordinates:!d&&e.geo.proj?e.geo.proj.toGeodetic(f):f}}else break;g*=3;f[0]/=g;f[1]/=g;return{type:"Point",coordinates:!d&&e.geo.proj?
-e.geo.proj.toGeodetic(f):f}}return p},contains:function(b,d){if(b.type!="Polygon")return false;switch(d.type){case "Point":return this._containsPolygonPoint(b.coordinates,d.coordinates);case "LineString":return this._containsPolygonLineString(b.coordinates,d.coordinates);case "Polygon":return this._containsPolygonLineString(b.coordinates,d.coordinates[0]);default:return false}},_containsPolygonPoint:function(b,d){if(b.length==0||b[0].length<4)return false;for(var g=0,f=b[0][0],m=1,l;m<b[0].length;m++){l=
-b[0][m];if(f[1]<=d[1]&&d[1]<l[1]||l[1]<=d[1]&&d[1]<f[1]&&(d[0]<f[0]||d[0]<l[0])){f=f[0]+(l[0]-f[0])*(d[1]-f[1])/(l[1]-f[1]);f>d[0]&&g++}f=l}return g%2==1},_containsPolygonLineString:function(b,d){for(var g=0;g<d.length;g++)if(!this._containsPolygonPoint(b,d[g]))return false;return true},distance:function(b,d,g){var f=!g&&e.geo.proj?e.geo.proj.fromGeodetic(b.coordinates):b.coordinates;g=!g&&e.geo.proj?e.geo.proj.fromGeodetic(d.coordinates):d.coordinates;switch(b.type){case "Point":switch(d.type){case "Point":return this._distancePointPoint(g,
-f);case "LineString":return this._distanceLineStringPoint(g,f);case "Polygon":return this._containsPolygonPoint(g,f)?0:this._distanceLineStringPoint(g[0],f);default:return p}case "LineString":switch(d.type){case "Point":return this._distanceLineStringPoint(f,g);case "LineString":return this._distanceLineStringLineString(f,g);case "Polygon":return this._containsPolygonLineString(g,f)?0:this._distanceLineStringLineString(g[0],f);default:return p}case "Polygon":switch(d.type){case "Point":return this._containsPolygonPoint(f,
-g)?0:this._distanceLineStringPoint(f[0],g);case "LineString":return this._containsPolygonLineString(f,g)?0:this._distanceLineStringLineString(f[0],g);case "Polygon":return this._containsPolygonLineString(f,g[0])?0:this._distanceLineStringLineString(f[0],g[0]);default:return p}}},_distancePointPoint:function(b,d){var g=d[0]-b[0],f=d[1]-b[1];return Math.sqrt(g*g+f*f)},_distanceLineStringPoint:function(b,d){var g=a;if(b.length>0){var f=b[0],m=d[0]-f[0],l=d[1]-f[1];if(b.length==1)return Math.sqrt(m*m+
-l*l);else for(var o=1;o<b.length;o++){var s=b[o],x=d[0]-s[0],t=d[1]-s[1];f=this._distanceSegmentPoint(s[0]-f[0],s[1]-f[1],m,l,x,t);if(f==0)return 0;if(f<g)g=f;f=s;m=x;l=t}}return Math.sqrt(g)},_distanceSegmentPoint:function(b,d,g,f,m,l){var o=b*g+d*f;if(o<=0)return g*g+f*f;b=b*b+d*d;if(o>=b)return m*m+l*l;return g*g+f*f-o*o/b},_distanceLineStringLineString:function(b,d){for(var g=a,f=0;f<d.length;f++)g=Math.min(g,this._distanceLineStringPoint(b,d[f]));return g},_flatten:function(b){var d=[],g=0;switch(b.type){case "Feature":e.merge(d,
-this._flatten(b.geometry));break;case "FeatureCollection":for(;g<b.features.length;g++)e.merge(d,this._flatten(b.features[g].geometry));break;case "GeometryCollection":for(;g<b.geometries.length;g++)e.merge(d,this._flatten(b.geometries[g]));break;default:d[0]=b}return d},_WKT:function(){function b(f){if(f&&f.length){for(var m=[],l=0;l<f.length;l++)m.push(f[l].join(" "));return"("+m+")"}else return"EMPTY"}function d(f){if(f&&f.length){for(var m=[],l=0;l<f.length;l++)m.push(b(f[l]));return"("+m+")"}else return"EMTPY"}
-function g(f){if(f&&f.type)switch(f.type){case "Point":return"POINT "+(f.coordinates&&f.coordinates.length?"("+f.coordinates.join(" ")+")":"EMPTY");case "LineString":return"LINESTRING "+b(f.coordinates);case "Polygon":return"POLYGON "+d(f.coordinates);case "MultiPoint":return"MULTIPOINT "+b(f.coordinates);case "MultiLineString":return"MULTILINSTRING "+d(f.coordinates);case "MultiPolygon":if((f=f.coordinates)&&f.length){for(var m=[],l=0;l<f.length;l++)m.push(d(f[l]));f="("+m+")"}else f="EMPTY";return"MULTIPOLYGON "+
-f;case "GeometryCollection":if((f=f.geometries)&&f.length){m=[];for(l=0;l<f.length;l++)m.push(g(f[l]));f="("+f+")"}else f="EMPTY";return"GEOMETRYCOLLECTION "+f;default:return""}else return""}return{stringify:g,parse:function(f){f=e.trim(f);var m=f.indexOf(" ");switch(f.substr(0,m).toUpperCase()){case "POINT":return(f=f.substr(m+1).match(/\(\s*([\d\.-]+)\s+([\d\.-]+)\s*\)/))&&f.length>=2?{type:"Point",coordinates:[parseFloat(f[1]),parseFloat(f[2])]}:null}}}}(),proj:function(){return{fromGeodeticPos:function(b){if(!b)debugger;
-return[6378137*b[0]*0.017453292519943295,6378137*Math.log(Math.tan(0.7853981633974483+b[1]*0.017453292519943295/2))]},fromGeodetic:function(b){var d=e.isArray(b[0]),g=this.fromGeodeticPos;if(!d&&b.length==4){d=g([b[0],b[1]]);b=g([b[2],b[3]]);return[d[0],d[1],b[0],b[1]]}else{var f=d&&e.isArray(b[0][0]),m=f&&e.isArray(b[0][0][0]),l=[],o,s,x;if(!m){if(!f){d||(b=[b]);b=[b]}b=[b]}for(o=0;o<b.length;o++){l[o]=[];for(s=0;s<b[o].length;s++){l[o][s]=[];for(x=0;x<b[o][s].length;x++)l[o][s][x]=g(b[o][s][x])}}return m?
-l:f?l[0]:d?l[0][0]:l[0][0][0]}},toGeodeticPos:function(b){return[b[0]/6378137*57.29577951308232,(1.5707963267948966-2*Math.atan(1/Math.exp(b[1]/6378137)))*57.29577951308232]},toGeodetic:function(b){var d=e.isArray(b[0]),g=this.toGeodeticPos;if(!d&&b.length==4){d=g([b[0],b[1]]);b=g([b[2],b[3]]);return[d[0],d[1],b[0],b[1]]}else{var f=d&&e.isArray(b[0][0]),m=f&&e.isArray(b[0][0][0]),l=[];if(!m){if(!f){d||(b=[b]);b=[b]}b=[b]}for(i=0;i<b.length;i++){l[i]=[];for(j=0;j<b[i].length;j++){l[i][j]=[];for(k=
-0;k<b[i][j].length;k++)l[i][j][k]=g(b[i][j][k])}}return m?l:f?l[0]:d?l[0][0]:l[0][0][0]}}}}(),_serviceTypes:{}}})(jQuery,this);
-(function(e,r){var p=function(){for(var a=5,c=document.createElement("div"),b=c.all||[];c.innerHTML="<!--[if gt IE "+ ++a+"]><br><![endif]--\>",b[0];);return a>6?a:!a}();e.widget("geo.geographics",{_$elem:r,_options:{},_trueCanvas:true,_width:0,_height:0,_$canvas:r,_context:r,options:{style:{borderRadius:"8px",color:"#7f0000",fillOpacity:0.2,height:"8px",opacity:1,strokeOpacity:1,strokeWidth:"2px",visibility:"visible",width:"8px"}},_create:function(){this._$elem=this.element;this._options=this.options;
-this._$elem.css({display:"inline-block",overflow:"hidden",textAlign:"left"});this._$elem.css("position")=="static"&&this._$elem.css("position","relative");this._width=this._$elem.width();this._height=this._$elem.height();if(!(this._width&&this._height)){this._width=parseInt(this._$elem.css("width"));this._height=parseInt(this._$elem.css("height"))}if(document.createElement("canvas").getContext){this._$elem.append('<canvas width="'+this._width+'" height="'+this._height+'" style="position:absolute; left:0; top:0; width:'+
-this._width+"px; height:"+this._height+'px;"></canvas>');this._$canvas=this._$elem.children(":last");this._context=this._$canvas[0].getContext("2d")}else if(p<=8){this._trueCanvas=false;this._$elem.append('<div width="'+this._width+'" height="'+this._height+'" style="position:absolute; left:0; top:0; width:'+this._width+"px; height:"+this._height+'px; margin:0; padding:0;"></div>');this._$canvas=this._$elem.children(":last");G_vmlCanvasManager.initElement(this._$canvas[0]);this._context=this._$canvas[0].getContext("2d");
-this._$canvas.children().css({backgroundColor:"transparent",width:this._width,height:this._height})}},_setOption:function(a,c){if(a=="style")c=e.extend({},this._options.style,c);e.Widget.prototype._setOption.apply(this,arguments)},destroy:function(){e.Widget.prototype.destroy.apply(this,arguments);this._$elem.html("")},clear:function(){this._context.clearRect(0,0,this._width,this._height)},drawArc:function(a,c,b,d){d=this._getGraphicStyle(d);if(d.visibility!="hidden"&&d.opacity>0&&d.widthValue>0&&
-d.heightValue>0){var g=Math.min(d.widthValue,d.heightValue)/2;c=c*Math.PI/180;b=b*Math.PI/180;this._context.save();this._context.translate(a[0],a[1]);d.widthValue>d.heightValue?this._context.scale(d.widthValue/d.heightValue,1):this._context.scale(1,d.heightValue/d.widthValue);this._context.beginPath();this._context.arc(0,0,g,c,b,false);this._trueCanvas&&this._context.restore();if(d.doFill){this._context.fillStyle=d.fill;this._context.globalAlpha=d.opacity*d.fillOpacity;this._context.fill()}if(d.doStroke){this._context.lineJoin=
-"round";this._context.lineWidth=d.strokeWidthValue;this._context.strokeStyle=d.stroke;this._context.globalAlpha=d.opacity*d.strokeOpacity;this._context.stroke()}this._trueCanvas||this._context.restore()}},drawPoint:function(a,c){c=this._getGraphicStyle(c);if(c.widthValue==c.heightValue&&c.heightValue==c.borderRadiusValue)this.drawArc(a,0,360,c);else if(c.visibility!="hidden"&&c.opacity>0){c.borderRadiusValue=Math.min(Math.min(c.widthValue,c.heightValue)/2,c.borderRadiusValue);a[0]-=c.widthValue/2;
-a[1]-=c.heightValue/2;this._context.beginPath();this._context.moveTo(a[0]+c.borderRadiusValue,a[1]);this._context.lineTo(a[0]+c.widthValue-c.borderRadiusValue,a[1]);this._context.quadraticCurveTo(a[0]+c.widthValue,a[1],a[0]+c.widthValue,a[1]+c.borderRadiusValue);this._context.lineTo(a[0]+c.widthValue,a[1]+c.heightValue-c.borderRadiusValue);this._context.quadraticCurveTo(a[0]+c.widthValue,a[1]+c.heightValue,a[0]+c.widthValue-c.borderRadiusValue,a[1]+c.heightValue);this._context.lineTo(a[0]+c.borderRadiusValue,
-a[1]+c.heightValue);this._context.quadraticCurveTo(a[0],a[1]+c.heightValue,a[0],a[1]+c.heightValue-c.borderRadiusValue);this._context.lineTo(a[0],a[1]+c.borderRadiusValue);this._context.quadraticCurveTo(a[0],a[1],a[0]+c.borderRadiusValue,a[1]);this._context.closePath();if(c.doFill){this._context.fillStyle=c.fill;this._context.globalAlpha=c.opacity*c.fillOpacity;this._context.fill()}if(c.doStroke){this._context.lineJoin="round";this._context.lineWidth=c.strokeWidthValue;this._context.strokeStyle=c.stroke;
-this._context.globalAlpha=c.opacity*c.strokeOpacity;this._context.stroke()}}},drawLineString:function(a,c){this._drawLines([a],false,c)},drawPolygon:function(a,c){this._drawLines(a,true,c)},drawBbox:function(a,c){this._drawLines([[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]],[a[0],a[1]]]],true,c)},_getGraphicStyle:function(a){function c(b){b=parseInt(b);return+b+""===b?+b:b}a=e.extend({},this._options.style,a);a.borderRadiusValue=c(a.borderRadius);a.fill=a.fill||a.color;a.doFill=a.fill&&a.fillOpacity>
-0;a.stroke=a.stroke||a.color;a.strokeWidthValue=c(a.strokeWidth);a.doStroke=a.stroke&&a.strokeOpacity>0&&a.strokeWidthValue>0;a.widthValue=c(a.width);a.heightValue=c(a.height);return a},_drawLines:function(a,c,b){if(!(!a||!a.length||a[0].length<2)){b=this._getGraphicStyle(b);var d,g;if(b.visibility!="hidden"&&b.opacity>0){this._context.beginPath();this._context.moveTo(a[0][0][0],a[0][0][1]);for(d=0;d<a.length;d++)for(g=0;g<a[d].length;g++)this._context.lineTo(a[d][g][0],a[d][g][1]);c&&this._context.closePath();
-if(c&&b.doFill){this._context.fillStyle=b.fill;this._context.globalAlpha=b.opacity*b.fillOpacity;this._context.fill()}if(b.doStroke){this._context.lineCap=this._context.lineJoin="round";this._context.lineWidth=b.strokeWidthValue;this._context.strokeStyle=b.stroke;this._context.globalAlpha=b.opacity*b.strokeOpacity;this._context.stroke()}}}}})})(jQuery);
-(function(e,r){var p=function(){for(var a=5,c=document.createElement("div"),b=c.all||[];c.innerHTML="<!--[if gt IE "+ ++a+"]><br><![endif]--\>",b[0];);return a>6?a:!a}();e.widget("geo.geomap",{_$elem:r,_created:false,_contentBounds:{},_$contentFrame:r,_$existingChildren:r,_$servicesContainer:r,_$drawContainer:r,_$shapesContainer:r,_$textContainer:r,_$textContent:r,_$eventTarget:r,_dpi:96,_currentServices:[],_center:r,_pixelSize:r,_centerMax:r,_pixelSizeMax:r,_wheelZoomFactor:1.18920711500273,_wheelTimeout:null,
-_wheelLevel:0,_zoomFactor:2,_mouseDown:r,_inOp:r,_toolPan:r,_shiftZoom:r,_anchor:r,_current:r,_downDate:r,_moveDate:r,_clickDate:r,_lastMove:r,_lastDrag:r,_windowHandler:null,_resizeTimeout:null,_panning:r,_velocity:r,_friction:r,_supportTouch:r,_softDblClick:r,_isTap:r,_isDbltap:r,_drawTimeout:null,_drawPixels:[],_drawCoords:[],_graphicShapes:[],_initOptions:{},_options:{},options:e.extend({},{bbox:[-180,-85,180,85],bboxMax:[-180,-85,180,85],center:[0,0],cursors:{pan:"move",zoom:"crosshair",drawPoint:"crosshair",
-drawLineString:"crosshair",drawPolygon:"crosshair"},drawStyle:{},shapeStyle:{},mode:"pan",services:[{"class":"osm",type:"tiled",getUrl:function(a){return"http://tile.openstreetmap.org/"+a.zoom+"/"+a.tile.column+"/"+a.tile.row+".png"},attr:"&copy; OpenStreetMap &amp; contributors, CC-BY-SA"}],tilingScheme:{tileWidth:256,tileHeight:256,levels:18,basePixelSize:156543.03392799935,origin:[-2.0037508342787E7,2.0037508342787E7]},zoom:0,pixelSize:0}),_createWidget:function(a,c){this._$elem=e(c);if(!this._$elem.is("[data-geo-service]")){this._$elem.attr("data-geo-map",
-"data-geo-map");this._graphicShapes=[];this._initOptions=a||{};this._forcePosition(this._$elem);this._$elem.css("text-align","left");var b=this._findMapSize();this._contentBounds={x:parseInt(this._$elem.css("padding-left")),y:parseInt(this._$elem.css("padding-top")),width:b.width,height:b.height};this._createChildren();this._center=this._centerMax=[0,0];this.options.pixelSize=this._pixelSize=this._pixelSizeMax=156543.03392799935;this._mouseDown=this._inOp=this._toolPan=this._shiftZoom=this._panning=
-this._isTap=this._isDbltap=false;this._anchor=this._current=this._lastMove=this._lastDrag=this._velocity=[0,0];this._friction=[0.8,0.8];this._downDate=this._moveDate=this._clickDate=0}e.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){if(!this._$elem.is("[data-geo-service]")){this._options=this.options;this._softDblClick=(this._supportTouch="ontouchend"in document)||p==7;var a=this._supportTouch?"touchstart":"mousedown",c=this._supportTouch?"touchend touchcancel":"mouseup",
-b=this._supportTouch?"touchmove":"mousemove";e(document).keydown(e.proxy(this._document_keydown,this));this._$eventTarget.dblclick(e.proxy(this._eventTarget_dblclick,this));this._$eventTarget.bind(a,e.proxy(this._eventTarget_touchstart,this));a=this._$eventTarget[0].setCapture?this._$eventTarget:e(document);a.bind(b,e.proxy(this._dragTarget_touchmove,this));a.bind(c,e.proxy(this._dragTarget_touchstop,this));this._$eventTarget.mousewheel(e.proxy(this._eventTarget_mousewheel,this));var d=this;this._windowHandler=
-function(){d._resizeTimeout&&clearTimeout(d._resizeTimeout);this._resizeTimeout=setTimeout(function(){d._created&&d._$elem.geomap("resize")},500)};e(window).resize(this._windowHandler);this._$drawContainer.geographics({style:this._initOptions.drawStyle||{}});this._options.drawStyle=this._$drawContainer.geographics("option","style");this._$shapesContainer.geographics({style:this._initOptions.shapeStyle||{}});this._options.shapeStyle=this._$shapesContainer.geographics("option","style");if(this._initOptions){this._initOptions.bbox&&
-this._setOption("bbox",this._initOptions.bbox,false);this._initOptions.center&&this._setOption("center",this._initOptions.center,false);this._initOptions.zoom&&this._setZoom(this._initOptions.zoom,false,false)}this._$eventTarget.css("cursor",this._options.cursors[this._options.mode]);this._createServices();this._refresh();this._created=true}},_setOption:function(a,c,b){if(!(this._$elem.is("[data-geo-service]")||a=="pixelSize")){b=b===r||b;switch(a){case "bbox":if(e.geo.proj){c=e.geo.proj.fromGeodetic([[c[0],
-c[1]],[c[2],c[3]]]);c=[c[0][0],c[0][1],c[1][0],c[1][1]]}this._setBbox(c,false,b);c=this._getBbox();if(e.geo.proj){c=e.geo.proj.toGeodetic([[c[0],c[1]],[c[2],c[3]]]);c=[c[0][0],c[0][1],c[1][0],c[1][1]]}break;case "center":this._setCenterAndSize(e.geo.proj?e.geo.proj.fromGeodetic([[c[0],c[1]]])[0]:c,this._pixelSize,false,b);break;case "drawStyle":if(this._$drawContainer){this._$drawContainer.geographics("option","style",c);c=this._$drawContainer.geographics("option","style")}break;case "shapeStyle":if(this._$shapesContainer){this._$shapesContainer.geographics("option",
-"style",c);c=this._$shapesContainer.geographics("option","style")}break;case "mode":this._$drawContainer.geographics("clear");this._$eventTarget.css("cursor",this._options.cursors[c]);break;case "zoom":this._setZoom(c,false,b)}e.Widget.prototype._setOption.apply(this,arguments);switch(a){case "services":this._createServices();b&&this._refresh();break;case "shapeStyle":if(b){this._$shapesContainer.geographics("clear");this._refreshShapes(this._$shapesContainer,this._graphicShapes,this._graphicShapes)}}}},
-destroy:function(){if(this._$elem.is("[data-geo-map]")){this._created=false;e(window).unbind("resize",this._windowHandler);for(var a=0;a<this._currentServices.length;a++){this._currentServices[a].serviceContainer.geomap("destroy");e.geo._serviceTypes[this._currentServices[a].type].destroy(this,this._$servicesContainer,this._currentServices[a])}this._$shapesContainer.geographics("destroy");this._$drawContainer.geographics("destroy");this._$existingChildren.detach();this._$elem.html("");this._$elem.append(this._$existingChildren);
-this._$elem.removeAttr("data-geo-map")}e.Widget.prototype.destroy.apply(this,arguments)},toMap:function(a){a=this._toMap(a);return e.geo.proj?e.geo.proj.toGeodetic(a):a},toPixel:function(a,c,b){a=e.geo.proj?e.geo.proj.fromGeodetic(a):a;return this._toPixel(a,c,b)},opacity:function(a,c){if(this._$elem.is("[data-geo-service]"))this._$elem.closest("[data-geo-map]").geomap("opacity",a,this._$elem);else if(a>=0||a<=1)for(var b=0;b<this._currentServices.length;b++){var d=this._currentServices[b];if(!c||
-d.serviceContainer[0]==c[0]){this._options.services[b].opacity=d.opacity=a;e.geo._serviceTypes[d.type].opacity(this,d)}}},toggle:function(a,c){if(this._$elem.is("[data-geo-service]"))this._$elem.closest("[data-geo-map]").geomap("toggle",a,this._$elem);else for(var b=0;b<this._currentServices.length;b++){var d=this._currentServices[b];if(!c||d.serviceContainer[0]==c[0]){if(a===r)a=d.visibility===r||d.visibility==="visible"?false:true;this._options.services[b].visibility=d.visibility=a?"visible":"hidden";
-e.geo._serviceTypes[d.type].toggle(this,d);a&&e.geo._serviceTypes[d.type].refresh(this,d)}}},zoom:function(a){a!=null&&this._setZoom(this._options.zoom+a,false,true)},refresh:function(){this._refresh()},resize:function(){var a=this._findMapSize(),c=a.width/2-this._contentBounds.width/2,b=a.height/2-this._contentBounds.height/2,d;this._contentBounds={x:parseInt(this._$elem.css("padding-left")),y:parseInt(this._$elem.css("padding-top")),width:a.width,height:a.height};this._$contentFrame.css({width:a.width,
-height:a.height});this._$servicesContainer.css({width:a.width,height:a.height});this._$eventTarget.css({width:a.width,height:a.height});var g=this._$shapesContainer.geographics("option","style");this._$shapesContainer.geographics("destroy");this._$drawContainer.geographics("destroy");for(d=0;d<this._currentServices.length;d++)e.geo._serviceTypes[this._currentServices[d].type].resize(this,this._currentServices[d]);this._$drawContainer.css({width:a.width,height:a.height});this._$drawContainer.geographics();
-this._$shapesContainer.css({width:a.width,height:a.height});this._$shapesContainer.geographics({style:g});for(d=0;d<this._drawPixels.length;d++){this._drawPixels[d][0]+=c;this._drawPixels[d][1]+=b}this._setCenterAndSize(this._center,this._pixelSize,false,true)},append:function(a,c,b){if(a){var d=0;a=a.type=="FeatureCollection"?a.features:e.isArray(a)?a:[a];if(typeof c==="boolean"){b=c;c=null}for(;d<a.length;d++){if(a[d].type!="Point"){var g=e.geo.bbox(a[d]);if(e.geo.proj)g=e.geo.proj.fromGeodetic(g);
-e.data(a[d],"geoBbox",g)}this._graphicShapes.push({shape:a[d],style:c})}if(b===r||b)this._refresh()}},empty:function(a){e.each(this._graphicShapes,function(){e.removeData(this,"geoBbox")});this._graphicShapes=[];if(a===r||a)this._refresh()},find:function(a,c){this.toPixel(a.coordinates);var b=this._pixelSize*c,d=[],g;e.each(this._graphicShapes,function(){if(this.shape.type=="Point")e.geo.distance(this.shape,a)<=b&&d.push(this.shape);else{var f=e.data(this.shape,"geoBbox");f={type:"Polygon",coordinates:[[[f[0],
-f[1]],[f[0],f[3]],[f[2],f[3]],[f[2],f[1]],[f[0],f[1]]]]};var m={type:"Point",coordinates:e.geo.proj?e.geo.proj.fromGeodetic(a.coordinates):a.coordinates};if(e.geo.distance(f,m,true)<=b){f=e.geo._flatten(this.shape);for(g=0;g<f.length;g++)if(e.geo.distance(f[g],a)<=b){d.push(this.shape);break}}}});return d},remove:function(a,c){var b=this;e.each(this._graphicShapes,function(d){if(this.shape==a){e.removeData(a,"geoBbox");var g=b._graphicShapes.slice(d+1);b._graphicShapes.length=d;b._graphicShapes.push.apply(b._graphicShapes,
-g);return false}});if(c===r||c)this._refresh()},_getBbox:function(a,c){a=a||this._center;c=c||this._pixelSize;var b=this._contentBounds.width/2*c,d=this._contentBounds.height/2*c;return[a[0]-b,a[1]-d,a[0]+b,a[1]+d]},_setBbox:function(a,c,b){var d=[a[0]+(a[2]-a[0])/2,a[1]+(a[3]-a[1])/2];a=Math.max(e.geo.width(a,true)/this._contentBounds.width,e.geo.height(a,true)/this._contentBounds.height);if(this._options.tilingScheme)a=this._getTiledPixelSize(this._getTiledZoom(a));this._setCenterAndSize(d,a,c,
-b)},_getBboxMax:function(){var a=this._contentBounds.width/2*this._pixelSizeMax,c=this._contentBounds.height/2*this._pixelSizeMax;return[this._centerMax[0]-a,this._centerMax[1]-c,this._centerMax[0]+a,this._centerMax[1]+c]},_getCenter:function(){return this._center},_getContentBounds:function(){return this._contentBounds},_getServicesContainer:function(){return this._$servicesContainer},_getZoom:function(){if(this._options.tilingScheme)return this._getTiledZoom(this._pixelSize);else{var a=this._contentBounds.width/
-this._contentBounds.height,c=e.geo.reaspect(this._getBbox(),a,true);a=e.geo.reaspect(this._getBboxMax(),a,true);return Math.log(e.geo.width(a,true)/e.geo.width(c,true))/Math.log(this._zoomFactor)}},_setZoom:function(a,c,b){a=Math.max(a,0);if(this._options.tilingScheme)this._setCenterAndSize(this._center,this._getTiledPixelSize(a),c,b);else{a=e.geo.scaleBy(this._getBboxMax(),1/Math.pow(this._zoomFactor,a),true);this._setCenterAndSize(this._center,Math.max(e.geo.width(a,true)/this._contentBounds.width,
-e.geo.height(a,true)/this._contentBounds.height),c,b)}},_createChildren:function(){this._$existingChildren=this._$elem.children().detach();this._forcePosition(this._$existingChildren);this._$existingChildren.css("-moz-user-select","none");this._$elem.prepend("<div style='position:absolute; left:"+this._contentBounds.x+"px; top:"+this._contentBounds.y+"px; width:"+this._contentBounds.width+"px; height:"+this._contentBounds.height+"px; margin:0; padding:0; overflow:hidden; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none;' unselectable='on'></div>");
-this._$eventTarget=this._$contentFrame=this._$elem.children(":first");this._$contentFrame.append('<div style="position:absolute; left:0; top:0; width:'+this._contentBounds.width+"px; height:"+this._contentBounds.height+'px; margin:0; padding:0;"></div>');this._$servicesContainer=this._$contentFrame.children(":last");this._$contentFrame.append('<div style="position:absolute; left:0; top:0; width:'+this._contentBounds.width+"px; height:"+this._contentBounds.height+'px; margin:0; padding:0;"></div>');
-this._$shapesContainer=this._$contentFrame.children(":last");this._$contentFrame.append('<div style="position:absolute; left:0; top:0; width:'+this._contentBounds.width+"px; height:"+this._contentBounds.height+'px; margin:0; padding:0;"></div>');this._$drawContainer=this._$contentFrame.children(":last");this._$contentFrame.append('<div class="ui-widget ui-widget-content ui-corner-all" style="position:absolute; left:0; top:0px; max-width:128px; display:none;"><div style="margin:.2em;"></div></div>');
-this._$textContainer=this._$contentFrame.children(":last");this._$textContent=this._$textContainer.children();this._$contentFrame.append(this._$existingChildren)},_createServices:function(){var a;for(a=0;a<this._currentServices.length;a++){this._currentServices[a].serviceContainer.geomap("destroy");e.geo._serviceTypes[this._currentServices[a].type].destroy(this,this._$servicesContainer,this._currentServices[a])}this._currentServices=[];for(a=0;a<this._options.services.length;a++){this._currentServices[a]=
-this._options.services[a];this._currentServices[a].serviceContainer=e.geo._serviceTypes[this._currentServices[a].type].create(this,this._$servicesContainer,this._currentServices[a],a).geomap()}},_refreshDrawing:function(){this._$drawContainer.geographics("clear");if(this._drawPixels.length>0){var a=this._options.mode,c=this._drawPixels;if(a=="drawPolygon")c=[c];this._$drawContainer.geographics(a,c)}},_resetDrawing:function(){this._drawPixels=[];this._drawCoords=[];this._$drawContainer.geographics("clear")},
-_refreshShapes:function(a,c,b,d,g){var f,m,l,o,s,x=this._getBbox(d,g),t=this;for(f=0;f<c.length;f++){l=c[f].shape||c[f];l=l.geometry||l;m=e.data(l,"geoBbox");if(!(m&&e.geo._bboxDisjoint(x,m))){o=e.isArray(b)?b[f].style:b;switch(l.type){case "Point":this._$shapesContainer.geographics("drawPoint",this.toPixel(l.coordinates,d,g),o);break;case "LineString":this._$shapesContainer.geographics("drawLineString",this.toPixel(l.coordinates,d,g),o);break;case "Polygon":s=[];e.each(l.coordinates,function(A){s[A]=
-t.toPixel(this,d,g)});this._$shapesContainer.geographics("drawPolygon",s,o);break;case "MultiPoint":for(m=0;m<l.coordinates;m++)this._$shapesContainer.geographics("drawPoint",this.toPixel(l.coordinates[m],d,g),o);break;case "MultiLineString":for(m=0;m<l.coordinates;m++)this._$shapesContainer.geographics("drawLineString",this.toPixel(l.coordinates[m],d,g),o);break;case "MultiPolygon":for(m=0;m<l.coordinates;m++){s=[];e.each(l.coordinates[m],function(A){s[A]=t.toPixel(this,d,g)});this._$shapesContainer.geographics("drawPolygon",
-s,o)}break;case "GeometryCollection":t._refreshShapes(a,l.geometries,o,d,g)}}}},_findMapSize:function(){for(var a={width:0,height:0},c=this._$elem;c.size()&&!(a.width>0&&a.height>0);){a={width:c.width(),height:c.height()};if(a.width<=0||a.height<=0)a={width:parseInt(c.css("width")),height:parseInt(c.css("height"))};c=c.parent()}return a},_forcePosition:function(a){var c=a.css("position");c!="relative"&&c!="absolute"&&c!="fixed"&&a.css("position","relative")},_getTiledPixelSize:function(a){var c=this._options.tilingScheme;
-if(c!=null){if(a===0)return c.pixelSizes!=null?c.pixelSizes[0]:c.basePixelSize;a=Math.round(a);a=Math.max(a,0);a=Math.min(a,(c.pixelSizes!=null?c.pixelSizes.length:c.levels)-1);return c.pixelSizes!=null?c.pixelSizes[a]:c.basePixelSize/Math.pow(2,a)}else return NaN},_getTiledZoom:function(a){var c=this._options.tilingScheme;if(c.pixelSizes!=null){a=Math.floor(a*1E3);for(var b=(c.pixelSizes!=null?c.pixelSizes.length:c.levels)-1;b>=0;b--)if(Math.floor(c.pixelSizes[b]*1E3)>=a)return b;return 0}else return Math.max(Math.round(Math.log(c.basePixelSize/
-a)/Math.log(2)),0)},_getZoomCenterAndSize:function(a,c,b){if(this._options.tilingScheme){c=this._getTiledZoom(this._pixelSize)+c;c=this._getTiledPixelSize(c)}else{c=Math.pow(b,-c);c=this._pixelSize*c}b=c/this._pixelSize;a=this._toMap(a);b=[(this._center[0]-a[0])*b,(this._center[1]-a[1])*b];return{pixelSize:c,center:[a[0]+b[0],a[1]+b[1]]}},_mouseWheelFinish:function(){this._wheelTimeout=null;if(this._wheelLevel!=0){var a=this._getZoomCenterAndSize(this._anchor,this._wheelLevel,this._wheelZoomFactor);
-this._setCenterAndSize(a.center,a.pixelSize,true,true);this._wheelLevel=0}else this._refresh()},_panEnd:function(){this._velocity=[this._velocity[0]>0?Math.floor(this._velocity[0]*this._friction[0]):Math.ceil(this._velocity[0]*this._friction[0]),this._velocity[1]>0?Math.floor(this._velocity[1]*this._friction[1]):Math.ceil(this._velocity[1]*this._friction[1])];if(Math.abs(this._velocity[0])<4&&Math.abs(this._velocity[1])<4)this._panFinalize();else{this._current=[this._current[0]+this._velocity[0],
-this._current[1]+this._velocity[1]];this._panMove();setTimeout(e.proxy(this._panEnd,this),30)}},_panFinalize:function(){if(this._panning){this._velocity=[0,0];var a=-(this._current[0]-this._anchor[0])*this._pixelSize,c=(this._current[1]-this._anchor[1])*this._pixelSize;this._$shapesContainer.css({left:0,top:0});this._setCenterAndSize([this._center[0]+a,this._center[1]+c],this._pixelSize,true,true);this._inOp=false;this._anchor=this._current;this._toolPan=this._panning=false;this._$eventTarget.css("cursor",
-this._options.cursors[this._options.mode])}},_panMove:function(){var a=this._current[0]-this._lastDrag[0],c=this._current[1]-this._lastDrag[1],b=0,d;if(this._toolPan||a>3||a<-3||c>3||c<-3){if(!this._toolPan){this._toolPan=true;this._$eventTarget.css("cursor",this._options.cursors.pan)}if(this._mouseDown)this._velocity=[a,c];if(a!=0||c!=0){this._panning=true;this._lastDrag=this._current;for(b=0;b<this._options.services.length;b++){d=this._options.services[b];e.geo._serviceTypes[d.type].interactivePan(this,
-d,a,c)}this._$shapesContainer.css({left:function(g,f){return parseInt(f)+a},top:function(g,f){return parseInt(f)+c}});for(b=0;b<this._drawPixels.length;b++){this._drawPixels[b][0]+=a;this._drawPixels[b][1]+=c}this._refreshDrawing()}}},_refresh:function(){for(var a=0;a<this._options.services.length;a++){var c=this._options.services[a];!this._mouseDown&&e.geo._serviceTypes[c.type]!=null&&e.geo._serviceTypes[c.type].refresh(this,c)}if(this._$shapesContainer){this._$shapesContainer.geographics("clear");
-this._graphicShapes.length>0&&this._refreshShapes(this._$shapesContainer,this._graphicShapes,this._graphicShapes)}},_setCenterAndSize:function(a,c,b,d){if(this._pixelSize!=c){this._$shapesContainer.geographics("clear");for(var g=0;g<this._options.services.length;g++){var f=this._options.services[g];e.geo._serviceTypes[f.type].interactiveScale(this,f,a,c)}}this._center=a;this.options.pixelSize=this._pixelSize=c;if(e.geo.proj){a=this._getBbox();a=e.geo.proj.toGeodetic([[a[0],a[1]],[a[2],a[3]]]);a=[a[0][0],
-a[0][1],a[1][0],a[1][1]];this._options.bbox=a;this._options.center=e.geo.proj.toGeodetic([[this._center[0],this._center[1]]])[0]}else{this._options.bbox=this._getBbox();this._options.center=this._center}this._options.zoom=this._getZoom();if(this._drawCoords.length>0)this._drawPixels=this._toPixel(this._drawCoords);b&&this._trigger("bboxchange",window.event,{bbox:this._options.bbox});if(d){this._refresh();this._refreshDrawing()}},_toMap:function(a,c,b){var d=e.isArray(a[0]);d||(a=[a]);c=c||this._center;
-b=b||this._pixelSize;var g=this._contentBounds.width,f=this._contentBounds.height,m=g/2*b;b=f/2*b;var l=[c[0]-m,c[1]-b,c[0]+m,c[1]+b],o=e.geo.width(l,true)/g,s=e.geo.height(l,true)/f,x=[];e.each(a,function(t){x[t]=[l[0]+this[0]*o,l[3]-this[1]*s]});return d?x:x[0]},_toPixel:function(a,c,b){var d=e.isArray(a[0]);d||(a=[a]);c=c||this._center;b=b||this._pixelSize;var g=this._contentBounds.width,f=this._contentBounds.height,m=g/2*b;b=f/2*b;var l=[c[0]-m,c[1]-b,c[0]+m,c[1]+b],o=e.geo.width(l,true),s=e.geo.height(l,
-true),x=[];e.each(a,function(t){x[t]=[Math.round((this[0]-l[0])*g/o),Math.round((l[3]-this[1])*f/s)]});return d?x:x[0]},_zoomTo:function(a,c,b,d){c=c<0?0:c;var g=this._getTiledPixelSize(c);if(isNaN(g)){c=e.geo._scaleBy(this._getBboxMax(),1/Math.pow(this._zoomFactor,c),true);c=Math.max(e.geo.width(c,true)/this._contentBounds.width,e.geo.height(c,true)/this._contentBounds.height);this._setCenterAndSize(a,c,b,d)}else this._setCenterAndSize(a,g,b,d)},_document_keydown:function(a){var c=this._drawCoords.length;
-if(c>0&&a.which==27)if(c<=2){this._resetDrawing();this._inOp=false}else{this._drawCoords[c-2]=e.merge([],this._drawCoords[c-1]);this._drawPixels[c-2]=e.merge([],this._drawPixels[c-1]);this._drawCoords.length--;this._drawPixels.length--;this._refreshDrawing()}},_eventTarget_dblclick_zoom:function(a){this._trigger("dblclick",a,{type:"Point",coordinates:this.toMap(this._current)});if(!a.isDefaultPrevented()){a=this._getZoomCenterAndSize(this._current,1,this._zoomFactor);this._setCenterAndSize(a.center,
-a.pixelSize,true,true)}},_eventTarget_dblclick:function(a){this._panFinalize();if(this._drawTimeout){window.clearTimeout(this._drawTimeout);this._drawTimeout=null}e(a.currentTarget).offset();switch(this._options.mode){case "pan":case "drawPoint":this._eventTarget_dblclick_zoom(a);break;case "drawLineString":if(this._drawCoords.length>1&&!(this._drawCoords[0][0]==this._drawCoords[1][0]&&this._drawCoords[0][1]==this._drawCoords[1][1])){this._drawCoords.length--;this._trigger("shape",a,{type:"LineString",
-coordinates:e.geo.proj?e.geo.proj.toGeodetic(this._drawCoords):this._drawCoords})}else this._eventTarget_dblclick_zoom(a);this._resetDrawing();break;case "drawPolygon":if(this._drawCoords.length>1&&!(this._drawCoords[0][0]==this._drawCoords[1][0]&&this._drawCoords[0][1]==this._drawCoords[1][1])){var c=this._drawCoords.length-1;if(c>2){this._drawCoords[c]=e.merge([],this._drawCoords[0]);this._trigger("shape",a,{type:"Polygon",coordinates:[e.geo.proj?e.geo.proj.toGeodetic(this._drawCoords):this._drawCoords]})}}else this._eventTarget_dblclick_zoom(a);
-this._resetDrawing()}this._inOp=false},_eventTarget_touchstart:function(a){if(!(!this._supportTouch&&a.which!=1)){this._panFinalize();this._mouseWheelFinish();var c=e(a.currentTarget).offset();this._current=this._supportTouch?[a.originalEvent.changedTouches[0].pageX-c.left,a.originalEvent.changedTouches[0].pageY-c.top]:[a.pageX-c.left,a.pageY-c.top];if(this._softDblClick){c=e.now();if(c-this._downDate<750){if(this._isTap){var b=this._current[0]-this._anchor[0],d=this._current[1]-this._anchor[1];if(Math.sqrt(b*
-b+d*d)>10)this._isTap=false;else this._current=this._anchor}this._isDbltap=this._isDbltap?false:this._isTap}else this._isDbltap=false;this._isTap=true;this._downDate=c}this._mouseDown=true;this._anchor=this._current;if(!this._inOp&&a.shiftKey){this._shiftZoom=true;this._$eventTarget.css("cursor",this._options.cursors.zoom)}else{this._inOp=true;switch(this._options.mode){case "pan":case "drawPoint":case "drawLineString":case "drawPolygon":this._lastDrag=this._current;a.currentTarget.setCapture&&a.currentTarget.setCapture()}}if(this._inOp){a.preventDefault();
-return false}}},_dragTarget_touchmove:function(a){var c=this._$eventTarget.offset(),b=this._drawCoords.length;c=this._supportTouch?[a.originalEvent.changedTouches[0].pageX-c.left,a.originalEvent.changedTouches[0].pageY-c.top]:[a.pageX-c.left,a.pageY-c.top];if(c[0]===this._lastMove[0]&&c[1]===this._lastMove[1])if(this._inOp){a.preventDefault();return false}if(this._softDblClick)this._isDbltap=this._isTap=false;if(this._mouseDown){this._current=c;this._moveDate=e.now()}switch(this._shiftZoom?"zoom":
-this._options.mode){case "zoom":if(this._mouseDown){this._$drawContainer.geographics("clear");this._$drawContainer.geographics("drawBbox",[this._anchor[0],this._anchor[1],c[0],c[1]])}else this._trigger("move",a,{type:"Point",coordinates:this.toMap(c)});break;case "pan":case "drawPoint":this._mouseDown||this._toolPan?this._panMove():this._trigger("move",a,{type:"Point",coordinates:this.toMap(c)});break;case "drawLineString":case "drawPolygon":if(this._mouseDown||this._toolPan)this._panMove();else{if(b>
-0){this._drawCoords[b-1]=this._toMap(c);this._drawPixels[b-1]=c;this._refreshDrawing()}this._trigger("move",a,{type:"Point",coordinates:this.toMap(c)})}}this._lastMove=c;if(this._inOp){a.preventDefault();return false}},_dragTarget_touchstop:function(a){!this._mouseDown&&p==7&&this._eventTarget_touchstart(a);var c=this._mouseDown,b=this._toolPan,d=this._$eventTarget.offset(),g=this._shiftZoom?"zoom":this._options.mode,f,m;f=this._supportTouch?[a.originalEvent.changedTouches[0].pageX-d.left,a.originalEvent.changedTouches[0].pageY-
-d.top]:[a.pageX-d.left,a.pageY-d.top];d=f[0]-this._anchor[0];m=f[1]-this._anchor[1];this._$eventTarget.css("cursor",this._options.cursors[this._options.mode]);this._shiftZoom=this._mouseDown=this._toolPan=false;document.releaseCapture&&document.releaseCapture();if(c){c=e.now();this._current=f;switch(g){case "zoom":if(d>0||m>0){b=this._pixelSize*6;g=this._toMap([[Math.min(this._anchor[0],f[0]),Math.max(this._anchor[1],f[1])],[Math.max(this._anchor[0],f[0]),Math.min(this._anchor[1],f[1])]]);g=[g[0][0],
-g[0][1],g[1][0],g[1][1]];if(g[2]-g[0]<b&&g[3]-g[1]<b)g=e.geo.scaleBy(this._getBbox(e.geo.center(g,true)),0.5,true);this._setBbox(g,true,true)}this._resetDrawing();break;case "pan":if(b)this._panEnd();else if(c-this._clickDate>100){this._trigger("click",a,{type:"Point",coordinates:this.toMap(f)});this._inOp=false}break;case "drawPoint":if(this._drawTimeout){window.clearTimeout(this._drawTimeout);this._drawTimeout=null}if(b)this._panFinalize();else if(c-this._clickDate>100){var l=this;this._drawTimeout=
-setTimeout(function(){if(l._drawTimeout){l._trigger("shape",a,{type:"Point",coordinates:l.toMap(f)});l._inOp=false;l._drawTimeout=false}},250)}break;case "drawLineString":case "drawPolygon":if(b)this._panFinalize();else{b=this._drawCoords.length==0?0:this._drawCoords.length-1;this._drawCoords[b]=this._toMap(f);this._drawPixels[b]=f;if(b<2||!(this._drawCoords[b][0]==this._drawCoords[b-1][0]&&this._drawCoords[b][1]==this._drawCoords[b-1][1])){this._drawCoords[b+1]=this._toMap(f);this._drawPixels[b+
-1]=f}this._refreshDrawing()}}this._clickDate=c;if(this._softDblClick&&this._isDbltap){this._isDbltap=this._isTap=false;this._$eventTarget.trigger("dblclick",a)}}if(this._inOp){a.preventDefault();return false}},_eventTarget_mousewheel:function(a,c){a.preventDefault();this._panFinalize();if(this._mouseDown)return false;if(c!=0){if(this._wheelTimeout){window.clearTimeout(this._wheelTimeout);this._wheelTimeout=null}else{var b=e(a.currentTarget).offset();this._anchor=[a.pageX-b.left,a.pageY-b.top]}this._wheelLevel+=
-c;b=this._getZoomCenterAndSize(this._anchor,this._wheelLevel,this._wheelZoomFactor);this._$shapesContainer.geographics("clear");for(i=0;i<this._options.services.length;i++){var d=this._options.services[i];e.geo._serviceTypes[d.type].interactiveScale(this,d,b.center,b.pixelSize)}this._$shapesContainer.geographics("clear");this._graphicShapes.length>0&&this._graphicShapes.length<256&&this._refreshShapes(this._$shapesContainer,this._graphicShapes,this._graphicShapes,b.center,b.pixelSize);if(this._drawCoords.length>
-0){this._drawPixels=this._toPixel(this._drawCoords,b.center,b.pixelSize);this._refreshDrawing()}var g=this;this._wheelTimeout=window.setTimeout(function(){g._mouseWheelFinish()},1E3)}return false}})})(jQuery);
-(function(e,r){e.geo._serviceTypes.tiled=function(){return{create:function(p,a,c){p=e.data(c,"geoServiceState");if(!p){p={loadCount:0,reloadTiles:false};a.append('<div data-geo-service="tiled"'+(c.id?' id="'+c.id+'"':"")+(c["class"]?' class="'+c["class"]+'"':"")+' style="position:absolute; left:0; top:0; width:8px; height:8px; margin:0; padding:0; display:'+(c.visibility===r||c.visibility==="visible"?"block":"none")+';"></div>');p.serviceContainer=a.children(":last");e.data(c,"geoServiceState",p)}return p.serviceContainer},
-destroy:function(p,a,c){e.data(c,"geoServiceState").serviceContainer.remove();e.removeData(c,"geoServiceState")},interactivePan:function(p,a,c,b){var d=e.data(a,"geoServiceState");if(d){this._cancelUnloaded(p,a);d.serviceContainer.children().css({left:function(w,M){return parseInt(M)+c},top:function(w,M){return parseInt(M)+b}});if(a&&(a.visibility===r||a.visibility==="visible")){var g=p._pixelSize,f=d.serviceContainer,m=f.children("[data-pixelSize='"+g+"']"),l=p._getContentBounds(),o=p.options.tilingScheme,
-s=o.tileWidth,x=o.tileHeight,t=l.width/2*g,A=l.height/2*g,B=m.position(),C=m.data("scaleOrigin").split(",");l=parseInt(C[0])-B.left;B=parseInt(C[1])-B.top;var y=p._getCenter();C=[y[0]+l*g,y[1]-B*g];var H=Math.floor((C[0]-t-o.origin[0])/(g*s));l=Math.floor((o.origin[1]-(C[1]+A))/(g*x));B=Math.ceil((C[0]+t-o.origin[0])/(g*s));C=Math.ceil((o.origin[1]-(C[1]-A))/(g*x));var I=p._getBboxMax(),G=p._getTiledPixelSize(0),E=G/g,D=Math.floor((I[0]-o.origin[0])/(G*s))*E;I=Math.floor((o.origin[1]-I[3])/(G*x))*
-E;t=Math.round((o.origin[0]+D*s*g-(y[0]-t))/g);A=Math.round((y[1]+A-(o.origin[1]-I*x*g))/g);var J=a.opacity===r?1:a.opacity;for(y=H;y<B;y++)for(H=l;H<C;H++){G=""+y+","+H;E=m.children("[data-tile='"+G+"']").removeAttr("data-dirty");if(E.size()===0){var K=[o.origin[0]+y*s*g,o.origin[1]-H*x*g],F=[o.origin[0]+((y+1)*s-1)*g,o.origin[1]-((H+1)*x-1)*g];K=a.getUrl({bbox:[K[0],K[1],F[0],F[1]],width:s,height:x,zoom:p._getZoom(),tile:{row:H,column:y},index:Math.abs(H+y)});d.loadCount++;if(d.reloadTiles&&E.size()>
-0)E.attr("src",K);else{E="<img style='position:absolute; left:"+((y-D)*100+(t-t%s)/s*100)+"%; top:"+((H-I)*100+(A-A%x)/x*100)+"%; ";if(e("body")[0].filters===r)E+="width: 100%; height: 100%;";E+="margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;' unselectable='on' data-tile='"+G+"' />";m.append(E);E=m.children(":last");E.load(function(w){J<1?e(w.target).fadeTo(0,J):e(w.target).show();d.loadCount--;if(d.loadCount<=0){f.children(":not([data-pixelSize='"+
-g+"'])").remove();d.loadCount=0}}).error(function(w){e(w.target).remove();d.loadCount--;if(d.loadCount<=0){f.children(":not([data-pixelSize='"+g+"'])").remove();d.loadCount=0}}).attr("src",K)}}}}}},interactiveScale:function(p,a,c,b){var d=e.data(a,"geoServiceState");if(d&&a&&(a.visibility===r||a.visibility==="visible")){this._cancelUnloaded(p,a);a=p.options.tilingScheme;var g=a.tileWidth,f=a.tileHeight;d.serviceContainer.children().each(function(){var m=e(this),l=m.attr("data-pixelSize")/b;l=Math.round(l*
-1E3)/1E3;var o=m.data("scaleOrigin").split(",");o=p._toMap([o[0],o[1]]);o=p._toPixel(o,c,b);m.css({left:Math.round(o[0])+"px",top:Math.round(o[1])+"px",width:g*l,height:f*l});e("body")[0].filters!==r&&m.children().each(function(){e(this).css("filter","progid:DXImageTransform.Microsoft.Matrix(FilterType=bilinear,M11="+l+",M22="+l+",sizingmethod='auto expand')")})})}},refresh:function(p,a){var c=e.data(a,"geoServiceState");if(c&&a&&(a.visibility===r||a.visibility==="visible")){this._cancelUnloaded(p,
-a);var b=p._getBbox(),d=p._pixelSize,g=c.serviceContainer;p._getContentBounds();var f=p.options.tilingScheme,m=f.tileWidth,l=f.tileHeight,o=Math.floor((b[0]-f.origin[0])/(d*m)),s=Math.floor((f.origin[1]-b[3])/(d*l)),x=Math.ceil((b[2]-f.origin[0])/(d*m)),t=Math.ceil((f.origin[1]-b[1])/(d*l)),A=p._getBboxMax(),B=p._getTiledPixelSize(0),C=B/d,y=Math.floor((A[0]-f.origin[0])/(B*m))*C,H=Math.floor((f.origin[1]-A[3])/(B*l))*C,I=Math.round((f.origin[0]+y*m*d-b[0])/d),G=Math.round((b[3]-(f.origin[1]-H*l*
-d))/d);b=g.children().show();A=b.filter("[data-pixelSize='"+d+"']").appendTo(g);var E=a.opacity===r?1:a.opacity;c.reloadTiles&&b.find("img").attr("data-dirty","true");if(A.size()){A.css({left:I%m+"px",top:G%l+"px"}).data("scaleOrigin",I%m+","+G%l);A.children().each(function(){var F=e(this),w=F.attr("data-tile").split(",");F.css({left:Math.round((parseInt(w[0])-y)*100+(I-I%m)/m*100)+"%",top:Math.round((parseInt(w[1])-H)*100+(G-G%l)/l*100)+"%"});E<1&&F.fadeTo(0,E)})}else{g.append("<div style='position:absolute; left:"+
-I%m+"px; top:"+G%l+"px; width:"+m+"px; height:"+l+"px; margin:0; padding:0;' data-pixelSize='"+d+"'></div>");A=g.children(":last").data("scaleOrigin",I%m+","+G%l)}for(o=o;o<x;o++)for(B=s;B<t;B++){C=""+o+","+B;var D=A.children("[data-tile='"+C+"']").removeAttr("data-dirty");if(D.size()===0||c.reloadTiles){var J=[f.origin[0]+o*m*d,f.origin[1]-B*l*d],K=[f.origin[0]+((o+1)*m-1)*d,f.origin[1]-((B+1)*l-1)*d];J=a.getUrl({bbox:[J[0],J[1],K[0],K[1]],width:m,height:l,zoom:p._getZoom(),tile:{row:B,column:o},
-index:Math.abs(B+o)});c.loadCount++;if(c.reloadTiles&&D.size()>0)D.attr("src",J);else{D="<img style='position:absolute; left:"+((o-y)*100+(I-I%m)/m*100)+"%; top:"+((B-H)*100+(G-G%l)/l*100)+"%; ";if(e("body")[0].filters===r)D+="width: 100%; height: 100%;";D+="margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;' unselectable='on' data-tile='"+C+"' />";A.append(D);D=A.children(":last");D.load(function(F){E<1?e(F.target).fadeTo(0,
-E):e(F.target).show();c.loadCount--;if(c.loadCount<=0){g.children(":not([data-pixelSize='"+d+"'])").remove();c.loadCount=0}}).error(function(F){e(F.target).remove();c.loadCount--;if(c.loadCount<=0){g.children(":not([data-pixelSize='"+d+"'])").remove();c.loadCount=0}}).attr("src",J)}}}b.find("[data-dirty]").remove();c.reloadTiles=false}},resize:function(){},opacity:function(p,a){e.data(a,"geoServiceState").serviceContainer.find("img").stop(true).fadeTo("fast",a.opacity)},toggle:function(p,a){e.data(a,
-"geoServiceState").serviceContainer.css("display",a.visibility==="visible"?"block":"none")},_cancelUnloaded:function(p,a){var c=e.data(a,"geoServiceState");if(c&&c.loadCount>0)for(c.serviceContainer.find("img:hidden").remove();c.loadCount>0;)c.loadCount--}}}()})(jQuery);
-(function(e,r){e.geo._serviceTypes.shingled=function(){return{create:function(p,a,c){p=e.data(c,"geoServiceState");if(!p){p={loadCount:0};a.append('<div data-geo-service="shingled"'+(c.id?' id="'+c.id+'"':"")+(c["class"]?' class="'+c["class"]+'"':"")+' style="position:absolute; left:0; top:0; width:16px; height:16px; margin:0; padding:0; display:'+(c.visibility===r||c.visibility==="visible"?"block":"none")+';"></div>');p.serviceContainer=a.children(":last");e.data(c,"geoServiceState",p)}return p.serviceContainer},
-destroy:function(p,a,c){e.data(c,"geoServiceState").serviceContainer.remove();e.removeData(c,"geoServiceState")},interactivePan:function(p,a,c,b){var d=e.data(a,"geoServiceState");if(d){this._cancelUnloaded(p,a);p=d.serviceContainer.children("[data-pixelSize='"+p._pixelSize+"']");a=p.children("div");if(!a.length){p.children("img").wrap('<div style="position:absolute; left:0; top:0; width:100%; height:100%;"></div>');a=p.children("div")}a.css({left:function(g,f){return parseInt(f)+c},top:function(g,
-f){return parseInt(f)+b}})}},interactiveScale:function(p,a,c,b){var d=e.data(a,"geoServiceState");if(d){this._cancelUnloaded(p,a);a=d.serviceContainer;p=p._getContentBounds();var g=p.width,f=p.height,m=g/2,l=f/2;a.children().each(function(){var o=e(this),s=o.attr("data-pixelSize"),x=s/b;o.css({width:g*x,height:f*x}).children("img").each(function(){var t=e(this),A=t.data("center");t.css({left:(Math.round((A[0]-c[0])/s)-m)*x+"px",top:(Math.round((c[1]-A[1])/s)-l)*x+"px"})})})}},refresh:function(p,a){var c=
-e.data(a,"geoServiceState");if(c&&a&&(a.visibility===r||a.visibility==="visible")){this._cancelUnloaded(p,a);var b=p._getBbox(),d=p._pixelSize,g=c.serviceContainer,f=p._getContentBounds(),m=f.width,l=f.height,o=m/2,s=l/2;f=g.children('[data-pixelSize="'+d+'"]');var x=a.opacity===r?1:a.opacity;if(!f.size()){g.append('<div style="position:absolute; left:'+o+"px; top:"+s+"px; width:"+m+"px; height:"+l+'px; margin:0; padding:0;" data-pixelSize="'+d+'"></div>');f=g.children(":last")}f.children("img").each(function(){var t=
-e(this),A=t.data("center"),B=p._getCenter();t.css({left:Math.round((A[0]-B[0])/d)-o+"px",top:Math.round((B[1]-A[1])/d)-s+"px"})});x<1&&g.find("img").attr("data-keepAlive","0");b=a.getUrl({bbox:b,width:m,height:l,zoom:p._getZoom(),tile:null,index:0});c.loadCount++;f.append('<img style="position:absolute; left:-'+o+"px; top:-"+s+'px; width:100%; height:100%; margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;" unselectable="on" />');
-f.children(":last").data("center",p._getCenter()).load(function(t){x<1?e(t.target).fadeTo(0,x):e(t.target).show();c.loadCount--;if(c.loadCount<=0){g.children(':not([data-pixelSize="'+d+'"])').remove();t=g.find('[data-pixelSize="'+d+'"]>div');if(t.size()>0){var A=t.position();t.children("img").each(function(){var B=e(this),C=A.left+parseInt(B.css("left")),y=A.top+parseInt(B.css("top"));B.css({left:C+"px",top:y+"px"})}).unwrap();t.remove()}c.loadCount=0}}).error(function(t){e(t.target).remove();c.loadCount--;
-if(c.loadCount<=0){g.children(":not([data-pixelSize='"+d+"'])").remove();c.loadCount=0}}).attr("src",b)}},resize:function(p,a){var c=e.data(a,"geoServiceState");if(c&&a&&(a.visibility===r||a.visibility==="visible")){this._cancelUnloaded(p,a);c=shingledServicesState[a.id];var b=c.serviceContainer,d=p._getContentBounds();c=d.width/2;d=d.height/2;b=b.children();b.attr("data-pixelSize","0");b.css({left:c+"px",top:d+"px"})}},opacity:function(p,a){e.data(a,"geoServiceState").serviceContainer.find("img").stop(true).fadeTo("fast",
-a.opacity)},toggle:function(p,a){e.data(a,"geoServiceState").serviceContainer.css("display",a.visibility==="visible"?"block":"none")},_cancelUnloaded:function(p,a){var c=e.data(a,"geoServiceState");if(c&&c.loadCount>0)for(c.serviceContainer.find("img:hidden").remove();c.loadCount>0;)c.loadCount--}}}()})(jQuery);
diff --git a/libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0a4.js b/libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0a4.js
deleted file mode 100755 (executable)
index 3223253..0000000
+++ /dev/null
@@ -1,6233 +0,0 @@
-// excanvas
-// Copyright 2006 Google Inc.
-//
-// 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.
-
-/* 
- * AppGeo/geo 
- * (c) 2007-2011, Applied Geographics, Inc. All rights reserved. 
- * Dual licensed under the MIT or GPL Version 2 licenses. 
- * http://jquery.org/license 
- */ 
-
-// Copyright 2006 Google Inc.
-//
-// 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.
-
-
-// Known Issues:
-//
-// * Patterns only support repeat.
-// * Radial gradient are not implemented. The VML version of these look very
-//   different from the canvas one.
-// * Clipping paths are not implemented.
-// * Coordsize. The width and height attribute have higher priority than the
-//   width and height style values which isn't correct.
-// * Painting mode isn't implemented.
-// * Canvas width/height should is using content-box by default. IE in
-//   Quirks mode will draw the canvas using border-box. Either change your
-//   doctype to HTML5
-//   (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype)
-//   or use Box Sizing Behavior from WebFX
-//   (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html)
-// * Non uniform scaling does not correctly scale strokes.
-// * Optimize. There is always room for speed improvements.
-
-// Only add this code if we do not already have a canvas implementation
-if (!document.createElement('canvas').getContext) {
-
-  (function () {
-
-    // alias some functions to make (compiled) code shorter
-    var m = Math;
-    var mr = m.round;
-    var ms = m.sin;
-    var mc = m.cos;
-    var abs = m.abs;
-    var sqrt = m.sqrt;
-
-    // this is used for sub pixel precision
-    var Z = 10;
-    var Z2 = Z / 2;
-
-    var IE_VERSION = +navigator.userAgent.match(/MSIE ([\d.]+)?/)[1];
-
-    /**
-    * This funtion is assigned to the <canvas> elements as element.getContext().
-    * @this {HTMLElement}
-    * @return {CanvasRenderingContext2D_}
-    */
-    function getContext() {
-      return this.context_ ||
-        (this.context_ = new CanvasRenderingContext2D_(this));
-    }
-
-    var slice = Array.prototype.slice;
-
-    /**
-    * Binds a function to an object. The returned function will always use the
-    * passed in {@code obj} as {@code this}.
-    *
-    * Example:
-    *
-    *   g = bind(f, obj, a, b)
-    *   g(c, d) // will do f.call(obj, a, b, c, d)
-    *
-    * @param {Function} f The function to bind the object to
-    * @param {Object} obj The object that should act as this when the function
-    *     is called
-    * @param {*} var_args Rest arguments that will be used as the initial
-    *     arguments when the function is called
-    * @return {Function} A new function that has bound this
-    */
-    function bind(f, obj, var_args) {
-      var a = slice.call(arguments, 2);
-      return function () {
-        return f.apply(obj, a.concat(slice.call(arguments)));
-      };
-    }
-
-    function encodeHtmlAttribute(s) {
-      return String(s).replace(/&/g, '&amp;').replace(/"/g, '&quot;');
-    }
-
-    function addNamespace(doc, prefix, urn) {
-      if (!doc.namespaces[prefix]) {
-        doc.namespaces.add(prefix, urn, '#default#VML');
-      }
-    }
-
-    function addNamespacesAndStylesheet(doc) {
-      addNamespace(doc, 'g_vml_', 'urn:schemas-microsoft-com:vml');
-      addNamespace(doc, 'g_o_', 'urn:schemas-microsoft-com:office:office');
-
-      // Setup default CSS.  Only add one style sheet per document
-      if (!doc.styleSheets['ex_canvas_']) {
-        var ss = doc.createStyleSheet();
-        ss.owningElement.id = 'ex_canvas_';
-        ss.cssText = 'canvas{display:inline-block;overflow:hidden;' +
-        // default size is 300x150 in Gecko and Opera
-          'text-align:left;width:300px;height:150px}';
-      }
-    }
-
-    // Add namespaces and stylesheet at startup.
-    addNamespacesAndStylesheet(document);
-
-    var G_vmlCanvasManager_ = {
-      init: function (opt_doc) {
-        var doc = opt_doc || document;
-        // Create a dummy element so that IE will allow canvas elements to be
-        // recognized.
-        doc.createElement('canvas');
-        doc.attachEvent('onreadystatechange', bind(this.init_, this, doc));
-      },
-
-      init_: function (doc) {
-        // find all canvas elements
-        var els = doc.getElementsByTagName('canvas');
-        for (var i = 0; i < els.length; i++) {
-          this.initElement(els[i]);
-        }
-      },
-
-      /**
-      * Public initializes a canvas element so that it can be used as canvas
-      * element from now on. This is called automatically before the page is
-      * loaded but if you are creating elements using createElement you need to
-      * make sure this is called on the element.
-      * @param {HTMLElement} el The canvas element to initialize.
-      * @return {HTMLElement} the element that was created.
-      */
-      initElement: function (el) {
-        if (!el.getContext) {
-          el.getContext = getContext;
-
-          // Add namespaces and stylesheet to document of the element.
-          addNamespacesAndStylesheet(el.ownerDocument);
-
-          // Remove fallback content. There is no way to hide text nodes so we
-          // just remove all childNodes. We could hide all elements and remove
-          // text nodes but who really cares about the fallback content.
-          el.innerHTML = '';
-
-          // do not use inline function because that will leak memory
-          el.attachEvent('onpropertychange', onPropertyChange);
-          el.attachEvent('onresize', onResize);
-
-          var attrs = el.attributes;
-          if (attrs.width && attrs.width.specified) {
-            // TODO: use runtimeStyle and coordsize
-            // el.getContext().setWidth_(attrs.width.nodeValue);
-            el.style.width = attrs.width.nodeValue + 'px';
-          } else {
-            el.width = el.clientWidth;
-          }
-          if (attrs.height && attrs.height.specified) {
-            // TODO: use runtimeStyle and coordsize
-            // el.getContext().setHeight_(attrs.height.nodeValue);
-            el.style.height = attrs.height.nodeValue + 'px';
-          } else {
-            el.height = el.clientHeight;
-          }
-          //el.getContext().setCoordsize_()
-        }
-        return el;
-      }
-    };
-
-    function onPropertyChange(e) {
-      var el = e.srcElement;
-
-      switch (e.propertyName) {
-        case 'width':
-          el.getContext().clearRect();
-          el.style.width = el.attributes.width.nodeValue + 'px';
-          // In IE8 this does not trigger onresize.
-          el.firstChild.style.width = el.clientWidth + 'px';
-          break;
-        case 'height':
-          el.getContext().clearRect();
-          el.style.height = el.attributes.height.nodeValue + 'px';
-          el.firstChild.style.height = el.clientHeight + 'px';
-          break;
-      }
-    }
-
-    function onResize(e) {
-      var el = e.srcElement;
-      if (el.firstChild) {
-        el.firstChild.style.width = el.clientWidth + 'px';
-        el.firstChild.style.height = el.clientHeight + 'px';
-      }
-    }
-
-    G_vmlCanvasManager_.init();
-
-    // precompute "00" to "FF"
-    var decToHex = [];
-    for (var i = 0; i < 16; i++) {
-      for (var j = 0; j < 16; j++) {
-        decToHex[i * 16 + j] = i.toString(16) + j.toString(16);
-      }
-    }
-
-    function createMatrixIdentity() {
-      return [
-      [1, 0, 0],
-      [0, 1, 0],
-      [0, 0, 1]
-    ];
-    }
-
-    function matrixMultiply(m1, m2) {
-      var result = createMatrixIdentity();
-
-      for (var x = 0; x < 3; x++) {
-        for (var y = 0; y < 3; y++) {
-          var sum = 0;
-
-          for (var z = 0; z < 3; z++) {
-            sum += m1[x][z] * m2[z][y];
-          }
-
-          result[x][y] = sum;
-        }
-      }
-      return result;
-    }
-
-    function copyState(o1, o2) {
-      o2.fillStyle     = o1.fillStyle;
-      o2.lineCap       = o1.lineCap;
-      o2.lineJoin      = o1.lineJoin;
-      o2.lineWidth     = o1.lineWidth;
-      o2.miterLimit    = o1.miterLimit;
-      o2.shadowBlur    = o1.shadowBlur;
-      o2.shadowColor   = o1.shadowColor;
-      o2.shadowOffsetX = o1.shadowOffsetX;
-      o2.shadowOffsetY = o1.shadowOffsetY;
-      o2.strokeStyle   = o1.strokeStyle;
-      o2.globalAlpha   = o1.globalAlpha;
-      o2.font          = o1.font;
-      o2.textAlign     = o1.textAlign;
-      o2.textBaseline  = o1.textBaseline;
-      o2.arcScaleX_    = o1.arcScaleX_;
-      o2.arcScaleY_    = o1.arcScaleY_;
-      o2.lineScale_    = o1.lineScale_;
-    }
-
-    //  var colorData = {
-    //    aliceblue: '#F0F8FF',
-    //    antiquewhite: '#FAEBD7',
-    //    aquamarine: '#7FFFD4',
-    //    azure: '#F0FFFF',
-    //    beige: '#F5F5DC',
-    //    bisque: '#FFE4C4',
-    //    black: '#000000',
-    //    blanchedalmond: '#FFEBCD',
-    //    blueviolet: '#8A2BE2',
-    //    brown: '#A52A2A',
-    //    burlywood: '#DEB887',
-    //    cadetblue: '#5F9EA0',
-    //    chartreuse: '#7FFF00',
-    //    chocolate: '#D2691E',
-    //    coral: '#FF7F50',
-    //    cornflowerblue: '#6495ED',
-    //    cornsilk: '#FFF8DC',
-    //    crimson: '#DC143C',
-    //    cyan: '#00FFFF',
-    //    darkblue: '#00008B',
-    //    darkcyan: '#008B8B',
-    //    darkgoldenrod: '#B8860B',
-    //    darkgray: '#A9A9A9',
-    //    darkgreen: '#006400',
-    //    darkgrey: '#A9A9A9',
-    //    darkkhaki: '#BDB76B',
-    //    darkmagenta: '#8B008B',
-    //    darkolivegreen: '#556B2F',
-    //    darkorange: '#FF8C00',
-    //    darkorchid: '#9932CC',
-    //    darkred: '#8B0000',
-    //    darksalmon: '#E9967A',
-    //    darkseagreen: '#8FBC8F',
-    //    darkslateblue: '#483D8B',
-    //    darkslategray: '#2F4F4F',
-    //    darkslategrey: '#2F4F4F',
-    //    darkturquoise: '#00CED1',
-    //    darkviolet: '#9400D3',
-    //    deeppink: '#FF1493',
-    //    deepskyblue: '#00BFFF',
-    //    dimgray: '#696969',
-    //    dimgrey: '#696969',
-    //    dodgerblue: '#1E90FF',
-    //    firebrick: '#B22222',
-    //    floralwhite: '#FFFAF0',
-    //    forestgreen: '#228B22',
-    //    gainsboro: '#DCDCDC',
-    //    ghostwhite: '#F8F8FF',
-    //    gold: '#FFD700',
-    //    goldenrod: '#DAA520',
-    //    grey: '#808080',
-    //    greenyellow: '#ADFF2F',
-    //    honeydew: '#F0FFF0',
-    //    hotpink: '#FF69B4',
-    //    indianred: '#CD5C5C',
-    //    indigo: '#4B0082',
-    //    ivory: '#FFFFF0',
-    //    khaki: '#F0E68C',
-    //    lavender: '#E6E6FA',
-    //    lavenderblush: '#FFF0F5',
-    //    lawngreen: '#7CFC00',
-    //    lemonchiffon: '#FFFACD',
-    //    lightblue: '#ADD8E6',
-    //    lightcoral: '#F08080',
-    //    lightcyan: '#E0FFFF',
-    //    lightgoldenrodyellow: '#FAFAD2',
-    //    lightgreen: '#90EE90',
-    //    lightgrey: '#D3D3D3',
-    //    lightpink: '#FFB6C1',
-    //    lightsalmon: '#FFA07A',
-    //    lightseagreen: '#20B2AA',
-    //    lightskyblue: '#87CEFA',
-    //    lightslategray: '#778899',
-    //    lightslategrey: '#778899',
-    //    lightsteelblue: '#B0C4DE',
-    //    lightyellow: '#FFFFE0',
-    //    limegreen: '#32CD32',
-    //    linen: '#FAF0E6',
-    //    magenta: '#FF00FF',
-    //    mediumaquamarine: '#66CDAA',
-    //    mediumblue: '#0000CD',
-    //    mediumorchid: '#BA55D3',
-    //    mediumpurple: '#9370DB',
-    //    mediumseagreen: '#3CB371',
-    //    mediumslateblue: '#7B68EE',
-    //    mediumspringgreen: '#00FA9A',
-    //    mediumturquoise: '#48D1CC',
-    //    mediumvioletred: '#C71585',
-    //    midnightblue: '#191970',
-    //    mintcream: '#F5FFFA',
-    //    mistyrose: '#FFE4E1',
-    //    moccasin: '#FFE4B5',
-    //    navajowhite: '#FFDEAD',
-    //    oldlace: '#FDF5E6',
-    //    olivedrab: '#6B8E23',
-    //    orange: '#FFA500',
-    //    orangered: '#FF4500',
-    //    orchid: '#DA70D6',
-    //    palegoldenrod: '#EEE8AA',
-    //    palegreen: '#98FB98',
-    //    paleturquoise: '#AFEEEE',
-    //    palevioletred: '#DB7093',
-    //    papayawhip: '#FFEFD5',
-    //    peachpuff: '#FFDAB9',
-    //    peru: '#CD853F',
-    //    pink: '#FFC0CB',
-    //    plum: '#DDA0DD',
-    //    powderblue: '#B0E0E6',
-    //    rosybrown: '#BC8F8F',
-    //    royalblue: '#4169E1',
-    //    saddlebrown: '#8B4513',
-    //    salmon: '#FA8072',
-    //    sandybrown: '#F4A460',
-    //    seagreen: '#2E8B57',
-    //    seashell: '#FFF5EE',
-    //    sienna: '#A0522D',
-    //    skyblue: '#87CEEB',
-    //    slateblue: '#6A5ACD',
-    //    slategray: '#708090',
-    //    slategrey: '#708090',
-    //    snow: '#FFFAFA',
-    //    springgreen: '#00FF7F',
-    //    steelblue: '#4682B4',
-    //    tan: '#D2B48C',
-    //    thistle: '#D8BFD8',
-    //    tomato: '#FF6347',
-    //    turquoise: '#40E0D0',
-    //    violet: '#EE82EE',
-    //    wheat: '#F5DEB3',
-    //    whitesmoke: '#F5F5F5',
-    //    yellowgreen: '#9ACD32'
-    //  };
-
-
-    function getRgbHslContent(styleString) {
-      var start = styleString.indexOf('(', 3);
-      var end = styleString.indexOf(')', start + 1);
-      var parts = styleString.substring(start + 1, end).split(',');
-      // add alpha if needed
-      if (parts.length != 4 || styleString.charAt(3) != 'a') {
-        parts[3] = 1;
-      }
-      return parts;
-    }
-
-    function percent(s) {
-      return parseFloat(s) / 100;
-    }
-
-    function clamp(v, min, max) {
-      return Math.min(max, Math.max(min, v));
-    }
-
-    function hslToRgb(parts) {
-      var r, g, b, h, s, l;
-      h = parseFloat(parts[0]) / 360 % 360;
-      if (h < 0)
-        h++;
-      s = clamp(percent(parts[1]), 0, 1);
-      l = clamp(percent(parts[2]), 0, 1);
-      if (s == 0) {
-        r = g = b = l; // achromatic
-      } else {
-        var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
-        var p = 2 * l - q;
-        r = hueToRgb(p, q, h + 1 / 3);
-        g = hueToRgb(p, q, h);
-        b = hueToRgb(p, q, h - 1 / 3);
-      }
-
-      return '#' + decToHex[Math.floor(r * 255)] +
-        decToHex[Math.floor(g * 255)] +
-        decToHex[Math.floor(b * 255)];
-    }
-
-    function hueToRgb(m1, m2, h) {
-      if (h < 0)
-        h++;
-      if (h > 1)
-        h--;
-
-      if (6 * h < 1)
-        return m1 + (m2 - m1) * 6 * h;
-      else if (2 * h < 1)
-        return m2;
-      else if (3 * h < 2)
-        return m1 + (m2 - m1) * (2 / 3 - h) * 6;
-      else
-        return m1;
-    }
-
-    var processStyleCache = {};
-
-    function processStyle(styleString) {
-      if (styleString in processStyleCache) {
-        return processStyleCache[styleString];
-      }
-
-      var str, alpha = 1;
-
-      styleString = String(styleString);
-      if (styleString.charAt(0) == '#') {
-        str = styleString;
-      } else if (/^rgb/.test(styleString)) {
-        var parts = getRgbHslContent(styleString);
-        var str = '#', n;
-        for (var i = 0; i < 3; i++) {
-          if (parts[i].indexOf('%') != -1) {
-            n = Math.floor(percent(parts[i]) * 255);
-          } else {
-            n = +parts[i];
-          }
-          str += decToHex[clamp(n, 0, 255)];
-        }
-        alpha = +parts[3];
-      } else if (/^hsl/.test(styleString)) {
-        var parts = getRgbHslContent(styleString);
-        str = hslToRgb(parts);
-        alpha = parts[3];
-      } else {
-        str = /*colorData[styleString] ||*/styleString;
-      }
-      return processStyleCache[styleString] = { color: str, alpha: alpha };
-    }
-
-    var DEFAULT_STYLE = {
-      style: 'normal',
-      variant: 'normal',
-      weight: 'normal',
-      size: 10,
-      family: 'sans-serif'
-    };
-
-    // Internal text style cache
-    //  var fontStyleCache = {};
-
-    //  function processFontStyle(styleString) {
-    //    if (fontStyleCache[styleString]) {
-    //      return fontStyleCache[styleString];
-    //    }
-
-    //    var el = document.createElement('div');
-    //    var style = el.style;
-    //    try {
-    //      style.font = styleString;
-    //    } catch (ex) {
-    //      // Ignore failures to set to invalid font.
-    //    }
-
-    //    return fontStyleCache[styleString] = {
-    //      style: style.fontStyle || DEFAULT_STYLE.style,
-    //      variant: style.fontVariant || DEFAULT_STYLE.variant,
-    //      weight: style.fontWeight || DEFAULT_STYLE.weight,
-    //      size: style.fontSize || DEFAULT_STYLE.size,
-    //      family: style.fontFamily || DEFAULT_STYLE.family
-    //    };
-    //  }
-
-    //  function getComputedStyle(style, element) {
-    //    var computedStyle = {};
-
-    //    for (var p in style) {
-    //      computedStyle[p] = style[p];
-    //    }
-
-    //    // Compute the size
-    //    var canvasFontSize = parseFloat(element.currentStyle.fontSize),
-    //        fontSize = parseFloat(style.size);
-
-    //    if (typeof style.size == 'number') {
-    //      computedStyle.size = style.size;
-    //    } else if (style.size.indexOf('px') != -1) {
-    //      computedStyle.size = fontSize;
-    //    } else if (style.size.indexOf('em') != -1) {
-    //      computedStyle.size = canvasFontSize * fontSize;
-    //    } else if(style.size.indexOf('%') != -1) {
-    //      computedStyle.size = (canvasFontSize / 100) * fontSize;
-    //    } else if (style.size.indexOf('pt') != -1) {
-    //      computedStyle.size = fontSize / .75;
-    //    } else {
-    //      computedStyle.size = canvasFontSize;
-    //    }
-
-    //    // Different scaling between normal text and VML text. This was found using
-    //    // trial and error to get the same size as non VML text.
-    //    computedStyle.size *= 0.981;
-
-    //    return computedStyle;
-    //  }
-
-    //  function buildStyle(style) {
-    //    return style.style + ' ' + style.variant + ' ' + style.weight + ' ' +
-    //        style.size + 'px ' + style.family;
-    //  }
-
-    var lineCapMap = {
-      'butt': 'flat',
-      'round': 'round'
-    };
-
-    function processLineCap(lineCap) {
-      return lineCapMap[lineCap] || 'square';
-    }
-
-    /**
-    * This class implements CanvasRenderingContext2D interface as described by
-    * the WHATWG.
-    * @param {HTMLElement} canvasElement The element that the 2D context should
-    * be associated with
-    */
-    function CanvasRenderingContext2D_(canvasElement) {
-      this.m_ = createMatrixIdentity();
-
-      this.mStack_ = [];
-      this.aStack_ = [];
-      this.currentPath_ = [];
-
-      // Canvas context properties
-      this.strokeStyle = '#000';
-      this.fillStyle = '#000';
-
-      this.lineWidth = 1;
-      this.lineJoin = 'miter';
-      this.lineCap = 'butt';
-      this.miterLimit = Z * 1;
-      this.globalAlpha = 1;
-      //this.font = '10px sans-serif';
-      //this.textAlign = 'left';
-      //this.textBaseline = 'alphabetic';
-      this.canvas = canvasElement;
-
-      var cssText = 'width:' + canvasElement.clientWidth + 'px;height:' +
-        canvasElement.clientHeight + 'px;overflow:hidden;position:absolute';
-      var el = canvasElement.ownerDocument.createElement('div');
-      el.style.cssText = cssText;
-      canvasElement.appendChild(el);
-
-      var overlayEl = el.cloneNode(false);
-      // Use a non transparent background.
-      overlayEl.style.backgroundColor = 'red';
-      overlayEl.style.filter = 'alpha(opacity=0)';
-      canvasElement.appendChild(overlayEl);
-
-      this.element_ = el;
-      this.arcScaleX_ = 1;
-      this.arcScaleY_ = 1;
-      this.lineScale_ = 1;
-    }
-
-    var contextPrototype = CanvasRenderingContext2D_.prototype;
-    contextPrototype.clearRect = function () {
-      if (this.textMeasureEl_) {
-        this.textMeasureEl_.removeNode(true);
-        this.textMeasureEl_ = null;
-      }
-      this.element_.innerHTML = '';
-    };
-
-    contextPrototype.beginPath = function () {
-      // TODO: Branch current matrix so that save/restore has no effect
-      //       as per safari docs.
-      this.currentPath_ = [];
-    };
-
-    contextPrototype.moveTo = function (aX, aY) {
-      var p = getCoords(this, aX, aY);
-      this.currentPath_.push({ type: 'moveTo', x: p.x, y: p.y });
-      this.currentX_ = p.x;
-      this.currentY_ = p.y;
-    };
-
-    contextPrototype.lineTo = function (aX, aY) {
-      var p = getCoords(this, aX, aY);
-      this.currentPath_.push({ type: 'lineTo', x: p.x, y: p.y });
-
-      this.currentX_ = p.x;
-      this.currentY_ = p.y;
-    };
-
-    contextPrototype.bezierCurveTo = function(aCP1x, aCP1y,
-                                              aCP2x, aCP2y,
-                                              aX, aY) {
-      var p = getCoords(this, aX, aY);
-      var cp1 = getCoords(this, aCP1x, aCP1y);
-      var cp2 = getCoords(this, aCP2x, aCP2y);
-      bezierCurveTo(this, cp1, cp2, p);
-    };
-
-    // Helper function that takes the already fixed cordinates.
-    function bezierCurveTo(self, cp1, cp2, p) {
-      self.currentPath_.push({
-        type: 'bezierCurveTo',
-        cp1x: cp1.x,
-        cp1y: cp1.y,
-        cp2x: cp2.x,
-        cp2y: cp2.y,
-        x: p.x,
-        y: p.y
-      });
-      self.currentX_ = p.x;
-      self.currentY_ = p.y;
-    }
-
-    contextPrototype.quadraticCurveTo = function(aCPx, aCPy, aX, aY) {
-      // the following is lifted almost directly from
-      // http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes
-
-      var cp = getCoords(this, aCPx, aCPy);
-      var p = getCoords(this, aX, aY);
-
-      var cp1 = {
-        x: this.currentX_ + 2.0 / 3.0 * (cp.x - this.currentX_),
-        y: this.currentY_ + 2.0 / 3.0 * (cp.y - this.currentY_)
-      };
-      var cp2 = {
-        x: cp1.x + (p.x - this.currentX_) / 3.0,
-        y: cp1.y + (p.y - this.currentY_) / 3.0
-      };
-
-      bezierCurveTo(this, cp1, cp2, p);
-    };
-
-    contextPrototype.arc = function (aX, aY, aRadius,
-                                  aStartAngle, aEndAngle, aClockwise) {
-      aRadius *= Z;
-      var arcType = aClockwise ? 'at' : 'wa';
-
-      var xStart = aX + mc(aStartAngle) * aRadius - Z2;
-      var yStart = aY + ms(aStartAngle) * aRadius - Z2;
-
-      var xEnd = aX + mc(aEndAngle) * aRadius - Z2;
-      var yEnd = aY + ms(aEndAngle) * aRadius - Z2;
-
-      // IE won't render arches drawn counter clockwise if xStart == xEnd.
-      if (xStart == xEnd && !aClockwise) {
-        xStart += 0.125; // Offset xStart by 1/80 of a pixel. Use something
-        // that can be represented in binary
-      }
-
-      var p = getCoords(this, aX, aY);
-      var pStart = getCoords(this, xStart, yStart);
-      var pEnd = getCoords(this, xEnd, yEnd);
-
-      this.currentPath_.push({ type: arcType,
-        x: p.x,
-        y: p.y,
-        radius: aRadius,
-        xStart: pStart.x,
-        yStart: pStart.y,
-        xEnd: pEnd.x,
-        yEnd: pEnd.y
-      });
-
-    };
-
-    //  contextPrototype.rect = function(aX, aY, aWidth, aHeight) {
-    //    this.moveTo(aX, aY);
-    //    this.lineTo(aX + aWidth, aY);
-    //    this.lineTo(aX + aWidth, aY + aHeight);
-    //    this.lineTo(aX, aY + aHeight);
-    //    this.closePath();
-    //  };
-
-    //  contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) {
-    //    var oldPath = this.currentPath_;
-    //    this.beginPath();
-
-    //    this.moveTo(aX, aY);
-    //    this.lineTo(aX + aWidth, aY);
-    //    this.lineTo(aX + aWidth, aY + aHeight);
-    //    this.lineTo(aX, aY + aHeight);
-    //    this.closePath();
-    //    this.stroke();
-
-    //    this.currentPath_ = oldPath;
-    //  };
-
-    //  contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) {
-    //    var oldPath = this.currentPath_;
-    //    this.beginPath();
-
-    //    this.moveTo(aX, aY);
-    //    this.lineTo(aX + aWidth, aY);
-    //    this.lineTo(aX + aWidth, aY + aHeight);
-    //    this.lineTo(aX, aY + aHeight);
-    //    this.closePath();
-    //    this.fill();
-
-    //    this.currentPath_ = oldPath;
-    //  };
-
-    //  contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) {
-    //    var gradient = new CanvasGradient_('gradient');
-    //    gradient.x0_ = aX0;
-    //    gradient.y0_ = aY0;
-    //    gradient.x1_ = aX1;
-    //    gradient.y1_ = aY1;
-    //    return gradient;
-    //  };
-
-    //  contextPrototype.createRadialGradient = function(aX0, aY0, aR0,
-    //                                                   aX1, aY1, aR1) {
-    //    var gradient = new CanvasGradient_('gradientradial');
-    //    gradient.x0_ = aX0;
-    //    gradient.y0_ = aY0;
-    //    gradient.r0_ = aR0;
-    //    gradient.x1_ = aX1;
-    //    gradient.y1_ = aY1;
-    //    gradient.r1_ = aR1;
-    //    return gradient;
-    //  };
-
-    //  contextPrototype.drawImage = function(image, var_args) {
-    //    var dx, dy, dw, dh, sx, sy, sw, sh;
-
-    //    // to find the original width we overide the width and height
-    //    var oldRuntimeWidth = image.runtimeStyle.width;
-    //    var oldRuntimeHeight = image.runtimeStyle.height;
-    //    image.runtimeStyle.width = 'auto';
-    //    image.runtimeStyle.height = 'auto';
-
-    //    // get the original size
-    //    var w = image.width;
-    //    var h = image.height;
-
-    //    // and remove overides
-    //    image.runtimeStyle.width = oldRuntimeWidth;
-    //    image.runtimeStyle.height = oldRuntimeHeight;
-
-    //    if (arguments.length == 3) {
-    //      dx = arguments[1];
-    //      dy = arguments[2];
-    //      sx = sy = 0;
-    //      sw = dw = w;
-    //      sh = dh = h;
-    //    } else if (arguments.length == 5) {
-    //      dx = arguments[1];
-    //      dy = arguments[2];
-    //      dw = arguments[3];
-    //      dh = arguments[4];
-    //      sx = sy = 0;
-    //      sw = w;
-    //      sh = h;
-    //    } else if (arguments.length == 9) {
-    //      sx = arguments[1];
-    //      sy = arguments[2];
-    //      sw = arguments[3];
-    //      sh = arguments[4];
-    //      dx = arguments[5];
-    //      dy = arguments[6];
-    //      dw = arguments[7];
-    //      dh = arguments[8];
-    //    } else {
-    //      throw Error('Invalid number of arguments');
-    //    }
-
-    //    var d = getCoords(this, dx, dy);
-
-    //    var w2 = sw / 2;
-    //    var h2 = sh / 2;
-
-    //    var vmlStr = [];
-
-    //    var W = 10;
-    //    var H = 10;
-
-    //    // For some reason that I've now forgotten, using divs didn't work
-    //    vmlStr.push(' <g_vml_:group',
-    //                ' coordsize="', Z * W, ',', Z * H, '"',
-    //                ' coordorigin="0,0"' ,
-    //                ' style="width:', W, 'px;height:', H, 'px;position:absolute;');
-
-    //    // If filters are necessary (rotation exists), create them
-    //    // filters are bog-slow, so only create them if abbsolutely necessary
-    //    // The following check doesn't account for skews (which don't exist
-    //    // in the canvas spec (yet) anyway.
-
-    //    if (this.m_[0][0] != 1 || this.m_[0][1] ||
-    //        this.m_[1][1] != 1 || this.m_[1][0]) {
-    //      var filter = [];
-
-    //      // Note the 12/21 reversal
-    //      filter.push('M11=', this.m_[0][0], ',',
-    //                  'M12=', this.m_[1][0], ',',
-    //                  'M21=', this.m_[0][1], ',',
-    //                  'M22=', this.m_[1][1], ',',
-    //                  'Dx=', mr(d.x / Z), ',',
-    //                  'Dy=', mr(d.y / Z), '');
-
-    //      // Bounding box calculation (need to minimize displayed area so that
-    //      // filters don't waste time on unused pixels.
-    //      var max = d;
-    //      var c2 = getCoords(this, dx + dw, dy);
-    //      var c3 = getCoords(this, dx, dy + dh);
-    //      var c4 = getCoords(this, dx + dw, dy + dh);
-
-    //      max.x = m.max(max.x, c2.x, c3.x, c4.x);
-    //      max.y = m.max(max.y, c2.y, c3.y, c4.y);
-
-    //      vmlStr.push('padding:0 ', mr(max.x / Z), 'px ', mr(max.y / Z),
-    //                  'px 0;filter:progid:DXImageTransform.Microsoft.Matrix(',
-    //                  filter.join(''), ", sizingmethod='clip');");
-
-    //    } else {
-    //      vmlStr.push('top:', mr(d.y / Z), 'px;left:', mr(d.x / Z), 'px;');
-    //    }
-
-    //    vmlStr.push(' ">' ,
-    //                '<g_vml_:image src="', image.src, '"',
-    //                ' style="width:', Z * dw, 'px;',
-    //                ' height:', Z * dh, 'px"',
-    //                ' cropleft="', sx / w, '"',
-    //                ' croptop="', sy / h, '"',
-    //                ' cropright="', (w - sx - sw) / w, '"',
-    //                ' cropbottom="', (h - sy - sh) / h, '"',
-    //                ' />',
-    //                '</g_vml_:group>');
-
-    //    this.element_.insertAdjacentHTML('BeforeEnd', vmlStr.join(''));
-    //  };
-
-    contextPrototype.stroke = function (aFill) {
-      var lineStr = [];
-      var lineOpen = false;
-
-      var W = 10;
-      var H = 10;
-
-      lineStr.push('<g_vml_:shape',
-                 ' filled="', !!aFill, '"',
-                 ' style="position:absolute;width:', W, 'px;height:', H, 'px;"',
-                 ' coordorigin="0,0"',
-                 ' coordsize="', Z * W, ',', Z * H, '"',
-                 ' stroked="', !aFill, '"',
-                 ' path="');
-
-      var newSeq = false;
-      var min = { x: null, y: null };
-      var max = { x: null, y: null };
-
-      for (var i = 0; i < this.currentPath_.length; i++) {
-        var p = this.currentPath_[i];
-        var c;
-
-        switch (p.type) {
-          case 'moveTo':
-            c = p;
-            lineStr.push(' m ', mr(p.x), ',', mr(p.y));
-            break;
-          case 'lineTo':
-            lineStr.push(' l ', mr(p.x), ',', mr(p.y));
-            break;
-          case 'close':
-            lineStr.push(' x ');
-            p = null;
-            break;
-          case 'bezierCurveTo':
-            lineStr.push(' c ',
-                       mr(p.cp1x), ',', mr(p.cp1y), ',',
-                       mr(p.cp2x), ',', mr(p.cp2y), ',',
-                       mr(p.x), ',', mr(p.y));
-            break;
-          case 'at':
-          case 'wa':
-            lineStr.push(' ', p.type, ' ',
-                       mr(p.x - this.arcScaleX_ * p.radius), ',',
-                       mr(p.y - this.arcScaleY_ * p.radius), ' ',
-                       mr(p.x + this.arcScaleX_ * p.radius), ',',
-                       mr(p.y + this.arcScaleY_ * p.radius), ' ',
-                       mr(p.xStart), ',', mr(p.yStart), ' ',
-                       mr(p.xEnd), ',', mr(p.yEnd));
-            break;
-        }
-
-
-        // TODO: Following is broken for curves due to
-        //       move to proper paths.
-
-        // Figure out dimensions so we can do gradient fills
-        // properly
-        if (p) {
-          if (min.x == null || p.x < min.x) {
-            min.x = p.x;
-          }
-          if (max.x == null || p.x > max.x) {
-            max.x = p.x;
-          }
-          if (min.y == null || p.y < min.y) {
-            min.y = p.y;
-          }
-          if (max.y == null || p.y > max.y) {
-            max.y = p.y;
-          }
-        }
-      }
-      lineStr.push(' ">');
-
-      if (!aFill) {
-        appendStroke(this, lineStr);
-      } else {
-        appendFill(this, lineStr, min, max);
-      }
-
-      lineStr.push('</g_vml_:shape>');
-
-      this.element_.insertAdjacentHTML('beforeEnd', lineStr.join(''));
-    };
-
-    function appendStroke(ctx, lineStr) {
-      var a = processStyle(ctx.strokeStyle);
-      var color = a.color;
-      var opacity = a.alpha * ctx.globalAlpha;
-      var lineWidth = ctx.lineScale_ * ctx.lineWidth;
-
-      // VML cannot correctly render a line if the width is less than 1px.
-      // In that case, we dilute the color to make the line look thinner.
-      if (lineWidth < 1) {
-        opacity *= lineWidth;
-      }
-
-      lineStr.push(
-      '<g_vml_:stroke',
-      ' opacity="', opacity, '"',
-      ' joinstyle="', ctx.lineJoin, '"',
-      ' miterlimit="', ctx.miterLimit, '"',
-      ' endcap="', processLineCap(ctx.lineCap), '"',
-      ' weight="', lineWidth, 'px"',
-      ' color="', color, '" />'
-    );
-    }
-
-    function appendFill(ctx, lineStr, min, max) {
-      var fillStyle = ctx.fillStyle;
-      var arcScaleX = ctx.arcScaleX_;
-      var arcScaleY = ctx.arcScaleY_;
-      var width = max.x - min.x;
-      var height = max.y - min.y;
-      //    if (fillStyle instanceof CanvasGradient_) {
-      //      // TODO: Gradients transformed with the transformation matrix.
-      //      var angle = 0;
-      //      var focus = {x: 0, y: 0};
-
-      //      // additional offset
-      //      var shift = 0;
-      //      // scale factor for offset
-      //      var expansion = 1;
-
-      //      if (fillStyle.type_ == 'gradient') {
-      //        var x0 = fillStyle.x0_ / arcScaleX;
-      //        var y0 = fillStyle.y0_ / arcScaleY;
-      //        var x1 = fillStyle.x1_ / arcScaleX;
-      //        var y1 = fillStyle.y1_ / arcScaleY;
-      //        var p0 = getCoords(ctx, x0, y0);
-      //        var p1 = getCoords(ctx, x1, y1);
-      //        var dx = p1.x - p0.x;
-      //        var dy = p1.y - p0.y;
-      //        angle = Math.atan2(dx, dy) * 180 / Math.PI;
-
-      //        // The angle should be a non-negative number.
-      //        if (angle < 0) {
-      //          angle += 360;
-      //        }
-
-      //        // Very small angles produce an unexpected result because they are
-      //        // converted to a scientific notation string.
-      //        if (angle < 1e-6) {
-      //          angle = 0;
-      //        }
-      //      } else {
-      //        var p0 = getCoords(ctx, fillStyle.x0_, fillStyle.y0_);
-      //        focus = {
-      //          x: (p0.x - min.x) / width,
-      //          y: (p0.y - min.y) / height
-      //        };
-
-      //        width  /= arcScaleX * Z;
-      //        height /= arcScaleY * Z;
-      //        var dimension = m.max(width, height);
-      //        shift = 2 * fillStyle.r0_ / dimension;
-      //        expansion = 2 * fillStyle.r1_ / dimension - shift;
-      //      }
-
-      //      // We need to sort the color stops in ascending order by offset,
-      //      // otherwise IE won't interpret it correctly.
-      //      var stops = fillStyle.colors_;
-      //      stops.sort(function(cs1, cs2) {
-      //        return cs1.offset - cs2.offset;
-      //      });
-
-      //      var length = stops.length;
-      //      var color1 = stops[0].color;
-      //      var color2 = stops[length - 1].color;
-      //      var opacity1 = stops[0].alpha * ctx.globalAlpha;
-      //      var opacity2 = stops[length - 1].alpha * ctx.globalAlpha;
-
-      //      var colors = [];
-      //      for (var i = 0; i < length; i++) {
-      //        var stop = stops[i];
-      //        colors.push(stop.offset * expansion + shift + ' ' + stop.color);
-      //      }
-
-      //      // When colors attribute is used, the meanings of opacity and o:opacity2
-      //      // are reversed.
-      //      lineStr.push('<g_vml_:fill type="', fillStyle.type_, '"',
-      //                   ' method="none" focus="100%"',
-      //                   ' color="', color1, '"',
-      //                   ' color2="', color2, '"',
-      //                   ' colors="', colors.join(','), '"',
-      //                   ' opacity="', opacity2, '"',
-      //                   ' g_o_:opacity2="', opacity1, '"',
-      //                   ' angle="', angle, '"',
-      //                   ' focusposition="', focus.x, ',', focus.y, '" />');
-      //    } else if (fillStyle instanceof CanvasPattern_) {
-      //      if (width && height) {
-      //        var deltaLeft = -min.x;
-      //        var deltaTop = -min.y;
-      //        lineStr.push('<g_vml_:fill',
-      //                     ' position="',
-      //                     deltaLeft / width * arcScaleX * arcScaleX, ',',
-      //                     deltaTop / height * arcScaleY * arcScaleY, '"',
-      //                     ' type="tile"',
-      //                     // TODO: Figure out the correct size to fit the scale.
-      //                     //' size="', w, 'px ', h, 'px"',
-      //                     ' src="', fillStyle.src_, '" />');
-      //       }
-      //    } else {
-      var a = processStyle(ctx.fillStyle);
-      var color = a.color;
-      var opacity = a.alpha * ctx.globalAlpha;
-      lineStr.push('<g_vml_:fill color="', color, '" opacity="', opacity,
-                   '" />');
-      //     }
-    }
-
-    contextPrototype.fill = function () {
-      this.stroke(true);
-    };
-
-    contextPrototype.closePath = function () {
-      this.currentPath_.push({ type: 'close' });
-    };
-
-    function getCoords(ctx, aX, aY) {
-      var m = ctx.m_;
-      return {
-        x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2,
-        y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2
-      };
-    };
-
-    contextPrototype.save = function () {
-      var o = {};
-      copyState(this, o);
-      this.aStack_.push(o);
-      this.mStack_.push(this.m_);
-      this.m_ = matrixMultiply(createMatrixIdentity(), this.m_);
-    };
-
-    contextPrototype.restore = function () {
-      if (this.aStack_.length) {
-        copyState(this.aStack_.pop(), this);
-        this.m_ = this.mStack_.pop();
-      }
-    };
-
-    function matrixIsFinite(m) {
-      return isFinite(m[0][0]) && isFinite(m[0][1]) &&
-        isFinite(m[1][0]) && isFinite(m[1][1]) &&
-        isFinite(m[2][0]) && isFinite(m[2][1]);
-    }
-
-    function setM(ctx, m, updateLineScale) {
-      if (!matrixIsFinite(m)) {
-        return;
-      }
-      ctx.m_ = m;
-
-      if (updateLineScale) {
-        // Get the line scale.
-        // Determinant of this.m_ means how much the area is enlarged by the
-        // transformation. So its square root can be used as a scale factor
-        // for width.
-        var det = m[0][0] * m[1][1] - m[0][1] * m[1][0];
-        ctx.lineScale_ = sqrt(abs(det));
-      }
-    }
-
-    contextPrototype.translate = function (aX, aY) {
-      var m1 = [
-      [1, 0, 0],
-      [0, 1, 0],
-      [aX, aY, 1]
-    ];
-
-      setM(this, matrixMultiply(m1, this.m_), false);
-    };
-
-    //  contextPrototype.rotate = function(aRot) {
-    //    var c = mc(aRot);
-    //    var s = ms(aRot);
-
-    //    var m1 = [
-    //      [c,  s, 0],
-    //      [-s, c, 0],
-    //      [0,  0, 1]
-    //    ];
-
-    //    setM(this, matrixMultiply(m1, this.m_), false);
-    //  };
-
-    contextPrototype.scale = function (aX, aY) {
-      this.arcScaleX_ *= aX;
-      this.arcScaleY_ *= aY;
-      var m1 = [
-      [aX, 0, 0],
-      [0, aY, 0],
-      [0, 0, 1]
-    ];
-
-      setM(this, matrixMultiply(m1, this.m_), true);
-    };
-
-    //  contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) {
-    //    var m1 = [
-    //      [m11, m12, 0],
-    //      [m21, m22, 0],
-    //      [dx,  dy,  1]
-    //    ];
-
-    //    setM(this, matrixMultiply(m1, this.m_), true);
-    //  };
-
-    //  contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) {
-    //    var m = [
-    //      [m11, m12, 0],
-    //      [m21, m22, 0],
-    //      [dx,  dy,  1]
-    //    ];
-
-    //    setM(this, m, true);
-    //  };
-
-    /**
-    * The text drawing function.
-    * The maxWidth argument isn't taken in account, since no browser supports
-    * it yet.
-    */
-    //  contextPrototype.drawText_ = function(text, x, y, maxWidth, stroke) {
-    //    var m = this.m_,
-    //        delta = 1000,
-    //        left = 0,
-    //        right = delta,
-    //        offset = {x: 0, y: 0},
-    //        lineStr = [];
-
-    //    var fontStyle = getComputedStyle(processFontStyle(this.font),
-    //                                     this.element_);
-
-    //    var fontStyleString = buildStyle(fontStyle);
-
-    //    var elementStyle = this.element_.currentStyle;
-    //    var textAlign = this.textAlign.toLowerCase();
-    //    switch (textAlign) {
-    //      case 'left':
-    //      case 'center':
-    //      case 'right':
-    //        break;
-    //      case 'end':
-    //        textAlign = elementStyle.direction == 'ltr' ? 'right' : 'left';
-    //        break;
-    //      case 'start':
-    //        textAlign = elementStyle.direction == 'rtl' ? 'right' : 'left';
-    //        break;
-    //      default:
-    //        textAlign = 'left';
-    //    }
-
-    //    // 1.75 is an arbitrary number, as there is no info about the text baseline
-    //    switch (this.textBaseline) {
-    //      case 'hanging':
-    //      case 'top':
-    //        offset.y = fontStyle.size / 1.75;
-    //        break;
-    //      case 'middle':
-    //        break;
-    //      default:
-    //      case null:
-    //      case 'alphabetic':
-    //      case 'ideographic':
-    //      case 'bottom':
-    //        offset.y = -fontStyle.size / 2.25;
-    //        break;
-    //    }
-
-    //    switch(textAlign) {
-    //      case 'right':
-    //        left = delta;
-    //        right = 0.05;
-    //        break;
-    //      case 'center':
-    //        left = right = delta / 2;
-    //        break;
-    //    }
-
-    //    var d = getCoords(this, x + offset.x, y + offset.y);
-
-    //    lineStr.push('<g_vml_:line from="', -left ,' 0" to="', right ,' 0.05" ',
-    //                 ' coordsize="100 100" coordorigin="0 0"',
-    //                 ' filled="', !stroke, '" stroked="', !!stroke,
-    //                 '" style="position:absolute;width:1px;height:1px;">');
-
-    //    if (stroke) {
-    //      appendStroke(this, lineStr);
-    //    } else {
-    //      // TODO: Fix the min and max params.
-    //      appendFill(this, lineStr, {x: -left, y: 0},
-    //                 {x: right, y: fontStyle.size});
-    //    }
-
-    //    var skewM = m[0][0].toFixed(3) + ',' + m[1][0].toFixed(3) + ',' +
-    //                m[0][1].toFixed(3) + ',' + m[1][1].toFixed(3) + ',0,0';
-
-    //    var skewOffset = mr(d.x / Z) + ',' + mr(d.y / Z);
-
-    //    lineStr.push('<g_vml_:skew on="t" matrix="', skewM ,'" ',
-    //                 ' offset="', skewOffset, '" origin="', left ,' 0" />',
-    //                 '<g_vml_:path textpathok="true" />',
-    //                 '<g_vml_:textpath on="true" string="',
-    //                 encodeHtmlAttribute(text),
-    //                 '" style="v-text-align:', textAlign,
-    //                 ';font:', encodeHtmlAttribute(fontStyleString),
-    //                 '" /></g_vml_:line>');
-
-    //    this.element_.insertAdjacentHTML('beforeEnd', lineStr.join(''));
-    //  };
-
-    //  contextPrototype.fillText = function(text, x, y, maxWidth) {
-    //    this.drawText_(text, x, y, maxWidth, false);
-    //  };
-
-    //  contextPrototype.strokeText = function(text, x, y, maxWidth) {
-    //    this.drawText_(text, x, y, maxWidth, true);
-    //  };
-
-    //  contextPrototype.measureText = function(text) {
-    //    if (!this.textMeasureEl_) {
-    //      var s = '<span style="position:absolute;' +
-    //          'top:-20000px;left:0;padding:0;margin:0;border:none;' +
-    //          'white-space:pre;"></span>';
-    //      this.element_.insertAdjacentHTML('beforeEnd', s);
-    //      this.textMeasureEl_ = this.element_.lastChild;
-    //    }
-    //    var doc = this.element_.ownerDocument;
-    //    this.textMeasureEl_.innerHTML = '';
-    //    this.textMeasureEl_.style.font = this.font;
-    //    // Don't use innerHTML or innerText because they allow markup/whitespace.
-    //    this.textMeasureEl_.appendChild(doc.createTextNode(text));
-    //    return {width: this.textMeasureEl_.offsetWidth};
-    //  };
-
-    /******** STUBS ********/
-    //  contextPrototype.clip = function() {
-    //    // TODO: Implement
-    //  };
-
-    //  contextPrototype.arcTo = function() {
-    //    // TODO: Implement
-    //  };
-
-    //  contextPrototype.createPattern = function(image, repetition) {
-    //    return new CanvasPattern_(image, repetition);
-    //  };
-
-    //  // Gradient / Pattern Stubs
-    //  function CanvasGradient_(aType) {
-    //    this.type_ = aType;
-    //    this.x0_ = 0;
-    //    this.y0_ = 0;
-    //    this.r0_ = 0;
-    //    this.x1_ = 0;
-    //    this.y1_ = 0;
-    //    this.r1_ = 0;
-    //    this.colors_ = [];
-    //  }
-
-    //  CanvasGradient_.prototype.addColorStop = function(aOffset, aColor) {
-    //    aColor = processStyle(aColor);
-    //    this.colors_.push({offset: aOffset,
-    //                       color: aColor.color,
-    //                       alpha: aColor.alpha});
-    //  };
-
-    //  function CanvasPattern_(image, repetition) {
-    //    assertImageIsValid(image);
-    //    switch (repetition) {
-    //      case 'repeat':
-    //      case null:
-    //      case '':
-    //        this.repetition_ = 'repeat';
-    //        break
-    //      case 'repeat-x':
-    //      case 'repeat-y':
-    //      case 'no-repeat':
-    //        this.repetition_ = repetition;
-    //        break;
-    //      default:
-    //        throwException('SYNTAX_ERR');
-    //    }
-
-    //    this.src_ = image.src;
-    //    this.width_ = image.width;
-    //    this.height_ = image.height;
-    //  }
-
-    function throwException(s) {
-      throw new DOMException_(s);
-    }
-
-    //  function assertImageIsValid(img) {
-    //    if (!img || img.nodeType != 1 || img.tagName != 'IMG') {
-    //      throwException('TYPE_MISMATCH_ERR');
-    //    }
-    //    if (img.readyState != 'complete') {
-    //      throwException('INVALID_STATE_ERR');
-    //    }
-    //  }
-
-    function DOMException_(s) {
-      this.code = this[s];
-      this.message = s + ': DOM Exception ' + this.code;
-    }
-    var p = DOMException_.prototype = new Error;
-    p.INDEX_SIZE_ERR = 1;
-    p.DOMSTRING_SIZE_ERR = 2;
-    p.HIERARCHY_REQUEST_ERR = 3;
-    p.WRONG_DOCUMENT_ERR = 4;
-    p.INVALID_CHARACTER_ERR = 5;
-    p.NO_DATA_ALLOWED_ERR = 6;
-    p.NO_MODIFICATION_ALLOWED_ERR = 7;
-    p.NOT_FOUND_ERR = 8;
-    p.NOT_SUPPORTED_ERR = 9;
-    p.INUSE_ATTRIBUTE_ERR = 10;
-    p.INVALID_STATE_ERR = 11;
-    p.SYNTAX_ERR = 12;
-    p.INVALID_MODIFICATION_ERR = 13;
-    p.NAMESPACE_ERR = 14;
-    p.INVALID_ACCESS_ERR = 15;
-    p.VALIDATION_ERR = 16;
-    p.TYPE_MISMATCH_ERR = 17;
-
-    // set up externs
-    G_vmlCanvasManager = G_vmlCanvasManager_;
-    CanvasRenderingContext2D = CanvasRenderingContext2D_;
-    //CanvasGradient = CanvasGradient_;
-    //CanvasPattern = CanvasPattern_;
-    DOMException = DOMException_;
-  })();
-
-} // if
-/*!
- * jQuery UI Widget @VERSION
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Widget
- */
-
-if ( ! $.widget ) {
-
-(function( $, undefined ) {
-
-// jQuery 1.4+
-if ( $.cleanData ) {
-       var _cleanData = $.cleanData;
-       $.cleanData = function( elems ) {
-               for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
-                       try {
-                               $( elem ).triggerHandler( "remove" );
-                       // http://bugs.jquery.com/ticket/8235
-                       } catch( e ) {}
-               }
-               _cleanData( elems );
-       };
-} else {
-       var _remove = $.fn.remove;
-       $.fn.remove = function( selector, keepData ) {
-               return this.each(function() {
-                       if ( !keepData ) {
-                               if ( !selector || $.filter( selector, [ this ] ).length ) {
-                                       $( "*", this ).add( [ this ] ).each(function() {
-                                               try {
-                                                       $( this ).triggerHandler( "remove" );
-                                               // http://bugs.jquery.com/ticket/8235
-                                               } catch( e ) {}
-                                       });
-                               }
-                       }
-                       return _remove.call( $(this), selector, keepData );
-               });
-       };
-}
-
-$.widget = function( name, base, prototype ) {
-       var namespace = name.split( "." )[ 0 ],
-               fullName;
-       name = name.split( "." )[ 1 ];
-       fullName = namespace + "-" + name;
-
-       if ( !prototype ) {
-               prototype = base;
-               base = $.Widget;
-       }
-
-       // create selector for plugin
-       $.expr[ ":" ][ fullName ] = function( elem ) {
-               return !!$.data( elem, name );
-       };
-
-       $[ namespace ] = $[ namespace ] || {};
-       $[ namespace ][ name ] = function( options, element ) {
-               // allow instantiation without initializing for simple inheritance
-               if ( arguments.length ) {
-                       this._createWidget( options, element );
-               }
-       };
-
-       var basePrototype = new base();
-       // we need to make the options hash a property directly on the new instance
-       // otherwise we'll modify the options hash on the prototype that we're
-       // inheriting from
-//     $.each( basePrototype, function( key, val ) {
-//             if ( $.isPlainObject(val) ) {
-//                     basePrototype[ key ] = $.extend( {}, val );
-//             }
-//     });
-       basePrototype.options = $.extend( true, {}, basePrototype.options );
-       $[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
-               namespace: namespace,
-               widgetName: name,
-               widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
-               widgetBaseClass: fullName
-       }, prototype );
-
-       $.widget.bridge( name, $[ namespace ][ name ] );
-};
-
-$.widget.bridge = function( name, object ) {
-       $.fn[ name ] = function( options ) {
-               var isMethodCall = typeof options === "string",
-                       args = Array.prototype.slice.call( arguments, 1 ),
-                       returnValue = this;
-
-               // allow multiple hashes to be passed on init
-               options = !isMethodCall && args.length ?
-                       $.extend.apply( null, [ true, options ].concat(args) ) :
-                       options;
-
-               // prevent calls to internal methods
-               if ( isMethodCall && options.charAt( 0 ) === "_" ) {
-                       return returnValue;
-               }
-
-               if ( isMethodCall ) {
-                       this.each(function() {
-                               var instance = $.data( this, name ),
-                                       methodValue = instance && $.isFunction( instance[options] ) ?
-                                               instance[ options ].apply( instance, args ) :
-                                               instance;
-                               // TODO: add this back in 1.9 and use $.error() (see #5972)
-//                             if ( !instance ) {
-//                                     throw "cannot call methods on " + name + " prior to initialization; " +
-//                                             "attempted to call method '" + options + "'";
-//                             }
-//                             if ( !$.isFunction( instance[options] ) ) {
-//                                     throw "no such method '" + options + "' for " + name + " widget instance";
-//                             }
-//                             var methodValue = instance[ options ].apply( instance, args );
-                               if ( methodValue !== instance && methodValue !== undefined ) {
-                                       returnValue = methodValue;
-                                       return false;
-                               }
-                       });
-               } else {
-                       this.each(function() {
-                               var instance = $.data( this, name );
-                               if ( instance ) {
-                                       instance.option( options || {} )._init();
-                               } else {
-                                       $.data( this, name, new object( options, this ) );
-                               }
-                       });
-               }
-
-               return returnValue;
-       };
-};
-
-$.Widget = function( options, element ) {
-       // allow instantiation without initializing for simple inheritance
-       if ( arguments.length ) {
-               this._createWidget( options, element );
-       }
-};
-
-$.Widget.prototype = {
-       widgetName: "widget",
-       widgetEventPrefix: "",
-       options: {
-               disabled: false
-       },
-       _createWidget: function( options, element ) {
-               // $.widget.bridge stores the plugin instance, but we do it anyway
-               // so that it's stored even before the _create function runs
-               $.data( element, this.widgetName, this );
-               this.element = $( element );
-               this.options = $.extend( true, {},
-                       this.options,
-                       this._getCreateOptions(),
-                       options );
-
-               var self = this;
-               this.element.bind( "remove." + this.widgetName, function() {
-                       self.destroy();
-               });
-
-               this._create();
-               this._trigger( "create" );
-               this._init();
-       },
-       _getCreateOptions: function() {
-               return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];
-       },
-       _create: function() {},
-       _init: function() {},
-
-       destroy: function() {
-               this.element
-                       .unbind( "." + this.widgetName )
-                       .removeData( this.widgetName );
-               this.widget()
-                       .unbind( "." + this.widgetName )
-                       .removeAttr( "aria-disabled" )
-                       .removeClass(
-                               this.widgetBaseClass + "-disabled " +
-                               "ui-state-disabled" );
-       },
-
-       widget: function() {
-               return this.element;
-       },
-
-       option: function( key, value ) {
-               var options = key;
-
-               if ( arguments.length === 0 ) {
-                       // don't return a reference to the internal hash
-                       return $.extend( {}, this.options );
-               }
-
-               if  (typeof key === "string" ) {
-                       if ( value === undefined ) {
-                               return this.options[ key ];
-                       }
-                       options = {};
-                       options[ key ] = value;
-               }
-
-               this._setOptions( options );
-
-               return this;
-       },
-       _setOptions: function( options ) {
-               var self = this;
-               $.each( options, function( key, value ) {
-                       self._setOption( key, value );
-               });
-
-               return this;
-       },
-       _setOption: function( key, value ) {
-               this.options[ key ] = value;
-
-               if ( key === "disabled" ) {
-                       this.widget()
-                               [ value ? "addClass" : "removeClass"](
-                                       this.widgetBaseClass + "-disabled" + " " +
-                                       "ui-state-disabled" )
-                               .attr( "aria-disabled", value );
-               }
-
-               return this;
-       },
-
-       enable: function() {
-               return this._setOption( "disabled", false );
-       },
-       disable: function() {
-               return this._setOption( "disabled", true );
-       },
-
-       _trigger: function( type, event, data ) {
-               var prop, orig,
-                       callback = this.options[ type ];
-
-               data = data || {};
-               event = $.Event( event );
-               event.type = ( type === this.widgetEventPrefix ?
-                       type :
-                       this.widgetEventPrefix + type ).toLowerCase();
-               // the original event may come from any element
-               // so we need to reset the target on the new event
-               event.target = this.element[ 0 ];
-
-               // copy original event properties over to the new event
-               orig = event.originalEvent;
-               if ( orig ) {
-                       for ( prop in orig ) {
-                               if ( !( prop in event ) ) {
-                                       event[ prop ] = orig[ prop ];
-                               }
-                       }
-               }
-
-               this.element.trigger( event, data );
-
-               return !( $.isFunction(callback) &&
-                       callback.call( this.element[0], event, data ) === false ||
-                       event.isDefaultPrevented() );
-       }
-};
-
-})( jQuery );
-
-}
-
-/*! JsRender v1.0pre - (jsrender.js version: does not require jQuery): http://github.com/BorisMoore/jsrender */
-/*
- * Optimized version of jQuery Templates, fosr rendering to string, using 'codeless' markup.
- *
- * Copyright 2011, Boris Moore
- * Released under the MIT License.
- */
-window.JsViews || window.jQuery && jQuery.views || (function( window, undefined ) {
-
-var $, _$, JsViews, viewsNs, tmplEncode, render, rTag, registerTags, registerHelpers, extend,
-       FALSE = false, TRUE = true,
-       jQuery = window.jQuery, document = window.document,
-       htmlExpr = /^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,
-       rPath = /^(true|false|null|[\d\.]+)|(\w+|\$(view|data|ctx|(\w+)))([\w\.]*)|((['"])(?:\\\1|.)*\7)$/g,
-       rParams = /(\$?[\w\.\[\]]+)(?:(\()|\s*(===|!==|==|!=|<|>|<=|>=)\s*|\s*(\=)\s*)?|(\,\s*)|\\?(\')|\\?(\")|(\))|(\s+)/g,
-       rNewLine = /\r?\n/g,
-       rUnescapeQuotes = /\\(['"])/g,
-       rEscapeQuotes = /\\?(['"])/g,
-       rBuildHash = /\x08([^\x08]+)\x08/g,
-       autoName = 0,
-       escapeMapForHtml = {
-               "&": "&amp;",
-               "<": "&lt;",
-               ">": "&gt;"
-       },
-       htmlSpecialChar = /[\x00"&'<>]/g,
-       slice = Array.prototype.slice;
-
-if ( jQuery ) {
-
-       ////////////////////////////////////////////////////////////////////////////////////////////////
-       // jQuery is loaded, so make $ the jQuery object
-       $ = jQuery;
-
-       $.fn.extend({
-               // Use first wrapped element as template markup.
-               // Return string obtained by rendering the template against data.
-               render: function( data, context, parentView, path ) {
-                       return render( data, this[0], context, parentView, path );
-               },
-
-               // Consider the first wrapped element as a template declaration, and get the compiled template or store it as a named template.
-               template: function( name, context ) {
-                       return $.template( name, this[0], context );
-               }
-       });
-
-} else {
-
-       ////////////////////////////////////////////////////////////////////////////////////////////////
-       // jQuery is not loaded. Make $ the JsViews object
-
-       // Map over the $ in case of overwrite
-       _$ = window.$;
-
-       window.JsViews = JsViews = window.$ = $ = {
-               extend: function( target, source ) {
-                       var name;
-                       for ( name in source ) {
-                               target[ name ] = source[ name ];
-                       }
-                       return target;
-               },
-               isArray: Array.isArray || function( obj ) {
-                       return Object.prototype.toString.call( obj ) === "[object Array]";
-               },
-               noConflict: function() {
-                       if ( window.$ === JsViews ) {
-                               window.$ = _$;
-                       }
-                       return JsViews;
-               }
-       };
-}
-
-extend = $.extend;
-
-//=================
-// View constructor
-//=================
-
-function View( context, path, parentView, data, template ) {
-       // Returns a view data structure for a new rendered instance of a template.
-       // The content field is a hierarchical array of strings and nested views.
-
-       parentView = parentView || { viewsCount:0, ctx: viewsNs.helpers };
-
-       var parentContext = parentView && parentView.ctx;
-
-       return {
-               jsViews: "v1.0pre",
-               path: path || "",
-               // inherit context from parentView, merged with new context.
-               itemNumber: ++parentView.viewsCount || 1,
-               viewsCount: 0,
-               tmpl: template,
-               data: data || parentView.data || {},
-               // Set additional context on this view (which will modify the context inherited from the parent, and be inherited by child views)
-               ctx : context && context === parentContext
-                       ? parentContext
-                       : (parentContext ? extend( extend( {}, parentContext ), context ) : context||{}), 
-                       // If no jQuery, extend does not support chained copies - so limit to two parameters
-               parent: parentView
-       };
-}
-extend( $, {
-       views: viewsNs = {
-               templates: {},
-               tags: {
-                       "if": function() {
-                               var ifTag = this,
-                                       view = ifTag._view;
-                               view.onElse = function( presenter, args ) {
-                                       var i = 0,
-                                               l = args.length;
-                                       while ( l && !args[ i++ ]) {
-                                               // Only render content if args.length === 0 (i.e. this is an else with no condition) or if a condition argument is truey
-                                               if ( i === l ) {
-                                                       return "";
-                                               }
-                                       }
-                                       view.onElse = undefined; // If condition satisfied, so won't run 'else'.
-                                       return render( view.data, presenter.tmpl, view.ctx, view);
-                               };
-                               return view.onElse( this, arguments );
-                       },
-                       "else": function() {
-                               var view = this._view;
-                               return view.onElse ? view.onElse( this, arguments ) : "";
-                       },
-                       each: function() {
-                               var i, 
-                                       self = this,
-                                       result = "",
-                                       args = arguments,
-                                       l = args.length,
-                                       content = self.tmpl,
-                                       view = self._view;
-                               for ( i = 0; i < l; i++ ) {
-                                       result += args[ i ] ? render( args[ i ], content, self.ctx || view.ctx, view, self._path, self._ctor ) : "";
-                               }
-                               return l ? result 
-                                       // If no data parameter, use the current $data from view, and render once
-                                       :  result + render( view.data, content, view.ctx, view, self._path, self.tag );
-                       },
-                       "=": function( value ) {
-                               return value;
-                       },
-                       "*": function( value ) {
-                               return value;
-                       }
-               },
-               helpers: {
-                       not: function( value ) {
-                               return !value;
-                       }
-               },
-               allowCode: FALSE,
-               debugMode: TRUE,
-               err: function( e ) {
-                       return viewsNs.debugMode ? ("<br/><b>Error:</b> <em> " + (e.message || e) + ". </em>"): '""';
-               },
-
-//===============
-// setDelimiters
-//===============
-
-               setDelimiters: function( openTag, closeTag ) {
-                       // Set or modify the delimiter characters for tags: "{{" and "}}"
-                       var firstCloseChar = closeTag.charAt( 0 ),
-                               secondCloseChar = closeTag.charAt( 1 );
-                       openTag = "\\" + openTag.charAt( 0 ) + "\\" + openTag.charAt( 1 );
-                       closeTag = "\\" + firstCloseChar + "\\" + secondCloseChar;
-
-                       // Build regex with new delimiters
-                       //           {{
-                       rTag = openTag
-                               //       #      tag    (followed by space,! or })             or equals or  code
-                               + "(?:(?:(\\#)?(\\w+(?=[!\\s\\" + firstCloseChar + "]))" + "|(?:(\\=)|(\\*)))"
-                               //     params
-                               + "\\s*((?:[^\\" + firstCloseChar + "]|\\" + firstCloseChar + "(?!\\" + secondCloseChar + "))*?)"
-                               //   encoding
-                               + "(!(\\w*))?"
-                               //        closeBlock
-                               + "|(?:\\/([\\w\\$\\.\\[\\]]+)))"
-                       //  }}
-                       + closeTag;
-
-                       // Default rTag:     #    tag              equals code        params         encoding    closeBlock
-                       //      /\{\{(?:(?:(\#)?(\w+(?=[\s\}!]))|(?:(\=)|(\*)))((?:[^\}]|\}(?!\}))*?)(!(\w*))?|(?:\/([\w\$\.\[\]]+)))\}\}/g;
-
-                       rTag = new RegExp( rTag, "g" );
-               },
-
-
-//===============
-// registerTags
-//===============
-
-               // Register declarative tag.
-               registerTags: registerTags = function( name, tagFn ) {
-                       var key;
-                       if ( typeof name === "object" ) {
-                               for ( key in name ) {
-                                       registerTags( key, name[ key ]);
-                               }
-                       } else {
-                               // Simple single property case.
-                               viewsNs.tags[ name ] = tagFn;
-                       }
-                       return this;
-               },
-
-//===============
-// registerHelpers
-//===============
-
-               // Register helper function for use in markup.
-               registerHelpers: registerHelpers = function( name, helper ) {
-                       if ( typeof name === "object" ) {
-                               // Object representation where property name is path and property value is value.
-                               // TODO: We've discussed an "objectchange" event to capture all N property updates here. See TODO note above about propertyChanges.
-                               var key;
-                               for ( key in name ) {
-                                       registerHelpers( key, name[ key ]);
-                               }
-                       } else {
-                               // Simple single property case.
-                               viewsNs.helpers[ name ] = helper;
-                       }
-                       return this;
-               },
-
-//===============
-// tmpl.encode
-//===============
-
-               encode: function( encoding, text ) {
-                       return text
-                               ? ( tmplEncode[ encoding || "html" ] || tmplEncode.html)( text ) // HTML encoding is the default
-                               : "";
-               },
-
-               encoders: tmplEncode = {
-                       "none": function( text ) {
-                               return text;
-                       },
-                       "html": function( text ) {
-                               // HTML encoding helper: Replace < > & and ' and " by corresponding entities.
-                               // Implementation, from Mike Samuel <msamuel@google.com>
-                               return String( text ).replace( htmlSpecialChar, replacerForHtml );
-                       }
-                       //TODO add URL encoding, and perhaps other encoding helpers...
-               },
-
-//===============
-// renderTag
-//===============
-
-               renderTag: function( tag, view, encode, content, tagProperties ) {
-                       // This is a tag call, with arguments: "tag", view, encode, content, presenter [, params...]
-                       var ret, ctx, name,
-                               args = arguments,
-                               presenters = viewsNs.presenters;
-                               hash = tagProperties._hash,
-                               tagFn = viewsNs.tags[ tag ];
-
-                       if ( !tagFn ) {
-                               return "";
-                       }
-                       
-                       content = content && view.tmpl.nested[ content - 1 ];
-                       tagProperties.tmpl = tagProperties.tmpl || content || undefined;
-                       // Set the tmpl property to the content of the block tag, unless set as an override property on the tag
-               
-                       if ( presenters && presenters[ tag ]) {
-                               ctx = extend( extend( {}, tagProperties.ctx ), tagProperties );  
-                               delete ctx.ctx;  
-                               delete ctx._path;  
-                               delete ctx.tmpl;
-                               tagProperties.ctx = ctx;  
-                               tagProperties._ctor = tag + (hash ? "=" + hash.slice( 0, -1 ) : "");
-
-                               tagProperties = extend( extend( {}, tagFn ), tagProperties );
-                               tagFn = viewsNs.tags.each; // Use each to render the layout template against the data
-                       } 
-
-                       tagProperties._encode = encode;
-                       tagProperties._view = view;
-                       ret = tagFn.apply( tagProperties, args.length > 5 ? slice.call( args, 5 ) : [view.data] );
-                       return ret || (ret === undefined ? "" : ret.toString()); // (If ret is the value 0 or false or null, will render to string) 
-               }
-       },
-
-//===============
-// render
-//===============
-
-       render: render = function( data, tmpl, context, parentView, path, tagName ) {
-               // Render template against data as a tree of subviews (nested template), or as a string (top-level template).
-               // tagName parameter for internal use only. Used for rendering templates registered as tags (which may have associated presenter objects)
-               var i, l, dataItem, arrayView, content, result = "";
-
-               if ( arguments.length === 2 && data.jsViews ) {
-                       parentView = data;
-                       context = parentView.ctx;
-                       data = parentView.data;
-               }
-               tmpl = $.template( tmpl );
-               if ( !tmpl ) {
-                       return ""; // Could throw...
-               }
-
-               if ( $.isArray( data )) {
-                       // Create a view item for the array, whose child views correspond to each data item.
-                       arrayView = new View( context, path, parentView, data);
-                       l = data.length;
-                       for ( i = 0, l = data.length; i < l; i++ ) {
-                               dataItem = data[ i ];
-                               content = dataItem ? tmpl( dataItem, new View( context, path, arrayView, dataItem, tmpl, this )) : "";
-                               result += viewsNs.activeViews ? "<!--item-->" + content + "<!--/item-->" : content;
-                       }
-               } else {
-                       result += tmpl( data, new View( context, path, parentView, data, tmpl ));
-               }
-
-               return viewsNs.activeViews
-                       // If in activeView mode, include annotations
-                       ? "<!--tmpl(" + (path || "") + ") " + (tagName ? "tag=" + tagName : tmpl._name) + "-->" + result + "<!--/tmpl-->"
-                       // else return just the string result
-                       : result;
-       },
-
-//===============
-// template
-//===============
-
-       template: function( name, tmpl ) {
-               // Set:
-               // Use $.template( name, tmpl ) to cache a named template,
-               // where tmpl is a template string, a script element or a jQuery instance wrapping a script element, etc.
-               // Use $( "selector" ).template( name ) to provide access by name to a script block template declaration.
-
-               // Get:
-               // Use $.template( name ) to access a cached template.
-               // Also $( selectorToScriptBlock ).template(), or $.template( null, templateString )
-               // will return the compiled template, without adding a name reference.
-               // If templateString is not a selector, $.template( templateString ) is equivalent
-               // to $.template( null, templateString ). To ensure a string is treated as a template,
-               // include an HTML element, an HTML comment, or a template comment tag.
-
-               if (tmpl) {
-                       // Compile template and associate with name
-                       if ( "" + tmpl === tmpl ) { // type string
-                               // This is an HTML string being passed directly in.
-                               tmpl = compile( tmpl );
-                       } else if ( jQuery && tmpl instanceof $ ) {
-                               tmpl = tmpl[0];
-                       }
-                       if ( tmpl ) {
-                               if ( jQuery && tmpl.nodeType ) {
-                                       // If this is a template block, use cached copy, or generate tmpl function and cache.
-                                       tmpl = $.data( tmpl, "tmpl" ) || $.data( tmpl, "tmpl", compile( tmpl.innerHTML ));
-                               }
-                               viewsNs.templates[ tmpl._name = tmpl._name || name || "_" + autoName++ ] = tmpl;
-                       }
-                       return tmpl;
-               }
-               // Return named compiled template
-               return name
-                       ? "" + name !== name // not type string
-                               ? (name._name
-                                       ? name // already compiled
-                                       : $.template( null, name ))
-                               : viewsNs.templates[ name ] ||
-                                       // If not in map, treat as a selector. (If integrated with core, use quickExpr.exec)
-                                       $.template( null, htmlExpr.test( name ) ? name : try$( name ))
-                       : null;
-       }
-});
-
-viewsNs.setDelimiters( "{{", "}}" );
-
-//=================
-// compile template
-//=================
-
-// Generate a reusable function that will serve to render a template against data
-// (Compile AST then build template function)
-
-function parsePath( all, comp, object, viewDataCtx, viewProperty, path, string, quot ) {
-       return object
-               ? ((viewDataCtx
-                       ? viewProperty
-                               ? ("$view." + viewProperty)
-                               : object
-                       :("$data." + object)
-               )  + ( path || "" ))
-               : string || (comp || "");
-}
-
-function compile( markup ) {
-       var newNode,
-               loc = 0,
-               stack = [],
-               topNode = [],
-               content = topNode,
-               current = [,,topNode];
-
-       function pushPreceedingContent( shift ) {
-               shift -= loc;
-               if ( shift ) {
-                       content.push( markup.substr( loc, shift ).replace( rNewLine,"\\n"));
-               }
-       }
-
-       function parseTag( all, isBlock, tagName, equals, code, params, useEncode, encode, closeBlock, index ) {
-               // rTag    :    #    tagName          equals code        params         encode      closeBlock
-               // /\{\{(?:(?:(\#)?(\w+(?=[\s\}!]))|(?:(\=)|(\*)))((?:[^\}]|\}(?!\}))*?)(!(\w*))?|(?:\/([\w\$\.\[\]]+)))\}\}/g;
-
-               // Build abstract syntax tree: [ tagName, params, content, encode ]
-               var named,
-                       hash = "",
-                       parenDepth = 0,
-                       quoted = FALSE, // boolean for string content in double qoutes
-                       aposed = FALSE; // or in single qoutes
-
-               function parseParams( all, path, paren, comp, eq, comma, apos, quot, rightParen, space, index ) {
-                       //      path          paren eq      comma   apos   quot  rtPrn  space
-                       // /(\$?[\w\.\[\]]+)(?:(\()|(===)|(\=))?|(\,\s*)|\\?(\')|\\?(\")|(\))|(\s+)/g
-
-                       return aposed
-                               // within single-quoted string
-                               ? ( aposed = !apos, (aposed ? all : '"'))
-                               : quoted
-                                       // within double-quoted string
-                                       ? ( quoted = !quot, (quoted ? all : '"'))
-                                       : comp
-                                               // comparison
-                                               ? ( path.replace( rPath, parsePath ) + comp)
-                                               : eq
-                                                       // named param
-                                                       ? parenDepth ? "" :( named = TRUE, '\b' + path + ':')
-                                                       : paren
-                                                               // function
-                                                               ? (parenDepth++, path.replace( rPath, parsePath ) + '(')
-                                                               : rightParen
-                                                                       // function
-                                                                       ? (parenDepth--, ")")
-                                                                       : path
-                                                                               // path
-                                                                               ? path.replace( rPath, parsePath )
-                                                                               : comma
-                                                                                       ? ","
-                                                                                       : space
-                                                                                               ? (parenDepth
-                                                                                                       ? ""
-                                                                                                       : named
-                                                                                                               ? ( named = FALSE, "\b")
-                                                                                                               : ","
-                                                                                               )
-                                                                                               : (aposed = apos, quoted = quot, '"');
-               }
-
-               tagName = tagName || equals;
-               pushPreceedingContent( index );
-               if ( code ) {
-                       if ( viewsNs.allowCode ) {
-                               content.push([ "*", params.replace( rUnescapeQuotes, "$1" )]);
-                       }
-               } else if ( tagName ) {
-                       if ( tagName === "else" ) {
-                               current = stack.pop();
-                               content = current[ 2 ];
-                               isBlock = TRUE;
-                       }
-                       params = (params
-                               ? (params + " ")
-                                       .replace( rParams, parseParams )
-                                       .replace( rBuildHash, function( all, keyValue, index ) {
-                                               hash += keyValue + ",";
-                                               return "";
-                                       })
-                               : "");
-                       params = params.slice( 0, -1 );
-                       newNode = [
-                               tagName,
-                               useEncode ? encode || "none" : "",
-                               isBlock && [],
-                               "{" + hash + "_hash:'" +  hash + "',_path:'" + params + "'}",
-                               params
-                       ];
-
-                       if ( isBlock ) {
-                               stack.push( current );
-                               current = newNode;
-                       }
-                       content.push( newNode );
-               } else if ( closeBlock ) {
-                       current = stack.pop();
-               }
-               loc = index + all.length; // location marker - parsed up to here
-               if ( !current ) {
-                       throw "Expected block tag";
-               }
-               content = current[ 2 ];
-       }
-       markup = markup.replace( rEscapeQuotes, "\\$1" );
-       markup.replace( rTag, parseTag );
-       pushPreceedingContent( markup.length );
-       return buildTmplFunction( topNode );
-}
-
-// Build javascript compiled template function, from AST
-function buildTmplFunction( nodes ) {
-       var ret, node, i,
-               nested = [],
-               l = nodes.length,
-               code = "try{var views="
-                       + (jQuery ? "jQuery" : "JsViews")
-                       + '.views,tag=views.renderTag,enc=views.encode,html=views.encoders.html,$ctx=$view && $view.ctx,result=""+\n\n';
-
-       for ( i = 0; i < l; i++ ) {
-               node = nodes[ i ];
-               if ( node[ 0 ] === "*" ) {
-                       code = code.slice( 0, i ? -1 : -3 ) + ";" + node[ 1 ] + ( i + 1 < l ? "result+=" : "" );
-               } else if ( "" + node === node ) { // type string
-                       code += '"' + node + '"+';
-               } else {
-                       var tag = node[ 0 ],
-                               encode = node[ 1 ],
-                               content = node[ 2 ],
-                               obj = node[ 3 ],
-                               params = node[ 4 ],
-                               paramsOrEmptyString = params + '||"")+';
-
-                       if( content ) {
-                               nested.push( buildTmplFunction( content ));
-                       }
-                       code += tag === "="
-                               ? (!encode || encode === "html"
-                                       ? "html(" + paramsOrEmptyString
-                                       : encode === "none"
-                                               ? ("(" + paramsOrEmptyString)
-                                               : ('enc("' + encode + '",' + paramsOrEmptyString)
-                               )
-                               : 'tag("' + tag + '",$view,"' + ( encode || "" ) + '",'
-                                       + (content ? nested.length : '""') // For block tags, pass in the key (nested.length) to the nested content template
-                                       + "," + obj + (params ? "," : "") + params + ")+";
-               }
-       }
-       ret = new Function( "$data, $view", code.slice( 0, -1) + ";return result;\n\n}catch(e){return views.err(e);}" );
-       ret.nested = nested;
-       return ret;
-}
-
-//========================== Private helper functions, used by code above ==========================
-
-function replacerForHtml( ch ) {
-       // Original code from Mike Samuel <msamuel@google.com>
-       return escapeMapForHtml[ ch ]
-               // Intentional assignment that caches the result of encoding ch.
-               || ( escapeMapForHtml[ ch ] = "&#" + ch.charCodeAt( 0 ) + ";" );
-}
-
-function try$( selector ) {
-       // If selector is valid, return jQuery object, otherwise return (invalid) selector string
-       try {
-               return $( selector );
-       } catch( e) {}
-       return selector;
-}
-})( window );
-(function ($, window, undefined) {
-  var pos_oo = Number.POSITIVE_INFINITY,
-      neg_oo = Number.NEGATIVE_INFINITY;
-
-  $.geo = {
-    //
-    // utility functions
-    //
-
-    _allCoordinates: function (geom) {
-      // return array of all positions in all geometries of geom
-      // not in JTS
-      var geometries = this._flatten(geom),
-          curGeom = 0,
-          result = [];
-
-      for (; curGeom < geometries.length; curGeom++) {
-        var coordinates = geometries[curGeom].coordinates,
-            isArray = coordinates && $.isArray(coordinates[0]),
-            isDblArray = isArray && $.isArray(coordinates[0][0]),
-            isTriArray = isDblArray && $.isArray(coordinates[0][0][0]),
-            i, j, k;
-
-        if (!isTriArray) {
-          if (!isDblArray) {
-            if (!isArray) {
-              coordinates = [coordinates];
-            }
-            coordinates = [coordinates];
-          }
-          coordinates = [coordinates];
-        }
-
-        for (i = 0; i < coordinates.length; i++) {
-          for (j = 0; j < coordinates[i].length; j++) {
-            for (k = 0; k < coordinates[i][j].length; k++) {
-              result.push(coordinates[i][j][k]);
-            }
-          }
-        }
-      }
-      return result;
-    },
-
-    _isGeodetic: function( coords ) {
-      // returns true if the first coordinate it can find is geodetic
-
-      while ( $.isArray( coords ) ) {
-        if ( coords.length > 1 && ! $.isArray( coords[ 0 ] ) ) {
-          return ( coords[ 0 ] >= -180 && coords[ 0 ] <= 180 && coords[ 1 ] >= -85 && coords[ 1 ] <= 85 );
-        } else {
-          coords = coords[ 0 ];
-        }
-      }
-
-      return false;
-    },
-
-    //
-    // bbox functions
-    //
-
-    center: function (bbox, _ignoreGeo /* Internal Use Only */) {
-      // Envelope.centre in JTS
-      // bbox only, use centroid for geom
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      var center = [(bbox[0] + bbox[2]) / 2, (bbox[1] + bbox[3]) / 2];
-      return wasGeodetic ? $.geo.proj.toGeodetic(center) : center;
-    },
-
-    expandBy: function (bbox, dx, dy, _ignoreGeo /* Internal Use Only */) {
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      bbox = [bbox[0] - dx, bbox[1] - dy, bbox[2] + dx, bbox[3] + dy];
-      return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    height: function (bbox, _ignoreGeo /* Internal Use Only */ ) {
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      return bbox[3] - bbox[1];
-    },
-
-    _in: function(bbox1, bbox2) {
-      return bbox1[0] <= bbox2[0] &&
-             bbox1[1] <= bbox2[1] &&
-             bbox1[2] >= bbox2[2] &&
-             bbox1[3] >= bbox2[3];
-    },
-
-    _bboxDisjoint: function( bbox1, bbox2 ) {
-      return bbox2[ 0 ] > bbox1[ 2 ] || 
-             bbox2[ 2 ] < bbox1[ 0 ] || 
-             bbox2[ 1 ] > bbox1[ 3 ] ||
-             bbox2[ 3 ] < bbox1[ 1 ];
-    },
-
-    reaspect: function (bbox, ratio, _ignoreGeo /* Internal Use Only */ ) {
-      // not in JTS
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      var width = this.width(bbox, true),
-          height = this.height(bbox, true),
-          center = this.center(bbox, true),
-          dx, dy;
-
-      if (width != 0 && height != 0 && ratio > 0) {
-        if (width / height > ratio) {
-          dx = width / 2;
-          dy = dx / ratio;
-        } else {
-          dy = height / 2;
-          dx = dy * ratio;
-        }
-
-        bbox = [center[0] - dx, center[1] - dy, center[0] + dx, center[1] + dy];
-      }
-
-      return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    recenter: function( bbox, center, _ignoreGeo /* Internal Use Only */ ) {
-      // not in JTS
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj ) {
-        if ( this._isGeodetic( bbox ) ) {
-          wasGeodetic = true;
-          bbox = $.geo.proj.fromGeodetic(bbox);
-        }
-
-        if ( this._isGeodetic( center ) ) {
-          center = $.geo.proj.fromGeodetic(center);
-        }
-      }
-
-      var halfWidth = ( bbox[ 2 ] - bbox[ 0 ] ) / 2,
-          halfHeight = ( bbox[ 3 ] - bbox[ 1 ] ) / 2;
-
-      bbox = [
-        center[ 0 ] - halfWidth,
-        center[ 1 ] - halfHeight,
-        center[ 0 ] + halfWidth,
-        center[ 1 ] + halfHeight
-      ];
-
-      return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    scaleBy: function ( bbox, scale, _ignoreGeo /* Internal Use Only */ ) {
-      // not in JTS
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      var c = this.center(bbox, true),
-          dx = (bbox[2] - bbox[0]) * scale / 2,
-          dy = (bbox[3] - bbox[1]) * scale / 2;
-
-      bbox = [c[0] - dx, c[1] - dy, c[0] + dx, c[1] + dy];
-
-      return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    width: function (bbox, _ignoreGeo /* Internal Use Only */ ) {
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      return bbox[2] - bbox[0];
-    },
-
-    //
-    // geometry functions
-    //
-
-    // bbox (Geometry.getEnvelope in JTS)
-
-    bbox: function ( geom, _ignoreGeo /* Internal Use Only */ ) {
-      if ( !geom ) {
-        return undefined;
-      } else if ( geom.bbox ) {
-        result = ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom.bbox ) ) ? $.geo.proj.fromGeodetic( geom.bbox ) : geom.bbox;
-      } else {
-        result = [ pos_oo, pos_oo, neg_oo, neg_oo ];
-
-        var coordinates = this._allCoordinates( geom ),
-            curCoord = 0;
-
-        if ( coordinates.length == 0 ) {
-          return undefined;
-        }
-
-        var wasGeodetic = false;
-        if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( coordinates ) ) {
-          wasGeodetic = true;
-          coordinates = $.geo.proj.fromGeodetic( coordinates );
-        }
-
-        for ( ; curCoord < coordinates.length; curCoord++ ) {
-          result[0] = Math.min(coordinates[curCoord][0], result[0]);
-          result[1] = Math.min(coordinates[curCoord][1], result[1]);
-          result[2] = Math.max(coordinates[curCoord][0], result[2]);
-          result[3] = Math.max(coordinates[curCoord][1], result[3]);
-        }
-      }
-
-      return wasGeodetic ? $.geo.proj.toGeodetic(result) : result;
-    },
-
-    // centroid
-    
-    centroid: function( geom, _ignoreGeo /* Internal Use Only */ ) {
-      switch (geom.type) {
-        case "Point":
-          return $.extend({}, geom);
-
-        case "LineString":
-        case "Polygon":
-          var a = 0,
-              c = [0, 0],
-              coords = $.merge( [ ], geom.type == "Polygon" ? geom.coordinates[0] : geom.coordinates ),
-              i = 1, j, n;
-
-          var wasGeodetic = false;
-          if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( coords ) ) {
-            wasGeodetic = true;
-            coords = $.geo.proj.fromGeodetic(coords);
-          }
-
-          //if (coords[0][0] != coords[coords.length - 1][0] || coords[0][1] != coords[coords.length - 1][1]) {
-          //  coords.push(coords[0]);
-          //}
-
-          for (; i <= coords.length; i++) {
-            j = i % coords.length;
-            n = (coords[i - 1][0] * coords[j][1]) - (coords[j][0] * coords[i - 1][1]);
-            a += n;
-            c[0] += (coords[i - 1][0] + coords[j][0]) * n;
-            c[1] += (coords[i - 1][1] + coords[j][1]) * n;
-          }
-
-          if (a == 0) {
-            if (coords.length > 0) {
-              c[0] = coords[0][0];
-              c[1] = coords[0][1];
-              return { type: "Point", coordinates: wasGeodetic ? $.geo.proj.toGeodetic(c) : c };
-            } else {
-              return undefined;
-            }
-          }
-
-          a *= 3;
-          c[0] /= a;
-          c[1] /= a;
-
-          return { type: "Point", coordinates: wasGeodetic ? $.geo.proj.toGeodetic(c) : c };
-      }
-      return undefined;
-    },
-
-    // contains
-
-    contains: function (geom1, geom2) {
-      if (geom1.type != "Polygon") {
-        return false;
-      }
-
-      switch (geom2.type) {
-        case "Point":
-          return this._containsPolygonPoint(geom1.coordinates, geom2.coordinates);
-
-        case "LineString":
-          return this._containsPolygonLineString(geom1.coordinates, geom2.coordinates);
-
-        case "Polygon":
-          return this._containsPolygonLineString(geom1.coordinates, geom2.coordinates[0]);
-
-        default:
-          return false;
-      }
-    },
-
-    _containsPolygonPoint: function (polygonCoordinates, pointCoordinate) {
-      if (polygonCoordinates.length == 0 || polygonCoordinates[0].length < 4) {
-        return false;
-      }
-
-      var rayCross = 0,
-          a = polygonCoordinates[0][0],
-          i = 1,
-          b,
-          x;
-
-      for (; i < polygonCoordinates[0].length; i++) {
-        b = polygonCoordinates[0][i];
-
-        if ((a[1] <= pointCoordinate[1] && pointCoordinate[1] < b[1]) || (b[1] <= pointCoordinate[1] && pointCoordinate[1] < a[1]) && (pointCoordinate[0] < a[0] || pointCoordinate[0] < b[0])) {
-          x = a[0] + (b[0] - a[0]) * (pointCoordinate[1] - a[1]) / (b[1] - a[1]);
-
-          if (x > pointCoordinate[0]) {
-            rayCross++;
-          }
-        }
-
-        a = b;
-      }
-
-      return rayCross % 2 == 1;
-    },
-
-    _containsPolygonLineString: function (polygonCoordinates, lineStringCoordinates) {
-      for (var i = 0; i < lineStringCoordinates.length; i++) {
-        if (!this._containsPolygonPoint(polygonCoordinates, lineStringCoordinates[i])) {
-          return false;
-        }
-      }
-      return true;
-    },
-
-    // distance
-
-    distance: function ( geom1, geom2, _ignoreGeo /* Internal Use Only */ ) {
-      var geom1CoordinatesProjected = ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom1.coordinates ) ) ? $.geo.proj.fromGeodetic(geom1.coordinates) : geom1.coordinates,
-          geom2CoordinatesProjected = ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom2.coordinates ) ) ? $.geo.proj.fromGeodetic(geom2.coordinates) : geom2.coordinates;
-
-      switch (geom1.type) {
-        case "Point":
-          switch (geom2.type) {
-            case "Point":
-              return this._distancePointPoint(geom2CoordinatesProjected, geom1CoordinatesProjected);
-            case "LineString":
-              return this._distanceLineStringPoint(geom2CoordinatesProjected, geom1CoordinatesProjected);
-            case "Polygon":
-              return this._containsPolygonPoint(geom2CoordinatesProjected, geom1CoordinatesProjected) ? 0 : this._distanceLineStringPoint(geom2CoordinatesProjected[0], geom1CoordinatesProjected);
-            default:
-              return undefined;
-          }
-          break;
-
-        case "LineString":
-          switch (geom2.type) {
-            case "Point":
-              return this._distanceLineStringPoint(geom1CoordinatesProjected, geom2CoordinatesProjected);
-            case "LineString":
-              return this._distanceLineStringLineString(geom1CoordinatesProjected, geom2CoordinatesProjected);
-            case "Polygon":
-              return this._containsPolygonLineString(geom2CoordinatesProjected, geom1CoordinatesProjected) ? 0 : this._distanceLineStringLineString(geom2CoordinatesProjected[0], geom1CoordinatesProjected);
-            default:
-              return undefined;
-          }
-          break;
-
-        case "Polygon":
-          switch (geom2.type) {
-            case "Point":
-              return this._containsPolygonPoint(geom1CoordinatesProjected, geom2CoordinatesProjected) ? 0 : this._distanceLineStringPoint(geom1CoordinatesProjected[0], geom2CoordinatesProjected);
-            case "LineString":
-              return this._containsPolygonLineString(geom1CoordinatesProjected, geom2CoordinatesProjected) ? 0 : this._distanceLineStringLineString(geom1CoordinatesProjected[0], geom2CoordinatesProjected);
-            case "Polygon":
-              return this._containsPolygonLineString(geom1CoordinatesProjected, geom2CoordinatesProjected[0]) ? 0 : this._distanceLineStringLineString(geom1CoordinatesProjected[0], geom2CoordinatesProjected[0]);
-            default:
-              return undefined;
-          }
-          break;
-      }
-    },
-
-    _distancePointPoint: function (coordinate1, coordinate2) {
-      var dx = coordinate2[0] - coordinate1[0],
-          dy = coordinate2[1] - coordinate1[1];
-      return Math.sqrt((dx * dx) + (dy * dy));
-    },
-
-    _distanceLineStringPoint: function (lineStringCoordinates, pointCoordinate) {
-      var minDist = pos_oo;
-
-      if (lineStringCoordinates.length > 0) {
-        var a = lineStringCoordinates[0],
-
-            apx = pointCoordinate[0] - a[0],
-            apy = pointCoordinate[1] - a[1];
-
-        if (lineStringCoordinates.length == 1) {
-          return Math.sqrt(apx * apx + apy * apy);
-        } else {
-          for (var i = 1; i < lineStringCoordinates.length; i++) {
-            var b = lineStringCoordinates[i],
-
-                abx = b[0] - a[0],
-                aby = b[1] - a[1],
-                bpx = pointCoordinate[0] - b[0],
-                bpy = pointCoordinate[1] - b[1],
-
-                d = this._distanceSegmentPoint(abx, aby, apx, apy, bpx, bpy);
-
-            if (d == 0) {
-              return 0;
-            }
-
-            if (d < minDist) {
-              minDist = d;
-            }
-
-            a = b;
-            apx = bpx;
-            apy = bpy;
-          }
-        }
-      }
-
-      return Math.sqrt(minDist);
-    },
-
-    _distanceSegmentPoint: function (abx, aby, apx, apy, bpx, bpy) {
-      var dot1 = abx * apx + aby * apy;
-
-      if (dot1 <= 0) {
-        return apx * apx + apy * apy;
-      }
-
-      var dot2 = abx * abx + aby * aby;
-
-      if (dot1 >= dot2) {
-        return bpx * bpx + bpy * bpy;
-      }
-
-      return apx * apx + apy * apy - dot1 * dot1 / dot2;
-    },
-
-    _distanceLineStringLineString: function (lineStringCoordinates1, lineStringCoordinates2) {
-      var minDist = pos_oo;
-      for (var i = 0; i < lineStringCoordinates2.length; i++) {
-        minDist = Math.min(minDist, this._distanceLineStringPoint(lineStringCoordinates1, lineStringCoordinates2[i]));
-      }
-      return minDist;
-    },
-
-    // buffer
-
-    _buffer: function( geom, distance, _ignoreGeo /* Internal Use Only */ ) {
-      var wasGeodetic = false,
-          coords = geom.coordinates;
-
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom.coordinates ) ) {
-        wasGeodetic = true;
-        coords = $.geo.proj.fromGeodetic( geom.coordinates );
-      }
-
-      switch ( geom.type ) {
-        case "Point":
-          var resultCoords = [],
-              slices = 180,
-              i = 0,
-              a;
-
-          for ( ; i <= slices; i++ ) {
-            a = ( i * 360 / slices ) * ( Math.PI / 180 );
-            resultCoords.push( [
-              coords[ 0 ] + Math.cos( a ) * distance,
-              coords[ 1 ] + Math.sin( a ) * distance
-            ] );
-          }
-
-          return {
-            type: "Polygon",
-            coordinates: [ ( wasGeodetic ? $.geo.proj.toGeodetic( resultCoords ) : resultCoords ) ]
-          };
-
-          break;
-
-        default:
-          return undefined;
-      }
-    },
-
-    
-    //
-    // feature
-    //
-
-    _flatten: function (geom) {
-      // return an array of all basic geometries
-      // not in JTS
-      var geometries = [],
-          curGeom = 0;
-      switch (geom.type) {
-        case "Feature":
-          $.merge(geometries, this._flatten(geom.geometry));
-          break;
-
-        case "FeatureCollection":
-          for (; curGeom < geom.features.length; curGeom++) {
-            $.merge(geometries, this._flatten(geom.features[curGeom].geometry));
-          }
-          break;
-
-        case "GeometryCollection":
-          for (; curGeom < geom.geometries.length; curGeom++) {
-            $.merge(geometries, this._flatten(geom.geometries[curGeom]));
-          }
-          break;
-
-        default:
-          geometries[0] = geom;
-          break;
-      }
-      return geometries;
-    },
-
-    length: function( geom, _ignoreGeo /* Internal Use Only */ ) {
-      var sum = 0,
-          lineStringCoordinates,
-          i = 1, dx, dy;
-
-      switch ( geom.type ) {
-        case "Point":
-          return 0;
-
-        case "LineString":
-          lineStringCoordinates = geom.coordinates;
-          break;
-
-        case "Polygon":
-          lineStringCoordinates = geom.coordinates[ 0 ];
-          break;
-      }
-
-      if ( lineStringCoordinates ) {
-        if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( lineStringCoordinates ) ) {
-          lineStringCoordinates = $.geo.proj.fromGeodetic( lineStringCoordinates );
-        }
-
-        for ( ; i < lineStringCoordinates.length; i++ ) {
-          dx = lineStringCoordinates[ i ][0] - lineStringCoordinates[ i - 1 ][0];
-          dy = lineStringCoordinates[ i ][1] - lineStringCoordinates[ i - 1 ][1];
-          sum += Math.sqrt((dx * dx) + (dy * dy));
-        }
-
-        return sum;
-      }
-
-      // return undefined;
-    },
-
-    area: function( geom, _ignoreGeo /* Internal Use Only */ ) {
-      var sum = 0,
-          polygonCoordinates,
-          i = 1, j;
-
-      switch ( geom.type ) {
-        case "Point":
-        case "LineString":
-          return 0;
-
-        case "Polygon":
-          polygonCoordinates = geom.coordinates[ 0 ];
-          break;
-      }
-
-      if ( polygonCoordinates ) {
-        if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( polygonCoordinates ) ) {
-          polygonCoordinates = $.geo.proj.fromGeodetic( polygonCoordinates );
-        }
-
-        for ( ; i <= polygonCoordinates.length; i++) {
-          j = i %  polygonCoordinates.length;
-          sum += ( polygonCoordinates[ i - 1 ][ 0 ] - polygonCoordinates[ j ][ 0 ] ) * ( polygonCoordinates[ i - 1 ][ 1 ] + polygonCoordinates[ j ][ 1 ] ) / 2;
-        }
-
-        return Math.abs( sum );
-      }
-    },
-
-    pointAlong: function( geom, percentage, _ignoreGeo /* Internal Use Only */ ) {
-      var totalLength = 0,
-          previousPercentageSum = 0,
-          percentageSum = 0,
-          remainderPercentageSum,
-          len,
-          lineStringCoordinates,
-          segmentLengths = [],
-          i = 1, dx, dy,
-          c, c0, c1,
-          wasGeodetic = false;
-
-      switch ( geom.type ) {
-        case "Point":
-          return $.extend( { }, geom );
-
-        case "LineString":
-          lineStringCoordinates = geom.coordinates;
-          break;
-
-        case "Polygon":
-          lineStringCoordinates = geom.coordinates[ 0 ];
-          break;
-      }
-
-      if ( lineStringCoordinates ) {
-        if ( percentage === 0 ) {
-          return {
-            type: "Point",
-            coordinates: [ lineStringCoordinates[ 0 ][ 0 ], lineStringCoordinates[ 0 ][ 1 ] ]
-          };
-        } else if ( percentage === 1 ) {
-          i = lineStringCoordinates.length - 1;
-          return {
-            type: "Point",
-            coordinates: [ lineStringCoordinates[ i ][ 0 ], lineStringCoordinates[ i ][ 1 ] ]
-          };
-        } else {
-          if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( lineStringCoordinates ) ) {
-            wasGeodetic = true;
-            lineStringCoordinates = $.geo.proj.fromGeodetic( lineStringCoordinates );
-          }
-
-          for ( ; i < lineStringCoordinates.length; i++ ) {
-            dx = lineStringCoordinates[ i ][ 0 ] - lineStringCoordinates[ i - 1 ][ 0 ];
-            dy = lineStringCoordinates[ i ][ 1 ] - lineStringCoordinates[ i - 1 ][ 1 ];
-            len = Math.sqrt((dx * dx) + (dy * dy));
-            segmentLengths.push( len );
-            totalLength += len;
-          }
-
-          for ( i = 0; i < segmentLengths.length && percentageSum < percentage; i++ ) {
-            previousPercentageSum = percentageSum;
-            percentageSum += ( segmentLengths[ i ] / totalLength );
-          }
-
-          remainderPercentageSum = percentage - previousPercentageSum;
-
-          c0 = lineStringCoordinates[ i - 1 ];
-          c1 = lineStringCoordinates[ i ];
-
-          c = [
-            c0[ 0 ] + ( remainderPercentageSum * ( c1[ 0 ] - c0[ 0 ] ) ),
-            c0[ 1 ] + ( remainderPercentageSum * ( c1[ 1 ] - c0[ 1 ] ) )
-          ];
-
-          return {
-            type: "Point",
-            coordinates: wasGeodetic ? $.geo.proj.toGeodetic(c) : c
-          };
-        }
-      }
-    },
-
-    //
-    // WKT functions
-    //
-
-    _WKT: (function () {
-      function pointToString(value) {
-        return "POINT " + pointToUntaggedString(value.coordinates);
-      }
-
-      function pointToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMPTY";
-        } else {
-          return "(" + coordinates.join(" ") + ")";
-        }
-      }
-
-      function lineStringToString(value) {
-        return "LINESTRING " + lineStringToUntaggedString(value.coordinates);
-      }
-
-      function lineStringToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMPTY";
-        } else {
-          var points = []
-
-          for (var i = 0; i < coordinates.length; i++) {
-            points.push(coordinates[i].join(" "));
-          }
-
-          return "(" + points + ")";
-        }
-      }
-
-      function polygonToString(value) {
-        return "POLYGON " + polygonToUntaggedString(value.coordinates);
-      }
-
-      function polygonToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMTPY";
-        } else {
-          var lineStrings = [];
-
-          for (var i = 0; i < coordinates.length; i++) {
-            lineStrings.push(lineStringToUntaggedString(coordinates[i]));
-          }
-
-          return "(" + lineStrings + ")";
-        }
-      }
-
-      function multiPointToString(value) {
-        return "MULTIPOINT " + lineStringToUntaggedString(value.coordinates);
-      }
-
-      function multiLineStringToString(value) {
-        return "MULTILINSTRING " + polygonToUntaggedString(value.coordinates);
-      }
-
-      function multiPolygonToString(value) {
-        return "MULTIPOLYGON " + multiPolygonToUntaggedString(value.coordinates);
-      }
-
-      function multiPolygonToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMPTY";
-        } else {
-          var polygons = [];
-          for (var i = 0; i < coordinates.length; i++) {
-            polygons.push(polygonToUntaggedString(coordinates[i]));
-          }
-          return "(" + polygons + ")";
-        }
-      }
-
-      function geometryCollectionToString(value) {
-        return "GEOMETRYCOLLECTION " + geometryCollectionToUntaggedString(value.geometries);
-      }
-
-      function geometryCollectionToUntaggedString(geometries) {
-        if (!(geometries && geometries.length)) {
-          return "EMPTY";
-        } else {
-          var geometryText = [];
-          for (var i = 0; i < geometries.length; i++) {
-            geometryText.push(stringify(geometries[i]));
-          }
-          return "(" + geometries + ")";
-        }
-      }
-
-      function stringify(value) {
-        if (!(value && value.type)) {
-          return "";
-        } else {
-          switch (value.type) {
-            case "Point":
-              return pointToString(value);
-
-            case "LineString":
-              return lineStringToString(value);
-
-            case "Polygon":
-              return polygonToString(value);
-
-            case "MultiPoint":
-              return multiPointToString(value);
-
-            case "MultiLineString":
-              return multiLineStringToString(value);
-
-            case "MultiPolygon":
-              return multiPolygonToString(value);
-
-            case "GeometryCollection":
-              return geometryCollectionToString(value);
-
-            default:
-              return "";
-          }
-        }
-      }
-
-      function pointParseUntagged(wkt) {
-        var pointString = wkt.match( /\(\s*([\d\.-]+)\s+([\d\.-]+)\s*\)/ );
-        return pointString && pointString.length > 2 ? {
-          type: "Point",
-          coordinates: [
-            parseFloat(pointString[1]),
-            parseFloat(pointString[2])
-          ]
-        } : null;
-      }
-
-      function lineStringParseUntagged(wkt) {
-        var lineString = wkt.match( /\s*\((.*)\)/ ),
-            coords = [],
-            pointStrings,
-            pointParts,
-            i = 0;
-
-        if ( lineString.length > 1 ) {
-          pointStrings = lineString[ 1 ].match( /[\d\.-]+\s+[\d\.-]+/g );
-
-          for ( ; i < pointStrings.length; i++ ) {
-            pointParts = pointStrings[ i ].match( /\s*([\d\.-]+)\s+([\d\.-]+)\s*/ );
-            coords[ i ] = [ parseFloat( pointParts[ 1 ] ), parseFloat( pointParts[ 2 ] ) ];
-          }
-
-          return {
-            type: "LineString",
-            coordinates: coords
-          };
-        } else {
-          return null
-        }
-      }
-
-      function polygonParseUntagged(wkt) {
-        var polygon = wkt.match( /\s*\(\s*\((.*)\)\s*\)/ ),
-            coords = [],
-            pointStrings,
-            pointParts,
-            i = 0;
-
-        if ( polygon.length > 1 ) {
-          pointStrings = polygon[ 1 ].match( /[\d\.-]+\s+[\d\.-]+/g );
-
-          for ( ; i < pointStrings.length; i++ ) {
-            pointParts = pointStrings[ i ].match( /\s*([\d\.-]+)\s+([\d\.-]+)\s*/ );
-            coords[ i ] = [ parseFloat( pointParts[ 1 ] ), parseFloat( pointParts[ 2 ] ) ];
-          }
-
-          return {
-            type: "Polygon",
-            coordinates: [ coords ]
-          };
-        } else {
-          return null;
-        }
-      }
-
-      function parse(wkt) {
-        wkt = $.trim(wkt);
-
-        var typeIndex = wkt.indexOf( " " ),
-            untagged = wkt.substr( typeIndex + 1 );
-
-        switch (wkt.substr(0, typeIndex).toUpperCase()) {
-          case "POINT":
-            return pointParseUntagged( untagged );
-
-          case "LINESTRING":
-            return lineStringParseUntagged( untagged );
-
-          case "POLYGON":
-            return polygonParseUntagged( untagged );
-
-          default:
-            return null;
-        }
-      }
-
-      return {
-        stringify: stringify,
-
-        parse: parse
-      };
-    })(),
-
-    //
-    // projection functions
-    //
-
-    proj: (function () {
-      var halfPi = 1.5707963267948966192,
-          quarterPi = 0.7853981633974483096,
-          radiansPerDegree = 0.0174532925199432958,
-          degreesPerRadian = 57.295779513082320877,
-          semiMajorAxis = 6378137;
-
-      return {
-        fromGeodeticPos: function (coordinate) {
-          if (!coordinate) {
-            debugger;
-          }
-          return [
-            semiMajorAxis * coordinate[ 0 ] * radiansPerDegree,
-            semiMajorAxis * Math.log(Math.tan(quarterPi + coordinate[ 1 ] * radiansPerDegree / 2))
-          ];
-        },
-
-        fromGeodetic: function ( coordinates ) {
-          if ( ! $.geo._isGeodetic( coordinates ) ) {
-            return coordinates;
-          }
-
-          var isMultiPointOrLineString = $.isArray(coordinates[ 0 ]),
-              fromGeodeticPos = this.fromGeodeticPos;
-
-          if (!isMultiPointOrLineString && coordinates.length == 4) {
-            // bbox
-            var min = fromGeodeticPos([ coordinates[ 0 ], coordinates[ 1 ] ]),
-                max = fromGeodeticPos([ coordinates[ 2 ], coordinates[ 3 ] ]);
-            return [ min[ 0 ], min[ 1 ], max[ 0 ], max[ 1 ] ];
-          } else {
-            // geometry
-            var isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray(coordinates[ 0 ][ 0 ]),
-                isMultiPolygon = isMultiLineStringOrPolygon && $.isArray(coordinates[ 0 ][ 0 ][ 0 ]),
-                result = [ ],
-                i, j, k;
-
-            if (!isMultiPolygon) {
-              if (!isMultiLineStringOrPolygon) {
-                if (!isMultiPointOrLineString) {
-                  coordinates = [ coordinates ];
-                }
-                coordinates = [ coordinates ];
-              }
-              coordinates = [ coordinates ];
-            }
-
-            for ( i = 0; i < coordinates.length; i++ ) {
-              result[ i ] = [ ];
-              for ( j = 0; j < coordinates[ i ].length; j++ ) {
-                result[ i ][ j ] = [ ];
-                for ( k = 0; k < coordinates[ i ][ j ].length; k++ ) {
-                  result[ i ][ j ][ k ] = fromGeodeticPos(coordinates[ i ][ j ][ k ]);
-                }
-              }
-            }
-
-            return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-          }
-        },
-
-        toGeodeticPos: function (coordinate) {
-          return [
-            (coordinate[ 0 ] / semiMajorAxis) * degreesPerRadian,
-            (halfPi - 2 * Math.atan(1 / Math.exp(coordinate[ 1 ] / semiMajorAxis))) * degreesPerRadian
-          ];
-        },
-
-        toGeodetic: function (coordinates) {
-          if ( $.geo._isGeodetic( coordinates ) ) {
-            return coordinates;
-          }
-
-          var isMultiPointOrLineString = $.isArray(coordinates[ 0 ]),
-              toGeodeticPos = this.toGeodeticPos;
-
-          if (!isMultiPointOrLineString && coordinates.length == 4) {
-            // bbox
-            var min = toGeodeticPos([ coordinates[ 0 ], coordinates[ 1 ] ]),
-                max = toGeodeticPos([ coordinates[ 2 ], coordinates[ 3 ] ]);
-            return [ min[ 0 ], min[ 1 ], max[ 0 ], max[ 1 ] ];
-          } else {
-            // geometry
-            var isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray(coordinates[ 0 ][ 0 ]),
-                isMultiPolygon = isMultiLineStringOrPolygon && $.isArray(coordinates[ 0 ][ 0 ][ 0 ]),
-                result = [ ];
-
-            if (!isMultiPolygon) {
-              if (!isMultiLineStringOrPolygon) {
-                if (!isMultiPointOrLineString) {
-                  coordinates = [ coordinates ];
-                }
-                coordinates = [ coordinates ];
-              }
-              coordinates = [ coordinates ];
-            }
-
-            for ( i = 0; i < coordinates.length; i++ ) {
-              result[ i ] = [ ];
-              for ( j = 0; j < coordinates[ i ].length; j++ ) {
-                result[ i ][ j ] = [ ];
-                for ( k = 0; k < coordinates[ i ][ j ].length; k++ ) {
-                  result[ i ][ j ][ k ] = toGeodeticPos(coordinates[ i ][ j ][ k ]);
-                }
-              }
-            }
-
-            return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-          }
-        }
-      }
-    })(),
-
-    //
-    // service types (defined in other files)
-    //
-
-    _serviceTypes: {}
-  }
-})(jQuery, this);
-(function ($, undefined) {
-
-  var _ieVersion = (function () {
-    var v = 5, div = document.createElement("div"), a = div.all || [];
-    while (div.innerHTML = "<!--[if gt IE " + (++v) + "]><br><![endif]-->", a[0]) { }
-    return v > 6 ? v : !v;
-  } ());
-
-  $.widget("geo.geographics", {
-    _$elem: undefined,
-    _options: {},
-    _trueCanvas: true,
-
-    _width: 0,
-    _height: 0,
-
-    _$canvas: undefined,
-    _context: undefined,
-    _$labelsContainer: undefined,
-
-    options: {
-      style: {
-        borderRadius: "8px",
-        color: "#7f0000",
-        //fill: undefined,
-        fillOpacity: .2,
-        height: "8px",
-        opacity: 1,
-        //stroke: undefined,
-        strokeOpacity: 1,
-        strokeWidth: "2px",
-        visibility: "visible",
-        width: "8px"
-      }
-    },
-
-    _create: function () {
-      this._$elem = this.element;
-      this._options = this.options;
-
-      this._$elem.css({ display: "inline-block", overflow: "hidden", textAlign: "left" });
-
-      if (this._$elem.css("position") == "static") {
-        this._$elem.css("position", "relative");
-      }
-
-      this._$elem.addClass( "geo-graphics" );
-
-      this._width = this._$elem.width();
-      this._height = this._$elem.height();
-
-      if (!(this._width && this._height)) {
-        this._width = parseInt(this._$elem.css("width"));
-        this._height = parseInt(this._$elem.css("height"));
-      }
-
-      var posCss = 'position:absolute;left:0;top:0;margin:0;padding:0;',
-          sizeCss = 'width:' + this._width + 'px;height:' + this._height + 'px;',
-          sizeAttr = 'width="' + this._width + '" height="' + this._height + '"';
-
-      if (document.createElement('canvas').getContext) {
-        this._$elem.append('<canvas ' + sizeAttr + ' style="' + posCss + '"></canvas>');
-        this._$canvas = this._$elem.children(':last');
-        this._context = this._$canvas[0].getContext("2d");
-      } else if (_ieVersion <= 8) {
-        this._trueCanvas = false;
-        this._$elem.append( '<div ' + sizeAttr + ' style="' + posCss + sizeCss + '"></div>');
-        this._$canvas = this._$elem.children(':last');
-
-        G_vmlCanvasManager.initElement(this._$canvas[0]);
-        this._context = this._$canvas[0].getContext("2d");
-        this._$canvas.children().css({ backgroundColor: "transparent", width: this._width, height: this._height });
-      }
-
-      this._$elem.append('<div class="geo-labels-container" style="' + posCss + sizeCss + '"></div>');
-      this._$labelsContainer = this._$elem.children(':last');
-    },
-
-    _setOption: function (key, value) {
-      if (key == "style") {
-        value = $.extend({}, this._options.style, value);
-      }
-      $.Widget.prototype._setOption.apply(this, arguments);
-    },
-
-    destroy: function () {
-      $.Widget.prototype.destroy.apply(this, arguments);
-      this._$elem.html("");
-      this._$elem.removeClass( "geo-graphics" );
-    },
-
-    clear: function () {
-      this._context.clearRect(0, 0, this._width, this._height);
-      this._$labelsContainer.html("");
-    },
-
-    drawArc: function (coordinates, startAngle, sweepAngle, style) {
-      style = this._getGraphicStyle(style);
-
-      if (style.visibility != "hidden" && style.opacity > 0 && style.widthValue > 0 && style.heightValue > 0) {
-        var r = Math.min(style.widthValue, style.heightValue) / 2;
-
-        startAngle = (startAngle * Math.PI / 180);
-        sweepAngle = (sweepAngle * Math.PI / 180);
-
-        this._context.save();
-        this._context.translate(coordinates[0], coordinates[1]);
-        if (style.widthValue > style.heightValue) {
-          this._context.scale(style.widthValue / style.heightValue, 1);
-        } else {
-          this._context.scale(1, style.heightValue / style.widthValue);
-        }
-
-        this._context.beginPath();
-        this._context.arc(0, 0, r, startAngle, sweepAngle, false);
-
-        if (this._trueCanvas) {
-          this._context.restore();
-        }
-
-        if (style.doFill) {
-          this._context.fillStyle = style.fill;
-          this._context.globalAlpha = style.opacity * style.fillOpacity;
-          this._context.fill();
-        }
-
-        if (style.doStroke) {
-          this._context.lineJoin = "round";
-          this._context.lineWidth = style.strokeWidthValue;
-          this._context.strokeStyle = style.stroke;
-
-          this._context.globalAlpha = style.opacity * style.strokeOpacity;
-          this._context.stroke();
-        }
-
-        if (!this._trueCanvas) {
-          this._context.restore();
-        }
-      }
-    },
-
-    drawPoint: function (coordinates, style) {
-      var style = this._getGraphicStyle(style);
-      if (style.widthValue == style.heightValue && style.heightValue == style.borderRadiusValue) {
-        this.drawArc(coordinates, 0, 360, style);
-      } else if (style.visibility != "hidden" && style.opacity > 0) {
-        style.borderRadiusValue = Math.min(Math.min(style.widthValue, style.heightValue) / 2, style.borderRadiusValue);
-        coordinates[0] -= style.widthValue / 2;
-        coordinates[1] -= style.heightValue / 2;
-        this._context.beginPath();
-        this._context.moveTo(coordinates[0] + style.borderRadiusValue, coordinates[1]);
-        this._context.lineTo(coordinates[0] + style.widthValue - style.borderRadiusValue, coordinates[1]);
-        this._context.quadraticCurveTo(coordinates[0] + style.widthValue, coordinates[1], coordinates[0] + style.widthValue, coordinates[1] + style.borderRadiusValue);
-        this._context.lineTo(coordinates[0] + style.widthValue, coordinates[1] + style.heightValue - style.borderRadiusValue);
-        this._context.quadraticCurveTo(coordinates[0] + style.widthValue, coordinates[1] + style.heightValue, coordinates[0] + style.widthValue - style.borderRadiusValue, coordinates[1] + style.heightValue);
-        this._context.lineTo(coordinates[0] + style.borderRadiusValue, coordinates[1] + style.heightValue);
-        this._context.quadraticCurveTo(coordinates[0], coordinates[1] + style.heightValue, coordinates[0], coordinates[1] + style.heightValue - style.borderRadiusValue);
-        this._context.lineTo(coordinates[0], coordinates[1] + style.borderRadiusValue);
-        this._context.quadraticCurveTo(coordinates[0], coordinates[1], coordinates[0] + style.borderRadiusValue, coordinates[1]);
-        this._context.closePath();
-
-        if (style.doFill) {
-          this._context.fillStyle = style.fill;
-          this._context.globalAlpha = style.opacity * style.fillOpacity;
-          this._context.fill();
-        }
-
-        if (style.doStroke) {
-          this._context.lineJoin = "round";
-          this._context.lineWidth = style.strokeWidthValue;
-          this._context.strokeStyle = style.stroke;
-
-          this._context.globalAlpha = style.opacity * style.strokeOpacity;
-
-          this._context.stroke();
-        }
-      }
-    },
-
-    drawLineString: function (coordinates, style) {
-      this._drawLines([coordinates], false, style);
-    },
-
-    drawPolygon: function (coordinates, style) {
-      this._drawLines(coordinates, true, style);
-    },
-
-    drawBbox: function (bbox, style) {
-      this._drawLines([[
-        [bbox[0], bbox[1]],
-        [bbox[0], bbox[3]],
-        [bbox[2], bbox[3]],
-        [bbox[2], bbox[1]],
-        [bbox[0], bbox[1]]
-      ]], true, style);
-    },
-
-    drawLabel: function( coordinates, label ) {
-      this._$labelsContainer.append( '<div class="geo-label" style="position:absolute; left:' + coordinates[ 0 ] + 'px; top:' + coordinates[ 1 ] + 'px;">' + label + '</div>');
-    },
-
-    resize: function( ) {
-      this._width = this._$elem.width();
-      this._height = this._$elem.height();
-
-      if (!(this._width && this._height)) {
-        this._width = parseInt(this._$elem.css("width"));
-        this._height = parseInt(this._$elem.css("height"));
-      }
-
-      if ( this._trueCanvas ) {
-        this._$canvas[0].width = this._width;
-        this._$canvas[0].height = this._height;
-      } else {
-      }
-
-      this._$labelsContainer.css( {
-        width: this._width,
-        height: this._height
-      } );
-    },
-
-    _getGraphicStyle: function (style) {
-      function safeParse(value) {
-        value = parseInt(value);
-        return (+value + '') === value ? +value : value;
-      }
-
-      style = $.extend({}, this._options.style, style);
-      style.borderRadiusValue = safeParse(style.borderRadius);
-      style.fill = style.fill || style.color;
-      style.doFill = style.fill && style.fillOpacity > 0;
-      style.stroke = style.stroke || style.color;
-      style.strokeWidthValue = safeParse(style.strokeWidth);
-      style.doStroke = style.stroke && style.strokeOpacity > 0 && style.strokeWidthValue > 0;
-      style.widthValue = safeParse(style.width);
-      style.heightValue = safeParse(style.height);
-      return style;
-    },
-
-    _drawLines: function (coordinates, close, style) {
-      if (!coordinates || !coordinates.length || coordinates[0].length < 2) {
-        return;
-      }
-
-      var style = this._getGraphicStyle(style),
-          i, j;
-
-      if (style.visibility != "hidden" && style.opacity > 0) {
-        this._context.beginPath();
-        this._context.moveTo(coordinates[0][0][0], coordinates[0][0][1]);
-
-        for (i = 0; i < coordinates.length; i++) {
-          for (j = 0; j < coordinates[i].length; j++) {
-            this._context.lineTo(coordinates[i][j][0], coordinates[i][j][1]);
-          }
-        }
-
-        if (close) {
-          this._context.closePath();
-        }
-
-        if (close && style.doFill) {
-          this._context.fillStyle = style.fill;
-          this._context.globalAlpha = style.opacity * style.fillOpacity;
-          this._context.fill();
-        }
-
-        if (style.doStroke) {
-          this._context.lineCap = this._context.lineJoin = "round";
-          this._context.lineWidth = style.strokeWidthValue;
-          this._context.strokeStyle = style.stroke;
-
-          this._context.globalAlpha = style.opacity * style.strokeOpacity;
-          this._context.stroke();
-        }
-      }
-    }
-  });
-
-
-})(jQuery);
-
-(function ($, undefined) {
-  var _ieVersion = (function () {
-    var v = 5, div = document.createElement("div"), a = div.all || [];
-    while (div.innerHTML = "<!--[if gt IE " + (++v) + "]><br><![endif]-->", a[0]) { }
-    return v > 6 ? v : !v;
-  } ()),
-
-      _defaultOptions = {
-        bbox: [-180, -85, 180, 85],
-        bboxMax: [-180, -85, 180, 85],
-        center: [0, 0],
-        cursors: {
-          "static": "default",
-          pan: "url(data:image/vnd.microsoft.icon;base64,AAACAAEAICACAAgACAAwAQAAFgAAACgAAAAgAAAAQAAAAAEAAQAAAAAAAAEAAAAAAAAAAAAAAgAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8AAAA/AAAAfwAAAP+AAAH/gAAB/8AAA//AAAd/wAAGf+AAAH9gAADbYAAA2yAAAZsAAAGbAAAAGAAAAAAAAA//////////////////////////////////////////////////////////////////////////////////////gH///4B///8Af//+AD///AA///wAH//4AB//8AAf//AAD//5AA///gAP//4AD//8AF///AB///5A////5///8=), move",
-          zoom: "crosshair",
-          drawPoint: "crosshair",
-          drawLineString: "crosshair",
-          drawPolygon: "crosshair",
-          measureLength: "crosshair",
-          measureArea: "crosshair"
-        },
-        measureLabels: {
-          length: "{{=length.toFixed( 2 )}} m",
-          area: "{{=area.toFixed( 2 )}} sq m"
-        },
-        drawStyle: {},
-        shapeStyle: {},
-        mode: "pan",
-        pannable: true,
-        scroll: "default",
-        services: [
-            {
-              "class": "osm",
-              type: "tiled",
-              src: function (view) {
-                return "http://tile.openstreetmap.org/" + view.zoom + "/" + view.tile.column + "/" + view.tile.row + ".png";
-              },
-              attr: "&copy; OpenStreetMap &amp; contributors, CC-BY-SA"
-            }
-          ],
-        tilingScheme: {
-          tileWidth: 256,
-          tileHeight: 256,
-          levels: 18,
-          basePixelSize: 156543.03392799936,
-          origin: [-20037508.342787, 20037508.342787]
-        },
-        axisLayout: "map",
-        zoom: 0,
-        pixelSize: 0
-      };
-
-  $.widget("geo.geomap", {
-    // private widget members
-    _$elem: undefined, //< map div for maps, service div for services
-    _map: undefined, //< only defined in services
-    _created: false,
-
-    _contentBounds: {},
-
-    _$resizeContainer: undefined, //< all elements that should match _contentBounds' size
-
-    _$eventTarget: undefined,
-    _$contentFrame: undefined,
-    _$existingChildren: undefined,
-    _$attrList: undefined,
-    _$servicesContainer: undefined,
-
-    _$panContainer: undefined, //< all non-service elements that move while panning
-    _$shapesContainer: undefined,
-    _$drawContainer: undefined,
-    _$measureContainer: undefined,
-    _$measureLabel: undefined,
-
-    _dpi: 96,
-
-    _currentServices: [], //< internal copy
-
-    _center: undefined,
-    _pixelSize: undefined,
-    _centerMax: undefined,
-    _pixelSizeMax: undefined,
-
-    _userGeodetic: true,
-
-    _wheelTimeout: null,
-    _wheelLevel: 0,
-
-    _zoomFactor: 2, //< determines what a zoom level means
-
-    _fullZoomFactor: 2, //< interactiveScale factor needed to zoom a whole level
-    _partialZoomFactor: 1.18920711500273, //< interactiveScale factor needed to zoom a fraction of a level (the fourth root of 2)
-
-    _mouseDown: undefined,
-    _inOp: undefined,
-    _toolPan: undefined,
-    _shiftZoom: undefined,
-    _anchor: undefined,
-    _current: undefined,
-    _downDate: undefined,
-    _moveDate: undefined,
-    _clickDate: undefined,
-    _lastMove: undefined,
-    _lastDrag: undefined,
-
-    _windowHandler: null,
-    _resizeTimeout: null,
-
-    _panning: undefined,
-    _velocity: undefined,
-    _friction: undefined,
-
-    _supportTouch: undefined,
-    _softDblClick: undefined,
-    _isTap: undefined,
-    _isDbltap: undefined,
-
-    _isMultiTouch: undefined,
-    _multiTouchAnchor: undefined, //< TouchList
-    _multiTouchAnchorBbox: undefined, //< bbox
-    _multiTouchCurrentBbox: undefined, //< bbox
-
-    _drawTimeout: null, //< used in drawPoint mode so we don't send two shape events on dbltap
-    _drawPixels: [], //< an array of coordinate arrays for drawing lines & polygons, in pixel coordinates
-    _drawCoords: [],
-
-    _graphicShapes: [], //< an array of objects containing style object refs & GeoJSON object refs
-
-    _initOptions: {},
-
-    _options: {},
-
-    options: $.extend({}, _defaultOptions),
-
-    _createWidget: function (options, element) {
-      this._$elem = $(element);
-
-      if (this._$elem.is(".geo-service")) {
-        var $contentFrame = this._$elem.closest( ".geo-content-frame" );
-        this._$elem.append('<div class="geo-shapes-container" style="position:absolute; left:0; top:0; width:' + $contentFrame.css( "width" ) + '; height:' + $contentFrame.css( "height" ) + '; margin:0; padding:0;"></div>');
-        this._$shapesContainer = this._$elem.children(':last');
-        this._graphicShapes = [];
-        $.Widget.prototype._createWidget.apply(this, arguments);
-        return;
-      }
-
-      this._$elem.addClass("geo-map");
-
-      this._initOptions = options || {};
-
-      this._forcePosition(this._$elem);
-
-      this._$elem.css("text-align", "left");
-
-      var size = this._findMapSize();
-      this._contentBounds = {
-        x: parseInt(this._$elem.css("padding-left")),
-        y: parseInt(this._$elem.css("padding-top")),
-        width: size["width"],
-        height: size["height"]
-      };
-
-      this._createChildren();
-
-      this._center = this._centerMax = [0, 0];
-
-      this.options["pixelSize"] = this._pixelSize = this._pixelSizeMax = 156543.03392799936;
-
-      this._mouseDown =
-          this._inOp =
-          this._toolPan =
-          this._shiftZoom =
-          this._panning =
-          this._isTap =
-          this._isDbltap = false;
-
-      this._anchor = [ 0, 0 ];
-      this._current = [ 0, 0 ];
-      this._lastMove = [ 0, 0 ];
-      this._lastDrag = [ 0, 0 ];
-      this._velocity = [ 0, 0 ];
-
-      this._friction = [.8, .8];
-
-      this._downDate =
-          this._moveDate =
-          this._clickDate = 0;
-
-      this._drawPixels = [];
-      this._drawCoords =  [];
-      this._graphicShapes = [];
-
-
-      $.Widget.prototype._createWidget.apply(this, arguments);
-    },
-
-    _create: function () {
-      this._options = this.options;
-
-      if (this._$elem.is(".geo-service")) {
-        this._map = this._$elem.data( "geoMap" );
-        this._$shapesContainer.geographics( );
-        this._options["shapeStyle"] = this._$shapesContainer.geographics("option", "style");
-        return;
-      }
-
-      this._map = this;
-
-      this._supportTouch = "ontouchend" in document;
-      this._softDblClick = this._supportTouch || _ieVersion == 7;
-
-      var geomap = this,
-          touchStartEvent = this._supportTouch ? "touchstart" : "mousedown",
-          touchStopEvent = this._supportTouch ? "touchend touchcancel" : "mouseup",
-          touchMoveEvent = this._supportTouch ? "touchmove" : "mousemove";
-
-      $(document).keydown($.proxy(this._document_keydown, this));
-
-      this._$eventTarget.dblclick($.proxy(this._eventTarget_dblclick, this));
-
-      this._$eventTarget.bind(touchStartEvent, $.proxy(this._eventTarget_touchstart, this));
-
-      var dragTarget = (this._$eventTarget[0].setCapture) ? this._$eventTarget : $(document);
-      dragTarget.bind(touchMoveEvent, $.proxy(this._dragTarget_touchmove, this));
-      dragTarget.bind(touchStopEvent, $.proxy(this._dragTarget_touchstop, this));
-
-      this._$eventTarget.mousewheel($.proxy(this._eventTarget_mousewheel, this));
-
-      this._windowHandler = function () {
-        if (geomap._resizeTimeout) {
-          clearTimeout(geomap._resizeTimeout);
-        }
-        geomap._resizeTimeout = setTimeout(function () {
-          if (geomap._created) {
-            geomap._$elem.geomap("resize");
-          }
-        }, 500);
-      };
-
-      $(window).resize(this._windowHandler);
-
-      this._$drawContainer.geographics({ style: this._initOptions.drawStyle || {} });
-      this._options["drawStyle"] = this._$drawContainer.geographics("option", "style");
-
-      this._$shapesContainer.geographics( { style: this._initOptions.shapeStyle || { } } );
-      this._options["shapeStyle"] = this._$shapesContainer.geographics("option", "style");
-
-      if (this._initOptions) {
-        if (this._initOptions.tilingScheme) {
-          this._setOption("tilingScheme", this._initOptions.tilingScheme, false);
-        }
-        if ( this._initOptions.services ) {
-          // jQuery UI Widget Factory merges user services with our default, we want to clobber the default
-          this._options[ "services" ] = $.merge( [ ], this._initOptions.services );
-        }
-        if (this._initOptions.bbox) {
-          this._setOption("bbox", this._initOptions.bbox, false);
-        }
-        if (this._initOptions.center) {
-          this._setOption("center", this._initOptions.center, false);
-        }
-        if (this._initOptions.zoom !== undefined) {
-          this._setZoom(this._initOptions.zoom, false, false);
-        }
-      }
-
-      $.template( "geoMeasureLength", this._options[ "measureLabels" ].length );
-      $.template( "geoMeasureArea", this._options[ "measureLabels" ].area );
-
-      this._$eventTarget.css("cursor", this._options["cursors"][this._options["mode"]]);
-
-      this._createServices();
-      this._refresh();
-
-      this._created = true;
-    },
-
-    _setOption: function (key, value, refresh) {
-      if ( key == "pixelSize" ) {
-        return;
-      }
-
-      refresh = (refresh === undefined || refresh);
-
-      if ( this._$elem.is( ".geo-map" ) ) {
-        this._panFinalize();
-      }
-
-      switch (key) {
-        case "bbox":
-          this._userGeodetic = $.geo.proj && $.geo._isGeodetic( value );
-          if ( this._userGeodetic ) {
-            value = $.geo.proj.fromGeodetic( value );
-          }
-
-          this._setBbox(value, false, refresh);
-          value = this._getBbox();
-          break;
-
-        case "center":
-          this._userGeodetic = $.geo.proj && $.geo._isGeodetic( value );
-          if ( this._userGeodetic ) {
-            value = $.geo.proj.fromGeodetic( value );
-          }
-
-          this._setCenterAndSize( value, this._pixelSize, false, refresh );
-          break;
-
-        case "measureLabels":
-          value = $.extend( this._options[ "measureLabels" ], value );
-          $.template( "geoMeasureLength", value.length );
-          $.template( "geoMeasureArea", value.area );
-          break;
-
-        case "drawStyle":
-          if (this._$drawContainer) {
-            this._$drawContainer.geographics("option", "style", value);
-            value = this._$drawContainer.geographics("option", "style");
-          }
-          break;
-
-        case "shapeStyle":
-          if (this._$shapesContainer) {
-            this._$shapesContainer.geographics("option", "style", value);
-            value = this._$shapesContainer.geographics("option", "style");
-          }
-          break;
-
-        case "mode":
-          this._resetDrawing( );
-          this._$eventTarget.css("cursor", this._options["cursors"][value]);
-          break;
-
-        case "zoom":
-          this._setZoom(value, false, refresh);
-          break;
-      }
-
-      $.Widget.prototype._setOption.apply(this, arguments);
-
-      switch ( key ) {
-        case "bbox":
-        case "center":
-          if ( this._userGeodetic ) {
-            this._options[ "bbox" ] = $.geo.proj.toGeodetic( this._options[ "bbox" ] );
-            this._options[ "center" ] = $.geo.proj.toGeodetic( this._center );
-          }
-          break;
-
-        case "tilingScheme":
-          if ( value != null ) {
-            this._pixelSizeMax = this._getPixelSize( 0 );
-            this._centerMax = [
-              value.origin[ 0 ] + this._pixelSizeMax * value.tileWidth / 2,
-              value.origin[ 1 ] + this._pixelSizeMax * value.tileHeight / 2
-            ];
-          }
-          break;
-
-        case "bboxMax":
-          this._pixelSizeMax = this._getPixelSize( 0 );
-
-          if ( $.geo.proj && $.geo._isGeodetic( value ) ) {
-            this._centerMax = $.geo.center( $.geo.proj.fromGeodetic( value ) );
-          } else {
-            this._centerMax = $.geo.center( value );
-          }
-          break;
-
-        case "services":
-          this._createServices();
-          if (refresh) {
-            this._refresh();
-          }
-          break;
-
-        case "shapeStyle":
-          if ( refresh ) {
-            this._$shapesContainer.geographics("clear");
-            this._refreshShapes( this._$shapesContainer, this._graphicShapes, this._graphicShapes, this._graphicShapes );
-          }
-          break;
-      }
-    },
-
-    destroy: function () {
-      if ( this._$elem.is(".geo-service") ) {
-        this._$shapesContainer.geographics("destroy");
-        this._$shapesContainer = undefined;
-      } else {
-        this._created = false;
-
-        $(window).unbind("resize", this._windowHandler);
-
-        for ( var i = 0; i < this._currentServices.length; i++ ) {
-          this._currentServices[ i ].serviceContainer.geomap("destroy");
-          $.geo["_serviceTypes"][this._currentServices[i].type].destroy(this, this._$servicesContainer, this._currentServices[i]);
-        }
-
-        this._$shapesContainer.geographics("destroy");
-        this._$shapesContainer = undefined;
-        this._$drawContainer.geographics("destroy");
-        this._$drawContainer = undefined;
-
-        this._$existingChildren.detach();
-        this._$elem.html("");
-        this._$elem.append(this._$existingChildren);
-        this._$elem.removeClass("geo-map");
-      }
-
-      $.Widget.prototype.destroy.apply(this, arguments);
-    },
-
-    toMap: function (p) {
-      p = this._toMap(p);
-      return this._userGeodetic ? $.geo.proj.toGeodetic(p) : p;
-    },
-
-    toPixel: function ( p, _center /* Internal Use Only */, _pixelSize /* Internal Use Only */ ) {
-      return this._toPixel( $.geo.proj ? $.geo.proj.fromGeodetic( p ) : p, _center, _pixelSize );
-    },
-
-    opacity: function ( value, _serviceContainer ) {
-      if ( this._$elem.is( ".geo-service" ) ) {
-        this._$elem.closest( ".geo-map" ).geomap( "opacity", value, this._$elem );
-      } else {
-        if ( value >= 0 || value <= 1 ) {
-          for ( var i = 0; i < this._currentServices.length; i++ ) {
-            var service = this._currentServices[ i ];
-            if ( !_serviceContainer || service.serviceContainer[ 0 ] == _serviceContainer[ 0 ] ) {
-              service.style.opacity = value;
-              $.geo[ "_serviceTypes" ][ service.type ].opacity( this, service );
-            }
-          }
-        }
-      }
-    },
-
-    toggle: function ( value, _serviceContainer ) {
-      if ( this._$elem.is( ".geo-service" ) ) {
-        this._$elem.closest( ".geo-map" ).geomap( "toggle", value, this._$elem );
-      } else {
-
-        for ( var i = 0; i < this._currentServices.length; i++ ) {
-          var service = this._currentServices[ i ];
-
-          if ( !_serviceContainer || service.serviceContainer[ 0 ] == _serviceContainer[ 0 ] ) {
-            if ( value === undefined ) {
-              // toggle visibility
-              value = ( service.style.visibility !== "visible" );
-            }
-
-            service.style.visibility = ( value ? "visible" : "hidden" );
-
-            service.serviceContainer.toggle( value );
-
-            if ( value ) {
-              $.geo[ "_serviceTypes" ][ service.type ].refresh( this, service );
-            }
-          }
-        }
-      }
-    },
-
-    zoom: function (numberOfLevels) {
-      if (numberOfLevels != null) {
-        this._setZoom(this._options["zoom"] + numberOfLevels, false, true);
-      }
-    },
-
-    refresh: function () {
-      this._refresh();
-    },
-
-    resize: function () {
-      var size = this._findMapSize(),
-          dx = size["width"]/2 - this._contentBounds.width/2,
-          dy = size["height"]/2 - this._contentBounds.height/2,
-          i;
-
-      this._contentBounds = {
-        x: parseInt(this._$elem.css("padding-left")),
-        y: parseInt(this._$elem.css("padding-top")),
-        width: size["width"],
-        height: size["height"]
-      };
-
-      this._$resizeContainer.css( {
-        width: size["width"],
-        height: size["height"]
-      } );
-
-      for (i = 0; i < this._currentServices.length; i++) {
-        $.geo["_serviceTypes"][this._currentServices[i].type].resize(this, this._currentServices[i]);
-      }
-
-      this._$elem.find( ".geo-graphics" ).css( {
-        width: size["width"],
-        height: size["height"]
-      }).geographics( "resize" );
-
-      for (i = 0; i < this._drawPixels.length; i++) {
-        this._drawPixels[i][0] += dx;
-        this._drawPixels[i][1] += dy;
-      }
-
-      this._setCenterAndSize(this._center, this._pixelSize, false, true);
-    },
-
-    append: function ( shape, style, label, refresh ) {
-      if ( shape && $.isPlainObject( shape ) ) {
-        var shapes, arg, i, realStyle, realLabel, realRefresh;
-
-        if ( shape.type == "FeatureCollection" ) {
-          shapes = shape.features;
-        } else {
-          shapes = $.isArray( shape ) ? shape : [ shape ];
-        }
-
-        for ( i = 1; i < arguments.length; i++ ) {
-          arg = arguments[ i ];
-
-          if ( typeof arg === "object" ) {
-            realStyle = arg;
-          } else if ( typeof arg === "number" || typeof arg === "string" ) {
-            realLabel = arg;
-          } else if ( typeof arg === "boolean" ) {
-            realRefresh = arg;
-          }
-        }
-
-        for ( i = 0; i < shapes.length; i++ ) {
-          if ( shapes[ i ].type != "Point" ) {
-            var bbox = $.geo.bbox( shapes[ i ] );
-            if ( $.geo.proj && $.geo._isGeodetic( bbox ) ) {
-              bbox = $.geo.proj.fromGeodetic( bbox );
-            }
-            $.data( shapes[ i ], "geoBbox", bbox );
-          }
-
-          this._graphicShapes.push( {
-            shape: shapes[ i ],
-            style: realStyle,
-            label: realLabel
-          } );
-        }
-
-        if ( realRefresh === undefined || realRefresh ) {
-          this._refresh( );
-        }
-      }
-    },
-
-    empty: function ( refresh ) {
-      for ( var i = 0; i < this._graphicShapes.length; i++ ) {
-        $.removeData( this._graphicShapes[ i ].shape, "geoBbox" );
-      }
-
-      this._graphicShapes = [];
-
-      if ( refresh === undefined || refresh ) {
-        this._refresh();
-      }
-    },
-
-    find: function ( selector, pixelTolerance ) {
-      var isPoint = $.isPlainObject( selector ),
-          searchPixel = isPoint ? this._map.toPixel( selector.coordinates ) : undefined,
-          mapTol = this._map._pixelSize * pixelTolerance,
-          result = [],
-          graphicShape,
-          geometries,
-          curGeom,
-          i = 0;
-
-      for ( ; i < this._graphicShapes.length; i++ ) {
-        graphicShape = this._graphicShapes[ i ];
-
-        if ( isPoint ) {
-          if ( graphicShape.shape.type == "Point" ) {
-            if ( $.geo.distance( graphicShape.shape, selector ) <= mapTol ) {
-              result.push( graphicShape.shape );
-            }
-          } else {
-            var bbox = $.data( graphicShape.shape, "geoBbox" ),
-                bboxPolygon = {
-                  type: "Polygon",
-                  coordinates: [ [
-                    [bbox[0], bbox[1]],
-                    [bbox[0], bbox[3]],
-                    [bbox[2], bbox[3]],
-                    [bbox[2], bbox[1]],
-                    [bbox[0], bbox[1]]
-                  ] ]
-                },
-                projectedPoint = {
-                  type: "Point",
-                  coordinates: $.geo.proj && $.geo._isGeodetic( selector.coordinates ) ? $.geo.proj.fromGeodetic( selector.coordinates ) : selector.coordinates
-                };
-
-            if ( $.geo.distance( bboxPolygon, projectedPoint, true ) <= mapTol ) {
-              geometries = $.geo._flatten( graphicShape.shape );
-              for ( curGeom = 0; curGeom < geometries.length; curGeom++ ) {
-                if ( $.geo.distance( geometries[ curGeom ], selector ) <= mapTol ) {
-                  result.push( graphicShape.shape );
-                  break;
-                }
-              }
-            }
-          }
-        } else {
-          result.push( graphicShape.shape );
-        }
-      }
-
-      if ( this._$elem.is( ".geo-map" ) ) {
-        this._$elem.find( ".geo-service" ).each( function( ) {
-          result = $.merge( result, $( this ).geomap( "find", selector, pixelTolerance ) );
-        } );
-      }
-
-      return result;
-    },
-
-    remove: function ( shape, refresh ) {
-      for ( var i = 0; i < this._graphicShapes.length; i++ ) {
-        if ( this._graphicShapes[ i ].shape == shape ) {
-          $.removeData( shape, "geoBbox" );
-          var rest = this._graphicShapes.slice( i + 1 );
-          this._graphicShapes.length = i;
-          this._graphicShapes.push.apply( this._graphicShapes, rest );
-          break;
-        }
-      }
-
-      if ( refresh === undefined || refresh ) {
-        this._refresh();
-      }
-    },
-
-    _getBbox: function (center, pixelSize) {
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      // calculate the internal bbox
-      var halfWidth = this._contentBounds[ "width" ] / 2 * pixelSize,
-          halfHeight = this._contentBounds[ "height" ] / 2 * pixelSize;
-      return [ center[ 0 ] - halfWidth, center[ 1 ] - halfHeight, center[ 0 ] + halfWidth, center[ 1 ] + halfHeight ];
-    },
-
-    _setBbox: function (value, trigger, refresh) {
-      var center = [value[0] + (value[2] - value[0]) / 2, value[1] + (value[3] - value[1]) / 2],
-          pixelSize = Math.max($.geo.width(value, true) / this._contentBounds.width, $.geo.height(value, true) / this._contentBounds.height);
-
-      if (this._options["tilingScheme"]) {
-        var zoom = this._getZoom( center, pixelSize );
-        pixelSize = this._getPixelSize( zoom );
-      } else {
-        if ( this._getZoom( center, pixelSize ) < 0 ) {
-          pixelSize = this._pixelSizeMax;
-        }
-      }
-
-      this._setCenterAndSize(center, pixelSize, trigger, refresh);
-    },
-
-    _getBboxMax: function () {
-      // calculate the internal bboxMax
-      var halfWidth = this._contentBounds["width"] / 2 * this._pixelSizeMax,
-        halfHeight = this._contentBounds["height"] / 2 * this._pixelSizeMax;
-      return [this._centerMax[0] - halfWidth, this._centerMax[1] - halfHeight, this._centerMax[0] + halfWidth, this._centerMax[1] + halfHeight];
-    },
-
-    _getCenter: function () {
-      return this._center;
-    },
-
-    _getContentBounds: function () {
-      return this._contentBounds;
-    },
-
-    _getServicesContainer: function () {
-      return this._$servicesContainer;
-    },
-
-    _getZoom: function ( center, pixelSize ) {
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      // calculate the internal zoom level, vs. public zoom property
-      var tilingScheme = this._options["tilingScheme"];
-      if ( tilingScheme ) {
-        if ( tilingScheme.pixelSizes != null ) {
-          var roundedPixelSize = Math.floor(pixelSize * 1000),
-              levels = tilingScheme.pixelSizes.length,
-              i = levels - 1;
-
-          for ( ; i >= 0; i-- ) {
-            if ( Math.floor( tilingScheme.pixelSizes[ i ] * 1000 ) >= roundedPixelSize ) {
-              return i;
-            }
-          }
-
-          return 0;
-        } else {
-          return Math.max( Math.round( Math.log( tilingScheme.basePixelSize / pixelSize) / Math.log( 2 ) ), 0 );
-        }
-      } else {
-        var ratio = this._contentBounds["width"] / this._contentBounds["height"],
-            bbox = $.geo.reaspect( this._getBbox( center, pixelSize ), ratio, true ),
-            bboxMax = $.geo.reaspect(this._getBboxMax(), ratio, true);
-
-        return Math.max( Math.round( Math.log($.geo.width(bboxMax, true) / $.geo.width(bbox, true)) / Math.log(this._zoomFactor) ), 0 );
-      }
-    },
-
-    _setZoom: function ( value, trigger, refresh ) {
-      value = Math.max( value, 0 );
-
-      this._setCenterAndSize( this._center, this._getPixelSize( value ), trigger, refresh );
-    },
-
-    _createChildren: function () {
-      this._$existingChildren = this._$elem.children().detach();
-
-      this._forcePosition(this._$existingChildren);
-
-      this._$existingChildren.css("-moz-user-select", "none");
-
-      var contentSizeCss = "width:" + this._contentBounds["width"] + "px; height:" + this._contentBounds["height"] + "px; margin:0; padding:0;",
-          contentPosCss = "position:absolute; left:0; top:0;";
-
-      this._$elem.prepend('<div class="geo-event-target geo-content-frame" style="position:absolute; left:' + this._contentBounds.x + 'px; top:' + this._contentBounds.y + 'px;' + contentSizeCss + 'overflow:hidden; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none;" unselectable="on"></div>');
-      this._$eventTarget = this._$contentFrame = this._$elem.children(':first');
-
-      this._$contentFrame.append('<div class="geo-services-container" style="' + contentPosCss + contentSizeCss + '"></div>');
-      this._$servicesContainer = this._$contentFrame.children(':last');
-
-      this._$contentFrame.append('<div class="geo-shapes-container" style="' + contentPosCss + contentSizeCss + '"></div>');
-      this._$shapesContainer = this._$contentFrame.children(':last');
-
-      this._$contentFrame.append( '<ul style="position: absolute; bottom: 8px; left: 8px; list-style-type: none; max-width: 50%; padding: 0; margin: 0;"></ul>' );
-      this._$attrList = this._$contentFrame.children( ":last" );
-
-      this._$contentFrame.append('<div class="geo-draw-container" style="' + contentPosCss + contentSizeCss + '"></div>');
-      this._$drawContainer = this._$contentFrame.children(':last');
-
-      this._$contentFrame.append('<div class="geo-measure-container" style="' + contentPosCss + contentSizeCss + '"><div class="geo-measure-label" style="' + contentPosCss + '; display: none;"></div></div>');
-      this._$measureContainer = this._$contentFrame.children(':last');
-      this._$measureLabel = this._$measureContainer.children();
-
-      this._$panContainer = $( [ this._$shapesContainer[ 0 ], this._$drawContainer[ 0 ], this._$measureContainer[ 0 ] ] );
-
-      this._$resizeContainer = $( [ this._$contentFrame[ 0 ], this._$servicesContainer[ 0 ], this._$eventTarget[ 0 ], this._$measureContainer[ 0 ] ] ); 
-
-      this._$contentFrame.append(this._$existingChildren);
-
-      if ( ! $("#geo-measure-style").length ) {
-        $("head").prepend( '<style type="text/css" id="geo-measure-style">.geo-measure-label { margin: 4px 0 0 6px; font-family: sans-serif;' + ( _ieVersion ? 'letter-spacing: 2px; color: #444; filter:progid:DXImageTransform.Microsoft.DropShadow(Color=white, OffX=1, OffY=2, Positive=true);' : 'color: #000; text-shadow: #fff 1px 2px; font-weight: bold;' ) + ' }</style>' );
-      }
-    },
-
-    _createServices: function () {
-      var service, i;
-
-      for ( i = 0; i < this._currentServices.length; i++ ) {
-        this._currentServices[ i ].serviceContainer.geomap( "destroy" );
-        $.geo[ "_serviceTypes" ][ this._currentServices[ i ].type ].destroy( this, this._$servicesContainer, this._currentServices[ i ] );
-      }
-
-      this._currentServices = [ ];
-      this._$servicesContainer.html( "" );
-      this._$attrList.html( "" );
-
-      for ( i = 0; i < this._options[ "services" ].length; i++ ) {
-        service = this._currentServices[ i ] = $.extend( { }, this._options[ "services" ][ i ] );
-
-        // default the service style property on our copy
-        service.style = $.extend( {
-                          visibility: "visible",
-                          opacity: 1
-                        }, service.style );
-
-        var idString = service.id ? ' id="' + service.id + '"' : "",
-            classString = 'class="geo-service ' + ( service["class"] ? service["class"] : '' ) + '"',
-            scHtml = '<div ' + idString + classString + ' style="position:absolute; left:0; top:0; width:32px; height:32px; margin:0; padding:0; display:' + ( service.style.visibility === "visible" ? "block" : "none" ) + ';"></div>',
-            servicesContainer;
-
-        this._$servicesContainer.append( scHtml );
-        serviceContainer = this._$servicesContainer.children( ":last" );
-        this._currentServices[ i ].serviceContainer = serviceContainer;
-        
-        $.geo[ "_serviceTypes" ][ service.type ].create( this, serviceContainer, service, i );
-
-        serviceContainer.data( "geoMap", this ).geomap();
-
-        if ( service.attr ) {
-          this._$attrList.append( '<li>' + service.attr + '</li>' );
-        }
-      }
-
-      this._$attrList.find( "a" ).css( {
-        position: "relative",
-        zIndex: 100
-      } );
-    },
-
-    _refreshDrawing: function ( ) {
-      this._$drawContainer.geographics("clear");
-
-      if ( this._drawPixels.length > 0 ) {
-        var mode = this._options[ "mode" ],
-            pixels = this._drawPixels,
-            coords = this._drawCoords,
-            label,
-            labelShape,
-            labelPixel,
-            widthOver,
-            heightOver;
-
-        switch ( mode ) {
-          case "measureLength":
-            mode = "drawLineString";
-            labelShape = {
-              type: "LineString",
-              coordinates: coords
-            };
-            label = $.render( { length: $.geo.length( labelShape, true ) }, "geoMeasureLength" );
-            labelPixel = $.merge( [], pixels[ pixels.length - 1 ] );
-            break;
-
-          case "measureArea":
-            mode = "drawPolygon";
-
-            labelShape = {
-              type: "Polygon",
-              coordinates: [ $.merge( [ ], coords ) ]
-            };
-            labelShape.coordinates[ 0 ].push( coords[ 0 ] );
-
-            label = $.render( { area: $.geo.area( labelShape, true ) }, "geoMeasureArea" );
-            labelPixel = $.merge( [], pixels[ pixels.length - 1 ] );
-            pixels = [ pixels ];
-            break;
-
-          case "drawPolygon":
-            pixels = [ pixels ];
-            break;
-        }
-
-        this._$drawContainer.geographics( mode, pixels );
-        
-        if ( label ) {
-          this._$measureLabel.html( label );
-
-          widthOver = this._contentBounds.width - ( this._$measureLabel.outerWidth( true ) + labelPixel[ 0 ] );
-          heightOver = this._contentBounds.height - ( this._$measureLabel.outerHeight( true ) + labelPixel[ 1 ] );
-
-          if ( widthOver < 0 ) {
-            labelPixel[ 0 ] += widthOver;
-          }
-
-          if ( heightOver < 0 ) {
-            labelPixel[ 1 ] += heightOver;
-          }
-
-          this._$measureLabel.css( {
-            left: labelPixel[ 0 ],
-            top: labelPixel[ 1 ]
-          } ).show();
-        }
-      }
-    },
-
-    _resetDrawing: function () {
-      this._drawPixels = [];
-      this._drawCoords = [];
-      this._$drawContainer.geographics("clear");
-      this._$measureLabel.hide();
-    },
-
-    _refreshShapes: function (geographics, shapes, styles, labels, center, pixelSize) {
-      var i, mgi,
-          shape,
-          shapeBbox,
-          style,
-          label,
-          hasLabel,
-          labelPixel,
-          bbox = this._map._getBbox(center, pixelSize);
-
-      for (i = 0; i < shapes.length; i++) {
-        shape = shapes[i].shape || shapes[i];
-        shape = shape.geometry || shape;
-        shapeBbox = $.data(shape, "geoBbox");
-
-        if ( shapeBbox && $.geo._bboxDisjoint( bbox, shapeBbox ) ) {
-          continue;
-        }
-
-        style = $.isArray(styles) ? styles[i].style : styles;
-        label = $.isArray(labels) ? labels[i].label : labels;
-        hasLabel = ( label !== undefined );
-        labelPixel = undefined;
-
-        switch (shape.type) {
-          case "Point":
-            labelPixel = this._map.toPixel( shape.coordinates, center, pixelSize );
-            this._$shapesContainer.geographics("drawPoint", labelPixel, style);
-            break;
-          case "LineString":
-            this._$shapesContainer.geographics("drawLineString", this._map.toPixel(shape.coordinates, center, pixelSize), style);
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.pointAlong( shape, .5 ).coordinates, center, pixelSize );
-            }
-            break;
-          case "Polygon":
-            this._$shapesContainer.geographics("drawPolygon", this._map.toPixel(shape.coordinates, center, pixelSize), style);
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize );
-            }
-            break;
-          case "MultiPoint":
-            for (mgi = 0; mgi < shape.coordinates.length; mgi++) {
-              this._$shapesContainer.geographics("drawPoint", this._map.toPixel(shape.coordinates[mgi], center, pixelSize), style);
-            }
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize );
-            }
-            break;
-          case "MultiLineString":
-            for (mgi = 0; mgi < shape.coordinates.length; mgi++) {
-              this._$shapesContainer.geographics("drawLineString", this._map.toPixel(shape.coordinates[mgi], center, pixelSize), style);
-            }
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize );
-            }
-            break;
-          case "MultiPolygon":
-            for (mgi = 0; mgi < shape.coordinates.length; mgi++) {
-              this._$shapesContainer.geographics("drawPolygon", this._map.toPixel(shape.coordinates[mgi], center, pixelSize), style);
-            }
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize );
-            }
-            break;
-
-          case "GeometryCollection":
-            this._refreshShapes(geographics, shape.geometries, style, label, center, pixelSize);
-            break;
-        }
-
-        if ( hasLabel && labelPixel ) {
-          this._$shapesContainer.geographics( "drawLabel", labelPixel, label );
-        }
-      }
-    },
-
-    _findMapSize: function () {
-      // really, really attempt to find a size for this thing
-      // even if it's hidden (look at parents)
-      var size = { width: 0, height: 0 },
-        sizeContainer = this._$elem;
-
-      while (sizeContainer.size() && !(size["width"] > 0 && size["height"] > 0)) {
-        size = { width: sizeContainer.width(), height: sizeContainer.height() };
-        if (size["width"] <= 0 || size["height"] <= 0) {
-          size = { width: parseInt(sizeContainer.css("width")), height: parseInt(sizeContainer.css("height")) };
-        }
-        sizeContainer = sizeContainer.parent();
-      }
-      return size;
-    },
-
-    _forcePosition: function (elem) {
-      var cssPosition = elem.css("position");
-      if (cssPosition != "relative" && cssPosition != "absolute" && cssPosition != "fixed") {
-        elem.css("position", "relative");
-      }
-    },
-
-    _getPixelSize: function ( zoom ) {
-      var tilingScheme = this._options["tilingScheme"];
-      if (tilingScheme != null) {
-        if (zoom === 0) {
-          return tilingScheme.pixelSizes != null ? tilingScheme.pixelSizes[0] : tilingScheme.basePixelSize;
-        }
-
-        zoom = Math.round(zoom);
-        zoom = Math.max(zoom, 0);
-        var levels = tilingScheme.pixelSizes != null ? tilingScheme.pixelSizes.length : tilingScheme.levels;
-        zoom = Math.min(zoom, levels - 1);
-
-        if (tilingScheme.pixelSizes != null) {
-          return tilingScheme.pixelSizes[zoom];
-        } else {
-          return tilingScheme.basePixelSize / Math.pow(2, zoom);
-        }
-      } else {
-        var bbox = $.geo.scaleBy( this._getBboxMax(), 1 / Math.pow( this._zoomFactor, zoom ), true );
-        return Math.max( $.geo.width( bbox, true ) / this._contentBounds.width, $.geo.height( bbox, true ) / this._contentBounds.height );
-      }
-    },
-
-    _getZoomCenterAndSize: function ( anchor, zoomDelta, full ) {
-      var zoomFactor = ( full ? this._fullZoomFactor : this._partialZoomFactor ),
-          scale = Math.pow( zoomFactor, -zoomDelta ),
-          pixelSize,
-          zoomLevel;
-
-      if ( this._options[ "tilingScheme" ] ) {
-        zoomLevel = this._getZoom(this._center, this._pixelSize * scale);
-        pixelSize = this._getPixelSize(zoomLevel);
-      } else {
-        pixelSize = this._pixelSize * scale;
-
-        if ( this._getZoom( this._center, pixelSize ) < 0 ) {
-          pixelSize = this._pixelSizeMax;
-        }
-      }
-
-      var ratio = pixelSize / this._pixelSize,
-          anchorMapCoord = this._toMap(anchor),
-          centerDelta = [(this._center[0] - anchorMapCoord[0]) * ratio, (this._center[1] - anchorMapCoord[1]) * ratio],
-          scaleCenter = [anchorMapCoord[0] + centerDelta[0], anchorMapCoord[1] + centerDelta[1]];
-
-      return { pixelSize: pixelSize, center: scaleCenter };
-    },
-
-    _mouseWheelFinish: function () {
-      this._wheelTimeout = null;
-
-      if (this._wheelLevel != 0) {
-        var wheelCenterAndSize = this._getZoomCenterAndSize( this._anchor, this._wheelLevel, this._options[ "tilingScheme" ] != null );
-
-        this._setCenterAndSize(wheelCenterAndSize.center, wheelCenterAndSize.pixelSize, true, true);
-
-        this._wheelLevel = 0;
-      } else {
-        this._refresh();
-      }
-    },
-
-    _panEnd: function () {
-      this._velocity = [
-        (this._velocity[0] > 0 ? Math.floor(this._velocity[0] * this._friction[0]) : Math.ceil(this._velocity[0] * this._friction[0])),
-        (this._velocity[1] > 0 ? Math.floor(this._velocity[1] * this._friction[1]) : Math.ceil(this._velocity[1] * this._friction[1]))
-      ];
-
-      if (Math.abs(this._velocity[0]) < 4 && Math.abs(this._velocity[1]) < 4) {
-        this._panFinalize();
-      } else {
-        this._current = [
-          this._current[0] + this._velocity[0],
-          this._current[1] + this._velocity[1]
-        ];
-
-        this._panMove();
-        setTimeout($.proxy(this._panEnd, this), 30);
-      }
-    },
-
-    _panFinalize: function () {
-      if (this._panning) {
-        this._velocity = [0, 0];
-
-        var dx = this._current[0] - this._anchor[0],
-            dy = this._current[1] - this._anchor[1],
-            image = this._options[ "axisLayout" ] === "image",
-            dxMap = -dx * this._pixelSize,
-            dyMap = ( image ? -1 : 1 ) * dy * this._pixelSize;
-
-        this._$panContainer.css({ left: 0, top: 0 });
-
-        this._$servicesContainer.find( ".geo-shapes-container" ).css( { left: 0, top: 0 } );
-
-        this._setCenterAndSize([this._center[0] + dxMap, this._center[1] + dyMap], this._pixelSize, true, true);
-
-        this._$eventTarget.css("cursor", this._options["cursors"][this._options["mode"]]);
-
-        this._inOp = false;
-        this._anchor = this._current;
-        this._mouseDown = this._toolPan = this._panning = false;
-      }
-    },
-
-    _panMove: function () {
-      if ( ! this._options[ "pannable" ] ) {
-        return;
-      }
-
-      var dx = this._current[0] - this._lastDrag[0],
-          dy = this._current[1] - this._lastDrag[1],
-          i = 0,
-          service,
-          translateObj;
-
-      if (this._toolPan || dx > 3 || dx < -3 || dy > 3 || dy < -3) {
-        if (!this._toolPan) {
-          this._toolPan = true;
-          this._$eventTarget.css("cursor", this._options["cursors"]["pan"]);
-        }
-
-        if (this._mouseDown) {
-          this._velocity = [dx, dy];
-        }
-
-        if (dx != 0 || dy != 0) {
-          this._panning = true;
-          this._lastDrag = this._current;
-
-          translateObj = {
-            left: function (index, value) {
-              return parseInt(value) + dx;
-            },
-            top: function (index, value) {
-              return parseInt(value) + dy;
-            }
-          };
-
-          for ( i = 0; i < this._currentServices.length; i++ ) {
-            service = this._currentServices[ i ];
-            $.geo[ "_serviceTypes" ][ service.type ].interactivePan( this, service, dx, dy );
-            
-            service.serviceContainer.find( ".geo-shapes-container" ).css( translateObj );
-          }
-
-          this._$panContainer.css( translateObj );
-
-          //this._refreshDrawing();
-        }
-      }
-    },
-
-    _refresh: function () {
-      var service,
-          i = 0;
-
-      if ( this._$elem.is( ".geo-map" ) ) {
-        for ( ; i < this._currentServices.length; i++ ) {
-          service = this._currentServices[ i ];
-
-          if ( !this._mouseDown && $.geo[ "_serviceTypes" ][ service.type ] !== null ) {
-            $.geo[ "_serviceTypes" ][ service.type ].refresh( this, service );
-            service.serviceContainer.geomap( "refresh" );
-          }
-        }
-      }
-
-      if ( this._$shapesContainer ) {
-        this._$shapesContainer.geographics( "clear" );
-        if ( this._graphicShapes.length > 0 ) {
-          this._refreshShapes( this._$shapesContainer, this._graphicShapes, this._graphicShapes, this._graphicShapes );
-        }
-      }
-    },
-
-    _setCenterAndSize: function (center, pixelSize, trigger, refresh) {
-      if ( ! $.isArray( center ) || center.length != 2 || typeof center[ 0 ] !== "number" || typeof center[ 1 ] !== "number" ) {
-        return;
-      }
-
-      // the final call during any extent change
-      if (this._pixelSize != pixelSize) {
-        this._$elem.find( ".geo-shapes-container" ).geographics("clear");
-        for (var i = 0; i < this._currentServices.length; i++) {
-          var service = this._currentServices[i];
-          $.geo["_serviceTypes"][service.type].interactiveScale(this, service, center, pixelSize);
-        }
-      }
-
-      this._center = $.merge( [ ], center );
-      this._options["pixelSize"] = this._pixelSize = pixelSize;
-
-      if ( this._userGeodetic ) {
-        this._options["bbox"] = $.geo.proj.toGeodetic( this._getBbox() );
-        this._options["center"] = $.geo.proj.toGeodetic( this._center );
-      } else {
-        this._options["bbox"] = this._getBbox();
-        this._options["center"] = $.merge( [ ], center );
-      }
-
-      this._options["zoom"] = this._getZoom();
-
-      if (this._drawCoords.length > 0) {
-        this._drawPixels = this._toPixel(this._drawCoords);
-      }
-
-      if (trigger) {
-        this._trigger("bboxchange", window.event, { bbox: $.merge( [ ], this._options["bbox"] ) });
-      }
-
-      if (refresh) {
-        this._refresh();
-        this._refreshDrawing();
-      }
-    },
-
-    _toMap: function (p, center, pixelSize) {
-      // ignores $.geo.proj
-
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      var isMultiPointOrLineString = $.isArray( p[ 0 ] ),
-          isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray( p[ 0 ][ 0 ] ),
-          isMultiPolygon = isMultiLineStringOrPolygon && $.isArray( p[ 0 ][ 0 ][ 0 ] ),
-          width = this._contentBounds["width"],
-          height = this._contentBounds["height"],
-          halfWidth = width / 2 * pixelSize,
-          halfHeight = height / 2 * pixelSize,
-          bbox = [center[0] - halfWidth, center[1] - halfHeight, center[0] + halfWidth, center[1] + halfHeight],
-          xRatio = $.geo.width(bbox, true) / width,
-          yRatio = $.geo.height(bbox, true) / height,
-          yOffset,
-          image = this._options[ "axisLayout" ] === "image",
-          result = [],
-          i, j, k;
-
-      if ( !isMultiPolygon ) {
-        if ( !isMultiLineStringOrPolygon ) {
-          if ( !isMultiPointOrLineString ) {
-            p = [ p ];
-          }
-          p = [ p ];
-        }
-        p = [ p ];
-      }
-
-      for ( i = 0; i < p.length; i++ ) {
-        result[ i ] = [ ];
-        for ( j = 0; j < p[ i ].length; j++ ) {
-          result[ i ][ j ] = [ ];
-          for ( k = 0; k < p[ i ][ j ].length; k++ ) {
-            yOffset = (p[ i ][ j ][ k ][1] * yRatio);
-            result[ i ][ j ][ k ] = [
-              bbox[ 0 ] + ( p[ i ][ j ][ k ][ 0 ] * xRatio ),
-              image ? bbox[ 1 ] + yOffset : bbox[ 3 ] - yOffset
-            ];
-          }
-        }
-      }
-
-      return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-    },
-
-    _toPixel: function (p, center, pixelSize) {
-      // ignores $.geo.proj
-
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      var isMultiPointOrLineString = $.isArray( p[ 0 ] ),
-          isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray( p[ 0 ][ 0 ] ),
-          isMultiPolygon = isMultiLineStringOrPolygon && $.isArray( p[ 0 ][ 0 ][ 0 ] ),
-          width = this._contentBounds["width"],
-          height = this._contentBounds["height"],
-          halfWidth = width / 2 * pixelSize,
-          halfHeight = height / 2 * pixelSize,
-          bbox = [center[0] - halfWidth, center[1] - halfHeight, center[0] + halfWidth, center[1] + halfHeight],
-          bboxWidth = $.geo.width(bbox, true),
-          bboxHeight = $.geo.height(bbox, true),
-          image = this._options[ "axisLayout" ] === "image",
-          xRatio = width / bboxWidth,
-          yRatio = height / bboxHeight,
-          result = [ ],
-          i, j, k;
-
-      if ( !isMultiPolygon ) {
-        if ( !isMultiLineStringOrPolygon ) {
-          if ( !isMultiPointOrLineString ) {
-            p = [ p ];
-          }
-          p = [ p ];
-        }
-        p = [ p ];
-      }
-
-      for ( i = 0; i < p.length; i++ ) {
-        result[ i ] = [ ];
-        for ( j = 0; j < p[ i ].length; j++ ) {
-          result[ i ][ j ] = [ ];
-          for ( k = 0; k < p[ i ][ j ].length; k++ ) {
-            result[ i ][ j ][ k ] = [
-              Math.round( ( p[ i ][ j ][ k ][ 0 ] - bbox[ 0 ] ) * xRatio ),
-              Math.round( ( image ? p[ i ][ j ][ k ][ 1 ] - bbox[ 1 ] : bbox[ 3 ] - p[ i ][ j ][ k ][ 1 ] ) * yRatio )
-            ];
-          }
-        }
-      }
-
-      return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-    },
-
-    _zoomTo: function (coord, zoom, trigger, refresh) {
-      zoom = zoom < 0 ? 0 : zoom;
-
-      var pixelSize = this._getPixelSize( zoom );
-
-      this._setCenterAndSize( coord, pixelSize, trigger, refresh );
-    },
-
-    _document_keydown: function (e) {
-      var len = this._drawCoords.length;
-      if (len > 0 && e.which == 27) {
-        if (len <= 2) {
-          this._resetDrawing();
-          this._inOp = false;
-        } else {
-          this._drawCoords[len - 2] = $.merge( [], this._drawCoords[ len - 1 ] );
-          this._drawPixels[len - 2] = $.merge( [], this._drawPixels[ len - 1 ] );
-
-          this._drawCoords.length--;
-          this._drawPixels.length--;
-
-          this._refreshDrawing();
-        }
-      }
-    },
-
-    _eventTarget_dblclick_zoom: function(e) {
-      this._trigger("dblclick", e, { type: "Point", coordinates: this.toMap(this._current) });
-      if (!e.isDefaultPrevented()) {
-        var centerAndSize = this._getZoomCenterAndSize(this._current, 1, true );
-        this._setCenterAndSize(centerAndSize.center, centerAndSize.pixelSize, true, true);
-      }
-    },
-
-    _eventTarget_dblclick: function (e) {
-      if ( this._options[ "mode" ] === "static" ) {
-        return;
-      }
-
-      this._panFinalize();
-
-      if (this._drawTimeout) {
-        window.clearTimeout(this._drawTimeout);
-        this._drawTimeout = null;
-      }
-
-      var offset = $(e.currentTarget).offset();
-
-      switch (this._options["mode"]) {
-        case "drawLineString":
-          if ( this._drawCoords.length > 1 && ! ( this._drawCoords[0][0] == this._drawCoords[1][0] &&
-                                                  this._drawCoords[0][1] == this._drawCoords[1][1] ) ) {
-              this._drawCoords.length--;
-              this._trigger( "shape", e, {
-                type: "LineString",
-                coordinates: this._userGeodetic ? $.geo.proj.toGeodetic(this._drawCoords) : this._drawCoords
-              } );
-          } else {
-            this._eventTarget_dblclick_zoom(e);
-          }
-          this._resetDrawing();
-          break;
-
-        case "drawPolygon":
-          if ( this._drawCoords.length > 1 && ! ( this._drawCoords[0][0] == this._drawCoords[1][0] &&
-                                                  this._drawCoords[0][1] == this._drawCoords[1][1] ) ) {
-            var endIndex = this._drawCoords.length - 1;
-            if (endIndex > 2) {
-              this._drawCoords[endIndex] = $.merge( [], this._drawCoords[0] );
-              this._trigger( "shape", e, {
-                type: "Polygon",
-                coordinates: [ this._userGeodetic ? $.geo.proj.toGeodetic(this._drawCoords) : this._drawCoords ]
-              } );
-            }
-          } else {
-            this._eventTarget_dblclick_zoom(e);
-          }
-          this._resetDrawing();
-          break;
-
-        case "measureLength":
-        case "measureArea":
-          this._resetDrawing();
-          break;
-
-        default:
-          this._eventTarget_dblclick_zoom(e);
-          break;
-      }
-
-      this._inOp = false;
-    },
-
-    _eventTarget_touchstart: function (e) {
-      if ( this._options[ "mode" ] === "static" ) {
-        return;
-      }
-
-      if ( !this._supportTouch && e.which != 1 ) {
-        return;
-      }
-
-      this._panFinalize();
-      this._mouseWheelFinish();
-
-      var offset = $(e.currentTarget).offset(),
-          touches = e.originalEvent.changedTouches;
-
-      if ( this._supportTouch ) {
-        this._multiTouchAnchor = $.merge( [ ], touches );
-
-        this._isMultiTouch = this._multiTouchAnchor.length > 1;
-
-        if ( this._isMultiTouch ) {
-          this._multiTouchCurrentBbox = [
-            touches[0].pageX - offset.left,
-            touches[0].pageY - offset.top,
-            touches[1].pageX - offset.left,
-            touches[1].pageY - offset.top
-          ];
-
-          this._multiTouchAnchorBbox = $.merge( [ ], this._multiTouchCurrentBbox );
-
-          this._current = $.geo.center( this._multiTouchCurrentBbox, true );
-        } else {
-          this._multiTouchCurrentBbox = [
-            touches[0].pageX - offset.left,
-            touches[0].pageY - offset.top,
-            NaN,
-            NaN
-          ];
-
-          this._current = [ touches[0].pageX - offset.left, touches[0].pageY - offset.top ];
-        }
-      } else {
-        this._current = [e.pageX - offset.left, e.pageY - offset.top];
-      }
-
-      if (this._softDblClick) {
-        var downDate = $.now();
-        if (downDate - this._downDate < 750) {
-          if (this._isTap) {
-            var dx = this._current[0] - this._anchor[0],
-                dy = this._current[1] - this._anchor[1],
-                distance = Math.sqrt((dx * dx) + (dy * dy));
-            if (distance > 8) {
-              this._isTap = false;
-            } else {
-              this._current = $.merge( [ ], this._anchor );
-            }
-          }
-
-          if (this._isDbltap) {
-            this._isDbltap = false;
-          } else {
-            this._isDbltap = this._isTap;
-          }
-        } else {
-          this._isDbltap = false;
-        }
-        this._isTap = true;
-        this._downDate = downDate;
-      }
-
-      this._mouseDown = true;
-      this._anchor = $.merge( [ ], this._current );
-
-      if (!this._inOp && e.shiftKey) {
-        this._shiftZoom = true;
-        this._$eventTarget.css("cursor", this._options["cursors"]["zoom"]);
-      } else if ( !this._isMultiTouch && this._options[ "pannable" ] ) {
-        this._inOp = true;
-
-        switch (this._options["mode"]) {
-          case "zoom":
-            break;
-
-          default:
-            this._lastDrag = this._current;
-
-            if (e.currentTarget.setCapture) {
-              e.currentTarget.setCapture();
-            }
-
-            break;
-        }
-      }
-
-      e.preventDefault();
-      return false;
-    },
-
-    _dragTarget_touchmove: function (e) {
-      if ( this._options[ "mode" ] === "static" ) {
-        return;
-      }
-
-      var offset = this._$eventTarget.offset(),
-          drawCoordsLen = this._drawCoords.length,
-          touches = e.originalEvent.changedTouches,
-          current,
-          service,
-          i = 0;
-
-      if ( this._supportTouch ) {
-        if ( !this._isMultiTouch && touches[ 0 ].identifier !== this._multiTouchAnchor[ 0 ].identifier ) {
-          // switch to multitouch
-          this._mouseDown = false;
-          this._dragTarget_touchstop( e );
-
-          this._isMultiTouch = true;
-
-          this._multiTouchAnchor.push( touches[ 0 ] );
-
-          this._multiTouchCurrentBbox = [
-            this._multiTouchCurrentBbox[ 0 ],
-            this._multiTouchCurrentBbox[ 1 ],
-            this._multiTouchAnchor[1].pageX - offset.left,
-            this._multiTouchAnchor[1].pageY - offset.top
-          ];
-
-          this._multiTouchAnchorBbox = $.merge( [ ], this._multiTouchCurrentBbox );
-
-          this._mouseDown = true;
-          this._anchor = this._current = $.geo.center( this._multiTouchCurrentBbox, true );
-
-          return false;
-        }
-
-        if ( this._isMultiTouch ) {
-          for ( ; i < touches.length; i++ ) {
-            if ( touches[ i ].identifier === this._multiTouchAnchor[ 0 ].identifier ) {
-              this._multiTouchCurrentBbox[ 0 ] = touches[ i ].pageX - offset.left;
-              this._multiTouchCurrentBbox[ 1 ] = touches[ i ].pageY - offset.top;
-            } else if ( touches[ i ].identifier === this._multiTouchAnchor[ 1 ].identifier ) {
-              this._multiTouchCurrentBbox[ 2 ] = touches[ i ].pageX - offset.left;
-              this._multiTouchCurrentBbox[ 3 ] = touches[ i ].pageY - offset.top;
-            }
-          }
-
-          current = $.geo.center( this._multiTouchCurrentBbox, true );
-
-          var currentWidth = this._multiTouchCurrentBbox[ 2 ] - this._multiTouchCurrentBbox[ 0 ],
-              anchorWidth = this._multiTouchAnchorBbox[ 2 ] - this._multiTouchAnchorBbox[ 0 ],
-              ratioWidth = currentWidth / anchorWidth;
-
-          this._wheelLevel = Math.abs( Math.floor( ( 1 - ratioWidth ) * 10 ) );
-          if ( Math.abs( currentWidth ) < Math.abs( anchorWidth ) ) {
-            this._wheelLevel = - this._wheelLevel;
-          }
-
-          var pinchCenterAndSize = this._getZoomCenterAndSize( this._anchor, this._wheelLevel, false );
-          this._$elem.find( ".geo-shapes-container" ).geographics("clear");
-
-          for ( i = 0; i < this._currentServices.length; i++ ) {
-            service = this._currentServices[ i ];
-            $.geo[ "_serviceTypes" ][ service.type ].interactiveScale( this, service, pinchCenterAndSize.center, pinchCenterAndSize.pixelSize );
-          }
-
-          if (this._graphicShapes.length > 0 && this._graphicShapes.length < 256) {
-            this._refreshShapes(this._$shapesContainer, this._graphicShapes, this._graphicShapes, this._graphicShapes, pinchCenterAndSize.center, pinchCenterAndSize.pixelSize);
-          }
-
-
-          if (this._drawCoords.length > 0) {
-            this._drawPixels = this._toPixel(this._drawCoords, pinchCenterAndSize.center, pinchCenterAndSize.pixelSize);
-            this._refreshDrawing();
-          }
-
-          current = $.geo.center( this._multiTouchCurrentBbox, true );
-        } else {
-          current = [e.originalEvent.changedTouches[0].pageX - offset.left, e.originalEvent.changedTouches[0].pageY - offset.top];
-        }
-      } else {
-        current = [e.pageX - offset.left, e.pageY - offset.top];
-      }
-
-      if (current[0] === this._lastMove[0] && current[1] === this._lastMove[1]) {
-        if ( this._inOp ) {
-          e.preventDefault();
-          return false;
-        }
-      }
-
-      if ( _ieVersion == 7 ) {
-        this._isDbltap = this._isTap = false;
-      }
-
-      if (this._mouseDown) {
-        this._current = current;
-        this._moveDate = $.now();
-      }
-
-      if ( this._isMultiTouch ) {
-        e.preventDefault( );
-        this._isDbltap = this._isTap = false;
-        return false;
-      }
-
-      var mode = this._shiftZoom ? "zoom" : this._options["mode"];
-
-      switch (mode) {
-        case "zoom":
-          if ( this._mouseDown ) {
-            this._$drawContainer.geographics( "clear" );
-            this._$drawContainer.geographics( "drawBbox", [
-              this._anchor[ 0 ],
-              this._anchor[ 1 ],
-              current[ 0 ],
-              current[ 1 ]
-            ] );
-          } else {
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-
-        case "drawLineString":
-        case "drawPolygon":
-        case "measureLength":
-        case "measureArea":
-          if (this._mouseDown || this._toolPan) {
-            this._panMove();
-          } else {
-            if (drawCoordsLen > 0) {
-              this._drawCoords[drawCoordsLen - 1] = this._toMap(current);
-              this._drawPixels[drawCoordsLen - 1] = current;
-
-              this._refreshDrawing();
-            }
-
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-
-        default:
-          if (this._mouseDown || this._toolPan) {
-            this._panMove();
-          } else {
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-      }
-
-      this._lastMove = current;
-
-      if ( this._inOp ) {
-        e.preventDefault();
-        return false;
-      }
-    },
-
-    _dragTarget_touchstop: function (e) {
-      if ( this._options[ "mode" ] === "static" ) {
-        return;
-      }
-
-      if (!this._mouseDown && _ieVersion == 7) {
-        // ie7 doesn't appear to trigger dblclick on this._$eventTarget,
-        // we fake regular click here to cause soft dblclick
-        this._eventTarget_touchstart(e);
-      }
-
-      var mouseWasDown = this._mouseDown,
-          wasToolPan = this._toolPan,
-          offset = this._$eventTarget.offset(),
-          mode = this._shiftZoom ? "zoom" : this._options["mode"],
-          current, i, clickDate,
-          dx, dy;
-
-      if (this._supportTouch) {
-        current = [e.originalEvent.changedTouches[0].pageX - offset.left, e.originalEvent.changedTouches[0].pageY - offset.top];
-      } else {
-        current = [e.pageX - offset.left, e.pageY - offset.top];
-      }
-
-      if (this._softDblClick) {
-        if (this._isTap) {
-          var dx = current[0] - this._anchor[0],
-              dy = current[1] - this._anchor[1],
-              distance = Math.sqrt((dx * dx) + (dy * dy));
-          if (distance <= 8) {
-            current = $.merge( [ ], this._anchor );
-          }
-        }
-      }
-
-      dx = current[0] - this._anchor[0];
-      dy = current[1] - this._anchor[1];
-
-      this._$eventTarget.css("cursor", this._options["cursors"][this._options["mode"]]);
-
-      this._shiftZoom = this._mouseDown = this._toolPan = false;
-
-      if ( this._isMultiTouch ) {
-        e.preventDefault( );
-        this._isMultiTouch = false;
-
-        var pinchCenterAndSize = this._getZoomCenterAndSize( this._anchor, this._wheelLevel, false );
-
-        this._setCenterAndSize(pinchCenterAndSize.center, pinchCenterAndSize.pixelSize, true, true);
-
-        this._wheelLevel = 0;
-
-        return false;
-      }
-
-      if (document.releaseCapture) {
-        document.releaseCapture();
-      }
-
-      if (mouseWasDown) {
-        clickDate = $.now();
-        this._current = current;
-
-        switch (mode) {
-          case "zoom":
-            if ( dx > 0 || dy > 0 ) {
-              var minSize = this._pixelSize * 6,
-                  bboxCoords = this._toMap( [ [
-                      Math.min( this._anchor[ 0 ], current[ 0 ] ),
-                      Math.max( this._anchor[ 1 ], current[ 1 ] )
-                    ], [
-                      Math.max( this._anchor[ 0 ], current[ 0 ] ),
-                      Math.min( this._anchor[ 1 ], current[ 1 ] )
-                    ]
-                  ] ),
-                  bbox = [
-                    bboxCoords[0][0],
-                    bboxCoords[0][1],
-                    bboxCoords[1][0],
-                    bboxCoords[1][1]
-                  ];
-
-              if ( ( bbox[2] - bbox[0] ) < minSize && ( bbox[3] - bbox[1] ) < minSize ) {
-                bbox = $.geo.scaleBy( this._getBbox( $.geo.center( bbox, true ) ), .5, true );
-              }
-
-              this._setBbox(bbox, true, true);
-            }
-
-            this._resetDrawing();
-            break;
-
-          case "drawPoint":
-            if (this._drawTimeout) {
-              window.clearTimeout(this._drawTimeout);
-              this._drawTimeout = null;
-            }
-
-            if (wasToolPan) {
-              this._panFinalize();
-            } else {
-              if (clickDate - this._clickDate > 100) {
-                var geomap = this;
-                this._drawTimeout = setTimeout(function () {
-                  if (geomap._drawTimeout) {
-                    geomap._trigger("shape", e, { type: "Point", coordinates: geomap.toMap(current) });
-                    geomap._inOp = false;
-                    geomap._drawTimeout = null;
-                  }
-                }, 250);
-              }
-            }
-            break;
-
-          case "drawLineString":
-          case "drawPolygon":
-          case "measureLength":
-          case "measureArea":
-            if (wasToolPan) {
-              this._panFinalize();
-            } else {
-              i = (this._drawCoords.length == 0 ? 0 : this._drawCoords.length - 1);
-
-              this._drawCoords[i] = this._toMap(current);
-              this._drawPixels[i] = current;
-
-              if (i < 2 || !(this._drawCoords[i][0] == this._drawCoords[i-1][0] &&
-                             this._drawCoords[i][1] == this._drawCoords[i-1][1])) {
-                this._drawCoords[i + 1] = this._toMap(current);
-                this._drawPixels[i + 1] = current;
-              }
-
-              this._refreshDrawing();
-            }
-            break;
-
-          default:
-            if (wasToolPan) {
-              this._panEnd();
-            } else {
-              if (clickDate - this._clickDate > 100) {
-                this._trigger("click", e, { type: "Point", coordinates: this.toMap(current) });
-                this._inOp = false;
-              }
-            }
-            break;
-        }
-
-        this._clickDate = clickDate;
-
-        if (this._softDblClick && this._isDbltap) {
-          this._isDbltap = this._isTap = false;
-          this._$eventTarget.trigger("dblclick", e);
-        }
-      }
-
-      if ( this._inOp ) {
-        e.preventDefault();
-        return false;
-      }
-    },
-
-    _eventTarget_mousewheel: function (e, delta) {
-      if ( this._options[ "mode" ] === "static" || this._options[ "scroll" ] === "off" ) {
-        return;
-      }
-
-      e.preventDefault();
-
-      this._panFinalize();
-
-      if ( this._mouseDown ) {
-        return false;
-      }
-
-      if (delta != 0) {
-        if (this._wheelTimeout) {
-          window.clearTimeout(this._wheelTimeout);
-          this._wheelTimeout = null;
-        } else {
-          var offset = $(e.currentTarget).offset();
-          this._anchor = [e.pageX - offset.left, e.pageY - offset.top];
-        }
-
-        this._wheelLevel += delta;
-
-        var wheelCenterAndSize = this._getZoomCenterAndSize( this._anchor, this._wheelLevel, this._options[ "tilingScheme" ] != null ),
-            service,
-            i = 0;
-
-        this._$elem.find( ".geo-shapes-container" ).geographics("clear");
-
-        for ( ; i < this._currentServices.length; i++ ) {
-          service = this._currentServices[ i ];
-          $.geo["_serviceTypes"][service.type].interactiveScale(this, service, wheelCenterAndSize.center, wheelCenterAndSize.pixelSize);
-        }
-
-        if (this._graphicShapes.length > 0 && this._graphicShapes.length < 256) {
-          this._refreshShapes(this._$shapesContainer, this._graphicShapes, this._graphicShapes, this._graphicShapes, wheelCenterAndSize.center, wheelCenterAndSize.pixelSize);
-        }
-
-        if (this._drawCoords.length > 0) {
-          this._drawPixels = this._toPixel(this._drawCoords, wheelCenterAndSize.center, wheelCenterAndSize.pixelSize);
-          this._refreshDrawing();
-        }
-
-        var geomap = this;
-        this._wheelTimeout = window.setTimeout(function () {
-          geomap._mouseWheelFinish();
-        }, 1000);
-      }
-
-      return false;
-    }
-  }
-  );
-})(jQuery);
-
-(function ($, undefined) {
-  $.geo._serviceTypes.tiled = (function () {
-    return {
-      create: function (map, serviceContainer, service, index) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( !serviceState ) {
-          serviceState = {
-            loadCount: 0,
-            reloadTiles: false
-          };
-
-          var scHtml = '<div data-geo-service="tiled" style="position:absolute; left:0; top:0; width:8px; height:8px; margin:0; padding:0;"></div>';
-
-          serviceContainer.append(scHtml);
-
-          serviceState.serviceContainer = serviceContainer.children( ":last" );
-
-          $.data(service, "geoServiceState", serviceState);
-        }
-
-        return serviceState.serviceContainer;
-      },
-
-      destroy: function (map, serviceContainer, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        serviceState.serviceContainer.remove();
-
-        $.removeData(service, "geoServiceState");
-      },
-
-      interactivePan: function ( map, service, dx, dy ) {
-        var serviceState = $.data( service, "geoServiceState" );
-
-        if ( serviceState ) {
-          this._cancelUnloaded( map, service );
-
-          serviceState.serviceContainer.children( ).css( "-moz-transition", "").css( {
-            webkitTransition: "",
-            transition: "",
-            left: function ( index, value ) {
-              return parseInt( value ) + dx;
-            },
-            top: function ( index, value ) {
-              return parseInt( value ) + dy;
-            }
-          });
-
-          if ( service && service.style.visibility === "visible" ) {
-            var pixelSize = map._pixelSize,
-
-                serviceObj = this,
-                serviceContainer = serviceState.serviceContainer,
-                scaleContainer = serviceContainer.children("[data-pixelSize='" + pixelSize + "']"),
-
-                /* same as refresh 1 */
-                contentBounds = map._getContentBounds(),
-                mapWidth = contentBounds["width"],
-                mapHeight = contentBounds["height"],
-
-                image = map.options[ "axisLayout" ] === "image",
-                ySign = image ? +1 : -1,
-
-                tilingScheme = map.options["tilingScheme"],
-                tileWidth = tilingScheme.tileWidth,
-                tileHeight = tilingScheme.tileHeight,
-                /* end same as refresh 1 */
-
-                halfWidth = mapWidth / 2 * pixelSize,
-                halfHeight = mapHeight / 2 * pixelSize,
-
-                currentPosition = scaleContainer.position(),
-                scaleOriginParts = scaleContainer.data("scaleOrigin").split(","),
-                totalDx = parseInt(scaleOriginParts[0]) - currentPosition.left,
-                totalDy = parseInt(scaleOriginParts[1]) - currentPosition.top,
-
-                mapCenterOriginal = map._getCenter(),
-                mapCenter = [
-                  mapCenterOriginal[0] + totalDx * pixelSize,
-                  mapCenterOriginal[1] + ySign * totalDy * pixelSize
-                ],
-
-                /* same as refresh 2 */
-                tileX = Math.floor(((mapCenter[0] - halfWidth) - tilingScheme.origin[0]) / (pixelSize * tileWidth)),
-                tileY = Math.max( Math.floor(( image ? (mapCenter[1] - halfHeight) - tilingScheme.origin[1] : tilingScheme.origin[1] - (mapCenter[1] + halfHeight)) / (pixelSize * tileHeight)), 0 ),
-                tileX2 = Math.ceil(((mapCenter[0] + halfWidth) - tilingScheme.origin[0]) / (pixelSize * tileWidth)),
-                tileY2 = Math.ceil(( image ? (mapCenter[1] + halfHeight) - tilingScheme.origin[1] : tilingScheme.origin[1] - (mapCenter[1] - halfHeight)) / (pixelSize * tileHeight)),
-
-                bboxMax = map._getBboxMax(),
-                pixelSizeAtZero = map._getPixelSize(0),
-                ratio = pixelSizeAtZero / pixelSize,
-                fullXAtScale = Math.floor((bboxMax[0] - tilingScheme.origin[0]) / (pixelSizeAtZero * tileWidth)) * ratio,
-                fullYAtScale = Math.floor((tilingScheme.origin[1] + ySign * bboxMax[3]) / (pixelSizeAtZero * tileHeight)) * ratio,
-
-                fullXMinX = tilingScheme.origin[0] + (fullXAtScale * tileWidth) * pixelSize,
-                fullYMinOrMaxY = tilingScheme.origin[1] + ySign * (fullYAtScale * tileHeight) * pixelSize,
-                /* end same as refresh 2 */
-
-                serviceLeft = Math.round((fullXMinX - (mapCenterOriginal[0] - halfWidth)) / pixelSize),
-                serviceTop = Math.round(( image ? fullYMinOrMaxY - (mapCenterOriginal[1] - halfHeight) : (mapCenterOriginal[1] + halfHeight) - fullYMinOrMaxY  ) / pixelSize),
-
-                opacity = service.style.opacity,
-
-                x, y;
-
-            for ( x = tileX; x < tileX2; x++ ) {
-              for ( y = tileY; y < tileY2; y++ ) {
-                var tileStr = "" + x + "," + y,
-                    $img = scaleContainer.children("[data-tile='" + tileStr + "']").removeAttr("data-dirty");
-
-                if ( $img.size( ) === 0 ) {
-                  /* same as refresh 3 */
-                  var bottomLeft = [
-                        tilingScheme.origin[0] + (x * tileWidth) * pixelSize,
-                        tilingScheme.origin[1] + ySign * (y * tileHeight) * pixelSize
-                      ],
-
-                      topRight = [
-                        tilingScheme.origin[0] + ((x + 1) * tileWidth - 1) * pixelSize,
-                        tilingScheme.origin[1] + ySign * ((y + 1) * tileHeight - 1) * pixelSize
-                      ],
-
-                      tileBbox = [bottomLeft[0], bottomLeft[1], topRight[0], topRight[1]],
-
-                      urlProp = ( service.hasOwnProperty("src") ? "src" : "getUrl" ),
-                      urlArgs = {
-                        bbox: tileBbox,
-                        width: tileWidth,
-                        height: tileHeight,
-                        zoom: map._getZoom(),
-                        tile: {
-                          row: y,
-                          column: x
-                        },
-                        index: Math.abs(y + x)
-                      },
-                      isFunc = $.isFunction( service[ urlProp ] ),
-                      imageUrl;
-
-                  if ( isFunc ) {
-                    imageUrl = service[ urlProp ]( urlArgs );
-                  } else {
-                    $.template( "geoSrc", service[ urlProp ] );
-                    imageUrl = $.render( urlArgs, "geoSrc" );
-                  }
-                  /* end same as refresh 3 */
-
-                  serviceState.loadCount++;
-                  //this._map._requestQueued();
-
-                  if ( serviceState.reloadTiles && $img.size() > 0 ) {
-                    $img.attr( "src", imageUrl );
-                  } else {
-                    /* same as refresh 4 */
-                    var imgMarkup = "<img style='position:absolute; " +
-                          "left:" + (((x - fullXAtScale) * 100) + (serviceLeft - (serviceLeft % tileWidth)) / tileWidth * 100) + "%; " +
-                          "top:" + (((y - fullYAtScale) * 100) + (serviceTop - (serviceTop % tileHeight)) / tileHeight * 100) + "%; ";
-
-                    if ($("body")[0].filters === undefined) {
-                      imgMarkup += "width: 100%; height: 100%;";
-                    }
-
-                    imgMarkup += "margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;' unselectable='on' data-tile='" + tileStr + "' />";
-
-                    scaleContainer.append( imgMarkup );
-                    $img = scaleContainer.children(":last");
-                  }
-
-                  if ( typeof imageUrl === "string" ) {
-                    serviceObj._loadImage( $img, imageUrl, pixelSize, serviceState, serviceContainer, opacity );
-                  } else {
-                    // assume Deferred
-                    imageUrl.done( function( url ) {
-                      serviceObj._loadImage( $img, url, pixelSize, serviceState, serviceContainer, opacity );
-                    } ).fail( function( ) {
-                      $img.remove( );
-                      serviceState.loadCount--;
-                    } );
-                  }
-
-                  /* end same as refresh 4 */
-                }
-              }
-            }
-          }
-        }
-      },
-
-      interactiveScale: function (map, service, center, pixelSize) {
-        var serviceState = $.data( service, "geoServiceState" );
-
-        if ( serviceState && service && service.style.visibility === "visible" ) {
-          this._cancelUnloaded(map, service);
-
-          var serviceContainer = serviceState.serviceContainer,
-
-              tilingScheme = map.options["tilingScheme"],
-              tileWidth = tilingScheme.tileWidth,
-              tileHeight = tilingScheme.tileHeight;
-
-
-          serviceContainer.children( ).each( function ( i ) {
-            var $scaleContainer = $(this),
-                scaleRatio = $scaleContainer.attr("data-pixelSize") / pixelSize,
-                transitionCss = ""; //"width .25s ease-in, height .25s ease-in, left .25s ease-in, top .25s ease-in";
-
-            scaleRatio = Math.round(scaleRatio * 1000) / 1000;
-
-
-            var scaleOriginParts = $scaleContainer.data("scaleOrigin").split(","),
-                oldMapCoord = map._toMap([scaleOriginParts[0], scaleOriginParts[1]]),
-                newPixelPoint = map._toPixel(oldMapCoord, center, pixelSize);
-
-            $scaleContainer.css( "-moz-transition", transitionCss ).css( {
-              webkitTransition: transitionCss,
-              transition: transitionCss,
-              left: Math.round(newPixelPoint[0]) + "px",
-              top: Math.round(newPixelPoint[1]) + "px",
-              width: tileWidth * scaleRatio,
-              height: tileHeight * scaleRatio
-            } );
-
-            if ( $("body")[0].filters !== undefined ) {
-              $scaleContainer.children().each( function ( i ) {
-                $( this ).css( "filter", "progid:DXImageTransform.Microsoft.Matrix(FilterType=bilinear,M11=" + scaleRatio + ",M22=" + scaleRatio + ",sizingmethod='auto expand')" );
-              } );
-            }
-          });
-        }
-      },
-
-      refresh: function (map, service) {
-        var serviceState = $.data( service, "geoServiceState" );
-
-        this._cancelUnloaded(map, service);
-
-        if ( serviceState && service && service.style.visibility === "visible" && !( serviceState.serviceContainer.is( ":hidden" ) ) ) {
-
-          var bbox = map._getBbox(),
-              pixelSize = map._pixelSize,
-
-              serviceObj = this,
-              $serviceContainer = serviceState.serviceContainer,
-
-              contentBounds = map._getContentBounds(),
-              mapWidth = contentBounds["width"],
-              mapHeight = contentBounds["height"],
-
-              image = map.options[ "axisLayout" ] === "image",
-              ySign = image ? +1 : -1,
-
-              tilingScheme = map.options["tilingScheme"],
-              tileWidth = tilingScheme.tileWidth,
-              tileHeight = tilingScheme.tileHeight,
-
-              tileX = Math.floor((bbox[0] - tilingScheme.origin[0]) / (pixelSize * tileWidth)),
-              tileY = Math.max( Math.floor( ( image ? bbox[1] - tilingScheme.origin[1] : tilingScheme.origin[1] - bbox[ 3 ] ) / (pixelSize * tileHeight) ), 0 ),
-              tileX2 = Math.ceil((bbox[2] - tilingScheme.origin[0]) / (pixelSize * tileWidth)),
-              tileY2 = Math.ceil( ( image ? bbox[3] - tilingScheme.origin[1] : tilingScheme.origin[1] - bbox[ 1 ] ) / (pixelSize * tileHeight) ),
-
-              bboxMax = map._getBboxMax(),
-              pixelSizeAtZero = map._getPixelSize(0),
-              ratio = pixelSizeAtZero / pixelSize,
-              fullXAtScale = Math.floor((bboxMax[0] - tilingScheme.origin[0]) / (pixelSizeAtZero * tileWidth)) * ratio,
-              fullYAtScale = Math.floor((tilingScheme.origin[1] + ySign * bboxMax[3]) / (pixelSizeAtZero * tileHeight)) * ratio,
-
-              fullXMinX = tilingScheme.origin[0] + (fullXAtScale * tileWidth) * pixelSize,
-              fullYMinOrMaxY = tilingScheme.origin[1] + ySign * (fullYAtScale * tileHeight) * pixelSize,
-
-              serviceLeft = Math.round((fullXMinX - bbox[0]) / pixelSize),
-              serviceTop = Math.round( ( image ? fullYMinOrMaxY - bbox[1] : bbox[3] - fullYMinOrMaxY ) / pixelSize),
-
-              scaleContainers = $serviceContainer.children().show(),
-              scaleContainer = scaleContainers.filter("[data-pixelSize='" + pixelSize + "']").appendTo($serviceContainer),
-
-              opacity = service.style.opacity,
-
-              x, y;
-
-          if (serviceState.reloadTiles) {
-            scaleContainers.find("img").attr("data-dirty", "true");
-          }
-
-          if (!scaleContainer.size()) {
-            $serviceContainer.append("<div style='position:absolute; left:" + serviceLeft % tileWidth + "px; top:" + serviceTop % tileHeight + "px; width:" + tileWidth + "px; height:" + tileHeight + "px; margin:0; padding:0;' data-pixelSize='" + pixelSize + "'></div>");
-            scaleContainer = $serviceContainer.children(":last").data("scaleOrigin", (serviceLeft % tileWidth) + "," + (serviceTop % tileHeight));
-          } else {
-            scaleContainer.css({
-              left: (serviceLeft % tileWidth) + "px",
-              top: (serviceTop % tileHeight) + "px"
-            }).data("scaleOrigin", (serviceLeft % tileWidth) + "," + (serviceTop % tileHeight));
-
-            scaleContainer.children().each(function (i) {
-              var 
-              $img = $(this),
-              tile = $img.attr("data-tile").split(",");
-
-              $img.css({
-                left: Math.round(((parseInt(tile[0]) - fullXAtScale) * 100) + (serviceLeft - (serviceLeft % tileWidth)) / tileWidth * 100) + "%",
-                top: Math.round(((parseInt(tile[1]) - fullYAtScale) * 100) + (serviceTop - (serviceTop % tileHeight)) / tileHeight * 100) + "%"
-              });
-
-              if (opacity < 1) {
-                $img.fadeTo(0, opacity);
-              }
-            });
-          }
-
-          for (x = tileX; x < tileX2; x++) {
-            for (y = tileY; y < tileY2; y++) {
-              var tileStr = "" + x + "," + y,
-                  $img = scaleContainer.children("[data-tile='" + tileStr + "']").removeAttr("data-dirty");
-
-              if ($img.size() === 0 || serviceState.reloadTiles) {
-                var bottomLeft = [
-                      tilingScheme.origin[0] + (x * tileWidth) * pixelSize,
-                      tilingScheme.origin[1] + ySign * (y * tileHeight) * pixelSize
-                    ],
-
-                    topRight = [
-                      tilingScheme.origin[0] + ((x + 1) * tileWidth - 1) * pixelSize,
-                      tilingScheme.origin[1] + ySign * ((y + 1) * tileHeight - 1) * pixelSize
-                    ],
-
-                    tileBbox = [bottomLeft[0], bottomLeft[1], topRight[0], topRight[1]],
-
-                    urlProp = ( service.hasOwnProperty( "src" ) ? "src" : "getUrl" ),
-                    urlArgs = {
-                      bbox: tileBbox,
-                      width: tileWidth,
-                      height: tileHeight,
-                      zoom: map._getZoom(),
-                      tile: {
-                        row: y,
-                        column: x
-                      },
-                      index: Math.abs(y + x)
-                    },
-                    isFunc = $.isFunction( service[ urlProp ] ),
-                    imageUrl;
-
-                if ( isFunc ) {
-                  imageUrl = service[ urlProp ]( urlArgs );
-                } else {
-                  $.template( "geoSrc", service[ urlProp ] );
-                  imageUrl = $.render( urlArgs, "geoSrc" );
-                }
-
-                serviceState.loadCount++;
-                //this._map._requestQueued();
-
-                if (serviceState.reloadTiles && $img.size() > 0) {
-                  $img.attr("src", imageUrl);
-                } else {
-                  var imgMarkup = "<img style='position:absolute; " +
-                    "left:" + (((x - fullXAtScale) * 100) + (serviceLeft - (serviceLeft % tileWidth)) / tileWidth * 100) + "%; " +
-                    "top:" + (((y - fullYAtScale) * 100) + (serviceTop - (serviceTop % tileHeight)) / tileHeight * 100) + "%; ";
-
-                  if ($("body")[0].filters === undefined) {
-                    imgMarkup += "width: 100%; height: 100%;";
-                  }
-
-                  imgMarkup += "margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;' unselectable='on' data-tile='" + tileStr + "' />";
-
-                  scaleContainer.append(imgMarkup);
-                  $img = scaleContainer.children(":last");
-                }
-
-                if ( typeof imageUrl === "string" ) {
-                  serviceObj._loadImage( $img, imageUrl, pixelSize, serviceState, $serviceContainer, opacity );
-                } else {
-                  // assume Deferred
-                  imageUrl.done( function( url ) {
-                    serviceObj._loadImage( $img, url, pixelSize, serviceState, $serviceContainer, opacity );
-                  } ).fail( function( ) {
-                    $img.remove( );
-                    serviceState.loadCount--;
-                  } );
-                }
-              }
-            }
-          }
-
-          scaleContainers.find("[data-dirty]").remove();
-          serviceState.reloadTiles = false;
-        }
-      },
-
-      resize: function (map, service) {
-      },
-
-      opacity: function ( map, service ) {
-        var serviceState = $.data( service, "geoServiceState" );
-        serviceState.serviceContainer.find( "img" ).stop( true ).fadeTo( "fast", service.style.opacity );
-      },
-
-      toggle: function ( map, service ) {
-        var serviceState = $.data( service, "geoServiceState" );
-        serviceState.serviceContainer.css( "display", service.style.visibility === "visible" ? "block" : "none" );
-      },
-
-      _cancelUnloaded: function (map, service) {
-        var serviceState = $.data( service, "geoServiceState" );
-
-        if (serviceState && serviceState.loadCount > 0) {
-          serviceState.serviceContainer.find("img:hidden").remove();
-          while (serviceState.loadCount > 0) {
-            serviceState.loadCount--;
-          }
-        }
-      },
-
-      _loadImage: function ( $img, url, pixelSize, serviceState, serviceContainer, opacity ) {
-        $img.load(function (e) {
-          if (opacity < 1) {
-            $(e.target).fadeTo(0, opacity);
-          } else {
-            $(e.target).show();
-          }
-
-          serviceState.loadCount--;
-
-          if (serviceState.loadCount <= 0) {
-            serviceContainer.children(":not([data-pixelSize='" + pixelSize + "'])").remove();
-            serviceState.loadCount = 0;
-          }
-        }).error(function (e) {
-          $(e.target).remove();
-          serviceState.loadCount--;
-
-          if (serviceState.loadCount <= 0) {
-            serviceContainer.children(":not([data-pixelSize='" + pixelSize + "'])").remove();
-            serviceState.loadCount = 0;
-          }
-        }).attr("src", url);
-      }
-    };
-  })();
-})(jQuery);
-(function ($, undefined) {
-  $.geo._serviceTypes.shingled = (function () {
-    return {
-      create: function (map, serviceContainer, service, index) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( !serviceState ) {
-          serviceState = {
-            loadCount: 0
-          };
-
-          var scHtml = '<div data-geo-service="shingled" style="position:absolute; left:0; top:0; width:16px; height:16px; margin:0; padding:0;"></div>';
-
-          serviceContainer.append(scHtml);
-
-          serviceState.serviceContainer = serviceContainer.children(":last");
-          $.data(service, "geoServiceState", serviceState);
-        }
-
-        return serviceState.serviceContainer;
-      },
-
-      destroy: function (map, serviceContainer, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        serviceState.serviceContainer.remove();
-
-        $.removeData(service, "geoServiceState");
-      },
-
-      interactivePan: function (map, service, dx, dy) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( serviceState ) {
-          this._cancelUnloaded(map, service);
-
-          var serviceContainer = serviceState.serviceContainer,
-              pixelSize = map._pixelSize,
-              scaleContainer = serviceContainer.children("[data-pixelSize='" + pixelSize + "']"),
-              panContainer = scaleContainer.children("div");
-
-          if ( !panContainer.length ) {
-            scaleContainer.children("img").wrap('<div style="position:absolute; left:0; top:0; width:100%; height:100%;"></div>');
-            panContainer = scaleContainer.children("div");
-          }
-
-          panContainer.css( {
-            left: function (index, value) {
-              return parseInt(value) + dx;
-            },
-            top: function (index, value) {
-              return parseInt(value) + dy;
-            }
-          } );
-
-          // until pan/zoom rewrite, remove all containers not in this scale
-          serviceContainer.children(":not([data-pixelSize='" + pixelSize + "'])").remove();
-        }
-      },
-
-      interactiveScale: function (map, service, center, pixelSize) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( serviceState ) {
-          this._cancelUnloaded(map, service);
-
-          var serviceContainer = serviceState.serviceContainer,
-
-              contentBounds = map._getContentBounds(),
-              mapWidth = contentBounds["width"],
-              mapHeight = contentBounds["height"],
-
-              halfWidth = mapWidth / 2,
-              halfHeight = mapHeight / 2,
-
-              bbox = [center[0] - halfWidth, center[1] - halfHeight, center[0] + halfWidth, center[1] + halfHeight];
-
-          serviceContainer.children().each(function (i) {
-            var $scaleContainer = $(this),
-                scalePixelSize = $scaleContainer.attr("data-pixelSize"),
-                ratio = scalePixelSize / pixelSize;
-                
-            $scaleContainer.css( {
-              width: mapWidth * ratio,
-              height: mapHeight * ratio } ).children("img").each(function (i) {
-              var $img = $(this),
-                  imgCenter = $img.data("center"),
-                  x = (Math.round((imgCenter[0] - center[0]) / scalePixelSize) - halfWidth) * ratio,
-                  y = (Math.round((center[1] - imgCenter[1]) / scalePixelSize) - halfHeight) * ratio;
-
-              $img.css({ left: x + "px", top: y + "px" });
-            });
-          });
-        }
-      },
-
-      refresh: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        this._cancelUnloaded(map, service);
-
-        if ( serviceState && service && service.style.visibility === "visible" && !( serviceState.serviceContainer.is( ":hidden" ) ) ) {
-
-          var bbox = map._getBbox(),
-              pixelSize = map._pixelSize,
-
-              serviceObj = this,
-              serviceContainer = serviceState.serviceContainer,
-
-              contentBounds = map._getContentBounds(),
-              mapWidth = contentBounds["width"],
-              mapHeight = contentBounds["height"],
-
-              halfWidth = mapWidth / 2,
-              halfHeight = mapHeight / 2,
-
-              scaleContainer = serviceContainer.children('[data-pixelSize="' + pixelSize + '"]'),
-
-              opacity = service.style.opacity,
-
-              $img;
-
-          if ( !scaleContainer.size() ) {
-            serviceContainer.append('<div style="position:absolute; left:' + halfWidth + 'px; top:' + halfHeight + 'px; width:' + mapWidth + 'px; height:' + mapHeight + 'px; margin:0; padding:0;" data-pixelSize="' + pixelSize + '"></div>');
-            scaleContainer = serviceContainer.children(":last");
-          }
-
-          scaleContainer.children("img").each(function (i) {
-            var $thisimg = $(this),
-                imgCenter = $thisimg.data("center"),
-                center = map._getCenter(),
-                x = Math.round((imgCenter[0] - center[0]) / pixelSize) - halfWidth,
-                y = Math.round((center[1] - imgCenter[1]) / pixelSize) - halfHeight;
-
-            $thisimg.css({ left: x + "px", top: y + "px" });
-          });
-
-          if (opacity < 1) {
-            serviceContainer.find("img").attr("data-keepAlive", "0");
-          }
-
-          var urlProp = ( service.hasOwnProperty("src") ? "src" : "getUrl" ),
-              urlArgs = {
-                bbox: bbox,
-                width: mapWidth,
-                height: mapHeight,
-                zoom: map._getZoom(),
-                tile: null,
-                index: 0
-              },
-              isFunc = $.isFunction( service[ urlProp ] ),
-              imageUrl;
-
-
-          if ( isFunc ) {
-            imageUrl = service[ urlProp ]( urlArgs );
-          } else {
-            $.template( "geoSrc", service[ urlProp ] );
-            imageUrl = $.render( urlArgs, "geoSrc" );
-          }
-
-          serviceState.loadCount++;
-          //this._map._requestQueued();
-
-          scaleContainer.append('<img style="position:absolute; left:-' + halfWidth + 'px; top:-' + halfHeight + 'px; width:100%; height:100%; margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;" unselectable="on" />');
-          $img = scaleContainer.children(":last").data("center", map._getCenter());
-
-          if ( typeof imageUrl === "string" ) {
-            serviceObj._loadImage( $img, imageUrl, pixelSize, serviceState, serviceContainer, opacity );
-          } else {
-            // assume Deferred
-            imageUrl.done( function( url ) {
-              serviceObj._loadImage( $img, url, pixelSize, serviceState, serviceContainer, opacity );
-            } ).fail( function( ) {
-              $img.remove( );
-              serviceState.loadCount--;
-            } );
-          }
-
-        }
-      },
-
-      resize: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( serviceState && service && service.style.visibility === "visible" ) {
-          this._cancelUnloaded(map, service);
-
-          var serviceContainer = serviceState.serviceContainer,
-
-              contentBounds = map._getContentBounds(),
-              mapWidth = contentBounds["width"],
-              mapHeight = contentBounds["height"],
-
-              halfWidth = mapWidth / 2,
-              halfHeight = mapHeight / 2,
-
-              scaleContainer = serviceContainer.children();
-
-          scaleContainer.attr("data-pixelSize", "0");
-          scaleContainer.css({
-            left: halfWidth + 'px',
-            top: halfHeight + 'px'
-          });
-        }
-      },
-
-      opacity: function ( map, service ) {
-        var serviceState = $.data( service, "geoServiceState" );
-        serviceState.serviceContainer.find( "img" ).stop( true ).fadeTo( "fast", service.style.opacity );
-      },
-
-      toggle: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-        serviceState.serviceContainer.css("display", service.style.visibility === "visible" ? "block" : "none");
-      },
-
-      _cancelUnloaded: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if (serviceState && serviceState.loadCount > 0) {
-          serviceState.serviceContainer.find("img:hidden").remove();
-          while (serviceState.loadCount > 0) {
-            serviceState.loadCount--;
-          }
-        }
-      },
-
-      _loadImage: function ( $img, url, pixelSize, serviceState, serviceContainer, opacity ) {
-        $img.load(function (e) {
-          if (opacity < 1) {
-            $(e.target).fadeTo(0, opacity);
-          } else {
-            $(e.target).show();
-          }
-
-          serviceState.loadCount--;
-
-          if (serviceState.loadCount <= 0) {
-            serviceContainer.children(':not([data-pixelSize="' + pixelSize + '"])').remove();
-
-            var panContainer = serviceContainer.find('[data-pixelSize="' + pixelSize + '"]>div');
-            if (panContainer.size() > 0) {
-              var panContainerPos = panContainer.position();
-
-              panContainer.children("img").each(function (i) {
-                var $thisimg = $(this),
-                    x = panContainerPos.left + parseInt($thisimg.css("left")),
-                    y = panContainerPos.top + parseInt($thisimg.css("top"));
-
-                $thisimg.css({ left: x + "px", top: y + "px" });
-              }).unwrap();
-
-              panContainer.remove();
-            }
-
-            serviceState.loadCount = 0;
-          }
-        }).error(function (e) {
-          $(e.target).remove();
-          serviceState.loadCount--;
-
-          if (serviceState.loadCount <= 0) {
-            serviceContainer.children(":not([data-pixelSize='" + pixelSize + "'])").remove();
-            serviceState.loadCount = 0;
-          }
-        }).attr("src", url);
-      }
-    }
-  })();
-})(jQuery);
-/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
- * Licensed under the MIT License (LICENSE.txt).
- *
- * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
- * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
- * Thanks to: Seamus Leahy for adding deltaX and deltaY
- *
- * Version: 3.0.6
- * 
- * Requires: 1.2.2+
- */
-
-(function($) {
-
-var types = ['DOMMouseScroll', 'mousewheel'];
-
-if ($.event.fixHooks) {
-    for ( var i=types.length; i; ) {
-        $.event.fixHooks[ types[--i] ] = $.event.mouseHooks;
-    }
-}
-
-$.event.special.mousewheel = {
-    setup: function() {
-        if ( this.addEventListener ) {
-            for ( var i=types.length; i; ) {
-                this.addEventListener( types[--i], handler, false );
-            }
-        } else {
-            this.onmousewheel = handler;
-        }
-    },
-    
-    teardown: function() {
-        if ( this.removeEventListener ) {
-            for ( var i=types.length; i; ) {
-                this.removeEventListener( types[--i], handler, false );
-            }
-        } else {
-            this.onmousewheel = null;
-        }
-    }
-};
-
-$.fn.extend({
-    mousewheel: function(fn) {
-        return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
-    },
-    
-    unmousewheel: function(fn) {
-        return this.unbind("mousewheel", fn);
-    }
-});
-
-
-function handler(event) {
-    var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
-    event = $.event.fix(orgEvent);
-    event.type = "mousewheel";
-    
-    // Old school scrollwheel delta
-    if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; }
-    if ( orgEvent.detail     ) { delta = -orgEvent.detail/3; }
-    
-    // New school multidimensional scroll (touchpads) deltas
-    deltaY = delta;
-    
-    // Gecko
-    if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
-        deltaY = 0;
-        deltaX = -1*delta;
-    }
-    
-    // Webkit
-    if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }
-    if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
-    
-    // Add event and delta to the front of the arguments
-    args.unshift(event, delta, deltaX, deltaY);
-    
-    return ($.event.dispatch || $.event.handle).apply(this, args);
-}
-
-})(jQuery);
diff --git a/libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0a4.min.js b/libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0a4.min.js
deleted file mode 100755 (executable)
index 8696f1e..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-document.createElement("canvas").getContext||function(){function g(){return this.context_||(this.context_=new t(this))}function q(p,h){var o=G.call(arguments,2);return function(){return p.apply(h,o.concat(G.call(arguments)))}}function r(p){p.namespaces.g_vml_||p.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML");p.namespaces.g_o_||p.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML");if(!p.styleSheets.ex_canvas_){p=p.createStyleSheet();p.owningElement.id=
-"ex_canvas_";p.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function b(p){var h=p.srcElement;switch(p.propertyName){case "width":h.getContext().clearRect();h.style.width=h.attributes.width.nodeValue+"px";h.firstChild.style.width=h.clientWidth+"px";break;case "height":h.getContext().clearRect();h.style.height=h.attributes.height.nodeValue+"px";h.firstChild.style.height=h.clientHeight+"px"}}function c(p){p=p.srcElement;if(p.firstChild){p.firstChild.style.width=
-p.clientWidth+"px";p.firstChild.style.height=p.clientHeight+"px"}}function a(){return[[1,0,0],[0,1,0],[0,0,1]]}function d(p,h){for(var o=a(),s=0;s<3;s++)for(var x=0;x<3;x++){for(var v=0,A=0;A<3;A++)v+=p[s][A]*h[A][x];o[s][x]=v}return o}function f(p,h){h.fillStyle=p.fillStyle;h.lineCap=p.lineCap;h.lineJoin=p.lineJoin;h.lineWidth=p.lineWidth;h.miterLimit=p.miterLimit;h.shadowBlur=p.shadowBlur;h.shadowColor=p.shadowColor;h.shadowOffsetX=p.shadowOffsetX;h.shadowOffsetY=p.shadowOffsetY;h.strokeStyle=p.strokeStyle;
-h.globalAlpha=p.globalAlpha;h.font=p.font;h.textAlign=p.textAlign;h.textBaseline=p.textBaseline;h.arcScaleX_=p.arcScaleX_;h.arcScaleY_=p.arcScaleY_;h.lineScale_=p.lineScale_}function e(p){var h=p.indexOf("(",3),o=p.indexOf(")",h+1);h=p.substring(h+1,o).split(",");if(h.length!=4||p.charAt(3)!="a")h[3]=1;return h}function l(p,h,o){return Math.min(o,Math.max(h,p))}function m(p,h,o){o<0&&o++;o>1&&o--;return 6*o<1?p+(h-p)*6*o:2*o<1?h:3*o<2?p+(h-p)*(2/3-o)*6:p}function n(p){if(p in R)return R[p];var h,
-o=1;p=String(p);if(p.charAt(0)=="#")h=p;else if(/^rgb/.test(p)){o=e(p);h="#";for(var s,x=0;x<3;x++){s=o[x].indexOf("%")!=-1?Math.floor(parseFloat(o[x])/100*255):+o[x];h+=M[l(s,0,255)]}o=+o[3]}else if(/^hsl/.test(p)){x=o=e(p);h=parseFloat(x[0])/360%360;h<0&&h++;s=l(parseFloat(x[1])/100,0,1);x=l(parseFloat(x[2])/100,0,1);if(s==0)s=x=h=x;else{var v=x<0.5?x*(1+s):x+s-x*s,A=2*x-v;s=m(A,v,h+1/3);x=m(A,v,h);h=m(A,v,h-1/3)}h="#"+M[Math.floor(s*255)]+M[Math.floor(x*255)]+M[Math.floor(h*255)];o=o[3]}else h=
-p;return R[p]={color:h,alpha:o}}function t(p){this.m_=a();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.fillStyle=this.strokeStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=H*1;this.globalAlpha=1;this.canvas=p;var h="width:"+p.clientWidth+"px;height:"+p.clientHeight+"px;overflow:hidden;position:absolute",o=p.ownerDocument.createElement("div");o.style.cssText=h;p.appendChild(o);h=o.cloneNode(false);h.style.backgroundColor="red";h.style.filter="alpha(opacity=0)";
-p.appendChild(h);this.element_=o;this.lineScale_=this.arcScaleY_=this.arcScaleX_=1}function u(p,h,o,s){p.currentPath_.push({type:"bezierCurveTo",cp1x:h.x,cp1y:h.y,cp2x:o.x,cp2y:o.y,x:s.x,y:s.y});p.currentX_=s.x;p.currentY_=s.y}function w(p,h,o){p=p.m_;return{x:H*(h*p[0][0]+o*p[1][0]+p[2][0])-C,y:H*(h*p[0][1]+o*p[1][1]+p[2][1])-C}}function B(p,h,o){if(isFinite(h[0][0])&&isFinite(h[0][1])&&isFinite(h[1][0])&&isFinite(h[1][1])&&isFinite(h[2][0])&&isFinite(h[2][1])){p.m_=h;if(o)p.lineScale_=P(J(h[0][0]*
-h[1][1]-h[0][1]*h[1][0]))}}function I(p){this.code=this[p];this.message=p+": DOM Exception "+this.code}var F=Math,y=F.round,K=F.sin,D=F.cos,J=F.abs,P=F.sqrt,H=10,C=H/2;navigator.userAgent.match(/MSIE ([\d.]+)?/);var G=Array.prototype.slice;r(document);F={init:function(p){p=p||document;p.createElement("canvas");p.attachEvent("onreadystatechange",q(this.init_,this,p))},init_:function(p){p=p.getElementsByTagName("canvas");for(var h=0;h<p.length;h++)this.initElement(p[h])},initElement:function(p){if(!p.getContext){p.getContext=
-g;r(p.ownerDocument);p.innerHTML="";p.attachEvent("onpropertychange",b);p.attachEvent("onresize",c);var h=p.attributes;if(h.width&&h.width.specified)p.style.width=h.width.nodeValue+"px";else p.width=p.clientWidth;if(h.height&&h.height.specified)p.style.height=h.height.nodeValue+"px";else p.height=p.clientHeight}return p}};F.init();for(var M=[],z=0;z<16;z++)for(var L=0;L<16;L++)M[z*16+L]=z.toString(16)+L.toString(16);var R={},U={butt:"flat",round:"round"};z=t.prototype;z.clearRect=function(){if(this.textMeasureEl_){this.textMeasureEl_.removeNode(true);
-this.textMeasureEl_=null}this.element_.innerHTML=""};z.beginPath=function(){this.currentPath_=[]};z.moveTo=function(p,h){var o=w(this,p,h);this.currentPath_.push({type:"moveTo",x:o.x,y:o.y});this.currentX_=o.x;this.currentY_=o.y};z.lineTo=function(p,h){var o=w(this,p,h);this.currentPath_.push({type:"lineTo",x:o.x,y:o.y});this.currentX_=o.x;this.currentY_=o.y};z.bezierCurveTo=function(p,h,o,s,x,v){x=w(this,x,v);p=w(this,p,h);o=w(this,o,s);u(this,p,o,x)};z.quadraticCurveTo=function(p,h,o,s){p=w(this,
-p,h);o=w(this,o,s);s={x:this.currentX_+2/3*(p.x-this.currentX_),y:this.currentY_+2/3*(p.y-this.currentY_)};u(this,s,{x:s.x+(o.x-this.currentX_)/3,y:s.y+(o.y-this.currentY_)/3},o)};z.arc=function(p,h,o,s,x,v){o*=H;var A=v?"at":"wa",E=p+D(s)*o-C,N=h+K(s)*o-C;s=p+D(x)*o-C;x=h+K(x)*o-C;if(E==s&&!v)E+=0.125;p=w(this,p,h);E=w(this,E,N);s=w(this,s,x);this.currentPath_.push({type:A,x:p.x,y:p.y,radius:o,xStart:E.x,yStart:E.y,xEnd:s.x,yEnd:s.y})};z.stroke=function(p){var h=[];h.push("<g_vml_:shape",' filled="',
-!!p,'"',' style="position:absolute;width:',10,"px;height:",10,'px;"',' coordorigin="0,0"',' coordsize="',H*10,",",H*10,'"',' stroked="',!p,'"',' path="');for(var o={x:null,y:null},s={x:null,y:null},x=0;x<this.currentPath_.length;x++){var v=this.currentPath_[x];switch(v.type){case "moveTo":h.push(" m ",y(v.x),",",y(v.y));break;case "lineTo":h.push(" l ",y(v.x),",",y(v.y));break;case "close":h.push(" x ");v=null;break;case "bezierCurveTo":h.push(" c ",y(v.cp1x),",",y(v.cp1y),",",y(v.cp2x),",",y(v.cp2y),
-",",y(v.x),",",y(v.y));break;case "at":case "wa":h.push(" ",v.type," ",y(v.x-this.arcScaleX_*v.radius),",",y(v.y-this.arcScaleY_*v.radius)," ",y(v.x+this.arcScaleX_*v.radius),",",y(v.y+this.arcScaleY_*v.radius)," ",y(v.xStart),",",y(v.yStart)," ",y(v.xEnd),",",y(v.yEnd))}if(v){if(o.x==null||v.x<o.x)o.x=v.x;if(s.x==null||v.x>s.x)s.x=v.x;if(o.y==null||v.y<o.y)o.y=v.y;if(s.y==null||v.y>s.y)s.y=v.y}}h.push(' ">');if(p){p=n(this.fillStyle);h.push('<g_vml_:fill color="',p.color,'" opacity="',p.alpha*this.globalAlpha,
-'" />')}else{o=n(this.strokeStyle);p=o.color;o=o.alpha*this.globalAlpha;s=this.lineScale_*this.lineWidth;if(s<1)o*=s;h.push("<g_vml_:stroke",' opacity="',o,'"',' joinstyle="',this.lineJoin,'"',' miterlimit="',this.miterLimit,'"',' endcap="',U[this.lineCap]||"square",'"',' weight="',s,'px"',' color="',p,'" />')}h.push("</g_vml_:shape>");this.element_.insertAdjacentHTML("beforeEnd",h.join(""))};z.fill=function(){this.stroke(true)};z.closePath=function(){this.currentPath_.push({type:"close"})};z.save=
-function(){var p={};f(this,p);this.aStack_.push(p);this.mStack_.push(this.m_);this.m_=d(a(),this.m_)};z.restore=function(){if(this.aStack_.length){f(this.aStack_.pop(),this);this.m_=this.mStack_.pop()}};z.translate=function(p,h){B(this,d([[1,0,0],[0,1,0],[p,h,1]],this.m_),false)};z.scale=function(p,h){this.arcScaleX_*=p;this.arcScaleY_*=h;B(this,d([[p,0,0],[0,h,0],[0,0,1]],this.m_),true)};z=I.prototype=Error();z.INDEX_SIZE_ERR=1;z.DOMSTRING_SIZE_ERR=2;z.HIERARCHY_REQUEST_ERR=3;z.WRONG_DOCUMENT_ERR=
-4;z.INVALID_CHARACTER_ERR=5;z.NO_DATA_ALLOWED_ERR=6;z.NO_MODIFICATION_ALLOWED_ERR=7;z.NOT_FOUND_ERR=8;z.NOT_SUPPORTED_ERR=9;z.INUSE_ATTRIBUTE_ERR=10;z.INVALID_STATE_ERR=11;z.SYNTAX_ERR=12;z.INVALID_MODIFICATION_ERR=13;z.NAMESPACE_ERR=14;z.INVALID_ACCESS_ERR=15;z.VALIDATION_ERR=16;z.TYPE_MISMATCH_ERR=17;G_vmlCanvasManager=F;CanvasRenderingContext2D=t;DOMException=I}();
-$.widget||function(g,q){if(g.cleanData){var r=g.cleanData;g.cleanData=function(c){for(var a=0,d;(d=c[a])!=null;a++)try{g(d).triggerHandler("remove")}catch(f){}r(c)}}else{var b=g.fn.remove;g.fn.remove=function(c,a){return this.each(function(){if(!a)if(!c||g.filter(c,[this]).length)g("*",this).add([this]).each(function(){try{g(this).triggerHandler("remove")}catch(d){}});return b.call(g(this),c,a)})}}g.widget=function(c,a,d){var f=c.split(".")[0],e;c=c.split(".")[1];e=f+"-"+c;if(!d){d=a;a=g.Widget}g.expr[":"][e]=
-function(l){return!!g.data(l,c)};g[f]=g[f]||{};g[f][c]=function(l,m){arguments.length&&this._createWidget(l,m)};a=new a;a.options=g.extend(true,{},a.options);g[f][c].prototype=g.extend(true,a,{namespace:f,widgetName:c,widgetEventPrefix:g[f][c].prototype.widgetEventPrefix||c,widgetBaseClass:e},d);g.widget.bridge(c,g[f][c])};g.widget.bridge=function(c,a){g.fn[c]=function(d){var f=typeof d==="string",e=Array.prototype.slice.call(arguments,1),l=this;d=!f&&e.length?g.extend.apply(null,[true,d].concat(e)):
-d;if(f&&d.charAt(0)==="_")return l;f?this.each(function(){var m=g.data(this,c),n=m&&g.isFunction(m[d])?m[d].apply(m,e):m;if(n!==m&&n!==q){l=n;return false}}):this.each(function(){var m=g.data(this,c);m?m.option(d||{})._init():g.data(this,c,new a(d,this))});return l}};g.Widget=function(c,a){arguments.length&&this._createWidget(c,a)};g.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(c,a){g.data(a,this.widgetName,this);this.element=g(a);this.options=
-g.extend(true,{},this.options,this._getCreateOptions(),c);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return g.metadata&&g.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+
-"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(c,a){var d=c;if(arguments.length===0)return g.extend({},this.options);if(typeof c==="string"){if(a===q)return this.options[c];d={};d[c]=a}this._setOptions(d);return this},_setOptions:function(c){var a=this;g.each(c,function(d,f){a._setOption(d,f)});return this},_setOption:function(c,a){this.options[c]=a;if(c==="disabled")this.widget()[a?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",
-a);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(c,a,d){var f,e=this.options[c];d=d||{};a=g.Event(a);a.type=(c===this.widgetEventPrefix?c:this.widgetEventPrefix+c).toLowerCase();a.target=this.element[0];if(c=a.originalEvent)for(f in c)f in a||(a[f]=c[f]);this.element.trigger(a,d);return!(g.isFunction(e)&&e.call(this.element[0],a,d)===false||a.isDefaultPrevented())}}}(jQuery);
-window.JsViews||window.jQuery&&jQuery.views||function(g,q){function r(h,o,s,x,v){var A=(s=s||{viewsCount:0,ctx:n.helpers})&&s.ctx;return{jsViews:"v1.0pre",path:o||"",itemNumber:++s.viewsCount||1,viewsCount:0,tmpl:v,data:x||s.data||{},ctx:h&&h===A?A:A?F(F({},A),h):h||{},parent:s}}function b(h,o,s,x,v,A,E){return s?(x?v?"$view."+v:s:"$data."+s)+(A||""):E||o||""}function c(h){function o(O){O-=x;O&&E.push(h.substr(x,O).replace(C,"\\n"))}var s,x=0,v=[],A=[],E=A,N=[,,A];h=h.replace(M,"\\$1");h.replace(w,
-function(O,S,Q,ga,ha,T,ia,ja,ka,ca){function la(Z,V,ma,da,na,oa,ea,fa,pa,qa){return W?(W=!ea,W?Z:'"'):X?(X=!fa,X?Z:'"'):da?V.replace(P,b)+da:na?Y?"":(aa=K,"\u0008"+V+":"):ma?(Y++,V.replace(P,b)+"("):pa?(Y--,")"):V?V.replace(P,b):oa?",":qa?Y?"":aa?(aa=y,"\u0008"):",":(W=ea,X=fa,'"')}var aa,ba="",Y=0,X=y,W=y;Q=Q||ga;o(ca);if(ha)n.allowCode&&E.push(["*",T.replace(G,"$1")]);else if(Q){if(Q==="else"){N=v.pop();E=N[2];S=K}T=T?(T+" ").replace(H,la).replace(z,function(Z,V){ba+=V+",";return""}):"";T=T.slice(0,
--1);s=[Q,ia?ja||"none":"",S&&[],"{"+ba+"_hash:'"+ba+"',_path:'"+T+"'}",T];if(S){v.push(N);N=s}E.push(s)}else if(ka)N=v.pop();x=ca+O.length;if(!N)throw"Expected block tag";E=N[2]});o(h.length);return a(A)}function a(h){var o,s,x=[],v=h.length,A="try{var views="+(D?"jQuery":"JsViews")+'.views,tag=views.renderTag,enc=views.encode,html=views.encoders.html,$ctx=$view && $view.ctx,result=""+\n\n';for(s=0;s<v;s++){o=h[s];if(o[0]==="*")A=A.slice(0,s?-1:-3)+";"+o[1]+(s+1<v?"result+=":"");else if(""+o===o)A+=
-'"'+o+'"+';else{var E=o[0],N=o[1],O=o[2],S=o[3];o=o[4];var Q=o+'||"")+';O&&x.push(a(O));A+=E==="="?!N||N==="html"?"html("+Q:N==="none"?"("+Q:'enc("'+N+'",'+Q:'tag("'+E+'",$view,"'+(N||"")+'",'+(O?x.length:'""')+","+S+(o?",":"")+o+")+"}}h=new Function("$data, $view",A.slice(0,-1)+";return result;\n\n}catch(e){return views.err(e);}");h.nested=x;return h}function d(h){return R[h]||(R[h]="&#"+h.charCodeAt(0)+";")}function f(h){try{return e(h)}catch(o){}return h}var e,l,m,n,t,u,w,B,I,F,y=false,K=true,
-D=g.jQuery,J=/^[^<]*(<[\w\W]+>)[^>]*$|\{\{\! /,P=/^(true|false|null|[\d\.]+)|(\w+|\$(view|data|ctx|(\w+)))([\w\.]*)|((['"])(?:\\\1|.)*\7)$/g,H=/(\$?[\w\.\[\]]+)(?:(\()|\s*(===|!==|==|!=|<|>|<=|>=)\s*|\s*(\=)\s*)?|(\,\s*)|\\?(\')|\\?(\")|(\))|(\s+)/g,C=/\r?\n/g,G=/\\(['"])/g,M=/\\?(['"])/g,z=/\x08([^\x08]+)\x08/g,L=0,R={"&":"&amp;","<":"&lt;",">":"&gt;"},U=/[\x00"&'<>]/g,p=Array.prototype.slice;if(D){e=D;e.fn.extend({render:function(h,o,s,x){return u(h,this[0],o,s,x)},template:function(h,o){return e.template(h,
-this[0],o)}})}else{l=g.$;g.JsViews=m=g.$=e={extend:function(h,o){for(var s in o)h[s]=o[s];return h},isArray:Array.isArray||function(h){return Object.prototype.toString.call(h)==="[object Array]"},noConflict:function(){if(g.$===m)g.$=l;return m}}}F=e.extend;F(e,{views:n={templates:{},tags:{"if":function(){var h=this._view;h.onElse=function(o,s){for(var x=0,v=s.length;v&&!s[x++];)if(x===v)return"";h.onElse=q;return u(h.data,o.tmpl,h.ctx,h)};return h.onElse(this,arguments)},"else":function(){var h=this._view;
-return h.onElse?h.onElse(this,arguments):""},each:function(){var h,o="",s=arguments,x=s.length,v=this.tmpl,A=this._view;for(h=0;h<x;h++)o+=s[h]?u(s[h],v,this.ctx||A.ctx,A,this._path,this._ctor):"";return x?o:o+u(A.data,v,A.ctx,A,this._path,this.tag)},"=":function(h){return h},"*":function(h){return h}},helpers:{not:function(h){return!h}},allowCode:y,debugMode:K,err:function(h){return n.debugMode?"<br/><b>Error:</b> <em> "+(h.message||h)+". </em>":'""'},setDelimiters:function(h,o){var s=o.charAt(0),
-x=o.charAt(1);h="\\"+h.charAt(0)+"\\"+h.charAt(1);o="\\"+s+"\\"+x;w=h+"(?:(?:(\\#)?(\\w+(?=[!\\s\\"+s+"]))|(?:(\\=)|(\\*)))\\s*((?:[^\\"+s+"]|\\"+s+"(?!\\"+x+"))*?)(!(\\w*))?|(?:\\/([\\w\\$\\.\\[\\]]+)))"+o;w=RegExp(w,"g")},registerTags:B=function(h,o){var s;if(typeof h==="object")for(s in h)B(s,h[s]);else n.tags[h]=o;return this},registerHelpers:I=function(h,o){if(typeof h==="object")for(var s in h)I(s,h[s]);else n.helpers[h]=o;return this},encode:function(h,o){return o?(t[h||"html"]||t.html)(o):
-""},encoders:t={none:function(h){return h},html:function(h){return String(h).replace(U,d)}},renderTag:function(h,o,s,x,v){var A,E;A=arguments;E=n.presenters;hash=v._hash;tagFn=n.tags[h];if(!tagFn)return"";x=x&&o.tmpl.nested[x-1];v.tmpl=v.tmpl||x||q;if(E&&E[h]){E=F(F({},v.ctx),v);delete E.ctx;delete E._path;delete E.tmpl;v.ctx=E;v._ctor=h+(hash?"="+hash.slice(0,-1):"");v=F(F({},tagFn),v);tagFn=n.tags.each}v._encode=s;v._view=o;return(A=tagFn.apply(v,A.length>5?p.call(A,5):[o.data]))||(A===q?"":A.toString())}},
-render:u=function(h,o,s,x,v,A){var E,N,O,S,Q="";if(arguments.length===2&&h.jsViews){x=h;s=x.ctx;h=x.data}o=e.template(o);if(!o)return"";if(e.isArray(h)){S=new r(s,v,x,h);E=0;for(N=h.length;E<N;E++){O=(O=h[E])?o(O,new r(s,v,S,O,o,this)):"";Q+=n.activeViews?"<!--item--\>"+O+"<!--/item--\>":O}}else Q+=o(h,new r(s,v,x,h,o));return n.activeViews?"<!--tmpl("+(v||"")+") "+(A?"tag="+A:o._name)+"--\>"+Q+"<!--/tmpl--\>":Q},template:function(h,o){if(o){if(""+o===o)o=c(o);else if(D&&o instanceof e)o=o[0];if(o){if(D&&
-o.nodeType)o=e.data(o,"tmpl")||e.data(o,"tmpl",c(o.innerHTML));n.templates[o._name=o._name||h||"_"+L++]=o}return o}return h?""+h!==h?h._name?h:e.template(null,h):n.templates[h]||e.template(null,J.test(h)?h:f(h)):null}});n.setDelimiters("{{","}}")}(window);
-(function(g,q,r){var b=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY;g.geo={_allCoordinates:function(a){a=this._flatten(a);for(var d=0,f=[];d<a.length;d++){var e=a[d].coordinates,l=e&&g.isArray(e[0]),m=l&&g.isArray(e[0][0]),n;if(!(m&&g.isArray(e[0][0][0]))){if(!m){l||(e=[e]);e=[e]}e=[e]}for(l=0;l<e.length;l++)for(m=0;m<e[l].length;m++)for(n=0;n<e[l][m].length;n++)f.push(e[l][m][n])}return f},_isGeodetic:function(a){for(;g.isArray(a);)if(a.length>1&&!g.isArray(a[0]))return a[0]>=-180&&a[0]<=
-180&&a[1]>=-85&&a[1]<=85;else a=a[0];return false},center:function(a,d){var f=false;if(!d&&g.geo.proj&&this._isGeodetic(a)){f=true;a=g.geo.proj.fromGeodetic(a)}var e=[(a[0]+a[2])/2,(a[1]+a[3])/2];return f?g.geo.proj.toGeodetic(e):e},expandBy:function(a,d,f,e){var l=false;if(!e&&g.geo.proj&&this._isGeodetic(a)){l=true;a=g.geo.proj.fromGeodetic(a)}a=[a[0]-d,a[1]-f,a[2]+d,a[3]+f];return l?g.geo.proj.toGeodetic(a):a},height:function(a,d){if(!d&&g.geo.proj&&this._isGeodetic(a))a=g.geo.proj.fromGeodetic(a);
-return a[3]-a[1]},_in:function(a,d){return a[0]<=d[0]&&a[1]<=d[1]&&a[2]>=d[2]&&a[3]>=d[3]},_bboxDisjoint:function(a,d){return d[0]>a[2]||d[2]<a[0]||d[1]>a[3]||d[3]<a[1]},reaspect:function(a,d,f){var e=false;if(!f&&g.geo.proj&&this._isGeodetic(a)){e=true;a=g.geo.proj.fromGeodetic(a)}var l=this.width(a,true),m=this.height(a,true);f=this.center(a,true);if(l!=0&&m!=0&&d>0){if(l/m>d){a=l/2;l=a/d}else{l=m/2;a=l*d}a=[f[0]-a,f[1]-l,f[0]+a,f[1]+l]}return e?g.geo.proj.toGeodetic(a):a},recenter:function(a,d,
-f){var e=false;if(!f&&g.geo.proj){if(this._isGeodetic(a)){e=true;a=g.geo.proj.fromGeodetic(a)}if(this._isGeodetic(d))d=g.geo.proj.fromGeodetic(d)}f=(a[2]-a[0])/2;a=(a[3]-a[1])/2;a=[d[0]-f,d[1]-a,d[0]+f,d[1]+a];return e?g.geo.proj.toGeodetic(a):a},scaleBy:function(a,d,f){var e=false;if(!f&&g.geo.proj&&this._isGeodetic(a)){e=true;a=g.geo.proj.fromGeodetic(a)}f=this.center(a,true);var l=(a[2]-a[0])*d/2;a=(a[3]-a[1])*d/2;a=[f[0]-l,f[1]-a,f[0]+l,f[1]+a];return e?g.geo.proj.toGeodetic(a):a},width:function(a,
-d){if(!d&&g.geo.proj&&this._isGeodetic(a))a=g.geo.proj.fromGeodetic(a);return a[2]-a[0]},bbox:function(a,d){if(a)if(a.bbox)result=!d&&g.geo.proj&&this._isGeodetic(a.bbox)?g.geo.proj.fromGeodetic(a.bbox):a.bbox;else{result=[b,b,c,c];var f=this._allCoordinates(a),e=0;if(f.length==0)return r;var l=false;if(!d&&g.geo.proj&&this._isGeodetic(f)){l=true;f=g.geo.proj.fromGeodetic(f)}for(;e<f.length;e++){result[0]=Math.min(f[e][0],result[0]);result[1]=Math.min(f[e][1],result[1]);result[2]=Math.max(f[e][0],
-result[2]);result[3]=Math.max(f[e][1],result[3])}}else return r;return l?g.geo.proj.toGeodetic(result):result},centroid:function(a,d){switch(a.type){case "Point":return g.extend({},a);case "LineString":case "Polygon":var f=0,e=[0,0],l=g.merge([],a.type=="Polygon"?a.coordinates[0]:a.coordinates),m=1,n,t,u=false;if(!d&&g.geo.proj&&this._isGeodetic(l)){u=true;l=g.geo.proj.fromGeodetic(l)}for(;m<=l.length;m++){n=m%l.length;t=l[m-1][0]*l[n][1]-l[n][0]*l[m-1][1];f+=t;e[0]+=(l[m-1][0]+l[n][0])*t;e[1]+=(l[m-
-1][1]+l[n][1])*t}if(f==0)if(l.length>0){e[0]=l[0][0];e[1]=l[0][1];return{type:"Point",coordinates:u?g.geo.proj.toGeodetic(e):e}}else break;f*=3;e[0]/=f;e[1]/=f;return{type:"Point",coordinates:u?g.geo.proj.toGeodetic(e):e}}return r},contains:function(a,d){if(a.type!="Polygon")return false;switch(d.type){case "Point":return this._containsPolygonPoint(a.coordinates,d.coordinates);case "LineString":return this._containsPolygonLineString(a.coordinates,d.coordinates);case "Polygon":return this._containsPolygonLineString(a.coordinates,
-d.coordinates[0]);default:return false}},_containsPolygonPoint:function(a,d){if(a.length==0||a[0].length<4)return false;for(var f=0,e=a[0][0],l=1,m;l<a[0].length;l++){m=a[0][l];if(e[1]<=d[1]&&d[1]<m[1]||m[1]<=d[1]&&d[1]<e[1]&&(d[0]<e[0]||d[0]<m[0])){e=e[0]+(m[0]-e[0])*(d[1]-e[1])/(m[1]-e[1]);e>d[0]&&f++}e=m}return f%2==1},_containsPolygonLineString:function(a,d){for(var f=0;f<d.length;f++)if(!this._containsPolygonPoint(a,d[f]))return false;return true},distance:function(a,d,f){var e=!f&&g.geo.proj&&
-this._isGeodetic(a.coordinates)?g.geo.proj.fromGeodetic(a.coordinates):a.coordinates;f=!f&&g.geo.proj&&this._isGeodetic(d.coordinates)?g.geo.proj.fromGeodetic(d.coordinates):d.coordinates;switch(a.type){case "Point":switch(d.type){case "Point":return this._distancePointPoint(f,e);case "LineString":return this._distanceLineStringPoint(f,e);case "Polygon":return this._containsPolygonPoint(f,e)?0:this._distanceLineStringPoint(f[0],e);default:return r}case "LineString":switch(d.type){case "Point":return this._distanceLineStringPoint(e,
-f);case "LineString":return this._distanceLineStringLineString(e,f);case "Polygon":return this._containsPolygonLineString(f,e)?0:this._distanceLineStringLineString(f[0],e);default:return r}case "Polygon":switch(d.type){case "Point":return this._containsPolygonPoint(e,f)?0:this._distanceLineStringPoint(e[0],f);case "LineString":return this._containsPolygonLineString(e,f)?0:this._distanceLineStringLineString(e[0],f);case "Polygon":return this._containsPolygonLineString(e,f[0])?0:this._distanceLineStringLineString(e[0],
-f[0]);default:return r}}},_distancePointPoint:function(a,d){var f=d[0]-a[0],e=d[1]-a[1];return Math.sqrt(f*f+e*e)},_distanceLineStringPoint:function(a,d){var f=b;if(a.length>0){var e=a[0],l=d[0]-e[0],m=d[1]-e[1];if(a.length==1)return Math.sqrt(l*l+m*m);else for(var n=1;n<a.length;n++){var t=a[n],u=d[0]-t[0],w=d[1]-t[1];e=this._distanceSegmentPoint(t[0]-e[0],t[1]-e[1],l,m,u,w);if(e==0)return 0;if(e<f)f=e;e=t;l=u;m=w}}return Math.sqrt(f)},_distanceSegmentPoint:function(a,d,f,e,l,m){var n=a*f+d*e;if(n<=
-0)return f*f+e*e;a=a*a+d*d;if(n>=a)return l*l+m*m;return f*f+e*e-n*n/a},_distanceLineStringLineString:function(a,d){for(var f=b,e=0;e<d.length;e++)f=Math.min(f,this._distanceLineStringPoint(a,d[e]));return f},_buffer:function(a,d,f){var e=false,l=a.coordinates;if(!f&&g.geo.proj&&this._isGeodetic(a.coordinates)){e=true;l=g.geo.proj.fromGeodetic(a.coordinates)}switch(a.type){case "Point":a=[];f=0;for(var m;f<=180;f++){m=f*360/180*(Math.PI/180);a.push([l[0]+Math.cos(m)*d,l[1]+Math.sin(m)*d])}return{type:"Polygon",
-coordinates:[e?g.geo.proj.toGeodetic(a):a]};default:return r}},_flatten:function(a){var d=[],f=0;switch(a.type){case "Feature":g.merge(d,this._flatten(a.geometry));break;case "FeatureCollection":for(;f<a.features.length;f++)g.merge(d,this._flatten(a.features[f].geometry));break;case "GeometryCollection":for(;f<a.geometries.length;f++)g.merge(d,this._flatten(a.geometries[f]));break;default:d[0]=a}return d},length:function(a,d){var f=0,e,l=1,m,n;switch(a.type){case "Point":return 0;case "LineString":e=
-a.coordinates;break;case "Polygon":e=a.coordinates[0]}if(e){if(!d&&g.geo.proj&&this._isGeodetic(e))e=g.geo.proj.fromGeodetic(e);for(;l<e.length;l++){m=e[l][0]-e[l-1][0];n=e[l][1]-e[l-1][1];f+=Math.sqrt(m*m+n*n)}return f}},area:function(a,d){var f=0,e,l=1,m;switch(a.type){case "Point":case "LineString":return 0;case "Polygon":e=a.coordinates[0]}if(e){if(!d&&g.geo.proj&&this._isGeodetic(e))e=g.geo.proj.fromGeodetic(e);for(;l<=e.length;l++){m=l%e.length;f+=(e[l-1][0]-e[m][0])*(e[l-1][1]+e[m][1])/2}return Math.abs(f)}},
-pointAlong:function(a,d,f){var e=0,l=0,m=0,n,t=[],u=1,w=false;switch(a.type){case "Point":return g.extend({},a);case "LineString":n=a.coordinates;break;case "Polygon":n=a.coordinates[0]}if(n)if(d===0)return{type:"Point",coordinates:[n[0][0],n[0][1]]};else if(d===1){u=n.length-1;return{type:"Point",coordinates:[n[u][0],n[u][1]]}}else{if(!f&&g.geo.proj&&this._isGeodetic(n)){w=true;n=g.geo.proj.fromGeodetic(n)}for(;u<n.length;u++){a=n[u][0]-n[u-1][0];f=n[u][1]-n[u-1][1];a=Math.sqrt(a*a+f*f);t.push(a);
-e+=a}for(u=0;u<t.length&&m<d;u++){l=m;m+=t[u]/e}d=d-l;e=n[u-1];n=n[u];n=[e[0]+d*(n[0]-e[0]),e[1]+d*(n[1]-e[1])];return{type:"Point",coordinates:w?g.geo.proj.toGeodetic(n):n}}},_WKT:function(){function a(e){if(e&&e.length){for(var l=[],m=0;m<e.length;m++)l.push(e[m].join(" "));return"("+l+")"}else return"EMPTY"}function d(e){if(e&&e.length){for(var l=[],m=0;m<e.length;m++)l.push(a(e[m]));return"("+l+")"}else return"EMTPY"}function f(e){if(e&&e.type)switch(e.type){case "Point":return"POINT "+(e.coordinates&&
-e.coordinates.length?"("+e.coordinates.join(" ")+")":"EMPTY");case "LineString":return"LINESTRING "+a(e.coordinates);case "Polygon":return"POLYGON "+d(e.coordinates);case "MultiPoint":return"MULTIPOINT "+a(e.coordinates);case "MultiLineString":return"MULTILINSTRING "+d(e.coordinates);case "MultiPolygon":if((e=e.coordinates)&&e.length){for(var l=[],m=0;m<e.length;m++)l.push(d(e[m]));e="("+l+")"}else e="EMPTY";return"MULTIPOLYGON "+e;case "GeometryCollection":if((e=e.geometries)&&e.length){l=[];for(m=
-0;m<e.length;m++)l.push(f(e[m]));e="("+e+")"}else e="EMPTY";return"GEOMETRYCOLLECTION "+e;default:return""}else return""}return{stringify:f,parse:function(e){e=g.trim(e);var l=e.indexOf(" "),m=e.substr(l+1);switch(e.substr(0,l).toUpperCase()){case "POINT":return(e=m.match(/\(\s*([\d\.-]+)\s+([\d\.-]+)\s*\)/))&&e.length>2?{type:"Point",coordinates:[parseFloat(e[1]),parseFloat(e[2])]}:null;case "LINESTRING":m=m.match(/\s*\((.*)\)/);e=[];var n;l=0;if(m.length>1){for(m=m[1].match(/[\d\.-]+\s+[\d\.-]+/g);l<
-m.length;l++){n=m[l].match(/\s*([\d\.-]+)\s+([\d\.-]+)\s*/);e[l]=[parseFloat(n[1]),parseFloat(n[2])]}e={type:"LineString",coordinates:e}}else e=null;return e;case "POLYGON":m=m.match(/\s*\(\s*\((.*)\)\s*\)/);e=[];l=0;if(m.length>1){for(m=m[1].match(/[\d\.-]+\s+[\d\.-]+/g);l<m.length;l++){n=m[l].match(/\s*([\d\.-]+)\s+([\d\.-]+)\s*/);e[l]=[parseFloat(n[1]),parseFloat(n[2])]}e={type:"Polygon",coordinates:[e]}}else e=null;return e;default:return null}}}}(),proj:function(){return{fromGeodeticPos:function(a){if(!a)debugger;
-return[6378137*a[0]*0.017453292519943295,6378137*Math.log(Math.tan(0.7853981633974483+a[1]*0.017453292519943295/2))]},fromGeodetic:function(a){if(!g.geo._isGeodetic(a))return a;var d=g.isArray(a[0]),f=this.fromGeodeticPos;if(!d&&a.length==4){d=f([a[0],a[1]]);a=f([a[2],a[3]]);return[d[0],d[1],a[0],a[1]]}else{var e=d&&g.isArray(a[0][0]),l=e&&g.isArray(a[0][0][0]),m=[],n,t,u;if(!l){if(!e){d||(a=[a]);a=[a]}a=[a]}for(n=0;n<a.length;n++){m[n]=[];for(t=0;t<a[n].length;t++){m[n][t]=[];for(u=0;u<a[n][t].length;u++)m[n][t][u]=
-f(a[n][t][u])}}return l?m:e?m[0]:d?m[0][0]:m[0][0][0]}},toGeodeticPos:function(a){return[a[0]/6378137*57.29577951308232,(1.5707963267948966-2*Math.atan(1/Math.exp(a[1]/6378137)))*57.29577951308232]},toGeodetic:function(a){if(g.geo._isGeodetic(a))return a;var d=g.isArray(a[0]),f=this.toGeodeticPos;if(!d&&a.length==4){d=f([a[0],a[1]]);a=f([a[2],a[3]]);return[d[0],d[1],a[0],a[1]]}else{var e=d&&g.isArray(a[0][0]),l=e&&g.isArray(a[0][0][0]),m=[];if(!l){if(!e){d||(a=[a]);a=[a]}a=[a]}for(i=0;i<a.length;i++){m[i]=
-[];for(j=0;j<a[i].length;j++){m[i][j]=[];for(k=0;k<a[i][j].length;k++)m[i][j][k]=f(a[i][j][k])}}return l?m:e?m[0]:d?m[0][0]:m[0][0][0]}}}}(),_serviceTypes:{}}})(jQuery,this);
-(function(g,q){var r=function(){for(var b=5,c=document.createElement("div"),a=c.all||[];c.innerHTML="<!--[if gt IE "+ ++b+"]><br><![endif]--\>",a[0];);return b>6?b:!b}();g.widget("geo.geographics",{_$elem:q,_options:{},_trueCanvas:true,_width:0,_height:0,_$canvas:q,_context:q,_$labelsContainer:q,options:{style:{borderRadius:"8px",color:"#7f0000",fillOpacity:0.2,height:"8px",opacity:1,strokeOpacity:1,strokeWidth:"2px",visibility:"visible",width:"8px"}},_create:function(){this._$elem=this.element;this._options=
-this.options;this._$elem.css({display:"inline-block",overflow:"hidden",textAlign:"left"});this._$elem.css("position")=="static"&&this._$elem.css("position","relative");this._$elem.addClass("geo-graphics");this._width=this._$elem.width();this._height=this._$elem.height();if(!(this._width&&this._height)){this._width=parseInt(this._$elem.css("width"));this._height=parseInt(this._$elem.css("height"))}var b="width:"+this._width+"px;height:"+this._height+"px;",c='width="'+this._width+'" height="'+this._height+
-'"';if(document.createElement("canvas").getContext){this._$elem.append("<canvas "+c+' style="position:absolute;left:0;top:0;margin:0;padding:0;"></canvas>');this._$canvas=this._$elem.children(":last");this._context=this._$canvas[0].getContext("2d")}else if(r<=8){this._trueCanvas=false;this._$elem.append("<div "+c+' style="position:absolute;left:0;top:0;margin:0;padding:0;'+b+'"></div>');this._$canvas=this._$elem.children(":last");G_vmlCanvasManager.initElement(this._$canvas[0]);this._context=this._$canvas[0].getContext("2d");
-this._$canvas.children().css({backgroundColor:"transparent",width:this._width,height:this._height})}this._$elem.append('<div class="geo-labels-container" style="position:absolute;left:0;top:0;margin:0;padding:0;'+b+'"></div>');this._$labelsContainer=this._$elem.children(":last")},_setOption:function(b,c){if(b=="style")c=g.extend({},this._options.style,c);g.Widget.prototype._setOption.apply(this,arguments)},destroy:function(){g.Widget.prototype.destroy.apply(this,arguments);this._$elem.html("");this._$elem.removeClass("geo-graphics")},
-clear:function(){this._context.clearRect(0,0,this._width,this._height);this._$labelsContainer.html("")},drawArc:function(b,c,a,d){d=this._getGraphicStyle(d);if(d.visibility!="hidden"&&d.opacity>0&&d.widthValue>0&&d.heightValue>0){var f=Math.min(d.widthValue,d.heightValue)/2;c=c*Math.PI/180;a=a*Math.PI/180;this._context.save();this._context.translate(b[0],b[1]);d.widthValue>d.heightValue?this._context.scale(d.widthValue/d.heightValue,1):this._context.scale(1,d.heightValue/d.widthValue);this._context.beginPath();
-this._context.arc(0,0,f,c,a,false);this._trueCanvas&&this._context.restore();if(d.doFill){this._context.fillStyle=d.fill;this._context.globalAlpha=d.opacity*d.fillOpacity;this._context.fill()}if(d.doStroke){this._context.lineJoin="round";this._context.lineWidth=d.strokeWidthValue;this._context.strokeStyle=d.stroke;this._context.globalAlpha=d.opacity*d.strokeOpacity;this._context.stroke()}this._trueCanvas||this._context.restore()}},drawPoint:function(b,c){c=this._getGraphicStyle(c);if(c.widthValue==
-c.heightValue&&c.heightValue==c.borderRadiusValue)this.drawArc(b,0,360,c);else if(c.visibility!="hidden"&&c.opacity>0){c.borderRadiusValue=Math.min(Math.min(c.widthValue,c.heightValue)/2,c.borderRadiusValue);b[0]-=c.widthValue/2;b[1]-=c.heightValue/2;this._context.beginPath();this._context.moveTo(b[0]+c.borderRadiusValue,b[1]);this._context.lineTo(b[0]+c.widthValue-c.borderRadiusValue,b[1]);this._context.quadraticCurveTo(b[0]+c.widthValue,b[1],b[0]+c.widthValue,b[1]+c.borderRadiusValue);this._context.lineTo(b[0]+
-c.widthValue,b[1]+c.heightValue-c.borderRadiusValue);this._context.quadraticCurveTo(b[0]+c.widthValue,b[1]+c.heightValue,b[0]+c.widthValue-c.borderRadiusValue,b[1]+c.heightValue);this._context.lineTo(b[0]+c.borderRadiusValue,b[1]+c.heightValue);this._context.quadraticCurveTo(b[0],b[1]+c.heightValue,b[0],b[1]+c.heightValue-c.borderRadiusValue);this._context.lineTo(b[0],b[1]+c.borderRadiusValue);this._context.quadraticCurveTo(b[0],b[1],b[0]+c.borderRadiusValue,b[1]);this._context.closePath();if(c.doFill){this._context.fillStyle=
-c.fill;this._context.globalAlpha=c.opacity*c.fillOpacity;this._context.fill()}if(c.doStroke){this._context.lineJoin="round";this._context.lineWidth=c.strokeWidthValue;this._context.strokeStyle=c.stroke;this._context.globalAlpha=c.opacity*c.strokeOpacity;this._context.stroke()}}},drawLineString:function(b,c){this._drawLines([b],false,c)},drawPolygon:function(b,c){this._drawLines(b,true,c)},drawBbox:function(b,c){this._drawLines([[[b[0],b[1]],[b[0],b[3]],[b[2],b[3]],[b[2],b[1]],[b[0],b[1]]]],true,c)},
-drawLabel:function(b,c){this._$labelsContainer.append('<div class="geo-label" style="position:absolute; left:'+b[0]+"px; top:"+b[1]+'px;">'+c+"</div>")},resize:function(){this._width=this._$elem.width();this._height=this._$elem.height();if(!(this._width&&this._height)){this._width=parseInt(this._$elem.css("width"));this._height=parseInt(this._$elem.css("height"))}if(this._trueCanvas){this._$canvas[0].width=this._width;this._$canvas[0].height=this._height}this._$labelsContainer.css({width:this._width,
-height:this._height})},_getGraphicStyle:function(b){function c(a){a=parseInt(a);return+a+""===a?+a:a}b=g.extend({},this._options.style,b);b.borderRadiusValue=c(b.borderRadius);b.fill=b.fill||b.color;b.doFill=b.fill&&b.fillOpacity>0;b.stroke=b.stroke||b.color;b.strokeWidthValue=c(b.strokeWidth);b.doStroke=b.stroke&&b.strokeOpacity>0&&b.strokeWidthValue>0;b.widthValue=c(b.width);b.heightValue=c(b.height);return b},_drawLines:function(b,c,a){if(!(!b||!b.length||b[0].length<2)){a=this._getGraphicStyle(a);
-var d,f;if(a.visibility!="hidden"&&a.opacity>0){this._context.beginPath();this._context.moveTo(b[0][0][0],b[0][0][1]);for(d=0;d<b.length;d++)for(f=0;f<b[d].length;f++)this._context.lineTo(b[d][f][0],b[d][f][1]);c&&this._context.closePath();if(c&&a.doFill){this._context.fillStyle=a.fill;this._context.globalAlpha=a.opacity*a.fillOpacity;this._context.fill()}if(a.doStroke){this._context.lineCap=this._context.lineJoin="round";this._context.lineWidth=a.strokeWidthValue;this._context.strokeStyle=a.stroke;
-this._context.globalAlpha=a.opacity*a.strokeOpacity;this._context.stroke()}}}}})})(jQuery);
-(function(g,q){var r=function(){for(var b=5,c=document.createElement("div"),a=c.all||[];c.innerHTML="<!--[if gt IE "+ ++b+"]><br><![endif]--\>",a[0];);return b>6?b:!b}();g.widget("geo.geomap",{_$elem:q,_map:q,_created:false,_contentBounds:{},_$resizeContainer:q,_$eventTarget:q,_$contentFrame:q,_$existingChildren:q,_$attrList:q,_$servicesContainer:q,_$panContainer:q,_$shapesContainer:q,_$drawContainer:q,_$measureContainer:q,_$measureLabel:q,_dpi:96,_currentServices:[],_center:q,_pixelSize:q,_centerMax:q,
-_pixelSizeMax:q,_userGeodetic:true,_wheelTimeout:null,_wheelLevel:0,_zoomFactor:2,_fullZoomFactor:2,_partialZoomFactor:1.18920711500273,_mouseDown:q,_inOp:q,_toolPan:q,_shiftZoom:q,_anchor:q,_current:q,_downDate:q,_moveDate:q,_clickDate:q,_lastMove:q,_lastDrag:q,_windowHandler:null,_resizeTimeout:null,_panning:q,_velocity:q,_friction:q,_supportTouch:q,_softDblClick:q,_isTap:q,_isDbltap:q,_isMultiTouch:q,_multiTouchAnchor:q,_multiTouchAnchorBbox:q,_multiTouchCurrentBbox:q,_drawTimeout:null,_drawPixels:[],
-_drawCoords:[],_graphicShapes:[],_initOptions:{},_options:{},options:g.extend({},{bbox:[-180,-85,180,85],bboxMax:[-180,-85,180,85],center:[0,0],cursors:{"static":"default",pan:"url(data:image/vnd.microsoft.icon;base64,AAACAAEAICACAAgACAAwAQAAFgAAACgAAAAgAAAAQAAAAAEAAQAAAAAAAAEAAAAAAAAAAAAAAgAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8AAAA/AAAAfwAAAP+AAAH/gAAB/8AAA//AAAd/wAAGf+AAAH9gAADbYAAA2yAAAZsAAAGbAAAAGAAAAAAAAA//////////////////////////////////////////////////////////////////////////////////////gH///4B///8Af//+AD///AA///wAH//4AB//8AAf//AAD//5AA///gAP//4AD//8AF///AB///5A////5///8=), move",
-zoom:"crosshair",drawPoint:"crosshair",drawLineString:"crosshair",drawPolygon:"crosshair",measureLength:"crosshair",measureArea:"crosshair"},measureLabels:{length:"{{=length.toFixed( 2 )}} m",area:"{{=area.toFixed( 2 )}} sq m"},drawStyle:{},shapeStyle:{},mode:"pan",pannable:true,scroll:"default",services:[{"class":"osm",type:"tiled",src:function(b){return"http://tile.openstreetmap.org/"+b.zoom+"/"+b.tile.column+"/"+b.tile.row+".png"},attr:"&copy; OpenStreetMap &amp; contributors, CC-BY-SA"}],tilingScheme:{tileWidth:256,
-tileHeight:256,levels:18,basePixelSize:156543.03392799935,origin:[-2.0037508342787E7,2.0037508342787E7]},axisLayout:"map",zoom:0,pixelSize:0}),_createWidget:function(b,c){this._$elem=g(c);if(this._$elem.is(".geo-service")){var a=this._$elem.closest(".geo-content-frame");this._$elem.append('<div class="geo-shapes-container" style="position:absolute; left:0; top:0; width:'+a.css("width")+"; height:"+a.css("height")+'; margin:0; padding:0;"></div>');this._$shapesContainer=this._$elem.children(":last")}else{this._$elem.addClass("geo-map");
-this._initOptions=b||{};this._forcePosition(this._$elem);this._$elem.css("text-align","left");a=this._findMapSize();this._contentBounds={x:parseInt(this._$elem.css("padding-left")),y:parseInt(this._$elem.css("padding-top")),width:a.width,height:a.height};this._createChildren();this._center=this._centerMax=[0,0];this.options.pixelSize=this._pixelSize=this._pixelSizeMax=156543.03392799935;this._mouseDown=this._inOp=this._toolPan=this._shiftZoom=this._panning=this._isTap=this._isDbltap=false;this._anchor=
-[0,0];this._current=[0,0];this._lastMove=[0,0];this._lastDrag=[0,0];this._velocity=[0,0];this._friction=[0.8,0.8];this._downDate=this._moveDate=this._clickDate=0;this._drawPixels=[];this._drawCoords=[]}this._graphicShapes=[];g.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this._options=this.options;if(this._$elem.is(".geo-service")){this._map=this._$elem.data("geoMap");this._$shapesContainer.geographics();this._options.shapeStyle=this._$shapesContainer.geographics("option",
-"style")}else{this._map=this;this._softDblClick=(this._supportTouch="ontouchend"in document)||r==7;var b=this,c=this._supportTouch?"touchstart":"mousedown",a=this._supportTouch?"touchend touchcancel":"mouseup",d=this._supportTouch?"touchmove":"mousemove";g(document).keydown(g.proxy(this._document_keydown,this));this._$eventTarget.dblclick(g.proxy(this._eventTarget_dblclick,this));this._$eventTarget.bind(c,g.proxy(this._eventTarget_touchstart,this));c=this._$eventTarget[0].setCapture?this._$eventTarget:
-g(document);c.bind(d,g.proxy(this._dragTarget_touchmove,this));c.bind(a,g.proxy(this._dragTarget_touchstop,this));this._$eventTarget.mousewheel(g.proxy(this._eventTarget_mousewheel,this));this._windowHandler=function(){b._resizeTimeout&&clearTimeout(b._resizeTimeout);b._resizeTimeout=setTimeout(function(){b._created&&b._$elem.geomap("resize")},500)};g(window).resize(this._windowHandler);this._$drawContainer.geographics({style:this._initOptions.drawStyle||{}});this._options.drawStyle=this._$drawContainer.geographics("option",
-"style");this._$shapesContainer.geographics({style:this._initOptions.shapeStyle||{}});this._options.shapeStyle=this._$shapesContainer.geographics("option","style");if(this._initOptions){this._initOptions.tilingScheme&&this._setOption("tilingScheme",this._initOptions.tilingScheme,false);if(this._initOptions.services)this._options.services=g.merge([],this._initOptions.services);this._initOptions.bbox&&this._setOption("bbox",this._initOptions.bbox,false);this._initOptions.center&&this._setOption("center",
-this._initOptions.center,false);this._initOptions.zoom!==q&&this._setZoom(this._initOptions.zoom,false,false)}g.template("geoMeasureLength",this._options.measureLabels.length);g.template("geoMeasureArea",this._options.measureLabels.area);this._$eventTarget.css("cursor",this._options.cursors[this._options.mode]);this._createServices();this._refresh();this._created=true}},_setOption:function(b,c,a){if(b!="pixelSize"){a=a===q||a;this._$elem.is(".geo-map")&&this._panFinalize();switch(b){case "bbox":if(this._userGeodetic=
-g.geo.proj&&g.geo._isGeodetic(c))c=g.geo.proj.fromGeodetic(c);this._setBbox(c,false,a);c=this._getBbox();break;case "center":if(this._userGeodetic=g.geo.proj&&g.geo._isGeodetic(c))c=g.geo.proj.fromGeodetic(c);this._setCenterAndSize(c,this._pixelSize,false,a);break;case "measureLabels":c=g.extend(this._options.measureLabels,c);g.template("geoMeasureLength",c.length);g.template("geoMeasureArea",c.area);break;case "drawStyle":if(this._$drawContainer){this._$drawContainer.geographics("option","style",
-c);c=this._$drawContainer.geographics("option","style")}break;case "shapeStyle":if(this._$shapesContainer){this._$shapesContainer.geographics("option","style",c);c=this._$shapesContainer.geographics("option","style")}break;case "mode":this._resetDrawing();this._$eventTarget.css("cursor",this._options.cursors[c]);break;case "zoom":this._setZoom(c,false,a)}g.Widget.prototype._setOption.apply(this,arguments);switch(b){case "bbox":case "center":if(this._userGeodetic){this._options.bbox=g.geo.proj.toGeodetic(this._options.bbox);
-this._options.center=g.geo.proj.toGeodetic(this._center)}break;case "tilingScheme":if(c!=null){this._pixelSizeMax=this._getPixelSize(0);this._centerMax=[c.origin[0]+this._pixelSizeMax*c.tileWidth/2,c.origin[1]+this._pixelSizeMax*c.tileHeight/2]}break;case "bboxMax":this._pixelSizeMax=this._getPixelSize(0);this._centerMax=g.geo.proj&&g.geo._isGeodetic(c)?g.geo.center(g.geo.proj.fromGeodetic(c)):g.geo.center(c);break;case "services":this._createServices();a&&this._refresh();break;case "shapeStyle":if(a){this._$shapesContainer.geographics("clear");
-this._refreshShapes(this._$shapesContainer,this._graphicShapes,this._graphicShapes,this._graphicShapes)}}}},destroy:function(){if(this._$elem.is(".geo-service")){this._$shapesContainer.geographics("destroy");this._$shapesContainer=q}else{this._created=false;g(window).unbind("resize",this._windowHandler);for(var b=0;b<this._currentServices.length;b++){this._currentServices[b].serviceContainer.geomap("destroy");g.geo._serviceTypes[this._currentServices[b].type].destroy(this,this._$servicesContainer,
-this._currentServices[b])}this._$shapesContainer.geographics("destroy");this._$shapesContainer=q;this._$drawContainer.geographics("destroy");this._$drawContainer=q;this._$existingChildren.detach();this._$elem.html("");this._$elem.append(this._$existingChildren);this._$elem.removeClass("geo-map")}g.Widget.prototype.destroy.apply(this,arguments)},toMap:function(b){b=this._toMap(b);return this._userGeodetic?g.geo.proj.toGeodetic(b):b},toPixel:function(b,c,a){return this._toPixel(g.geo.proj?g.geo.proj.fromGeodetic(b):
-b,c,a)},opacity:function(b,c){if(this._$elem.is(".geo-service"))this._$elem.closest(".geo-map").geomap("opacity",b,this._$elem);else if(b>=0||b<=1)for(var a=0;a<this._currentServices.length;a++){var d=this._currentServices[a];if(!c||d.serviceContainer[0]==c[0]){d.style.opacity=b;g.geo._serviceTypes[d.type].opacity(this,d)}}},toggle:function(b,c){if(this._$elem.is(".geo-service"))this._$elem.closest(".geo-map").geomap("toggle",b,this._$elem);else for(var a=0;a<this._currentServices.length;a++){var d=
-this._currentServices[a];if(!c||d.serviceContainer[0]==c[0]){if(b===q)b=d.style.visibility!=="visible";d.style.visibility=b?"visible":"hidden";d.serviceContainer.toggle(b);b&&g.geo._serviceTypes[d.type].refresh(this,d)}}},zoom:function(b){b!=null&&this._setZoom(this._options.zoom+b,false,true)},refresh:function(){this._refresh()},resize:function(){var b=this._findMapSize(),c=b.width/2-this._contentBounds.width/2,a=b.height/2-this._contentBounds.height/2,d;this._contentBounds={x:parseInt(this._$elem.css("padding-left")),
-y:parseInt(this._$elem.css("padding-top")),width:b.width,height:b.height};this._$resizeContainer.css({width:b.width,height:b.height});for(d=0;d<this._currentServices.length;d++)g.geo._serviceTypes[this._currentServices[d].type].resize(this,this._currentServices[d]);this._$elem.find(".geo-graphics").css({width:b.width,height:b.height}).geographics("resize");for(d=0;d<this._drawPixels.length;d++){this._drawPixels[d][0]+=c;this._drawPixels[d][1]+=a}this._setCenterAndSize(this._center,this._pixelSize,
-false,true)},append:function(b){if(b&&g.isPlainObject(b)){var c,a,d,f,e,l;c=b.type=="FeatureCollection"?b.features:g.isArray(b)?b:[b];for(d=1;d<arguments.length;d++){a=arguments[d];if(typeof a==="object")f=a;else if(typeof a==="number"||typeof a==="string")e=a;else if(typeof a==="boolean")l=a}for(d=0;d<c.length;d++){if(c[d].type!="Point"){a=g.geo.bbox(c[d]);if(g.geo.proj&&g.geo._isGeodetic(a))a=g.geo.proj.fromGeodetic(a);g.data(c[d],"geoBbox",a)}this._graphicShapes.push({shape:c[d],style:f,label:e})}if(l===
-q||l)this._refresh()}},empty:function(b){for(var c=0;c<this._graphicShapes.length;c++)g.removeData(this._graphicShapes[c].shape,"geoBbox");this._graphicShapes=[];if(b===q||b)this._refresh()},find:function(b,c){var a=g.isPlainObject(b);a&&this._map.toPixel(b.coordinates);for(var d=this._map._pixelSize*c,f=[],e,l,m,n=0;n<this._graphicShapes.length;n++){e=this._graphicShapes[n];if(a)if(e.shape.type=="Point")g.geo.distance(e.shape,b)<=d&&f.push(e.shape);else{l=g.data(e.shape,"geoBbox");l={type:"Polygon",
-coordinates:[[[l[0],l[1]],[l[0],l[3]],[l[2],l[3]],[l[2],l[1]],[l[0],l[1]]]]};m={type:"Point",coordinates:g.geo.proj&&g.geo._isGeodetic(b.coordinates)?g.geo.proj.fromGeodetic(b.coordinates):b.coordinates};if(g.geo.distance(l,m,true)<=d){l=g.geo._flatten(e.shape);for(m=0;m<l.length;m++)if(g.geo.distance(l[m],b)<=d){f.push(e.shape);break}}}else f.push(e.shape)}this._$elem.is(".geo-map")&&this._$elem.find(".geo-service").each(function(){f=g.merge(f,g(this).geomap("find",b,c))});return f},remove:function(b,
-c){for(var a=0;a<this._graphicShapes.length;a++)if(this._graphicShapes[a].shape==b){g.removeData(b,"geoBbox");var d=this._graphicShapes.slice(a+1);this._graphicShapes.length=a;this._graphicShapes.push.apply(this._graphicShapes,d);break}if(c===q||c)this._refresh()},_getBbox:function(b,c){b=b||this._center;c=c||this._pixelSize;var a=this._contentBounds.width/2*c,d=this._contentBounds.height/2*c;return[b[0]-a,b[1]-d,b[0]+a,b[1]+d]},_setBbox:function(b,c,a){var d=[b[0]+(b[2]-b[0])/2,b[1]+(b[3]-b[1])/
-2];b=Math.max(g.geo.width(b,true)/this._contentBounds.width,g.geo.height(b,true)/this._contentBounds.height);if(this._options.tilingScheme)b=this._getPixelSize(this._getZoom(d,b));else if(this._getZoom(d,b)<0)b=this._pixelSizeMax;this._setCenterAndSize(d,b,c,a)},_getBboxMax:function(){var b=this._contentBounds.width/2*this._pixelSizeMax,c=this._contentBounds.height/2*this._pixelSizeMax;return[this._centerMax[0]-b,this._centerMax[1]-c,this._centerMax[0]+b,this._centerMax[1]+c]},_getCenter:function(){return this._center},
-_getContentBounds:function(){return this._contentBounds},_getServicesContainer:function(){return this._$servicesContainer},_getZoom:function(b,c){b=b||this._center;c=c||this._pixelSize;var a=this._options.tilingScheme;if(a)if(a.pixelSizes!=null){for(var d=Math.floor(c*1E3),f=a.pixelSizes.length-1;f>=0;f--)if(Math.floor(a.pixelSizes[f]*1E3)>=d)return f;return 0}else return Math.max(Math.round(Math.log(a.basePixelSize/c)/Math.log(2)),0);else{d=this._contentBounds.width/this._contentBounds.height;a=
-g.geo.reaspect(this._getBbox(b,c),d,true);d=g.geo.reaspect(this._getBboxMax(),d,true);return Math.max(Math.round(Math.log(g.geo.width(d,true)/g.geo.width(a,true))/Math.log(this._zoomFactor)),0)}},_setZoom:function(b,c,a){b=Math.max(b,0);this._setCenterAndSize(this._center,this._getPixelSize(b),c,a)},_createChildren:function(){this._$existingChildren=this._$elem.children().detach();this._forcePosition(this._$existingChildren);this._$existingChildren.css("-moz-user-select","none");var b="width:"+this._contentBounds.width+
-"px; height:"+this._contentBounds.height+"px; margin:0; padding:0;";this._$elem.prepend('<div class="geo-event-target geo-content-frame" style="position:absolute; left:'+this._contentBounds.x+"px; top:"+this._contentBounds.y+"px;"+b+'overflow:hidden; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none;" unselectable="on"></div>');this._$eventTarget=this._$contentFrame=this._$elem.children(":first");this._$contentFrame.append('<div class="geo-services-container" style="position:absolute; left:0; top:0;'+
-b+'"></div>');this._$servicesContainer=this._$contentFrame.children(":last");this._$contentFrame.append('<div class="geo-shapes-container" style="position:absolute; left:0; top:0;'+b+'"></div>');this._$shapesContainer=this._$contentFrame.children(":last");this._$contentFrame.append('<ul style="position: absolute; bottom: 8px; left: 8px; list-style-type: none; max-width: 50%; padding: 0; margin: 0;"></ul>');this._$attrList=this._$contentFrame.children(":last");this._$contentFrame.append('<div class="geo-draw-container" style="position:absolute; left:0; top:0;'+
-b+'"></div>');this._$drawContainer=this._$contentFrame.children(":last");this._$contentFrame.append('<div class="geo-measure-container" style="position:absolute; left:0; top:0;'+b+'"><div class="geo-measure-label" style="position:absolute; left:0; top:0;; display: none;"></div></div>');this._$measureContainer=this._$contentFrame.children(":last");this._$measureLabel=this._$measureContainer.children();this._$panContainer=g([this._$shapesContainer[0],this._$drawContainer[0],this._$measureContainer[0]]);
-this._$resizeContainer=g([this._$contentFrame[0],this._$servicesContainer[0],this._$eventTarget[0],this._$measureContainer[0]]);this._$contentFrame.append(this._$existingChildren);g("#geo-measure-style").length||g("head").prepend('<style type="text/css" id="geo-measure-style">.geo-measure-label { margin: 4px 0 0 6px; font-family: sans-serif;'+(r?"letter-spacing: 2px; color: #444; filter:progid:DXImageTransform.Microsoft.DropShadow(Color=white, OffX=1, OffY=2, Positive=true);":"color: #000; text-shadow: #fff 1px 2px; font-weight: bold;")+
-" }</style>")},_createServices:function(){var b,c;for(c=0;c<this._currentServices.length;c++){this._currentServices[c].serviceContainer.geomap("destroy");g.geo._serviceTypes[this._currentServices[c].type].destroy(this,this._$servicesContainer,this._currentServices[c])}this._currentServices=[];this._$servicesContainer.html("");this._$attrList.html("");for(c=0;c<this._options.services.length;c++){b=this._currentServices[c]=g.extend({},this._options.services[c]);b.style=g.extend({visibility:"visible",
-opacity:1},b.style);this._$servicesContainer.append("<div "+(b.id?' id="'+b.id+'"':"")+('class="geo-service '+(b["class"]?b["class"]:"")+'"')+' style="position:absolute; left:0; top:0; width:32px; height:32px; margin:0; padding:0; display:'+(b.style.visibility==="visible"?"block":"none")+';"></div>');serviceContainer=this._$servicesContainer.children(":last");this._currentServices[c].serviceContainer=serviceContainer;g.geo._serviceTypes[b.type].create(this,serviceContainer,b,c);serviceContainer.data("geoMap",
-this).geomap();b.attr&&this._$attrList.append("<li>"+b.attr+"</li>")}this._$attrList.find("a").css({position:"relative",zIndex:100})},_refreshDrawing:function(){this._$drawContainer.geographics("clear");if(this._drawPixels.length>0){var b=this._options.mode,c=this._drawPixels,a=this._drawCoords,d,f;switch(b){case "measureLength":b="drawLineString";f={type:"LineString",coordinates:a};d=g.render({length:g.geo.length(f,true)},"geoMeasureLength");f=g.merge([],c[c.length-1]);break;case "measureArea":b=
-"drawPolygon";f={type:"Polygon",coordinates:[g.merge([],a)]};f.coordinates[0].push(a[0]);d=g.render({area:g.geo.area(f,true)},"geoMeasureArea");f=g.merge([],c[c.length-1]);c=[c];break;case "drawPolygon":c=[c]}this._$drawContainer.geographics(b,c);if(d){this._$measureLabel.html(d);b=this._contentBounds.width-(this._$measureLabel.outerWidth(true)+f[0]);c=this._contentBounds.height-(this._$measureLabel.outerHeight(true)+f[1]);if(b<0)f[0]+=b;if(c<0)f[1]+=c;this._$measureLabel.css({left:f[0],top:f[1]}).show()}}},
-_resetDrawing:function(){this._drawPixels=[];this._drawCoords=[];this._$drawContainer.geographics("clear");this._$measureLabel.hide()},_refreshShapes:function(b,c,a,d,f,e){var l,m,n,t,u,w,B,I=this._map._getBbox(f,e);for(l=0;l<c.length;l++){n=c[l].shape||c[l];n=n.geometry||n;m=g.data(n,"geoBbox");if(!(m&&g.geo._bboxDisjoint(I,m))){t=g.isArray(a)?a[l].style:a;u=g.isArray(d)?d[l].label:d;w=u!==q;B=q;switch(n.type){case "Point":B=this._map.toPixel(n.coordinates,f,e);this._$shapesContainer.geographics("drawPoint",
-B,t);break;case "LineString":this._$shapesContainer.geographics("drawLineString",this._map.toPixel(n.coordinates,f,e),t);if(w)B=this._map.toPixel(g.geo.pointAlong(n,0.5).coordinates,f,e);break;case "Polygon":this._$shapesContainer.geographics("drawPolygon",this._map.toPixel(n.coordinates,f,e),t);if(w)B=this._map.toPixel(g.geo.centroid(n).coordinates,f,e);break;case "MultiPoint":for(m=0;m<n.coordinates.length;m++)this._$shapesContainer.geographics("drawPoint",this._map.toPixel(n.coordinates[m],f,e),
-t);if(w)B=this._map.toPixel(g.geo.centroid(n).coordinates,f,e);break;case "MultiLineString":for(m=0;m<n.coordinates.length;m++)this._$shapesContainer.geographics("drawLineString",this._map.toPixel(n.coordinates[m],f,e),t);if(w)B=this._map.toPixel(g.geo.centroid(n).coordinates,f,e);break;case "MultiPolygon":for(m=0;m<n.coordinates.length;m++)this._$shapesContainer.geographics("drawPolygon",this._map.toPixel(n.coordinates[m],f,e),t);if(w)B=this._map.toPixel(g.geo.centroid(n).coordinates,f,e);break;
-case "GeometryCollection":this._refreshShapes(b,n.geometries,t,u,f,e)}w&&B&&this._$shapesContainer.geographics("drawLabel",B,u)}}},_findMapSize:function(){for(var b={width:0,height:0},c=this._$elem;c.size()&&!(b.width>0&&b.height>0);){b={width:c.width(),height:c.height()};if(b.width<=0||b.height<=0)b={width:parseInt(c.css("width")),height:parseInt(c.css("height"))};c=c.parent()}return b},_forcePosition:function(b){var c=b.css("position");c!="relative"&&c!="absolute"&&c!="fixed"&&b.css("position",
-"relative")},_getPixelSize:function(b){var c=this._options.tilingScheme;if(c!=null){if(b===0)return c.pixelSizes!=null?c.pixelSizes[0]:c.basePixelSize;b=Math.round(b);b=Math.max(b,0);b=Math.min(b,(c.pixelSizes!=null?c.pixelSizes.length:c.levels)-1);return c.pixelSizes!=null?c.pixelSizes[b]:c.basePixelSize/Math.pow(2,b)}else{b=g.geo.scaleBy(this._getBboxMax(),1/Math.pow(this._zoomFactor,b),true);return Math.max(g.geo.width(b,true)/this._contentBounds.width,g.geo.height(b,true)/this._contentBounds.height)}},
-_getZoomCenterAndSize:function(b,c,a){c=Math.pow(a?this._fullZoomFactor:this._partialZoomFactor,-c);if(this._options.tilingScheme){c=this._getZoom(this._center,this._pixelSize*c);c=this._getPixelSize(c)}else{c=this._pixelSize*c;if(this._getZoom(this._center,c)<0)c=this._pixelSizeMax}a=c/this._pixelSize;b=this._toMap(b);a=[(this._center[0]-b[0])*a,(this._center[1]-b[1])*a];return{pixelSize:c,center:[b[0]+a[0],b[1]+a[1]]}},_mouseWheelFinish:function(){this._wheelTimeout=null;if(this._wheelLevel!=0){var b=
-this._getZoomCenterAndSize(this._anchor,this._wheelLevel,this._options.tilingScheme!=null);this._setCenterAndSize(b.center,b.pixelSize,true,true);this._wheelLevel=0}else this._refresh()},_panEnd:function(){this._velocity=[this._velocity[0]>0?Math.floor(this._velocity[0]*this._friction[0]):Math.ceil(this._velocity[0]*this._friction[0]),this._velocity[1]>0?Math.floor(this._velocity[1]*this._friction[1]):Math.ceil(this._velocity[1]*this._friction[1])];if(Math.abs(this._velocity[0])<4&&Math.abs(this._velocity[1])<
-4)this._panFinalize();else{this._current=[this._current[0]+this._velocity[0],this._current[1]+this._velocity[1]];this._panMove();setTimeout(g.proxy(this._panEnd,this),30)}},_panFinalize:function(){if(this._panning){this._velocity=[0,0];var b=-(this._current[0]-this._anchor[0])*this._pixelSize,c=(this._options.axisLayout==="image"?-1:1)*(this._current[1]-this._anchor[1])*this._pixelSize;this._$panContainer.css({left:0,top:0});this._$servicesContainer.find(".geo-shapes-container").css({left:0,top:0});
-this._setCenterAndSize([this._center[0]+b,this._center[1]+c],this._pixelSize,true,true);this._$eventTarget.css("cursor",this._options.cursors[this._options.mode]);this._inOp=false;this._anchor=this._current;this._mouseDown=this._toolPan=this._panning=false}},_panMove:function(){if(this._options.pannable){var b=this._current[0]-this._lastDrag[0],c=this._current[1]-this._lastDrag[1],a=0,d,f;if(this._toolPan||b>3||b<-3||c>3||c<-3){if(!this._toolPan){this._toolPan=true;this._$eventTarget.css("cursor",
-this._options.cursors.pan)}if(this._mouseDown)this._velocity=[b,c];if(b!=0||c!=0){this._panning=true;this._lastDrag=this._current;f={left:function(e,l){return parseInt(l)+b},top:function(e,l){return parseInt(l)+c}};for(a=0;a<this._currentServices.length;a++){d=this._currentServices[a];g.geo._serviceTypes[d.type].interactivePan(this,d,b,c);d.serviceContainer.find(".geo-shapes-container").css(f)}this._$panContainer.css(f)}}}},_refresh:function(){var b,c=0;if(this._$elem.is(".geo-map"))for(;c<this._currentServices.length;c++){b=
-this._currentServices[c];if(!this._mouseDown&&g.geo._serviceTypes[b.type]!==null){g.geo._serviceTypes[b.type].refresh(this,b);b.serviceContainer.geomap("refresh")}}if(this._$shapesContainer){this._$shapesContainer.geographics("clear");this._graphicShapes.length>0&&this._refreshShapes(this._$shapesContainer,this._graphicShapes,this._graphicShapes,this._graphicShapes)}},_setCenterAndSize:function(b,c,a,d){if(!(!g.isArray(b)||b.length!=2||typeof b[0]!=="number"||typeof b[1]!=="number")){if(this._pixelSize!=
-c){this._$elem.find(".geo-shapes-container").geographics("clear");for(var f=0;f<this._currentServices.length;f++){var e=this._currentServices[f];g.geo._serviceTypes[e.type].interactiveScale(this,e,b,c)}}this._center=g.merge([],b);this._options.pixelSize=this._pixelSize=c;if(this._userGeodetic){this._options.bbox=g.geo.proj.toGeodetic(this._getBbox());this._options.center=g.geo.proj.toGeodetic(this._center)}else{this._options.bbox=this._getBbox();this._options.center=g.merge([],b)}this._options.zoom=
-this._getZoom();if(this._drawCoords.length>0)this._drawPixels=this._toPixel(this._drawCoords);a&&this._trigger("bboxchange",window.event,{bbox:g.merge([],this._options.bbox)});if(d){this._refresh();this._refreshDrawing()}}},_toMap:function(b,c,a){c=c||this._center;a=a||this._pixelSize;var d=g.isArray(b[0]),f=d&&g.isArray(b[0][0]),e=f&&g.isArray(b[0][0][0]),l=this._contentBounds.width,m=this._contentBounds.height,n=l/2*a;a=m/2*a;c=[c[0]-n,c[1]-a,c[0]+n,c[1]+a];l=g.geo.width(c,true)/l;m=g.geo.height(c,
-true)/m;a=this._options.axisLayout==="image";var t=[],u,w,B;if(!e){if(!f){d||(b=[b]);b=[b]}b=[b]}for(u=0;u<b.length;u++){t[u]=[];for(w=0;w<b[u].length;w++){t[u][w]=[];for(B=0;B<b[u][w].length;B++){n=b[u][w][B][1]*m;t[u][w][B]=[c[0]+b[u][w][B][0]*l,a?c[1]+n:c[3]-n]}}}return e?t:f?t[0]:d?t[0][0]:t[0][0][0]},_toPixel:function(b,c,a){c=c||this._center;a=a||this._pixelSize;var d=g.isArray(b[0]),f=d&&g.isArray(b[0][0]),e=f&&g.isArray(b[0][0][0]),l=this._contentBounds.width,m=this._contentBounds.height,
-n=l/2*a;a=m/2*a;c=[c[0]-n,c[1]-a,c[0]+n,c[1]+a];var t=g.geo.width(c,true);a=g.geo.height(c,true);n=this._options.axisLayout==="image";l=l/t;m=m/a;a=[];var u,w;if(!e){if(!f){d||(b=[b]);b=[b]}b=[b]}for(t=0;t<b.length;t++){a[t]=[];for(u=0;u<b[t].length;u++){a[t][u]=[];for(w=0;w<b[t][u].length;w++)a[t][u][w]=[Math.round((b[t][u][w][0]-c[0])*l),Math.round((n?b[t][u][w][1]-c[1]:c[3]-b[t][u][w][1])*m)]}}return e?a:f?a[0]:d?a[0][0]:a[0][0][0]},_zoomTo:function(b,c,a,d){c=c<0?0:c;c=this._getPixelSize(c);this._setCenterAndSize(b,
-c,a,d)},_document_keydown:function(b){var c=this._drawCoords.length;if(c>0&&b.which==27)if(c<=2){this._resetDrawing();this._inOp=false}else{this._drawCoords[c-2]=g.merge([],this._drawCoords[c-1]);this._drawPixels[c-2]=g.merge([],this._drawPixels[c-1]);this._drawCoords.length--;this._drawPixels.length--;this._refreshDrawing()}},_eventTarget_dblclick_zoom:function(b){this._trigger("dblclick",b,{type:"Point",coordinates:this.toMap(this._current)});if(!b.isDefaultPrevented()){b=this._getZoomCenterAndSize(this._current,
-1,true);this._setCenterAndSize(b.center,b.pixelSize,true,true)}},_eventTarget_dblclick:function(b){if(this._options.mode!=="static"){this._panFinalize();if(this._drawTimeout){window.clearTimeout(this._drawTimeout);this._drawTimeout=null}g(b.currentTarget).offset();switch(this._options.mode){case "drawLineString":if(this._drawCoords.length>1&&!(this._drawCoords[0][0]==this._drawCoords[1][0]&&this._drawCoords[0][1]==this._drawCoords[1][1])){this._drawCoords.length--;this._trigger("shape",b,{type:"LineString",
-coordinates:this._userGeodetic?g.geo.proj.toGeodetic(this._drawCoords):this._drawCoords})}else this._eventTarget_dblclick_zoom(b);this._resetDrawing();break;case "drawPolygon":if(this._drawCoords.length>1&&!(this._drawCoords[0][0]==this._drawCoords[1][0]&&this._drawCoords[0][1]==this._drawCoords[1][1])){var c=this._drawCoords.length-1;if(c>2){this._drawCoords[c]=g.merge([],this._drawCoords[0]);this._trigger("shape",b,{type:"Polygon",coordinates:[this._userGeodetic?g.geo.proj.toGeodetic(this._drawCoords):
-this._drawCoords]})}}else this._eventTarget_dblclick_zoom(b);this._resetDrawing();break;case "measureLength":case "measureArea":this._resetDrawing();break;default:this._eventTarget_dblclick_zoom(b)}this._inOp=false}},_eventTarget_touchstart:function(b){if(this._options.mode!=="static")if(!(!this._supportTouch&&b.which!=1)){this._panFinalize();this._mouseWheelFinish();var c=g(b.currentTarget).offset(),a=b.originalEvent.changedTouches;if(this._supportTouch){this._multiTouchAnchor=g.merge([],a);if(this._isMultiTouch=
-this._multiTouchAnchor.length>1){this._multiTouchCurrentBbox=[a[0].pageX-c.left,a[0].pageY-c.top,a[1].pageX-c.left,a[1].pageY-c.top];this._multiTouchAnchorBbox=g.merge([],this._multiTouchCurrentBbox);this._current=g.geo.center(this._multiTouchCurrentBbox,true)}else{this._multiTouchCurrentBbox=[a[0].pageX-c.left,a[0].pageY-c.top,NaN,NaN];this._current=[a[0].pageX-c.left,a[0].pageY-c.top]}}else this._current=[b.pageX-c.left,b.pageY-c.top];if(this._softDblClick){c=g.now();if(c-this._downDate<750){if(this._isTap){a=
-this._current[0]-this._anchor[0];var d=this._current[1]-this._anchor[1];if(Math.sqrt(a*a+d*d)>8)this._isTap=false;else this._current=g.merge([],this._anchor)}this._isDbltap=this._isDbltap?false:this._isTap}else this._isDbltap=false;this._isTap=true;this._downDate=c}this._mouseDown=true;this._anchor=g.merge([],this._current);if(!this._inOp&&b.shiftKey){this._shiftZoom=true;this._$eventTarget.css("cursor",this._options.cursors.zoom)}else if(!this._isMultiTouch&&this._options.pannable){this._inOp=true;
-switch(this._options.mode){case "zoom":break;default:this._lastDrag=this._current;b.currentTarget.setCapture&&b.currentTarget.setCapture()}}b.preventDefault();return false}},_dragTarget_touchmove:function(b){if(this._options.mode!=="static"){var c=this._$eventTarget.offset(),a=this._drawCoords.length,d=b.originalEvent.changedTouches,f;f=0;if(this._supportTouch){if(!this._isMultiTouch&&d[0].identifier!==this._multiTouchAnchor[0].identifier){this._mouseDown=false;this._dragTarget_touchstop(b);this._isMultiTouch=
-true;this._multiTouchAnchor.push(d[0]);this._multiTouchCurrentBbox=[this._multiTouchCurrentBbox[0],this._multiTouchCurrentBbox[1],this._multiTouchAnchor[1].pageX-c.left,this._multiTouchAnchor[1].pageY-c.top];this._multiTouchAnchorBbox=g.merge([],this._multiTouchCurrentBbox);this._mouseDown=true;this._anchor=this._current=g.geo.center(this._multiTouchCurrentBbox,true);return false}if(this._isMultiTouch){for(;f<d.length;f++)if(d[f].identifier===this._multiTouchAnchor[0].identifier){this._multiTouchCurrentBbox[0]=
-d[f].pageX-c.left;this._multiTouchCurrentBbox[1]=d[f].pageY-c.top}else if(d[f].identifier===this._multiTouchAnchor[1].identifier){this._multiTouchCurrentBbox[2]=d[f].pageX-c.left;this._multiTouchCurrentBbox[3]=d[f].pageY-c.top}g.geo.center(this._multiTouchCurrentBbox,true);f=this._multiTouchCurrentBbox[2]-this._multiTouchCurrentBbox[0];c=this._multiTouchAnchorBbox[2]-this._multiTouchAnchorBbox[0];this._wheelLevel=Math.abs(Math.floor((1-f/c)*10));if(Math.abs(f)<Math.abs(c))this._wheelLevel=-this._wheelLevel;
-d=this._getZoomCenterAndSize(this._anchor,this._wheelLevel,false);this._$elem.find(".geo-shapes-container").geographics("clear");for(f=0;f<this._currentServices.length;f++){c=this._currentServices[f];g.geo._serviceTypes[c.type].interactiveScale(this,c,d.center,d.pixelSize)}this._graphicShapes.length>0&&this._graphicShapes.length<256&&this._refreshShapes(this._$shapesContainer,this._graphicShapes,this._graphicShapes,this._graphicShapes,d.center,d.pixelSize);if(this._drawCoords.length>0){this._drawPixels=
-this._toPixel(this._drawCoords,d.center,d.pixelSize);this._refreshDrawing()}f=g.geo.center(this._multiTouchCurrentBbox,true)}else f=[b.originalEvent.changedTouches[0].pageX-c.left,b.originalEvent.changedTouches[0].pageY-c.top]}else f=[b.pageX-c.left,b.pageY-c.top];if(f[0]===this._lastMove[0]&&f[1]===this._lastMove[1])if(this._inOp){b.preventDefault();return false}if(r==7)this._isDbltap=this._isTap=false;if(this._mouseDown){this._current=f;this._moveDate=g.now()}if(this._isMultiTouch){b.preventDefault();
-return this._isDbltap=this._isTap=false}switch(this._shiftZoom?"zoom":this._options.mode){case "zoom":if(this._mouseDown){this._$drawContainer.geographics("clear");this._$drawContainer.geographics("drawBbox",[this._anchor[0],this._anchor[1],f[0],f[1]])}else this._trigger("move",b,{type:"Point",coordinates:this.toMap(f)});break;case "drawLineString":case "drawPolygon":case "measureLength":case "measureArea":if(this._mouseDown||this._toolPan)this._panMove();else{if(a>0){this._drawCoords[a-1]=this._toMap(f);
-this._drawPixels[a-1]=f;this._refreshDrawing()}this._trigger("move",b,{type:"Point",coordinates:this.toMap(f)})}break;default:this._mouseDown||this._toolPan?this._panMove():this._trigger("move",b,{type:"Point",coordinates:this.toMap(f)})}this._lastMove=f;if(this._inOp){b.preventDefault();return false}}},_dragTarget_touchstop:function(b){if(this._options.mode!=="static"){!this._mouseDown&&r==7&&this._eventTarget_touchstart(b);var c=this._mouseDown,a=this._toolPan,d=this._$eventTarget.offset(),f=this._shiftZoom?
-"zoom":this._options.mode,e,l;e=this._supportTouch?[b.originalEvent.changedTouches[0].pageX-d.left,b.originalEvent.changedTouches[0].pageY-d.top]:[b.pageX-d.left,b.pageY-d.top];if(this._softDblClick)if(this._isTap){d=e[0]-this._anchor[0];l=e[1]-this._anchor[1];if(Math.sqrt(d*d+l*l)<=8)e=g.merge([],this._anchor)}d=e[0]-this._anchor[0];l=e[1]-this._anchor[1];this._$eventTarget.css("cursor",this._options.cursors[this._options.mode]);this._shiftZoom=this._mouseDown=this._toolPan=false;if(this._isMultiTouch){b.preventDefault();
-this._isMultiTouch=false;c=this._getZoomCenterAndSize(this._anchor,this._wheelLevel,false);this._setCenterAndSize(c.center,c.pixelSize,true,true);this._wheelLevel=0;return false}document.releaseCapture&&document.releaseCapture();if(c){c=g.now();this._current=e;switch(f){case "zoom":if(d>0||l>0){a=this._pixelSize*6;f=this._toMap([[Math.min(this._anchor[0],e[0]),Math.max(this._anchor[1],e[1])],[Math.max(this._anchor[0],e[0]),Math.min(this._anchor[1],e[1])]]);f=[f[0][0],f[0][1],f[1][0],f[1][1]];if(f[2]-
-f[0]<a&&f[3]-f[1]<a)f=g.geo.scaleBy(this._getBbox(g.geo.center(f,true)),0.5,true);this._setBbox(f,true,true)}this._resetDrawing();break;case "drawPoint":if(this._drawTimeout){window.clearTimeout(this._drawTimeout);this._drawTimeout=null}if(a)this._panFinalize();else if(c-this._clickDate>100){var m=this;this._drawTimeout=setTimeout(function(){if(m._drawTimeout){m._trigger("shape",b,{type:"Point",coordinates:m.toMap(e)});m._inOp=false;m._drawTimeout=null}},250)}break;case "drawLineString":case "drawPolygon":case "measureLength":case "measureArea":if(a)this._panFinalize();
-else{a=this._drawCoords.length==0?0:this._drawCoords.length-1;this._drawCoords[a]=this._toMap(e);this._drawPixels[a]=e;if(a<2||!(this._drawCoords[a][0]==this._drawCoords[a-1][0]&&this._drawCoords[a][1]==this._drawCoords[a-1][1])){this._drawCoords[a+1]=this._toMap(e);this._drawPixels[a+1]=e}this._refreshDrawing()}break;default:if(a)this._panEnd();else if(c-this._clickDate>100){this._trigger("click",b,{type:"Point",coordinates:this.toMap(e)});this._inOp=false}}this._clickDate=c;if(this._softDblClick&&
-this._isDbltap){this._isDbltap=this._isTap=false;this._$eventTarget.trigger("dblclick",b)}}if(this._inOp){b.preventDefault();return false}}},_eventTarget_mousewheel:function(b,c){if(!(this._options.mode==="static"||this._options.scroll==="off")){b.preventDefault();this._panFinalize();if(this._mouseDown)return false;if(c!=0){if(this._wheelTimeout){window.clearTimeout(this._wheelTimeout);this._wheelTimeout=null}else{var a=g(b.currentTarget).offset();this._anchor=[b.pageX-a.left,b.pageY-a.top]}this._wheelLevel+=
-c;a=this._getZoomCenterAndSize(this._anchor,this._wheelLevel,this._options.tilingScheme!=null);var d,f=0;for(this._$elem.find(".geo-shapes-container").geographics("clear");f<this._currentServices.length;f++){d=this._currentServices[f];g.geo._serviceTypes[d.type].interactiveScale(this,d,a.center,a.pixelSize)}this._graphicShapes.length>0&&this._graphicShapes.length<256&&this._refreshShapes(this._$shapesContainer,this._graphicShapes,this._graphicShapes,this._graphicShapes,a.center,a.pixelSize);if(this._drawCoords.length>
-0){this._drawPixels=this._toPixel(this._drawCoords,a.center,a.pixelSize);this._refreshDrawing()}var e=this;this._wheelTimeout=window.setTimeout(function(){e._mouseWheelFinish()},1E3)}return false}}})})(jQuery);
-(function(g,q){g.geo._serviceTypes.tiled=function(){return{create:function(r,b,c){r=g.data(c,"geoServiceState");if(!r){r={loadCount:0,reloadTiles:false};b.append('<div data-geo-service="tiled" style="position:absolute; left:0; top:0; width:8px; height:8px; margin:0; padding:0;"></div>');r.serviceContainer=b.children(":last");g.data(c,"geoServiceState",r)}return r.serviceContainer},destroy:function(r,b,c){g.data(c,"geoServiceState").serviceContainer.remove();g.removeData(c,"geoServiceState")},interactivePan:function(r,
-b,c,a){var d=g.data(b,"geoServiceState");if(d){this._cancelUnloaded(r,b);d.serviceContainer.children().css("-moz-transition","").css({webkitTransition:"",transition:"",left:function(R,U){return parseInt(U)+c},top:function(R,U){return parseInt(U)+a}});if(b&&b.style.visibility==="visible"){var f=r._pixelSize,e=this,l=d.serviceContainer,m=l.children("[data-pixelSize='"+f+"']"),n=r._getContentBounds(),t=r.options.axisLayout==="image",u=t?+1:-1,w=r.options.tilingScheme,B=w.tileWidth,I=w.tileHeight,F=n.width/
-2*f,y=n.height/2*f,K=m.position(),D=m.data("scaleOrigin").split(",");n=parseInt(D[0])-K.left;K=parseInt(D[1])-K.top;var J=r._getCenter();D=[J[0]+n*f,J[1]+u*K*f];var P=Math.floor((D[0]-F-w.origin[0])/(f*B));n=Math.max(Math.floor((t?D[1]-y-w.origin[1]:w.origin[1]-(D[1]+y))/(f*I)),0);K=Math.ceil((D[0]+F-w.origin[0])/(f*B));D=Math.ceil((t?D[1]+y-w.origin[1]:w.origin[1]-(D[1]-y))/(f*I));var H=r._getBboxMax(),C=r._getPixelSize(0),G=C/f,M=Math.floor((H[0]-w.origin[0])/(C*B))*G;H=Math.floor((w.origin[1]+
-u*H[3])/(C*I))*G;C=w.origin[1]+u*H*I*f;F=Math.round((w.origin[0]+M*B*f-(J[0]-F))/f);t=Math.round((t?C-(J[1]-y):J[1]+y-C)/f);var z=b.style.opacity;for(y=P;y<K;y++)for(J=n;J<D;J++){P=""+y+","+J;var L=m.children("[data-tile='"+P+"']").removeAttr("data-dirty");if(L.size()===0){C=[w.origin[0]+y*B*f,w.origin[1]+u*J*I*f];G=[w.origin[0]+((y+1)*B-1)*f,w.origin[1]+u*((J+1)*I-1)*f];G=[C[0],C[1],G[0],G[1]];C=b.hasOwnProperty("src")?"src":"getUrl";G={bbox:G,width:B,height:I,zoom:r._getZoom(),tile:{row:J,column:y},
-index:Math.abs(J+y)};if(g.isFunction(b[C]))C=b[C](G);else{g.template("geoSrc",b[C]);C=g.render(G,"geoSrc")}d.loadCount++;if(d.reloadTiles&&L.size()>0)L.attr("src",C);else{G="<img style='position:absolute; left:"+((y-M)*100+(F-F%B)/B*100)+"%; top:"+((J-H)*100+(t-t%I)/I*100)+"%; ";if(g("body")[0].filters===q)G+="width: 100%; height: 100%;";G+="margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;' unselectable='on' data-tile='"+
-P+"' />";m.append(G);L=m.children(":last")}typeof C==="string"?e._loadImage(L,C,f,d,l,z):C.done(function(R){e._loadImage(L,R,f,d,l,z)}).fail(function(){L.remove();d.loadCount--})}}}}},interactiveScale:function(r,b,c,a){var d=g.data(b,"geoServiceState");if(d&&b&&b.style.visibility==="visible"){this._cancelUnloaded(r,b);b=r.options.tilingScheme;var f=b.tileWidth,e=b.tileHeight;d.serviceContainer.children().each(function(){var l=g(this),m=l.attr("data-pixelSize")/a;m=Math.round(m*1E3)/1E3;var n=l.data("scaleOrigin").split(",");
-n=r._toMap([n[0],n[1]]);n=r._toPixel(n,c,a);l.css("-moz-transition","").css({webkitTransition:"",transition:"",left:Math.round(n[0])+"px",top:Math.round(n[1])+"px",width:f*m,height:e*m});g("body")[0].filters!==q&&l.children().each(function(){g(this).css("filter","progid:DXImageTransform.Microsoft.Matrix(FilterType=bilinear,M11="+m+",M22="+m+",sizingmethod='auto expand')")})})}},refresh:function(r,b){var c=g.data(b,"geoServiceState");this._cancelUnloaded(r,b);if(c&&b&&b.style.visibility==="visible"&&
-!c.serviceContainer.is(":hidden")){var a=r._getBbox(),d=r._pixelSize,f=this,e=c.serviceContainer;r._getContentBounds();var l=r.options.axisLayout==="image",m=l?+1:-1,n=r.options.tilingScheme,t=n.tileWidth,u=n.tileHeight,w=Math.floor((a[0]-n.origin[0])/(d*t)),B=Math.max(Math.floor((l?a[1]-n.origin[1]:n.origin[1]-a[3])/(d*u)),0),I=Math.ceil((a[2]-n.origin[0])/(d*t)),F=Math.ceil((l?a[3]-n.origin[1]:n.origin[1]-a[1])/(d*u)),y=r._getBboxMax(),K=r._getPixelSize(0),D=K/d,J=Math.floor((y[0]-n.origin[0])/
-(K*t))*D,P=Math.floor((n.origin[1]+m*y[3])/(K*u))*D;y=n.origin[1]+m*P*u*d;var H=Math.round((n.origin[0]+J*t*d-a[0])/d),C=Math.round((l?y-a[1]:a[3]-y)/d);a=e.children().show();l=a.filter("[data-pixelSize='"+d+"']").appendTo(e);var G=b.style.opacity;c.reloadTiles&&a.find("img").attr("data-dirty","true");if(l.size()){l.css({left:H%t+"px",top:C%u+"px"}).data("scaleOrigin",H%t+","+C%u);l.children().each(function(){var L=g(this),R=L.attr("data-tile").split(",");L.css({left:Math.round((parseInt(R[0])-J)*
-100+(H-H%t)/t*100)+"%",top:Math.round((parseInt(R[1])-P)*100+(C-C%u)/u*100)+"%"});G<1&&L.fadeTo(0,G)})}else{e.append("<div style='position:absolute; left:"+H%t+"px; top:"+C%u+"px; width:"+t+"px; height:"+u+"px; margin:0; padding:0;' data-pixelSize='"+d+"'></div>");l=e.children(":last").data("scaleOrigin",H%t+","+C%u)}for(w=w;w<I;w++)for(y=B;y<F;y++){K=""+w+","+y;var M=l.children("[data-tile='"+K+"']").removeAttr("data-dirty");if(M.size()===0||c.reloadTiles){D=[n.origin[0]+w*t*d,n.origin[1]+m*y*u*
-d];var z=[n.origin[0]+((w+1)*t-1)*d,n.origin[1]+m*((y+1)*u-1)*d];z=[D[0],D[1],z[0],z[1]];D=b.hasOwnProperty("src")?"src":"getUrl";z={bbox:z,width:t,height:u,zoom:r._getZoom(),tile:{row:y,column:w},index:Math.abs(y+w)};if(g.isFunction(b[D]))D=b[D](z);else{g.template("geoSrc",b[D]);D=g.render(z,"geoSrc")}c.loadCount++;if(c.reloadTiles&&M.size()>0)M.attr("src",D);else{z="<img style='position:absolute; left:"+((w-J)*100+(H-H%t)/t*100)+"%; top:"+((y-P)*100+(C-C%u)/u*100)+"%; ";if(g("body")[0].filters===
-q)z+="width: 100%; height: 100%;";z+="margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;' unselectable='on' data-tile='"+K+"' />";l.append(z);M=l.children(":last")}typeof D==="string"?f._loadImage(M,D,d,c,e,G):D.done(function(L){f._loadImage(M,L,d,c,e,G)}).fail(function(){M.remove();c.loadCount--})}}a.find("[data-dirty]").remove();c.reloadTiles=false}},resize:function(){},opacity:function(r,b){g.data(b,"geoServiceState").serviceContainer.find("img").stop(true).fadeTo("fast",
-b.style.opacity)},toggle:function(r,b){g.data(b,"geoServiceState").serviceContainer.css("display",b.style.visibility==="visible"?"block":"none")},_cancelUnloaded:function(r,b){var c=g.data(b,"geoServiceState");if(c&&c.loadCount>0)for(c.serviceContainer.find("img:hidden").remove();c.loadCount>0;)c.loadCount--},_loadImage:function(r,b,c,a,d,f){r.load(function(e){f<1?g(e.target).fadeTo(0,f):g(e.target).show();a.loadCount--;if(a.loadCount<=0){d.children(":not([data-pixelSize='"+c+"'])").remove();a.loadCount=
-0}}).error(function(e){g(e.target).remove();a.loadCount--;if(a.loadCount<=0){d.children(":not([data-pixelSize='"+c+"'])").remove();a.loadCount=0}}).attr("src",b)}}}()})(jQuery);
-(function(g){g.geo._serviceTypes.shingled=function(){return{create:function(q,r,b){q=g.data(b,"geoServiceState");if(!q){q={loadCount:0};r.append('<div data-geo-service="shingled" style="position:absolute; left:0; top:0; width:16px; height:16px; margin:0; padding:0;"></div>');q.serviceContainer=r.children(":last");g.data(b,"geoServiceState",q)}return q.serviceContainer},destroy:function(q,r,b){g.data(b,"geoServiceState").serviceContainer.remove();g.removeData(b,"geoServiceState")},interactivePan:function(q,
-r,b,c){var a=g.data(r,"geoServiceState");if(a){this._cancelUnloaded(q,r);r=a.serviceContainer;q=q._pixelSize;a=r.children("[data-pixelSize='"+q+"']");var d=a.children("div");if(!d.length){a.children("img").wrap('<div style="position:absolute; left:0; top:0; width:100%; height:100%;"></div>');d=a.children("div")}d.css({left:function(f,e){return parseInt(e)+b},top:function(f,e){return parseInt(e)+c}});r.children(":not([data-pixelSize='"+q+"'])").remove()}},interactiveScale:function(q,r,b,c){var a=g.data(r,
-"geoServiceState");if(a){this._cancelUnloaded(q,r);r=a.serviceContainer;q=q._getContentBounds();var d=q.width,f=q.height,e=d/2,l=f/2;r.children().each(function(){var m=g(this),n=m.attr("data-pixelSize"),t=n/c;m.css({width:d*t,height:f*t}).children("img").each(function(){var u=g(this),w=u.data("center");u.css({left:(Math.round((w[0]-b[0])/n)-e)*t+"px",top:(Math.round((b[1]-w[1])/n)-l)*t+"px"})})})}},refresh:function(q,r){var b=g.data(r,"geoServiceState");this._cancelUnloaded(q,r);if(b&&r&&r.style.visibility===
-"visible"&&!b.serviceContainer.is(":hidden")){var c=q._getBbox(),a=q._pixelSize,d=this,f=b.serviceContainer,e=q._getContentBounds(),l=e.width,m=e.height,n=l/2,t=m/2;e=f.children('[data-pixelSize="'+a+'"]');var u=r.style.opacity,w;if(!e.size()){f.append('<div style="position:absolute; left:'+n+"px; top:"+t+"px; width:"+l+"px; height:"+m+'px; margin:0; padding:0;" data-pixelSize="'+a+'"></div>');e=f.children(":last")}e.children("img").each(function(){var I=g(this),F=I.data("center"),y=q._getCenter();
-I.css({left:Math.round((F[0]-y[0])/a)-n+"px",top:Math.round((y[1]-F[1])/a)-t+"px"})});u<1&&f.find("img").attr("data-keepAlive","0");var B=r.hasOwnProperty("src")?"src":"getUrl";c={bbox:c,width:l,height:m,zoom:q._getZoom(),tile:null,index:0};if(g.isFunction(r[B]))c=r[B](c);else{g.template("geoSrc",r[B]);c=g.render(c,"geoSrc")}b.loadCount++;e.append('<img style="position:absolute; left:-'+n+"px; top:-"+t+'px; width:100%; height:100%; margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;" unselectable="on" />');
-w=e.children(":last").data("center",q._getCenter());typeof c==="string"?d._loadImage(w,c,a,b,f,u):c.done(function(I){d._loadImage(w,I,a,b,f,u)}).fail(function(){w.remove();b.loadCount--})}},resize:function(q,r){var b=g.data(r,"geoServiceState");if(b&&r&&r.style.visibility==="visible"){this._cancelUnloaded(q,r);var c=b.serviceContainer,a=q._getContentBounds();b=a.width/2;a=a.height/2;c=c.children();c.attr("data-pixelSize","0");c.css({left:b+"px",top:a+"px"})}},opacity:function(q,r){g.data(r,"geoServiceState").serviceContainer.find("img").stop(true).fadeTo("fast",
-r.style.opacity)},toggle:function(q,r){g.data(r,"geoServiceState").serviceContainer.css("display",r.style.visibility==="visible"?"block":"none")},_cancelUnloaded:function(q,r){var b=g.data(r,"geoServiceState");if(b&&b.loadCount>0)for(b.serviceContainer.find("img:hidden").remove();b.loadCount>0;)b.loadCount--},_loadImage:function(q,r,b,c,a,d){q.load(function(f){d<1?g(f.target).fadeTo(0,d):g(f.target).show();c.loadCount--;if(c.loadCount<=0){a.children(':not([data-pixelSize="'+b+'"])').remove();f=a.find('[data-pixelSize="'+
-b+'"]>div');if(f.size()>0){var e=f.position();f.children("img").each(function(){var l=g(this),m=e.left+parseInt(l.css("left")),n=e.top+parseInt(l.css("top"));l.css({left:m+"px",top:n+"px"})}).unwrap();f.remove()}c.loadCount=0}}).error(function(f){g(f.target).remove();c.loadCount--;if(c.loadCount<=0){a.children(":not([data-pixelSize='"+b+"'])").remove();c.loadCount=0}}).attr("src",r)}}}()})(jQuery);
-/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
- * Licensed under the MIT License (LICENSE.txt).
- *
- * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
- * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
- * Thanks to: Seamus Leahy for adding deltaX and deltaY
- *
- * Version: 3.0.6
- * 
- * Requires: 1.2.2+
- */
-(function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery)
diff --git a/libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0b1.1.js b/libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0b1.1.js
deleted file mode 100755 (executable)
index c8a7a92..0000000
+++ /dev/null
@@ -1,6956 +0,0 @@
-/*! jQuery Geo - v1.0b1.1 - 2012-08-24
- * http://jquerygeo.com
- * Copyright (c) 2012 Ryan Westphal/Applied Geographics, Inc.; Licensed MIT, GPL */
-
-// Copyright 2006 Google Inc.
-//
-// 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.
-
-
-// Known Issues:
-//
-// * Patterns only support repeat.
-// * Radial gradient are not implemented. The VML version of these look very
-//   different from the canvas one.
-// * Clipping paths are not implemented.
-// * Coordsize. The width and height attribute have higher priority than the
-//   width and height style values which isn't correct.
-// * Painting mode isn't implemented.
-// * Canvas width/height should is using content-box by default. IE in
-//   Quirks mode will draw the canvas using border-box. Either change your
-//   doctype to HTML5
-//   (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype)
-//   or use Box Sizing Behavior from WebFX
-//   (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html)
-// * Non uniform scaling does not correctly scale strokes.
-// * Optimize. There is always room for speed improvements.
-
-// Only add this code if we do not already have a canvas implementation
-if (!document.createElement('canvas').getContext) {
-
-  (function () {
-
-    // alias some functions to make (compiled) code shorter
-    var m = Math;
-    var mr = m.round;
-    var ms = m.sin;
-    var mc = m.cos;
-    var abs = m.abs;
-    var sqrt = m.sqrt;
-
-    // this is used for sub pixel precision
-    var Z = 10;
-    var Z2 = Z / 2;
-
-    var IE_VERSION = +navigator.userAgent.match(/MSIE ([\d.]+)?/)[1];
-
-    /**
-    * This funtion is assigned to the <canvas> elements as element.getContext().
-    * @this {HTMLElement}
-    * @return {CanvasRenderingContext2D_}
-    */
-    function getContext() {
-      return this.context_ ||
-        (this.context_ = new CanvasRenderingContext2D_(this));
-    }
-
-    var slice = Array.prototype.slice;
-
-    /**
-    * Binds a function to an object. The returned function will always use the
-    * passed in {@code obj} as {@code this}.
-    *
-    * Example:
-    *
-    *   g = bind(f, obj, a, b)
-    *   g(c, d) // will do f.call(obj, a, b, c, d)
-    *
-    * @param {Function} f The function to bind the object to
-    * @param {Object} obj The object that should act as this when the function
-    *     is called
-    * @param {*} var_args Rest arguments that will be used as the initial
-    *     arguments when the function is called
-    * @return {Function} A new function that has bound this
-    */
-    function bind(f, obj, var_args) {
-      var a = slice.call(arguments, 2);
-      return function () {
-        return f.apply(obj, a.concat(slice.call(arguments)));
-      };
-    }
-
-    function encodeHtmlAttribute(s) {
-      return String(s).replace(/&/g, '&amp;').replace(/"/g, '&quot;');
-    }
-
-    function addNamespace(doc, prefix, urn) {
-      if (!doc.namespaces[prefix]) {
-        doc.namespaces.add(prefix, urn, '#default#VML');
-      }
-    }
-
-    function addNamespacesAndStylesheet(doc) {
-      addNamespace(doc, 'g_vml_', 'urn:schemas-microsoft-com:vml');
-      addNamespace(doc, 'g_o_', 'urn:schemas-microsoft-com:office:office');
-
-      // Setup default CSS.  Only add one style sheet per document
-      if (!doc.styleSheets['ex_canvas_']) {
-        var ss = doc.createStyleSheet();
-        ss.owningElement.id = 'ex_canvas_';
-        ss.cssText = 'canvas{display:inline-block;overflow:hidden;' +
-        // default size is 300x150 in Gecko and Opera
-          'text-align:left;width:300px;height:150px}';
-      }
-    }
-
-    // Add namespaces and stylesheet at startup.
-    addNamespacesAndStylesheet(document);
-
-    var G_vmlCanvasManager_ = {
-      init: function (opt_doc) {
-        var doc = opt_doc || document;
-        // Create a dummy element so that IE will allow canvas elements to be
-        // recognized.
-        doc.createElement('canvas');
-        doc.attachEvent('onreadystatechange', bind(this.init_, this, doc));
-      },
-
-      init_: function (doc) {
-        // find all canvas elements
-        var els = doc.getElementsByTagName('canvas');
-        for (var i = 0; i < els.length; i++) {
-          this.initElement(els[i]);
-        }
-      },
-
-      /**
-      * Public initializes a canvas element so that it can be used as canvas
-      * element from now on. This is called automatically before the page is
-      * loaded but if you are creating elements using createElement you need to
-      * make sure this is called on the element.
-      * @param {HTMLElement} el The canvas element to initialize.
-      * @return {HTMLElement} the element that was created.
-      */
-      initElement: function (el) {
-        if (!el.getContext) {
-          el.getContext = getContext;
-
-          // Add namespaces and stylesheet to document of the element.
-          addNamespacesAndStylesheet(el.ownerDocument);
-
-          // Remove fallback content. There is no way to hide text nodes so we
-          // just remove all childNodes. We could hide all elements and remove
-          // text nodes but who really cares about the fallback content.
-          el.innerHTML = '';
-
-          // do not use inline function because that will leak memory
-          el.attachEvent('onpropertychange', onPropertyChange);
-          el.attachEvent('onresize', onResize);
-
-          var attrs = el.attributes;
-          if (attrs.width && attrs.width.specified) {
-            // TODO: use runtimeStyle and coordsize
-            // el.getContext().setWidth_(attrs.width.nodeValue);
-            el.style.width = attrs.width.nodeValue + 'px';
-          } else {
-            el.width = el.clientWidth;
-          }
-          if (attrs.height && attrs.height.specified) {
-            // TODO: use runtimeStyle and coordsize
-            // el.getContext().setHeight_(attrs.height.nodeValue);
-            el.style.height = attrs.height.nodeValue + 'px';
-          } else {
-            el.height = el.clientHeight;
-          }
-          //el.getContext().setCoordsize_()
-        }
-        return el;
-      }
-    };
-
-    function onPropertyChange(e) {
-      var el = e.srcElement;
-
-      switch (e.propertyName) {
-        case 'width':
-          el.getContext().clearRect();
-          el.style.width = el.attributes.width.nodeValue + 'px';
-          // In IE8 this does not trigger onresize.
-          el.firstChild.style.width = el.clientWidth + 'px';
-          break;
-        case 'height':
-          el.getContext().clearRect();
-          el.style.height = el.attributes.height.nodeValue + 'px';
-          el.firstChild.style.height = el.clientHeight + 'px';
-          break;
-      }
-    }
-
-    function onResize(e) {
-      var el = e.srcElement;
-      if (el.firstChild) {
-        el.firstChild.style.width = el.clientWidth + 'px';
-        el.firstChild.style.height = el.clientHeight + 'px';
-      }
-    }
-
-    G_vmlCanvasManager_.init();
-
-    // precompute "00" to "FF"
-    var decToHex = [];
-    for (var i = 0; i < 16; i++) {
-      for (var j = 0; j < 16; j++) {
-        decToHex[i * 16 + j] = i.toString(16) + j.toString(16);
-      }
-    }
-
-    function createMatrixIdentity() {
-      return [
-      [1, 0, 0],
-      [0, 1, 0],
-      [0, 0, 1]
-    ];
-    }
-
-    function matrixMultiply(m1, m2) {
-      var result = createMatrixIdentity();
-
-      for (var x = 0; x < 3; x++) {
-        for (var y = 0; y < 3; y++) {
-          var sum = 0;
-
-          for (var z = 0; z < 3; z++) {
-            sum += m1[x][z] * m2[z][y];
-          }
-
-          result[x][y] = sum;
-        }
-      }
-      return result;
-    }
-
-    function copyState(o1, o2) {
-      o2.fillStyle     = o1.fillStyle;
-      o2.lineCap       = o1.lineCap;
-      o2.lineJoin      = o1.lineJoin;
-      o2.lineWidth     = o1.lineWidth;
-      o2.miterLimit    = o1.miterLimit;
-      o2.shadowBlur    = o1.shadowBlur;
-      o2.shadowColor   = o1.shadowColor;
-      o2.shadowOffsetX = o1.shadowOffsetX;
-      o2.shadowOffsetY = o1.shadowOffsetY;
-      o2.strokeStyle   = o1.strokeStyle;
-      o2.globalAlpha   = o1.globalAlpha;
-      o2.font          = o1.font;
-      o2.textAlign     = o1.textAlign;
-      o2.textBaseline  = o1.textBaseline;
-      o2.arcScaleX_    = o1.arcScaleX_;
-      o2.arcScaleY_    = o1.arcScaleY_;
-      o2.lineScale_    = o1.lineScale_;
-    }
-
-    //  var colorData = {
-    //    aliceblue: '#F0F8FF',
-    //    antiquewhite: '#FAEBD7',
-    //    aquamarine: '#7FFFD4',
-    //    azure: '#F0FFFF',
-    //    beige: '#F5F5DC',
-    //    bisque: '#FFE4C4',
-    //    black: '#000000',
-    //    blanchedalmond: '#FFEBCD',
-    //    blueviolet: '#8A2BE2',
-    //    brown: '#A52A2A',
-    //    burlywood: '#DEB887',
-    //    cadetblue: '#5F9EA0',
-    //    chartreuse: '#7FFF00',
-    //    chocolate: '#D2691E',
-    //    coral: '#FF7F50',
-    //    cornflowerblue: '#6495ED',
-    //    cornsilk: '#FFF8DC',
-    //    crimson: '#DC143C',
-    //    cyan: '#00FFFF',
-    //    darkblue: '#00008B',
-    //    darkcyan: '#008B8B',
-    //    darkgoldenrod: '#B8860B',
-    //    darkgray: '#A9A9A9',
-    //    darkgreen: '#006400',
-    //    darkgrey: '#A9A9A9',
-    //    darkkhaki: '#BDB76B',
-    //    darkmagenta: '#8B008B',
-    //    darkolivegreen: '#556B2F',
-    //    darkorange: '#FF8C00',
-    //    darkorchid: '#9932CC',
-    //    darkred: '#8B0000',
-    //    darksalmon: '#E9967A',
-    //    darkseagreen: '#8FBC8F',
-    //    darkslateblue: '#483D8B',
-    //    darkslategray: '#2F4F4F',
-    //    darkslategrey: '#2F4F4F',
-    //    darkturquoise: '#00CED1',
-    //    darkviolet: '#9400D3',
-    //    deeppink: '#FF1493',
-    //    deepskyblue: '#00BFFF',
-    //    dimgray: '#696969',
-    //    dimgrey: '#696969',
-    //    dodgerblue: '#1E90FF',
-    //    firebrick: '#B22222',
-    //    floralwhite: '#FFFAF0',
-    //    forestgreen: '#228B22',
-    //    gainsboro: '#DCDCDC',
-    //    ghostwhite: '#F8F8FF',
-    //    gold: '#FFD700',
-    //    goldenrod: '#DAA520',
-    //    grey: '#808080',
-    //    greenyellow: '#ADFF2F',
-    //    honeydew: '#F0FFF0',
-    //    hotpink: '#FF69B4',
-    //    indianred: '#CD5C5C',
-    //    indigo: '#4B0082',
-    //    ivory: '#FFFFF0',
-    //    khaki: '#F0E68C',
-    //    lavender: '#E6E6FA',
-    //    lavenderblush: '#FFF0F5',
-    //    lawngreen: '#7CFC00',
-    //    lemonchiffon: '#FFFACD',
-    //    lightblue: '#ADD8E6',
-    //    lightcoral: '#F08080',
-    //    lightcyan: '#E0FFFF',
-    //    lightgoldenrodyellow: '#FAFAD2',
-    //    lightgreen: '#90EE90',
-    //    lightgrey: '#D3D3D3',
-    //    lightpink: '#FFB6C1',
-    //    lightsalmon: '#FFA07A',
-    //    lightseagreen: '#20B2AA',
-    //    lightskyblue: '#87CEFA',
-    //    lightslategray: '#778899',
-    //    lightslategrey: '#778899',
-    //    lightsteelblue: '#B0C4DE',
-    //    lightyellow: '#FFFFE0',
-    //    limegreen: '#32CD32',
-    //    linen: '#FAF0E6',
-    //    magenta: '#FF00FF',
-    //    mediumaquamarine: '#66CDAA',
-    //    mediumblue: '#0000CD',
-    //    mediumorchid: '#BA55D3',
-    //    mediumpurple: '#9370DB',
-    //    mediumseagreen: '#3CB371',
-    //    mediumslateblue: '#7B68EE',
-    //    mediumspringgreen: '#00FA9A',
-    //    mediumturquoise: '#48D1CC',
-    //    mediumvioletred: '#C71585',
-    //    midnightblue: '#191970',
-    //    mintcream: '#F5FFFA',
-    //    mistyrose: '#FFE4E1',
-    //    moccasin: '#FFE4B5',
-    //    navajowhite: '#FFDEAD',
-    //    oldlace: '#FDF5E6',
-    //    olivedrab: '#6B8E23',
-    //    orange: '#FFA500',
-    //    orangered: '#FF4500',
-    //    orchid: '#DA70D6',
-    //    palegoldenrod: '#EEE8AA',
-    //    palegreen: '#98FB98',
-    //    paleturquoise: '#AFEEEE',
-    //    palevioletred: '#DB7093',
-    //    papayawhip: '#FFEFD5',
-    //    peachpuff: '#FFDAB9',
-    //    peru: '#CD853F',
-    //    pink: '#FFC0CB',
-    //    plum: '#DDA0DD',
-    //    powderblue: '#B0E0E6',
-    //    rosybrown: '#BC8F8F',
-    //    royalblue: '#4169E1',
-    //    saddlebrown: '#8B4513',
-    //    salmon: '#FA8072',
-    //    sandybrown: '#F4A460',
-    //    seagreen: '#2E8B57',
-    //    seashell: '#FFF5EE',
-    //    sienna: '#A0522D',
-    //    skyblue: '#87CEEB',
-    //    slateblue: '#6A5ACD',
-    //    slategray: '#708090',
-    //    slategrey: '#708090',
-    //    snow: '#FFFAFA',
-    //    springgreen: '#00FF7F',
-    //    steelblue: '#4682B4',
-    //    tan: '#D2B48C',
-    //    thistle: '#D8BFD8',
-    //    tomato: '#FF6347',
-    //    turquoise: '#40E0D0',
-    //    violet: '#EE82EE',
-    //    wheat: '#F5DEB3',
-    //    whitesmoke: '#F5F5F5',
-    //    yellowgreen: '#9ACD32'
-    //  };
-
-
-    function getRgbHslContent(styleString) {
-      var start = styleString.indexOf('(', 3);
-      var end = styleString.indexOf(')', start + 1);
-      var parts = styleString.substring(start + 1, end).split(',');
-      // add alpha if needed
-      if (parts.length != 4 || styleString.charAt(3) != 'a') {
-        parts[3] = 1;
-      }
-      return parts;
-    }
-
-    function percent(s) {
-      return parseFloat(s) / 100;
-    }
-
-    function clamp(v, min, max) {
-      return Math.min(max, Math.max(min, v));
-    }
-
-    function hslToRgb(parts) {
-      var r, g, b, h, s, l;
-      h = parseFloat(parts[0]) / 360 % 360;
-      if (h < 0)
-        h++;
-      s = clamp(percent(parts[1]), 0, 1);
-      l = clamp(percent(parts[2]), 0, 1);
-      if (s == 0) {
-        r = g = b = l; // achromatic
-      } else {
-        var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
-        var p = 2 * l - q;
-        r = hueToRgb(p, q, h + 1 / 3);
-        g = hueToRgb(p, q, h);
-        b = hueToRgb(p, q, h - 1 / 3);
-      }
-
-      return '#' + decToHex[Math.floor(r * 255)] +
-        decToHex[Math.floor(g * 255)] +
-        decToHex[Math.floor(b * 255)];
-    }
-
-    function hueToRgb(m1, m2, h) {
-      if (h < 0)
-        h++;
-      if (h > 1)
-        h--;
-
-      if (6 * h < 1)
-        return m1 + (m2 - m1) * 6 * h;
-      else if (2 * h < 1)
-        return m2;
-      else if (3 * h < 2)
-        return m1 + (m2 - m1) * (2 / 3 - h) * 6;
-      else
-        return m1;
-    }
-
-    var processStyleCache = {};
-
-    function processStyle(styleString) {
-      if (styleString in processStyleCache) {
-        return processStyleCache[styleString];
-      }
-
-      var str, alpha = 1;
-
-      styleString = String(styleString);
-      if (styleString.charAt(0) == '#') {
-        str = styleString;
-      } else if (/^rgb/.test(styleString)) {
-        var parts = getRgbHslContent(styleString);
-        var str = '#', n;
-        for (var i = 0; i < 3; i++) {
-          if (parts[i].indexOf('%') != -1) {
-            n = Math.floor(percent(parts[i]) * 255);
-          } else {
-            n = +parts[i];
-          }
-          str += decToHex[clamp(n, 0, 255)];
-        }
-        alpha = +parts[3];
-      } else if (/^hsl/.test(styleString)) {
-        var parts = getRgbHslContent(styleString);
-        str = hslToRgb(parts);
-        alpha = parts[3];
-      } else {
-        str = /*colorData[styleString] ||*/styleString;
-      }
-      return processStyleCache[styleString] = { color: str, alpha: alpha };
-    }
-
-    var DEFAULT_STYLE = {
-      style: 'normal',
-      variant: 'normal',
-      weight: 'normal',
-      size: 10,
-      family: 'sans-serif'
-    };
-
-    // Internal text style cache
-    //  var fontStyleCache = {};
-
-    //  function processFontStyle(styleString) {
-    //    if (fontStyleCache[styleString]) {
-    //      return fontStyleCache[styleString];
-    //    }
-
-    //    var el = document.createElement('div');
-    //    var style = el.style;
-    //    try {
-    //      style.font = styleString;
-    //    } catch (ex) {
-    //      // Ignore failures to set to invalid font.
-    //    }
-
-    //    return fontStyleCache[styleString] = {
-    //      style: style.fontStyle || DEFAULT_STYLE.style,
-    //      variant: style.fontVariant || DEFAULT_STYLE.variant,
-    //      weight: style.fontWeight || DEFAULT_STYLE.weight,
-    //      size: style.fontSize || DEFAULT_STYLE.size,
-    //      family: style.fontFamily || DEFAULT_STYLE.family
-    //    };
-    //  }
-
-    //  function getComputedStyle(style, element) {
-    //    var computedStyle = {};
-
-    //    for (var p in style) {
-    //      computedStyle[p] = style[p];
-    //    }
-
-    //    // Compute the size
-    //    var canvasFontSize = parseFloat(element.currentStyle.fontSize),
-    //        fontSize = parseFloat(style.size);
-
-    //    if (typeof style.size == 'number') {
-    //      computedStyle.size = style.size;
-    //    } else if (style.size.indexOf('px') != -1) {
-    //      computedStyle.size = fontSize;
-    //    } else if (style.size.indexOf('em') != -1) {
-    //      computedStyle.size = canvasFontSize * fontSize;
-    //    } else if(style.size.indexOf('%') != -1) {
-    //      computedStyle.size = (canvasFontSize / 100) * fontSize;
-    //    } else if (style.size.indexOf('pt') != -1) {
-    //      computedStyle.size = fontSize / .75;
-    //    } else {
-    //      computedStyle.size = canvasFontSize;
-    //    }
-
-    //    // Different scaling between normal text and VML text. This was found using
-    //    // trial and error to get the same size as non VML text.
-    //    computedStyle.size *= 0.981;
-
-    //    return computedStyle;
-    //  }
-
-    //  function buildStyle(style) {
-    //    return style.style + ' ' + style.variant + ' ' + style.weight + ' ' +
-    //        style.size + 'px ' + style.family;
-    //  }
-
-    var lineCapMap = {
-      'butt': 'flat',
-      'round': 'round'
-    };
-
-    function processLineCap(lineCap) {
-      return lineCapMap[lineCap] || 'square';
-    }
-
-    /**
-    * This class implements CanvasRenderingContext2D interface as described by
-    * the WHATWG.
-    * @param {HTMLElement} canvasElement The element that the 2D context should
-    * be associated with
-    */
-    function CanvasRenderingContext2D_(canvasElement) {
-      this.m_ = createMatrixIdentity();
-
-      this.mStack_ = [];
-      this.aStack_ = [];
-      this.currentPath_ = [];
-
-      // Canvas context properties
-      this.strokeStyle = '#000';
-      this.fillStyle = '#000';
-
-      this.lineWidth = 1;
-      this.lineJoin = 'miter';
-      this.lineCap = 'butt';
-      this.miterLimit = Z * 1;
-      this.globalAlpha = 1;
-      //this.font = '10px sans-serif';
-      //this.textAlign = 'left';
-      //this.textBaseline = 'alphabetic';
-      this.canvas = canvasElement;
-
-      var cssText = 'width:' + canvasElement.clientWidth + 'px;height:' +
-        canvasElement.clientHeight + 'px;overflow:hidden;position:absolute';
-      var el = canvasElement.ownerDocument.createElement('div');
-      el.style.cssText = cssText;
-      canvasElement.appendChild(el);
-
-      var overlayEl = el.cloneNode(false);
-      // Use a non transparent background.
-      overlayEl.style.backgroundColor = 'red';
-      overlayEl.style.filter = 'alpha(opacity=0)';
-      canvasElement.appendChild(overlayEl);
-
-      this.element_ = el;
-      this.arcScaleX_ = 1;
-      this.arcScaleY_ = 1;
-      this.lineScale_ = 1;
-    }
-
-    var contextPrototype = CanvasRenderingContext2D_.prototype;
-    contextPrototype.clearRect = function () {
-      if (this.textMeasureEl_) {
-        this.textMeasureEl_.removeNode(true);
-        this.textMeasureEl_ = null;
-      }
-      this.element_.innerHTML = '';
-    };
-
-    contextPrototype.beginPath = function () {
-      // TODO: Branch current matrix so that save/restore has no effect
-      //       as per safari docs.
-      this.currentPath_ = [];
-    };
-
-    contextPrototype.moveTo = function (aX, aY) {
-      var p = getCoords(this, aX, aY);
-      this.currentPath_.push({ type: 'moveTo', x: p.x, y: p.y });
-      this.currentX_ = p.x;
-      this.currentY_ = p.y;
-    };
-
-    contextPrototype.lineTo = function (aX, aY) {
-      var p = getCoords(this, aX, aY);
-      this.currentPath_.push({ type: 'lineTo', x: p.x, y: p.y });
-
-      this.currentX_ = p.x;
-      this.currentY_ = p.y;
-    };
-
-    contextPrototype.bezierCurveTo = function(aCP1x, aCP1y,
-                                              aCP2x, aCP2y,
-                                              aX, aY) {
-      var p = getCoords(this, aX, aY);
-      var cp1 = getCoords(this, aCP1x, aCP1y);
-      var cp2 = getCoords(this, aCP2x, aCP2y);
-      bezierCurveTo(this, cp1, cp2, p);
-    };
-
-    // Helper function that takes the already fixed cordinates.
-    function bezierCurveTo(self, cp1, cp2, p) {
-      self.currentPath_.push({
-        type: 'bezierCurveTo',
-        cp1x: cp1.x,
-        cp1y: cp1.y,
-        cp2x: cp2.x,
-        cp2y: cp2.y,
-        x: p.x,
-        y: p.y
-      });
-      self.currentX_ = p.x;
-      self.currentY_ = p.y;
-    }
-
-    contextPrototype.quadraticCurveTo = function(aCPx, aCPy, aX, aY) {
-      // the following is lifted almost directly from
-      // http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes
-
-      var cp = getCoords(this, aCPx, aCPy);
-      var p = getCoords(this, aX, aY);
-
-      var cp1 = {
-        x: this.currentX_ + 2.0 / 3.0 * (cp.x - this.currentX_),
-        y: this.currentY_ + 2.0 / 3.0 * (cp.y - this.currentY_)
-      };
-      var cp2 = {
-        x: cp1.x + (p.x - this.currentX_) / 3.0,
-        y: cp1.y + (p.y - this.currentY_) / 3.0
-      };
-
-      bezierCurveTo(this, cp1, cp2, p);
-    };
-
-    contextPrototype.arc = function (aX, aY, aRadius,
-                                  aStartAngle, aEndAngle, aClockwise) {
-      aRadius *= Z;
-      var arcType = aClockwise ? 'at' : 'wa';
-
-      var xStart = aX + mc(aStartAngle) * aRadius - Z2;
-      var yStart = aY + ms(aStartAngle) * aRadius - Z2;
-
-      var xEnd = aX + mc(aEndAngle) * aRadius - Z2;
-      var yEnd = aY + ms(aEndAngle) * aRadius - Z2;
-
-      // IE won't render arches drawn counter clockwise if xStart == xEnd.
-      if (xStart == xEnd && !aClockwise) {
-        xStart += 0.125; // Offset xStart by 1/80 of a pixel. Use something
-        // that can be represented in binary
-      }
-
-      var p = getCoords(this, aX, aY);
-      var pStart = getCoords(this, xStart, yStart);
-      var pEnd = getCoords(this, xEnd, yEnd);
-
-      this.currentPath_.push({ type: arcType,
-        x: p.x,
-        y: p.y,
-        radius: aRadius,
-        xStart: pStart.x,
-        yStart: pStart.y,
-        xEnd: pEnd.x,
-        yEnd: pEnd.y
-      });
-
-    };
-
-    //  contextPrototype.rect = function(aX, aY, aWidth, aHeight) {
-    //    this.moveTo(aX, aY);
-    //    this.lineTo(aX + aWidth, aY);
-    //    this.lineTo(aX + aWidth, aY + aHeight);
-    //    this.lineTo(aX, aY + aHeight);
-    //    this.closePath();
-    //  };
-
-    //  contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) {
-    //    var oldPath = this.currentPath_;
-    //    this.beginPath();
-
-    //    this.moveTo(aX, aY);
-    //    this.lineTo(aX + aWidth, aY);
-    //    this.lineTo(aX + aWidth, aY + aHeight);
-    //    this.lineTo(aX, aY + aHeight);
-    //    this.closePath();
-    //    this.stroke();
-
-    //    this.currentPath_ = oldPath;
-    //  };
-
-    //  contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) {
-    //    var oldPath = this.currentPath_;
-    //    this.beginPath();
-
-    //    this.moveTo(aX, aY);
-    //    this.lineTo(aX + aWidth, aY);
-    //    this.lineTo(aX + aWidth, aY + aHeight);
-    //    this.lineTo(aX, aY + aHeight);
-    //    this.closePath();
-    //    this.fill();
-
-    //    this.currentPath_ = oldPath;
-    //  };
-
-    //  contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) {
-    //    var gradient = new CanvasGradient_('gradient');
-    //    gradient.x0_ = aX0;
-    //    gradient.y0_ = aY0;
-    //    gradient.x1_ = aX1;
-    //    gradient.y1_ = aY1;
-    //    return gradient;
-    //  };
-
-    //  contextPrototype.createRadialGradient = function(aX0, aY0, aR0,
-    //                                                   aX1, aY1, aR1) {
-    //    var gradient = new CanvasGradient_('gradientradial');
-    //    gradient.x0_ = aX0;
-    //    gradient.y0_ = aY0;
-    //    gradient.r0_ = aR0;
-    //    gradient.x1_ = aX1;
-    //    gradient.y1_ = aY1;
-    //    gradient.r1_ = aR1;
-    //    return gradient;
-    //  };
-
-    //  contextPrototype.drawImage = function(image, var_args) {
-    //    var dx, dy, dw, dh, sx, sy, sw, sh;
-
-    //    // to find the original width we overide the width and height
-    //    var oldRuntimeWidth = image.runtimeStyle.width;
-    //    var oldRuntimeHeight = image.runtimeStyle.height;
-    //    image.runtimeStyle.width = 'auto';
-    //    image.runtimeStyle.height = 'auto';
-
-    //    // get the original size
-    //    var w = image.width;
-    //    var h = image.height;
-
-    //    // and remove overides
-    //    image.runtimeStyle.width = oldRuntimeWidth;
-    //    image.runtimeStyle.height = oldRuntimeHeight;
-
-    //    if (arguments.length == 3) {
-    //      dx = arguments[1];
-    //      dy = arguments[2];
-    //      sx = sy = 0;
-    //      sw = dw = w;
-    //      sh = dh = h;
-    //    } else if (arguments.length == 5) {
-    //      dx = arguments[1];
-    //      dy = arguments[2];
-    //      dw = arguments[3];
-    //      dh = arguments[4];
-    //      sx = sy = 0;
-    //      sw = w;
-    //      sh = h;
-    //    } else if (arguments.length == 9) {
-    //      sx = arguments[1];
-    //      sy = arguments[2];
-    //      sw = arguments[3];
-    //      sh = arguments[4];
-    //      dx = arguments[5];
-    //      dy = arguments[6];
-    //      dw = arguments[7];
-    //      dh = arguments[8];
-    //    } else {
-    //      throw Error('Invalid number of arguments');
-    //    }
-
-    //    var d = getCoords(this, dx, dy);
-
-    //    var w2 = sw / 2;
-    //    var h2 = sh / 2;
-
-    //    var vmlStr = [];
-
-    //    var W = 10;
-    //    var H = 10;
-
-    //    // For some reason that I've now forgotten, using divs didn't work
-    //    vmlStr.push(' <g_vml_:group',
-    //                ' coordsize="', Z * W, ',', Z * H, '"',
-    //                ' coordorigin="0,0"' ,
-    //                ' style="width:', W, 'px;height:', H, 'px;position:absolute;');
-
-    //    // If filters are necessary (rotation exists), create them
-    //    // filters are bog-slow, so only create them if abbsolutely necessary
-    //    // The following check doesn't account for skews (which don't exist
-    //    // in the canvas spec (yet) anyway.
-
-    //    if (this.m_[0][0] != 1 || this.m_[0][1] ||
-    //        this.m_[1][1] != 1 || this.m_[1][0]) {
-    //      var filter = [];
-
-    //      // Note the 12/21 reversal
-    //      filter.push('M11=', this.m_[0][0], ',',
-    //                  'M12=', this.m_[1][0], ',',
-    //                  'M21=', this.m_[0][1], ',',
-    //                  'M22=', this.m_[1][1], ',',
-    //                  'Dx=', mr(d.x / Z), ',',
-    //                  'Dy=', mr(d.y / Z), '');
-
-    //      // Bounding box calculation (need to minimize displayed area so that
-    //      // filters don't waste time on unused pixels.
-    //      var max = d;
-    //      var c2 = getCoords(this, dx + dw, dy);
-    //      var c3 = getCoords(this, dx, dy + dh);
-    //      var c4 = getCoords(this, dx + dw, dy + dh);
-
-    //      max.x = m.max(max.x, c2.x, c3.x, c4.x);
-    //      max.y = m.max(max.y, c2.y, c3.y, c4.y);
-
-    //      vmlStr.push('padding:0 ', mr(max.x / Z), 'px ', mr(max.y / Z),
-    //                  'px 0;filter:progid:DXImageTransform.Microsoft.Matrix(',
-    //                  filter.join(''), ", sizingmethod='clip');");
-
-    //    } else {
-    //      vmlStr.push('top:', mr(d.y / Z), 'px;left:', mr(d.x / Z), 'px;');
-    //    }
-
-    //    vmlStr.push(' ">' ,
-    //                '<g_vml_:image src="', image.src, '"',
-    //                ' style="width:', Z * dw, 'px;',
-    //                ' height:', Z * dh, 'px"',
-    //                ' cropleft="', sx / w, '"',
-    //                ' croptop="', sy / h, '"',
-    //                ' cropright="', (w - sx - sw) / w, '"',
-    //                ' cropbottom="', (h - sy - sh) / h, '"',
-    //                ' />',
-    //                '</g_vml_:group>');
-
-    //    this.element_.insertAdjacentHTML('BeforeEnd', vmlStr.join(''));
-    //  };
-
-    contextPrototype.stroke = function (aFill) {
-      var lineStr = [];
-      var lineOpen = false;
-
-      var W = 10;
-      var H = 10;
-
-      lineStr.push('<g_vml_:shape',
-                 ' filled="', !!aFill, '"',
-                 ' style="position:absolute;width:', W, 'px;height:', H, 'px;"',
-                 ' coordorigin="0,0"',
-                 ' coordsize="', Z * W, ',', Z * H, '"',
-                 ' stroked="', !aFill, '"',
-                 ' path="');
-
-      var newSeq = false;
-      var min = { x: null, y: null };
-      var max = { x: null, y: null };
-
-      for (var i = 0; i < this.currentPath_.length; i++) {
-        var p = this.currentPath_[i];
-        var c;
-
-        switch (p.type) {
-          case 'moveTo':
-            c = p;
-            lineStr.push(' m ', mr(p.x), ',', mr(p.y));
-            break;
-          case 'lineTo':
-            lineStr.push(' l ', mr(p.x), ',', mr(p.y));
-            break;
-          case 'close':
-            lineStr.push(' x ');
-            p = null;
-            break;
-          case 'bezierCurveTo':
-            lineStr.push(' c ',
-                       mr(p.cp1x), ',', mr(p.cp1y), ',',
-                       mr(p.cp2x), ',', mr(p.cp2y), ',',
-                       mr(p.x), ',', mr(p.y));
-            break;
-          case 'at':
-          case 'wa':
-            lineStr.push(' ', p.type, ' ',
-                       mr(p.x - this.arcScaleX_ * p.radius), ',',
-                       mr(p.y - this.arcScaleY_ * p.radius), ' ',
-                       mr(p.x + this.arcScaleX_ * p.radius), ',',
-                       mr(p.y + this.arcScaleY_ * p.radius), ' ',
-                       mr(p.xStart), ',', mr(p.yStart), ' ',
-                       mr(p.xEnd), ',', mr(p.yEnd));
-            break;
-        }
-
-
-        // TODO: Following is broken for curves due to
-        //       move to proper paths.
-
-        // Figure out dimensions so we can do gradient fills
-        // properly
-        if (p) {
-          if (min.x == null || p.x < min.x) {
-            min.x = p.x;
-          }
-          if (max.x == null || p.x > max.x) {
-            max.x = p.x;
-          }
-          if (min.y == null || p.y < min.y) {
-            min.y = p.y;
-          }
-          if (max.y == null || p.y > max.y) {
-            max.y = p.y;
-          }
-        }
-      }
-      lineStr.push(' ">');
-
-      if (!aFill) {
-        appendStroke(this, lineStr);
-      } else {
-        appendFill(this, lineStr, min, max);
-      }
-
-      lineStr.push('</g_vml_:shape>');
-
-      this.element_.insertAdjacentHTML('beforeEnd', lineStr.join(''));
-    };
-
-    function appendStroke(ctx, lineStr) {
-      var a = processStyle(ctx.strokeStyle);
-      var color = a.color;
-      var opacity = a.alpha * ctx.globalAlpha;
-      var lineWidth = ctx.lineScale_ * ctx.lineWidth;
-
-      // VML cannot correctly render a line if the width is less than 1px.
-      // In that case, we dilute the color to make the line look thinner.
-      if (lineWidth < 1) {
-        opacity *= lineWidth;
-      }
-
-      lineStr.push(
-      '<g_vml_:stroke',
-      ' opacity="', opacity, '"',
-      ' joinstyle="', ctx.lineJoin, '"',
-      ' miterlimit="', ctx.miterLimit, '"',
-      ' endcap="', processLineCap(ctx.lineCap), '"',
-      ' weight="', lineWidth, 'px"',
-      ' color="', color, '" />'
-    );
-    }
-
-    function appendFill(ctx, lineStr, min, max) {
-      var fillStyle = ctx.fillStyle;
-      var arcScaleX = ctx.arcScaleX_;
-      var arcScaleY = ctx.arcScaleY_;
-      var width = max.x - min.x;
-      var height = max.y - min.y;
-      //    if (fillStyle instanceof CanvasGradient_) {
-      //      // TODO: Gradients transformed with the transformation matrix.
-      //      var angle = 0;
-      //      var focus = {x: 0, y: 0};
-
-      //      // additional offset
-      //      var shift = 0;
-      //      // scale factor for offset
-      //      var expansion = 1;
-
-      //      if (fillStyle.type_ == 'gradient') {
-      //        var x0 = fillStyle.x0_ / arcScaleX;
-      //        var y0 = fillStyle.y0_ / arcScaleY;
-      //        var x1 = fillStyle.x1_ / arcScaleX;
-      //        var y1 = fillStyle.y1_ / arcScaleY;
-      //        var p0 = getCoords(ctx, x0, y0);
-      //        var p1 = getCoords(ctx, x1, y1);
-      //        var dx = p1.x - p0.x;
-      //        var dy = p1.y - p0.y;
-      //        angle = Math.atan2(dx, dy) * 180 / Math.PI;
-
-      //        // The angle should be a non-negative number.
-      //        if (angle < 0) {
-      //          angle += 360;
-      //        }
-
-      //        // Very small angles produce an unexpected result because they are
-      //        // converted to a scientific notation string.
-      //        if (angle < 1e-6) {
-      //          angle = 0;
-      //        }
-      //      } else {
-      //        var p0 = getCoords(ctx, fillStyle.x0_, fillStyle.y0_);
-      //        focus = {
-      //          x: (p0.x - min.x) / width,
-      //          y: (p0.y - min.y) / height
-      //        };
-
-      //        width  /= arcScaleX * Z;
-      //        height /= arcScaleY * Z;
-      //        var dimension = m.max(width, height);
-      //        shift = 2 * fillStyle.r0_ / dimension;
-      //        expansion = 2 * fillStyle.r1_ / dimension - shift;
-      //      }
-
-      //      // We need to sort the color stops in ascending order by offset,
-      //      // otherwise IE won't interpret it correctly.
-      //      var stops = fillStyle.colors_;
-      //      stops.sort(function(cs1, cs2) {
-      //        return cs1.offset - cs2.offset;
-      //      });
-
-      //      var length = stops.length;
-      //      var color1 = stops[0].color;
-      //      var color2 = stops[length - 1].color;
-      //      var opacity1 = stops[0].alpha * ctx.globalAlpha;
-      //      var opacity2 = stops[length - 1].alpha * ctx.globalAlpha;
-
-      //      var colors = [];
-      //      for (var i = 0; i < length; i++) {
-      //        var stop = stops[i];
-      //        colors.push(stop.offset * expansion + shift + ' ' + stop.color);
-      //      }
-
-      //      // When colors attribute is used, the meanings of opacity and o:opacity2
-      //      // are reversed.
-      //      lineStr.push('<g_vml_:fill type="', fillStyle.type_, '"',
-      //                   ' method="none" focus="100%"',
-      //                   ' color="', color1, '"',
-      //                   ' color2="', color2, '"',
-      //                   ' colors="', colors.join(','), '"',
-      //                   ' opacity="', opacity2, '"',
-      //                   ' g_o_:opacity2="', opacity1, '"',
-      //                   ' angle="', angle, '"',
-      //                   ' focusposition="', focus.x, ',', focus.y, '" />');
-      //    } else if (fillStyle instanceof CanvasPattern_) {
-      //      if (width && height) {
-      //        var deltaLeft = -min.x;
-      //        var deltaTop = -min.y;
-      //        lineStr.push('<g_vml_:fill',
-      //                     ' position="',
-      //                     deltaLeft / width * arcScaleX * arcScaleX, ',',
-      //                     deltaTop / height * arcScaleY * arcScaleY, '"',
-      //                     ' type="tile"',
-      //                     // TODO: Figure out the correct size to fit the scale.
-      //                     //' size="', w, 'px ', h, 'px"',
-      //                     ' src="', fillStyle.src_, '" />');
-      //       }
-      //    } else {
-      var a = processStyle(ctx.fillStyle);
-      var color = a.color;
-      var opacity = a.alpha * ctx.globalAlpha;
-      lineStr.push('<g_vml_:fill color="', color, '" opacity="', opacity,
-                   '" />');
-      //     }
-    }
-
-    contextPrototype.fill = function () {
-      this.stroke(true);
-    };
-
-    contextPrototype.closePath = function () {
-      this.currentPath_.push({ type: 'close' });
-    };
-
-    function getCoords(ctx, aX, aY) {
-      var m = ctx.m_;
-      return {
-        x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2,
-        y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2
-      };
-    };
-
-    contextPrototype.save = function () {
-      var o = {};
-      copyState(this, o);
-      this.aStack_.push(o);
-      this.mStack_.push(this.m_);
-      this.m_ = matrixMultiply(createMatrixIdentity(), this.m_);
-    };
-
-    contextPrototype.restore = function () {
-      if (this.aStack_.length) {
-        copyState(this.aStack_.pop(), this);
-        this.m_ = this.mStack_.pop();
-      }
-    };
-
-    function matrixIsFinite(m) {
-      return isFinite(m[0][0]) && isFinite(m[0][1]) &&
-        isFinite(m[1][0]) && isFinite(m[1][1]) &&
-        isFinite(m[2][0]) && isFinite(m[2][1]);
-    }
-
-    function setM(ctx, m, updateLineScale) {
-      if (!matrixIsFinite(m)) {
-        return;
-      }
-      ctx.m_ = m;
-
-      if (updateLineScale) {
-        // Get the line scale.
-        // Determinant of this.m_ means how much the area is enlarged by the
-        // transformation. So its square root can be used as a scale factor
-        // for width.
-        var det = m[0][0] * m[1][1] - m[0][1] * m[1][0];
-        ctx.lineScale_ = sqrt(abs(det));
-      }
-    }
-
-    contextPrototype.translate = function (aX, aY) {
-      var m1 = [
-      [1, 0, 0],
-      [0, 1, 0],
-      [aX, aY, 1]
-    ];
-
-      setM(this, matrixMultiply(m1, this.m_), false);
-    };
-
-    //  contextPrototype.rotate = function(aRot) {
-    //    var c = mc(aRot);
-    //    var s = ms(aRot);
-
-    //    var m1 = [
-    //      [c,  s, 0],
-    //      [-s, c, 0],
-    //      [0,  0, 1]
-    //    ];
-
-    //    setM(this, matrixMultiply(m1, this.m_), false);
-    //  };
-
-    contextPrototype.scale = function (aX, aY) {
-      this.arcScaleX_ *= aX;
-      this.arcScaleY_ *= aY;
-      var m1 = [
-      [aX, 0, 0],
-      [0, aY, 0],
-      [0, 0, 1]
-    ];
-
-      setM(this, matrixMultiply(m1, this.m_), true);
-    };
-
-    //  contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) {
-    //    var m1 = [
-    //      [m11, m12, 0],
-    //      [m21, m22, 0],
-    //      [dx,  dy,  1]
-    //    ];
-
-    //    setM(this, matrixMultiply(m1, this.m_), true);
-    //  };
-
-    //  contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) {
-    //    var m = [
-    //      [m11, m12, 0],
-    //      [m21, m22, 0],
-    //      [dx,  dy,  1]
-    //    ];
-
-    //    setM(this, m, true);
-    //  };
-
-    /**
-    * The text drawing function.
-    * The maxWidth argument isn't taken in account, since no browser supports
-    * it yet.
-    */
-    //  contextPrototype.drawText_ = function(text, x, y, maxWidth, stroke) {
-    //    var m = this.m_,
-    //        delta = 1000,
-    //        left = 0,
-    //        right = delta,
-    //        offset = {x: 0, y: 0},
-    //        lineStr = [];
-
-    //    var fontStyle = getComputedStyle(processFontStyle(this.font),
-    //                                     this.element_);
-
-    //    var fontStyleString = buildStyle(fontStyle);
-
-    //    var elementStyle = this.element_.currentStyle;
-    //    var textAlign = this.textAlign.toLowerCase();
-    //    switch (textAlign) {
-    //      case 'left':
-    //      case 'center':
-    //      case 'right':
-    //        break;
-    //      case 'end':
-    //        textAlign = elementStyle.direction == 'ltr' ? 'right' : 'left';
-    //        break;
-    //      case 'start':
-    //        textAlign = elementStyle.direction == 'rtl' ? 'right' : 'left';
-    //        break;
-    //      default:
-    //        textAlign = 'left';
-    //    }
-
-    //    // 1.75 is an arbitrary number, as there is no info about the text baseline
-    //    switch (this.textBaseline) {
-    //      case 'hanging':
-    //      case 'top':
-    //        offset.y = fontStyle.size / 1.75;
-    //        break;
-    //      case 'middle':
-    //        break;
-    //      default:
-    //      case null:
-    //      case 'alphabetic':
-    //      case 'ideographic':
-    //      case 'bottom':
-    //        offset.y = -fontStyle.size / 2.25;
-    //        break;
-    //    }
-
-    //    switch(textAlign) {
-    //      case 'right':
-    //        left = delta;
-    //        right = 0.05;
-    //        break;
-    //      case 'center':
-    //        left = right = delta / 2;
-    //        break;
-    //    }
-
-    //    var d = getCoords(this, x + offset.x, y + offset.y);
-
-    //    lineStr.push('<g_vml_:line from="', -left ,' 0" to="', right ,' 0.05" ',
-    //                 ' coordsize="100 100" coordorigin="0 0"',
-    //                 ' filled="', !stroke, '" stroked="', !!stroke,
-    //                 '" style="position:absolute;width:1px;height:1px;">');
-
-    //    if (stroke) {
-    //      appendStroke(this, lineStr);
-    //    } else {
-    //      // TODO: Fix the min and max params.
-    //      appendFill(this, lineStr, {x: -left, y: 0},
-    //                 {x: right, y: fontStyle.size});
-    //    }
-
-    //    var skewM = m[0][0].toFixed(3) + ',' + m[1][0].toFixed(3) + ',' +
-    //                m[0][1].toFixed(3) + ',' + m[1][1].toFixed(3) + ',0,0';
-
-    //    var skewOffset = mr(d.x / Z) + ',' + mr(d.y / Z);
-
-    //    lineStr.push('<g_vml_:skew on="t" matrix="', skewM ,'" ',
-    //                 ' offset="', skewOffset, '" origin="', left ,' 0" />',
-    //                 '<g_vml_:path textpathok="true" />',
-    //                 '<g_vml_:textpath on="true" string="',
-    //                 encodeHtmlAttribute(text),
-    //                 '" style="v-text-align:', textAlign,
-    //                 ';font:', encodeHtmlAttribute(fontStyleString),
-    //                 '" /></g_vml_:line>');
-
-    //    this.element_.insertAdjacentHTML('beforeEnd', lineStr.join(''));
-    //  };
-
-    //  contextPrototype.fillText = function(text, x, y, maxWidth) {
-    //    this.drawText_(text, x, y, maxWidth, false);
-    //  };
-
-    //  contextPrototype.strokeText = function(text, x, y, maxWidth) {
-    //    this.drawText_(text, x, y, maxWidth, true);
-    //  };
-
-    //  contextPrototype.measureText = function(text) {
-    //    if (!this.textMeasureEl_) {
-    //      var s = '<span style="position:absolute;' +
-    //          'top:-20000px;left:0;padding:0;margin:0;border:none;' +
-    //          'white-space:pre;"></span>';
-    //      this.element_.insertAdjacentHTML('beforeEnd', s);
-    //      this.textMeasureEl_ = this.element_.lastChild;
-    //    }
-    //    var doc = this.element_.ownerDocument;
-    //    this.textMeasureEl_.innerHTML = '';
-    //    this.textMeasureEl_.style.font = this.font;
-    //    // Don't use innerHTML or innerText because they allow markup/whitespace.
-    //    this.textMeasureEl_.appendChild(doc.createTextNode(text));
-    //    return {width: this.textMeasureEl_.offsetWidth};
-    //  };
-
-    /******** STUBS ********/
-    //  contextPrototype.clip = function() {
-    //    // TODO: Implement
-    //  };
-
-    //  contextPrototype.arcTo = function() {
-    //    // TODO: Implement
-    //  };
-
-    //  contextPrototype.createPattern = function(image, repetition) {
-    //    return new CanvasPattern_(image, repetition);
-    //  };
-
-    //  // Gradient / Pattern Stubs
-    //  function CanvasGradient_(aType) {
-    //    this.type_ = aType;
-    //    this.x0_ = 0;
-    //    this.y0_ = 0;
-    //    this.r0_ = 0;
-    //    this.x1_ = 0;
-    //    this.y1_ = 0;
-    //    this.r1_ = 0;
-    //    this.colors_ = [];
-    //  }
-
-    //  CanvasGradient_.prototype.addColorStop = function(aOffset, aColor) {
-    //    aColor = processStyle(aColor);
-    //    this.colors_.push({offset: aOffset,
-    //                       color: aColor.color,
-    //                       alpha: aColor.alpha});
-    //  };
-
-    //  function CanvasPattern_(image, repetition) {
-    //    assertImageIsValid(image);
-    //    switch (repetition) {
-    //      case 'repeat':
-    //      case null:
-    //      case '':
-    //        this.repetition_ = 'repeat';
-    //        break
-    //      case 'repeat-x':
-    //      case 'repeat-y':
-    //      case 'no-repeat':
-    //        this.repetition_ = repetition;
-    //        break;
-    //      default:
-    //        throwException('SYNTAX_ERR');
-    //    }
-
-    //    this.src_ = image.src;
-    //    this.width_ = image.width;
-    //    this.height_ = image.height;
-    //  }
-
-    function throwException(s) {
-      throw new DOMException_(s);
-    }
-
-    //  function assertImageIsValid(img) {
-    //    if (!img || img.nodeType != 1 || img.tagName != 'IMG') {
-    //      throwException('TYPE_MISMATCH_ERR');
-    //    }
-    //    if (img.readyState != 'complete') {
-    //      throwException('INVALID_STATE_ERR');
-    //    }
-    //  }
-
-    function DOMException_(s) {
-      this.code = this[s];
-      this.message = s + ': DOM Exception ' + this.code;
-    }
-    var p = DOMException_.prototype = new Error;
-    p.INDEX_SIZE_ERR = 1;
-    p.DOMSTRING_SIZE_ERR = 2;
-    p.HIERARCHY_REQUEST_ERR = 3;
-    p.WRONG_DOCUMENT_ERR = 4;
-    p.INVALID_CHARACTER_ERR = 5;
-    p.NO_DATA_ALLOWED_ERR = 6;
-    p.NO_MODIFICATION_ALLOWED_ERR = 7;
-    p.NOT_FOUND_ERR = 8;
-    p.NOT_SUPPORTED_ERR = 9;
-    p.INUSE_ATTRIBUTE_ERR = 10;
-    p.INVALID_STATE_ERR = 11;
-    p.SYNTAX_ERR = 12;
-    p.INVALID_MODIFICATION_ERR = 13;
-    p.NAMESPACE_ERR = 14;
-    p.INVALID_ACCESS_ERR = 15;
-    p.VALIDATION_ERR = 16;
-    p.TYPE_MISMATCH_ERR = 17;
-
-    // set up externs
-    G_vmlCanvasManager = G_vmlCanvasManager_;
-    CanvasRenderingContext2D = CanvasRenderingContext2D_;
-    //CanvasGradient = CanvasGradient_;
-    //CanvasPattern = CanvasPattern_;
-    DOMException = DOMException_;
-  })();
-
-} // if
-
-/*! JsRender v1.0pre: http://github.com/BorisMoore/jsrender */
-/*
- * Optimized version of jQuery Templates, for rendering to string.
- * Does not require jQuery, or HTML DOM
- * Integrates with JsViews (http://github.com/BorisMoore/jsviews)
- * Copyright 2012, Boris Moore
- * Released under the MIT License.
- */
-// informal pre beta commit counter: 3
-
-this.jsviews || this.jQuery && jQuery.views || (function( window, undefined ) {
-
-//========================== Top-level vars ==========================
-
-var versionNumber = "v1.0pre",
-
-       $, rTag, rTmplString, extend,
-       sub = {},
-       FALSE = false, TRUE = true,
-       jQuery = window.jQuery,
-
-       rPath = /^(?:null|true|false|\d[\d.]*|([\w$]+|~([\w$]+)|#(view|([\w$]+))?)([\w$.]*?)(?:[.[]([\w$]+)\]?)?|(['"]).*\8)$/g,
-       //                                 nil    object   helper    view  viewProperty pathTokens   leafToken     string
-
-       rParams = /(\()(?=|\s*\()|(?:([([])\s*)?(?:([#~]?[\w$.]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*!:?\/]|(=))\s*|([#~]?[\w$.]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*([)\]])([([]?))|(\s+)/g,
-       //          lftPrn        lftPrn2                path    operator err                                                eq         path2       prn    comma   lftPrn2   apos quot        rtPrn   prn2   space
-       // (left paren? followed by (path? followed by operator) or (path followed by paren?)) or comma or apos or quot or right paren or space
-
-    rNewLine = /\r?\n/g,
-       rUnescapeQuotes = /\\(['"])/g,
-       rEscapeQuotes = /\\?(['"])/g,
-       rBuildHash = /\x08(~)?([^\x08]+)\x08/g,
-
-       autoViewKey = 0,
-       autoTmplName = 0,
-       escapeMapForHtml = {
-               "&": "&amp;",
-               "<": "&lt;",
-               ">": "&gt;"
-       },
-       tmplAttr = "data-jsv-tmpl",
-       fnDeclStr = "var j=j||" + (jQuery ? "jQuery." : "js") + "views,",
-       htmlSpecialChar = /[\x00"&'<>]/g,
-       slice = Array.prototype.slice,
-
-       render = {},
-
-       // jsviews object ($.views if jQuery is loaded)
-       jsv = {
-               jsviews: versionNumber,
-               sub: sub, // subscription, e.g. JsViews integration
-               debugMode: TRUE,
-               err: function( e ) {
-                       return jsv.debugMode ? ("<br/><b>Error:</b> <em> " + (e.message || e) + ". </em>") : '""';
-               },
-               tmplFn: tmplFn,
-               render: render,
-               templates: templates,
-               tags: tags,
-               helpers: helpers,
-               converters: converters,
-               View: View,
-               convert: convert,
-               delimiters: setDelimiters,
-               tag: renderTag
-       };
-
-//========================== Top-level functions ==========================
-
-//===================
-// jsviews.delimiters
-//===================
-
-function setDelimiters( openChars, closeChars ) {
-       // Set the tag opening and closing delimiters. Default is "{{" and "}}"
-       // openChar, closeChars: opening and closing strings, each with two characters
-       var firstOpenChar = "\\" + openChars.charAt( 0 ), // Escape the characters - since they could be regex special characters
-               secondOpenChar = "\\" + openChars.charAt( 1 ),
-               firstCloseChar = "\\" + closeChars.charAt( 0 ),
-               secondCloseChar = "\\" + closeChars.charAt( 1 );
-       // Build regex with new delimiters
-       jsv.rTag = rTag // make rTag available to JsViews (or other components) for parsing binding expressions
-               = secondOpenChar
-                       //          tag    (followed by / space or })   or  colon     or  html or code
-               + "(?:(?:(\\w+(?=[\\/\\s" + firstCloseChar + "]))|(?:(\\w+)?(:)|(>)|(\\*)))"
-               //     params
-               + "\\s*((?:[^" + firstCloseChar + "]|" + firstCloseChar + "(?!" + secondCloseChar + "))*?)"
-               //  slash or closeBlock
-               + "(\\/)?|(?:\\/(\\w+)))"
-       //  }}
-       + firstCloseChar;
-
-       // Default rTag:    tag          converter colon  html  code     params         slash   closeBlock
-       //          /{{(?:(?:(\w+(?=[\/\s\}]))|(?:(\w+)?(:)|(>)|(\*)))\s*((?:[^}]|}(?!\}))*?)(\/)?|(?:\/(\w+)))}}
-
-       //      /{{(?:(?:(\w+(?=[\/!\s\}!]))|(?:(\w+)?(:)|(>)|(\*)))((?:[^\}]|}(?!}))*?)(\/)?|(?:\/(\w+)))}}/g;
-       rTag = new RegExp( firstOpenChar + rTag + secondCloseChar, "g" );
-       rTmplString = new RegExp( "<.*>|" + openChars + ".*" + closeChars );
-       return this;
-}
-
-//=================
-// View.hlp
-//=================
-
-function getHelper( helper ) {
-       // Helper method called as view.hlp() from compiled template, for helper functions or template parameters ~foo
-       var view = this,
-       tmplHelpers = view.tmpl.helpers || {};
-       helper = (view.ctx[ helper ] !== undefined ? view.ctx : tmplHelpers[ helper ] !== undefined ? tmplHelpers : helpers[ helper ] !== undefined ? helpers : {})[ helper ];
-       return typeof helper !== "function" ? helper : function() {
-               return helper.apply(view, arguments);
-       };
-}
-
-//=================
-// jsviews.convert
-//=================
-
-function convert( converter, view, text ) {
-       var tmplConverters = view.tmpl.converters;
-       converter = tmplConverters && tmplConverters[ converter ] || converters[ converter ];
-       return converter ? converter.call( view, text ) : text;
-}
-
-//=================
-// jsviews.tag
-//=================
-
-function renderTag( tag, parentView, converter, content, tagObject ) {
-       // Called from within compiled template function, to render a nested tag
-       // Returns the rendered tag
-       tagObject.props = tagObject.props || {};
-       var ret,
-               tmpl = tagObject.props.tmpl,
-               tmplTags = parentView.tmpl.tags,
-               nestedTemplates = parentView.tmpl.templates,
-               args = arguments,
-               tagFn = tmplTags && tmplTags[ tag ] || tags[ tag ];
-
-       if ( !tagFn ) {
-               return "";
-       }
-       // Set the tmpl property to the content of the block tag, unless set as an override property on the tag
-       content = content && parentView.tmpl.tmpls[ content - 1 ];
-       tmpl = tmpl || content || undefined;
-       tagObject.tmpl =
-               "" + tmpl === tmpl // if a string
-                       ? nestedTemplates && nestedTemplates[ tmpl ] || templates[ tmpl ] || templates( tmpl )
-                       : tmpl;
-
-       tagObject.isTag = TRUE;
-       tagObject.converter = converter;
-       tagObject.view = parentView;
-       tagObject.renderContent = renderContent;
-       if ( parentView.ctx ) {
-               extend( tagObject.ctx, parentView.ctx);
-       }
-
-       ret = tagFn.apply( tagObject, args.length > 5 ? slice.call( args, 5 ) : [] );
-       return ret || ( ret == undefined ? "" : ret.toString()); // (If ret is the value 0 or false, will render to string)
-}
-
-//=================
-// View constructor
-//=================
-
-function View( context, path, parentView, data, template, index ) {
-       // Constructor for view object in view hierarchy. (Augmented by JsViews if JsViews is loaded)
-       var views = parentView.views,
-//     TODO: add this, as part of smart re-linking on existing content ($.link method), or remove completely
-//                     self = parentView.views[ index ];
-//                     if ( !self ) { ... }
-               self = {
-                       tmpl: template,
-                       path: path,
-                       parent: parentView,
-                       data: data,
-                       ctx: context,
-                       views: $.isArray( data ) ? [] : {},
-                       hlp: getHelper
-               };
-
-       if ( $.isArray( views ))  {
-               views.splice(
-                       self.index = index !== undefined
-                               ? index
-                               : views.length, 0, self
-               );
-       } else {
-               views[ self.index = "_" + autoViewKey++ ] = self;
-       }
-       return self;
-}
-
-//=================
-// Registration
-//=================
-
-function addToStore( self, store, name, item, process ) {
-       // Add item to named store such as templates, helpers, converters...
-       var key, onStore;
-       if ( name && typeof name === "object" && !name.nodeType ) {
-               // If name is a map, iterate over map and call store for key
-               for ( key in name ) {
-                       store( key, name[ key ]);
-               }
-               return self;
-       }
-       if ( !name || item === undefined ) {
-               if ( process ) {
-                       item = process( undefined, item || name );
-               }
-       } else if ( "" + name === name ) { // name must be a string
-               if ( item === null ) {
-                       // If item is null, delete this entry
-                       delete store[name];
-               } else if ( item = process ? process( name, item ) : item ) {
-                       store[ name ] = item;
-               }
-       }
-       if ( onStore = sub.onStoreItem ) {
-               // e.g. JsViews integration
-               onStore( store, name, item, process );
-       }
-       return item;
-}
-
-function templates( name, tmpl ) {
-       // Register templates
-       // Setter: Use $.view.tags( name, tagFn ) or $.view.tags({ name: tagFn, ... }) to add additional tags to the registered tags collection.
-       // Getter: Use var tagFn = $.views.tags( name ) or $.views.tags[name] or $.views.tags.name to return the function for the registered tag.
-       // Remove: Use $.view.tags( name, null ) to remove a registered tag from $.view.tags.
-
-       // When registering for {{foo a b c==d e=f}}, tagFn should be a function with the signature:
-       // function(a,b). The 'this' pointer will be a hash with properties c and e.
-       return addToStore( this, templates, name, tmpl, compile );
-}
-
-function tags( name, tagFn ) {
-       // Register template tags
-       // Setter: Use $.view.tags( name, tagFn ) or $.view.tags({ name: tagFn, ... }) to add additional tags to the registered tags collection.
-       // Getter: Use var tagFn = $.views.tags( name ) or $.views.tags[name] or $.views.tags.name to return the function for the registered tag.
-       // Remove: Use $.view.tags( name, null ) to remove a registered tag from $.view.tags.
-
-       // When registering for {{foo a b c==d e=f}}, tagFn should be a function with the signature:
-       // function(a,b). The 'this' pointer will be a hash with properties c and e.
-       return addToStore( this, tags, name, tagFn );
-}
-
-function helpers( name, helperFn ) {
-       // Register helper functions for use in templates (or in data-link expressions if JsViews is loaded)
-       // Setter: Use $.view.helpers( name, helperFn ) or $.view.helpers({ name: helperFn, ... }) to add additional helpers to the registered helpers collection.
-       // Getter: Use var helperFn = $.views.helpers( name ) or $.views.helpers[name] or $.views.helpers.name to return the function.
-       // Remove: Use $.view.helpers( name, null ) to remove a registered helper function from $.view.helpers.
-       // Within a template, access the helper using the syntax: {{... ~myHelper(...) ...}}.
-       return addToStore( this, helpers, name, helperFn );
-}
-
-function converters( name, converterFn ) {
-       // Register converter functions for use in templates (or in data-link expressions if JsViews is loaded)
-       // Setter: Use $.view.converters( name, converterFn ) or $.view.converters({ name: converterFn, ... }) to add additional converters to the registered converters collection.
-       // Getter: Use var converterFn = $.views.converters( name ) or $.views.converters[name] or $.views.converters.name to return the converter function.
-       // Remove: Use $.view.converters( name, null ) to remove a registered converter from $.view.converters.
-       // Within a template, access the converter using the syntax: {{myConverter:...}}.
-       return addToStore( this, converters, name, converterFn );
-}
-
-//=================
-// renderContent
-//=================
-
-function renderContent( data, context, parentView, path, index ) {
-       // Render template against data as a tree of subviews (nested template), or as a string (top-level template).
-       // tagName parameter for internal use only. Used for rendering templates registered as tags (which may have associated presenter objects)
-       var i, l, dataItem, newView, itemWrap, itemsWrap, itemResult, parentContext, tmpl, layout,
-               props = {},
-               swapContent = index === TRUE,
-               self = this,
-               result = "";
-
-       if ( self.isTag ) {
-               // This is a call from renderTag
-               tmpl = self.tmpl;
-               context = context || self.ctx;
-               parentView = parentView || self.view;
-               path = path || self.path;
-               index = index || self.index;
-               props = self.props;
-       } else {
-               tmpl = self.jquery && self[0] // This is a call $.fn.render
-                       || self; // This is a call from tmpl.render
-       }
-       parentView = parentView || jsv.topView;
-       parentContext = parentView.ctx;
-       layout = tmpl.layout;
-       if ( data === parentView ) {
-               // Inherit the data from the parent view.
-               // This may be the contents of an {{if}} block
-               data = parentView.data;
-               layout = TRUE;
-       }
-
-       // Set additional context on views created here, (as modified context inherited from the parent, and be inherited by child views)
-       // Note: If no jQuery, extend does not support chained copies - so limit extend() to two parameters
-       context = (context && context === parentContext)
-               ? parentContext
-               : (parentContext
-                       // if parentContext, make copy
-                       ? ((parentContext = extend( {}, parentContext ), context)
-                               // If context, merge context with copied parentContext
-                               ? extend( parentContext, context )
-                               : parentContext)
-                       // if no parentContext, use context, or default to {}
-                       : context || {});
-
-       if ( props.link === FALSE ) {
-               // Override inherited value of link by an explicit setting in props: link=false
-               // The child views of an unlinked view are also unlinked. So setting child back to true will not have any effect.
-               context.link = FALSE;
-       }
-       if ( !tmpl.fn ) {
-               tmpl = templates[ tmpl ] || templates( tmpl );
-       }
-       itemWrap = context.link && sub.onRenderItem;
-       itemsWrap = context.link && sub.onRenderItems;
-
-       if ( tmpl ) {
-               if ( $.isArray( data ) && !layout ) {
-                       // Create a view for the array, whose child views correspond to each data item.
-                       // (Note: if index and parentView are passed in along with parent view, treat as
-                       // insert -e.g. from view.addViews - so parentView is already the view item for array)
-                       newView = swapContent ? parentView : (index !== undefined && parentView) || View( context, path, parentView, data, tmpl, index );
-
-                       for ( i = 0, l = data.length; i < l; i++ ) {
-                               // Create a view for each data item.
-                               dataItem = data[ i ];
-                               itemResult = tmpl.fn( dataItem, View( context, path, newView, dataItem, tmpl, (index||0) + i ), jsv );
-                               result += itemWrap ? itemWrap( itemResult, props ) : itemResult;
-                       }
-               } else {
-                       // Create a view for singleton data object.
-                       newView = swapContent ? parentView : View( context, path, parentView, data, tmpl, index );
-                       result += (data || layout) ? tmpl.fn( data, newView, jsv ) : "";
-               }
-               parentView.topKey = newView.index;
-               return itemsWrap ? itemsWrap( result, path, newView.index, tmpl, props ) : result;
-       }
-       return ""; // No tmpl. Could throw...
-}
-
-//===========================
-// Build and compile template
-//===========================
-
-// Generate a reusable function that will serve to render a template against data
-// (Compile AST then build template function)
-
-function syntaxError() {
-       throw "Syntax error";
-}
-
-function tmplFn( markup, tmpl, bind ) {
-       // Compile markup to AST (abtract syntax tree) then build the template function code from the AST nodes
-       // Used for compiling templates, and also by JsViews to build functions for data link expressions
-       var newNode, node, i, l, code, hasTag, hasEncoder, getsValue, hasConverter, hasViewPath, tag, converter, params, hash, nestedTmpl, allowCode,
-               tmplOptions = tmpl ? {
-                       allowCode: allowCode = tmpl.allowCode,
-                       debug: tmpl.debug
-               } : {},
-               nested = tmpl && tmpl.tmpls,
-               astTop = [],
-               loc = 0,
-               stack = [],
-               content = astTop,
-               current = [,,,astTop],
-               nestedIndex = 0;
-
-       //==== nested functions ====
-       function pushPreceedingContent( shift ) {
-               shift -= loc;
-               if ( shift ) {
-                       content.push( markup.substr( loc, shift ).replace( rNewLine, "\\n" ));
-               }
-       }
-
-       function parseTag( all, tagName, converter, colon, html, code, params, slash, closeBlock, index ) {
-               //                  tag           converter colon  html  code     params         slash   closeBlock
-               //      /{{(?:(?:(\w+(?=[\/!\s\}!]))|(?:(\w+)?(:)|(?:(>)|(\*)))((?:[^\}]|}(?!}))*?)(\/)?|(?:\/(\w+)))}}/g;
-               // Build abstract syntax tree (AST): [ tagName, converter, params, content, hash, contentMarkup ]
-               if ( html ) {
-                       colon = ":";
-                       converter = "html";
-               }
-               var hash = "",
-                       passedCtx = "",
-                       block = !slash && !colon; // Block tag if not self-closing and not {{:}} or {{>}} (special case)
-
-               //==== nested helper function ====
-
-               tagName = tagName || colon;
-               pushPreceedingContent( index );
-               loc = index + all.length; // location marker - parsed up to here
-               if ( code ) {
-                       if ( allowCode ) {
-                               content.push([ "*", params.replace( rUnescapeQuotes, "$1" ) ]);
-                       }
-               } else if ( tagName ) {
-                       if ( tagName === "else" ) {
-                               current[ 5 ] = markup.substring( current[ 5 ], index ); // contentMarkup for block tag
-                               current = stack.pop();
-                               content = current[ 3 ];
-                               block = TRUE;
-                       }
-                       params = (params
-                               ? parseParams( params, bind )
-                                       .replace( rBuildHash, function( all, isCtx, keyValue ) {
-                                               if ( isCtx ) {
-                                                       passedCtx += keyValue + ",";
-                                               } else {
-                                                       hash += keyValue + ",";
-                                               }
-                                               return "";
-                                       })
-                               : "");
-                       hash = hash.slice( 0, -1 );
-                       params = params.slice( 0, -1 );
-                       newNode = [
-                               tagName,
-                               converter || "",
-                               params,
-                               block && [],
-                               "{" + (hash ? ("props:{" + hash + "},"): "") + "path:'" + params + "'" + (passedCtx ? ",ctx:{" + passedCtx.slice( 0, -1 ) + "}" : "") + "}"
-                       ];
-                       if ( block ) {
-                               stack.push( current );
-                               current = newNode;
-                               current[ 5 ] = loc; // Store current location of open tag, to be able to add contentMarkup when we reach closing tag
-                       }
-                       content.push( newNode );
-               } else if ( closeBlock ) {
-                       //if ( closeBlock !== current[ 0 ]) {
-                       //      throw "unmatched close tag: /" + closeBlock + ". Expected /" + current[ 0 ];
-                       //}
-                       current[ 5 ] = markup.substring( current[ 5 ], index ); // contentMarkup for block tag
-                       current = stack.pop();
-               }
-               if ( !current ) {
-                       throw "Expected block tag";
-               }
-               content = current[ 3 ];
-       }
-       //==== /end of nested functions ====
-
-       markup = markup.replace( rEscapeQuotes, "\\$1" );
-
-       // Build the AST (abstract syntax tree) under astTop
-       markup.replace( rTag, parseTag );
-
-       pushPreceedingContent( markup.length );
-
-       // Use the AST (astTop) to build the template function
-       l = astTop.length;
-       code = (l ? "" : '"";');
-
-       for ( i = 0; i < l; i++ ) {
-               // AST nodes: [ tagName, converter, params, content, hash, contentMarkup ]
-               node = astTop[ i ];
-               if ( node[ 0 ] === "*" ) {
-                       code = code.slice( 0, i ? -1 : -3 ) + ";" + node[ 1 ] + (i + 1 < l ? "ret+=" : "");
-               } else if ( "" + node === node ) { // type string
-                       code += '"' + node + '"+';
-               } else {
-                       tag = node[ 0 ];
-                       converter = node[ 1 ];
-                       params = node[ 2 ];
-                       content = node[ 3 ];
-                       hash = node[ 4 ];
-                       markup = node[ 5 ];
-                       if ( content ) {
-                               // Create template object for nested template
-                               nestedTmpl = TmplObject( markup, tmplOptions, tmpl, nestedIndex++ );
-                               // Compile to AST and then to compiled function
-                               tmplFn( markup, nestedTmpl);
-                               nested.push( nestedTmpl );
-                       }
-                       hasViewPath = hasViewPath || hash.indexOf( "view" ) > -1;
-                       code += (tag === ":"
-                               ? (converter === "html"
-                                       ? (hasEncoder = TRUE, "e(" + params)
-                                       : converter
-                                               ? (hasConverter = TRUE, 'c("' + converter + '",view,' + params)
-                                               : (getsValue = TRUE, "((v=" + params + ')!=u?v:""')
-                               )
-                               : (hasTag = TRUE, 't("' + tag + '",view,"' + (converter || "") + '",'
-                                       + (content ? nested.length : '""') // For block tags, pass in the key (nested.length) to the nested content template
-                                       + "," + hash + (params ? "," : "") + params))
-                                       + ")+";
-               }
-       }
-       code =  new Function( "data, view, j, b, u", fnDeclStr
-               + (getsValue ? "v," : "")
-               + (hasTag ? "t=j.tag," : "")
-               + (hasConverter ? "c=j.convert," : "")
-               + (hasEncoder ? "e=j.converters.html," : "")
-               + "ret; try{\n\n"
-               + (tmplOptions.debug ? "debugger;" : "")
-               + (allowCode ? 'ret=' : 'return ')
-               + code.slice( 0, -1 ) + ";\n\n"
-               + (allowCode ? "return ret;" : "")
-               + "}catch(e){return j.err(e);}"
-       );
-
-       // Include only the var references that are needed in the code
-       if ( tmpl ) {
-               tmpl.fn = code;
-               tmpl.useVw = hasConverter || hasViewPath || hasTag;
-       }
-       return code;
-}
-
-function parseParams( params, bind ) {
-       var named,
-               fnCall = {},
-               parenDepth = 0,
-               quoted = FALSE, // boolean for string content in double quotes
-               aposed = FALSE; // or in single quotes
-
-       function parseTokens( all, lftPrn0, lftPrn, path, operator, err, eq, path2, prn, comma, lftPrn2, apos, quot, rtPrn, prn2, space ) {
-               // rParams = /(?:([([])\s*)?(?:([#~]?[\w$.]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*!:?\/]|(=))\s*|([#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*([)\]])([([]?))|(\s+)/g,
-               //            lftPrn                  path    operator err                                                eq         path2       prn    comma   lftPrn3   apos quot        rtPrn   prn2   space
-               // (left paren? followed by (path? followed by operator) or (path followed by paren?)) or comma or apos or quot or right paren or space
-               operator = operator || "";
-               lftPrn = lftPrn || lftPrn0 || lftPrn2;
-               path = path || path2;
-               prn = prn || prn2 || "";
-               operator = operator || "";
-
-               function parsePath( all, object, helper, view, viewProperty, pathTokens, leafToken ) {
-               // rPath = /^(?:null|true|false|\d[\d.]*|([\w$]+|~([\w$]+)|#(view|([\w$]+))?)([\w$.]*?)(?:[.[]([\w$]+)\]?)?|(['"]).*\8)$/g,
-               //                                        object   helper    view  viewProperty pathTokens   leafToken     string
-                       if ( object ) {
-                               var ret = (helper
-                                       ? 'view.hlp("' + helper + '")'
-                                       : view
-                                               ? "view"
-                                               : "data")
-                               + (leafToken
-                                       ? (viewProperty
-                                               ? "." + viewProperty
-                                               : helper
-                                                       ? ""
-                                                       : (view ? "" : "." + object)
-                                               ) + (pathTokens || "")
-                                       : (leafToken = helper ? "" : view ? viewProperty || "" : object, ""));
-
-                               if ( bind && prn !== "(" ) {
-                                       ret = "b(" + ret + ',"' + leafToken + '")';
-                               }
-                               return ret + (leafToken ? "." + leafToken : "");
-                       }
-                       return all;
-               }
-
-               if ( err ) {
-                       syntaxError();
-               } else {
-                       return (aposed
-                               // within single-quoted string
-                               ? (aposed = !apos, (aposed ? all : '"'))
-                               : quoted
-                                       // within double-quoted string
-                                       ? (quoted = !quot, (quoted ? all : '"'))
-                                       :
-                               (
-                                       (lftPrn
-                                                       ? (parenDepth++, lftPrn)
-                                                       : "")
-                                       + (space
-                                               ? (parenDepth
-                                                       ? ""
-                                                       : named
-                                                               ? (named = FALSE, "\b")
-                                                               : ","
-                                               )
-                                               : eq
-                                                       // named param
-                                                       ? (parenDepth && syntaxError(), named = TRUE, '\b' + path + ':')
-                                                       : path
-                                                               // path
-                                                               ? (path.replace( rPath, parsePath )
-                                                                       + (prn
-                                                                               ? (fnCall[ ++parenDepth ] = TRUE, prn)
-                                                                               : operator)
-                                                               )
-                                                               : operator
-                                                                       ? all
-                                                                       : rtPrn
-                                                                               // function
-                                                                               ? ((fnCall[ parenDepth-- ] = FALSE, rtPrn)
-                                                                                       + (prn
-                                                                                               ? (fnCall[ ++parenDepth ] = TRUE, prn)
-                                                                                               : "")
-                                                                               )
-                                                                               : comma
-                                                                                       ? (fnCall[ parenDepth ] || syntaxError(), ",") // We don't allow top-level literal arrays or objects
-                                                                                       : lftPrn0
-                                                                                               ? ""
-                                                                                               : (aposed = apos, quoted = quot, '"')
-                               ))
-                       );
-               }
-       }
-       params = (params + " " ).replace( rParams, parseTokens );
-       return params;
-}
-
-function compile( name, tmpl, parent, options ) {
-       // tmpl is either a template object, a selector for a template script block, the name of a compiled template, or a template object
-       // options is the set of template properties, c
-       var tmplOrMarkup, elem, key, nested, nestedItem;
-
-       //==== nested functions ====
-       function tmplOrMarkupFromStr( value ) {
-               // If value is of type string - treat as selector, or name of compiled template
-               // Return the template object, if already compiled, or the markup string
-
-               if ( ("" + value === value) || value.nodeType > 0 ) {
-                       // If selector is valid and returns at least one element, get first element
-                       elem = value.nodeType > 0 ? value : !rTmplString.test( value ) && jQuery && jQuery( value )[0];
-                       if ( elem && elem.type ) {
-                               // It is a script element
-                               // Create a name for data linking if none provided
-                               value = templates[ elem.getAttribute( tmplAttr )];
-                               if ( !value ) {
-                                       // Not already compiled and cached, so compile and cache the name
-                                       name = name || "_" + autoTmplName++;
-                                       elem.setAttribute( tmplAttr, name );
-                                       value = compile( name, elem.innerHTML, parent, options ); // Use tmpl as options
-                                       templates[ name ] = value;
-                               }
-                       }
-                       return value;
-               }
-               // If value is not a string or dom element, return undefined
-       }
-
-       //==== Compile the template ====
-       tmplOrMarkup = tmplOrMarkupFromStr( tmpl );
-
-       // If tmpl is a template object, use it for options
-       options = options || (tmpl.markup ? tmpl : {});
-       options.name = name;
-       nested = options.templates;
-
-       // If tmpl is not a markup string or a selector string, then it must be a template object
-       // In that case, get it from the markup property of the object
-       if ( !tmplOrMarkup && tmpl.markup && (tmplOrMarkup = tmplOrMarkupFromStr( tmpl.markup ))) {
-               if ( tmplOrMarkup.fn && (tmplOrMarkup.debug !== tmpl.debug || tmplOrMarkup.allowCode !== tmpl.allowCode )) {
-                       // if the string references a compiled template object, but the debug or allowCode props are different, need to recompile
-                       tmplOrMarkup = tmplOrMarkup.markup;
-               }
-       }
-       if ( tmplOrMarkup !== undefined ) {
-               if ( name && !parent ) {
-                       render[ name ] = function() {
-                               return tmpl.render.apply( tmpl, arguments );
-                       };
-               }
-               if ( tmplOrMarkup.fn || tmpl.fn ) {
-                       // tmpl is already compiled, so use it, or if different name is provided, clone it
-                       if ( tmplOrMarkup.fn ) {
-                               if ( name && name !== tmplOrMarkup.name ) {
-                                       tmpl = extend( extend( {}, tmplOrMarkup ), options);
-                               } else {
-                                       tmpl = tmplOrMarkup;
-                               }
-                       }
-               } else {
-                       // tmplOrMarkup is a markup string, not a compiled template
-                       // Create template object
-                       tmpl = TmplObject( tmplOrMarkup, options, parent, 0 );
-                       // Compile to AST and then to compiled function
-                       tmplFn( tmplOrMarkup, tmpl );
-               }
-               for ( key in nested ) {
-                       // compile nested template declarations
-                       nestedItem = nested[ key ];
-                       if ( nestedItem.name !== key ) {
-                               nested[ key ] = compile( key, nestedItem, tmpl );
-                       }
-               }
-               return tmpl;
-       }
-}
-//==== /end of function compile ====
-
-function TmplObject( markup, options, parent, index ) {
-       // Template object constructor
-
-       // nested helper function
-       function extendStore( storeName ) {
-               if ( parent[ storeName ]) {
-                       // Include parent items except if overridden by item of same name in options
-                       tmpl[ storeName ] = extend( extend( {}, parent[ storeName ] ), options[ storeName ] );
-               }
-       }
-
-       options = options || {};
-       var tmpl = {
-                       markup: markup,
-                       tmpls: [],
-                       links: [],
-                       render: renderContent
-               };
-       if ( parent ) {
-               if ( parent.templates ) {
-                       tmpl.templates = extend( extend( {}, parent.templates ), options.templates );
-               }
-               tmpl.parent = parent;
-               tmpl.name = parent.name + "[" + index + "]";
-               tmpl.index = index;
-       }
-
-       extend( tmpl, options );
-       if ( parent ) {
-               extendStore( "templates" );
-               extendStore( "tags" );
-               extendStore( "helpers" );
-               extendStore( "converters" );
-       }
-       return tmpl;
-}
-
-//========================== Initialize ==========================
-
-if ( jQuery ) {
-       ////////////////////////////////////////////////////////////////////////////////////////////////
-       // jQuery is loaded, so make $ the jQuery object
-       $ = jQuery;
-       $.templates = templates;
-       $.render = render;
-       $.views = jsv;
-       $.fn.render = renderContent;
-
-} else {
-       ////////////////////////////////////////////////////////////////////////////////////////////////
-       // jQuery is not loaded.
-
-       $ = window.jsviews = jsv;
-       $.extend = function( target, source ) {
-               var name;
-               target =  target || {};
-               for ( name in source ) {
-                       target[ name ] = source[ name ];
-               }
-               return target;
-       };
-
-       $.isArray = Array && Array.isArray || function( obj ) {
-               return Object.prototype.toString.call( obj ) === "[object Array]";
-       };
-}
-
-extend = $.extend;
-
-jsv.topView = { views: {}, tmpl: {}, hlp: getHelper, ctx: jsv.helpers };
-
-function replacerForHtml( ch ) {
-       // Original code from Mike Samuel <msamuel@google.com>
-       return escapeMapForHtml[ ch ]
-               // Intentional assignment that caches the result of encoding ch.
-               || (escapeMapForHtml[ ch ] = "&#" + ch.charCodeAt( 0 ) + ";");
-}
-
-//========================== Register tags ==========================
-
-tags({
-       "if": function() {
-               var ifTag = this,
-                       view = ifTag.view;
-
-               view.onElse = function( tagObject, args ) {
-                       var i = 0,
-                               l = args.length;
-
-                       while ( l && !args[ i++ ]) {
-                               // Only render content if args.length === 0 (i.e. this is an else with no condition) or if a condition argument is truey
-                               if ( i === l ) {
-                                       return "";
-                               }
-                       }
-                       view.onElse = undefined; // If condition satisfied, so won't run 'else'.
-                       tagObject.path = "";
-                       return tagObject.renderContent( view );
-                       // Test is satisfied, so render content, while remaining in current data context
-                       // By passing the view, we inherit data context from the parent view, and the content is treated as a layout template
-                       // (so if the data is an array, it will not iterate over the data
-               };
-               return view.onElse( this, arguments );
-       },
-       "else": function() {
-               var view = this.view;
-               return view.onElse ? view.onElse( this, arguments ) : "";
-       },
-       "for": function() {
-               var i,
-                       self = this,
-                       result = "",
-                       args = arguments,
-                       l = args.length;
-               if ( self.props.layout ) {
-                       self.tmpl.layout = TRUE;
-               }
-               for ( i = 0; i < l; i++ ) {
-                       result += self.renderContent( args[ i ]);
-               }
-               return result;
-       },
-       "=": function( value ) {
-               return value;
-       },
-       "*": function( value ) {
-               return value;
-       }
-});
-
-//========================== Register global helpers ==========================
-
-//     helpers({ // Global helper functions
-//             // TODO add any useful built-in helper functions
-//     });
-
-//========================== Register converters ==========================
-
-converters({
-       html: function( text ) {
-               // HTML encoding helper: Replace < > & and ' and " by corresponding entities.
-               // inspired by Mike Samuel <msamuel@google.com>
-               return text != undefined ? String( text ).replace( htmlSpecialChar, replacerForHtml ) : "";
-       }
-});
-
-//========================== Define default delimiters ==========================
-setDelimiters( "{{", "}}" );
-
-})( this );
-
-/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
- * Licensed under the MIT License (LICENSE.txt).
- *
- * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
- * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
- * Thanks to: Seamus Leahy for adding deltaX and deltaY
- *
- * Version: 3.0.6
- * 
- * Requires: 1.2.2+
- */
-
-(function($) {
-
-var types = ['DOMMouseScroll', 'mousewheel'];
-
-if ($.event.fixHooks) {
-    for ( var i=types.length; i; ) {
-        $.event.fixHooks[ types[--i] ] = $.event.mouseHooks;
-    }
-}
-
-$.event.special.mousewheel = {
-    setup: function() {
-        if ( this.addEventListener ) {
-            for ( var i=types.length; i; ) {
-                this.addEventListener( types[--i], handler, false );
-            }
-        } else {
-            this.onmousewheel = handler;
-        }
-    },
-    
-    teardown: function() {
-        if ( this.removeEventListener ) {
-            for ( var i=types.length; i; ) {
-                this.removeEventListener( types[--i], handler, false );
-            }
-        } else {
-            this.onmousewheel = null;
-        }
-    }
-};
-
-$.fn.extend({
-    mousewheel: function(fn) {
-        return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
-    },
-    
-    unmousewheel: function(fn) {
-        return this.unbind("mousewheel", fn);
-    }
-});
-
-
-function handler(event) {
-    var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
-    event = $.event.fix(orgEvent);
-    event.type = "mousewheel";
-    
-    // Old school scrollwheel delta
-    if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; }
-    if ( orgEvent.detail     ) { delta = -orgEvent.detail/3; }
-    
-    // New school multidimensional scroll (touchpads) deltas
-    deltaY = delta;
-    
-    // Gecko
-    if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
-        deltaY = 0;
-        deltaX = -1*delta;
-    }
-    
-    // Webkit
-    if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }
-    if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
-    
-    // Add event and delta to the front of the arguments
-    args.unshift(event, delta, deltaX, deltaY);
-    
-    return ($.event.dispatch || $.event.handle).apply(this, args);
-}
-
-})(jQuery);
-
-/*!
- * jQuery UI Widget 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Widget
- */
-
-if ( ! $.widget ) {
-
-(function( $, undefined ) {
-
-// jQuery 1.4+
-if ( $.cleanData ) {
-       var _cleanData = $.cleanData;
-       $.cleanData = function( elems ) {
-               for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
-                       try {
-                               $( elem ).triggerHandler( "remove" );
-                       // http://bugs.jquery.com/ticket/8235
-                       } catch( e ) {}
-               }
-               _cleanData( elems );
-       };
-} else {
-       var _remove = $.fn.remove;
-       $.fn.remove = function( selector, keepData ) {
-               return this.each(function() {
-                       if ( !keepData ) {
-                               if ( !selector || $.filter( selector, [ this ] ).length ) {
-                                       $( "*", this ).add( [ this ] ).each(function() {
-                                               try {
-                                                       $( this ).triggerHandler( "remove" );
-                                               // http://bugs.jquery.com/ticket/8235
-                                               } catch( e ) {}
-                                       });
-                               }
-                       }
-                       return _remove.call( $(this), selector, keepData );
-               });
-       };
-}
-
-$.widget = function( name, base, prototype ) {
-       var namespace = name.split( "." )[ 0 ],
-               fullName;
-       name = name.split( "." )[ 1 ];
-       fullName = namespace + "-" + name;
-
-       if ( !prototype ) {
-               prototype = base;
-               base = $.Widget;
-       }
-
-       // create selector for plugin
-       $.expr[ ":" ][ fullName ] = function( elem ) {
-               return !!$.data( elem, name );
-       };
-
-       $[ namespace ] = $[ namespace ] || {};
-       $[ namespace ][ name ] = function( options, element ) {
-               // allow instantiation without initializing for simple inheritance
-               if ( arguments.length ) {
-                       this._createWidget( options, element );
-               }
-       };
-
-       var basePrototype = new base();
-       // we need to make the options hash a property directly on the new instance
-       // otherwise we'll modify the options hash on the prototype that we're
-       // inheriting from
-//     $.each( basePrototype, function( key, val ) {
-//             if ( $.isPlainObject(val) ) {
-//                     basePrototype[ key ] = $.extend( {}, val );
-//             }
-//     });
-       basePrototype.options = $.extend( true, {}, basePrototype.options );
-       $[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
-               namespace: namespace,
-               widgetName: name,
-               widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
-               widgetBaseClass: fullName
-       }, prototype );
-
-       $.widget.bridge( name, $[ namespace ][ name ] );
-};
-
-$.widget.bridge = function( name, object ) {
-       $.fn[ name ] = function( options ) {
-               var isMethodCall = typeof options === "string",
-                       args = Array.prototype.slice.call( arguments, 1 ),
-                       returnValue = this;
-
-               // allow multiple hashes to be passed on init
-               options = !isMethodCall && args.length ?
-                       $.extend.apply( null, [ true, options ].concat(args) ) :
-                       options;
-
-               // prevent calls to internal methods
-               if ( isMethodCall && options.charAt( 0 ) === "_" ) {
-                       return returnValue;
-               }
-
-               if ( isMethodCall ) {
-                       this.each(function() {
-                               var instance = $.data( this, name ),
-                                       methodValue = instance && $.isFunction( instance[options] ) ?
-                                               instance[ options ].apply( instance, args ) :
-                                               instance;
-                               // TODO: add this back in 1.9 and use $.error() (see #5972)
-//                             if ( !instance ) {
-//                                     throw "cannot call methods on " + name + " prior to initialization; " +
-//                                             "attempted to call method '" + options + "'";
-//                             }
-//                             if ( !$.isFunction( instance[options] ) ) {
-//                                     throw "no such method '" + options + "' for " + name + " widget instance";
-//                             }
-//                             var methodValue = instance[ options ].apply( instance, args );
-                               if ( methodValue !== instance && methodValue !== undefined ) {
-                                       returnValue = methodValue;
-                                       return false;
-                               }
-                       });
-               } else {
-                       this.each(function() {
-                               var instance = $.data( this, name );
-                               if ( instance ) {
-                                       instance.option( options || {} )._init();
-                               } else {
-                                       $.data( this, name, new object( options, this ) );
-                               }
-                       });
-               }
-
-               return returnValue;
-       };
-};
-
-$.Widget = function( options, element ) {
-       // allow instantiation without initializing for simple inheritance
-       if ( arguments.length ) {
-               this._createWidget( options, element );
-       }
-};
-
-$.Widget.prototype = {
-       widgetName: "widget",
-       widgetEventPrefix: "",
-       options: {
-               disabled: false
-       },
-       _createWidget: function( options, element ) {
-               // $.widget.bridge stores the plugin instance, but we do it anyway
-               // so that it's stored even before the _create function runs
-               $.data( element, this.widgetName, this );
-               this.element = $( element );
-               this.options = $.extend( true, {},
-                       this.options,
-                       this._getCreateOptions(),
-                       options );
-
-               var self = this;
-               this.element.bind( "remove." + this.widgetName, function() {
-                       self.destroy();
-               });
-
-               this._create();
-               this._trigger( "create" );
-               this._init();
-       },
-       _getCreateOptions: function() {
-               return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];
-       },
-       _create: function() {},
-       _init: function() {},
-
-       destroy: function() {
-               this.element
-                       .unbind( "." + this.widgetName )
-                       .removeData( this.widgetName );
-               this.widget()
-                       .unbind( "." + this.widgetName )
-                       .removeAttr( "aria-disabled" )
-                       .removeClass(
-                               this.widgetBaseClass + "-disabled " +
-                               "ui-state-disabled" );
-       },
-
-       widget: function() {
-               return this.element;
-       },
-
-       option: function( key, value ) {
-               var options = key;
-
-               if ( arguments.length === 0 ) {
-                       // don't return a reference to the internal hash
-                       return $.extend( {}, this.options );
-               }
-
-               if  (typeof key === "string" ) {
-                       if ( value === undefined ) {
-                               return this.options[ key ];
-                       }
-                       options = {};
-                       options[ key ] = value;
-               }
-
-               this._setOptions( options );
-
-               return this;
-       },
-       _setOptions: function( options ) {
-               var self = this;
-               $.each( options, function( key, value ) {
-                       self._setOption( key, value );
-               });
-
-               return this;
-       },
-       _setOption: function( key, value ) {
-               this.options[ key ] = value;
-
-               if ( key === "disabled" ) {
-                       this.widget()
-                               [ value ? "addClass" : "removeClass"](
-                                       this.widgetBaseClass + "-disabled" + " " +
-                                       "ui-state-disabled" )
-                               .attr( "aria-disabled", value );
-               }
-
-               return this;
-       },
-
-       enable: function() {
-               return this._setOption( "disabled", false );
-       },
-       disable: function() {
-               return this._setOption( "disabled", true );
-       },
-
-       _trigger: function( type, event, data ) {
-               var prop, orig,
-                       callback = this.options[ type ];
-
-               data = data || {};
-               event = $.Event( event );
-               event.type = ( type === this.widgetEventPrefix ?
-                       type :
-                       this.widgetEventPrefix + type ).toLowerCase();
-               // the original event may come from any element
-               // so we need to reset the target on the new event
-               event.target = this.element[ 0 ];
-
-               // copy original event properties over to the new event
-               orig = event.originalEvent;
-               if ( orig ) {
-                       for ( prop in orig ) {
-                               if ( !( prop in event ) ) {
-                                       event[ prop ] = orig[ prop ];
-                               }
-                       }
-               }
-
-               this.element.trigger( event, data );
-
-               return !( $.isFunction(callback) &&
-                       callback.call( this.element[0], event, data ) === false ||
-                       event.isDefaultPrevented() );
-       }
-};
-
-})( jQuery );
-
-};
-
-
-(function ($, window, undefined) {
-  var pos_oo = Number.POSITIVE_INFINITY,
-      neg_oo = Number.NEGATIVE_INFINITY;
-
-  $.geo = {
-    //
-    // utility functions
-    //
-
-    _allCoordinates: function (geom) {
-      // return array of all positions in all geometries of geom
-      // not in JTS
-      var geometries = this._flatten(geom),
-          curGeom = 0,
-          result = [];
-
-      for (; curGeom < geometries.length; curGeom++) {
-        var coordinates = geometries[curGeom].coordinates,
-            isArray = coordinates && $.isArray(coordinates[0]),
-            isDblArray = isArray && $.isArray(coordinates[0][0]),
-            isTriArray = isDblArray && $.isArray(coordinates[0][0][0]),
-            i, j, k;
-
-        if (!isTriArray) {
-          if (!isDblArray) {
-            if (!isArray) {
-              coordinates = [coordinates];
-            }
-            coordinates = [coordinates];
-          }
-          coordinates = [coordinates];
-        }
-
-        for (i = 0; i < coordinates.length; i++) {
-          for (j = 0; j < coordinates[i].length; j++) {
-            for (k = 0; k < coordinates[i][j].length; k++) {
-              result.push(coordinates[i][j][k]);
-            }
-          }
-        }
-      }
-      return result;
-    },
-
-    _isGeodetic: function( coords ) {
-      // returns true if the first coordinate it can find is geodetic
-
-      while ( $.isArray( coords ) ) {
-        if ( coords.length > 1 && ! $.isArray( coords[ 0 ] ) ) {
-          return ( coords[ 0 ] >= -180 && coords[ 0 ] <= 180 && coords[ 1 ] >= -85 && coords[ 1 ] <= 85 );
-        } else {
-          coords = coords[ 0 ];
-        }
-      }
-
-      return false;
-    },
-
-    //
-    // bbox functions
-    //
-
-    center: function (bbox, _ignoreGeo /* Internal Use Only */) {
-      // Envelope.centre in JTS
-      // bbox only, use centroid for geom
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      var center = [(bbox[0] + bbox[2]) / 2, (bbox[1] + bbox[3]) / 2];
-      return wasGeodetic ? $.geo.proj.toGeodetic(center) : center;
-    },
-
-    expandBy: function (bbox, dx, dy, _ignoreGeo /* Internal Use Only */) {
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      bbox = [bbox[0] - dx, bbox[1] - dy, bbox[2] + dx, bbox[3] + dy];
-      return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    height: function (bbox, _ignoreGeo /* Internal Use Only */ ) {
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      return bbox[3] - bbox[1];
-    },
-
-    _in: function(bbox1, bbox2) {
-      return bbox1[0] <= bbox2[0] &&
-             bbox1[1] <= bbox2[1] &&
-             bbox1[2] >= bbox2[2] &&
-             bbox1[3] >= bbox2[3];
-    },
-
-    _bboxDisjoint: function( bbox1, bbox2 ) {
-      return bbox2[ 0 ] > bbox1[ 2 ] || 
-             bbox2[ 2 ] < bbox1[ 0 ] || 
-             bbox2[ 1 ] > bbox1[ 3 ] ||
-             bbox2[ 3 ] < bbox1[ 1 ];
-    },
-
-    include: function( bbox, value, _ignoreGeo /* Internal Use Only */ ) {
-      // similar to Envelope.expandToInclude in JTS
-      if ( !value || !$.isArray( value ) ) {
-        return bbox;
-      }
-
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox || value ) ) {
-        wasGeodetic = true;
-      }
-
-      if ( !bbox ) {
-        bbox = [ pos_oo, pos_oo, neg_oo, neg_oo ];
-      } else if ( wasGeodetic ) {
-        bbox = $.geo.proj.fromGeodetic( bbox );
-      }
-
-      if ( value.length === 2 ) {
-        value = [ value[ 0 ], value[ 1 ], value[ 0 ], value[ 1 ] ];
-      }
-
-      value = $.geo.proj.fromGeodetic( value );
-
-      bbox[0] = Math.min( value[ 0 ], bbox[ 0 ] );
-      bbox[1] = Math.min( value[ 1 ], bbox[ 1 ] );
-      bbox[2] = Math.max( value[ 2 ], bbox[ 2 ] );
-      bbox[3] = Math.max( value[ 3 ], bbox[ 3 ] );
-
-      return wasGeodetic ? $.geo.proj.toGeodetic( bbox ) : bbox;
-    },
-
-    polygonize: function( bbox, _ignoreGeo /* Internal Use Only */ ) {
-      // adaptation of Polygonizer class in JTS for use with bboxes
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      var polygon = {
-        type: "Polygon",
-        coordinates: [ [
-          [ bbox[ 0 ], bbox[ 1 ] ],
-          [ bbox[ 0 ], bbox[ 3 ] ],
-          [ bbox[ 2 ], bbox[ 3 ] ],
-          [ bbox[ 2 ], bbox[ 1 ] ],
-          [ bbox[ 0 ], bbox[ 1 ] ]
-        ] ]
-      };
-
-      if ( wasGeodetic ) {
-        polygon.coordinates = $.geo.proj.toGeodetic( polygon.coordinates );
-      }
-
-      return polygon;
-    },
-
-    reaspect: function (bbox, ratio, _ignoreGeo /* Internal Use Only */ ) {
-      // not in JTS
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      var width = this.width(bbox, true),
-          height = this.height(bbox, true),
-          center = this.center(bbox, true),
-          dx, dy;
-
-      if (width !== 0 && height !== 0 && ratio > 0) {
-        if (width / height > ratio) {
-          dx = width / 2;
-          dy = dx / ratio;
-        } else {
-          dy = height / 2;
-          dx = dy * ratio;
-        }
-
-        bbox = [center[0] - dx, center[1] - dy, center[0] + dx, center[1] + dy];
-      }
-
-      return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    recenter: function( bbox, center, _ignoreGeo /* Internal Use Only */ ) {
-      // not in JTS
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj ) {
-        if ( this._isGeodetic( bbox ) ) {
-          wasGeodetic = true;
-          bbox = $.geo.proj.fromGeodetic(bbox);
-        }
-
-        if ( this._isGeodetic( center ) ) {
-          center = $.geo.proj.fromGeodetic(center);
-        }
-      }
-
-      var halfWidth = ( bbox[ 2 ] - bbox[ 0 ] ) / 2,
-          halfHeight = ( bbox[ 3 ] - bbox[ 1 ] ) / 2;
-
-      bbox = [
-        center[ 0 ] - halfWidth,
-        center[ 1 ] - halfHeight,
-        center[ 0 ] + halfWidth,
-        center[ 1 ] + halfHeight
-      ];
-
-      return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    scaleBy: function ( bbox, scale, _ignoreGeo /* Internal Use Only */ ) {
-      // not in JTS
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      var c = this.center(bbox, true),
-          dx = (bbox[2] - bbox[0]) * scale / 2,
-          dy = (bbox[3] - bbox[1]) * scale / 2;
-
-      bbox = [c[0] - dx, c[1] - dy, c[0] + dx, c[1] + dy];
-
-      return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    width: function (bbox, _ignoreGeo /* Internal Use Only */ ) {
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      return bbox[2] - bbox[0];
-    },
-
-    //
-    // geometry functions
-    //
-
-    // bbox (Geometry.getEnvelope in JTS)
-
-    bbox: function ( geom, _ignoreGeo /* Internal Use Only */ ) {
-      var result, wasGeodetic = false;
-      if ( !geom ) {
-        return undefined;
-      } else if ( geom.bbox ) {
-        result = ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom.bbox ) ) ? $.geo.proj.fromGeodetic( geom.bbox ) : geom.bbox;
-      } else {
-        result = [ pos_oo, pos_oo, neg_oo, neg_oo ];
-
-        var coordinates = this._allCoordinates( geom ),
-            curCoord = 0;
-
-        if ( coordinates.length === 0 ) {
-          return undefined;
-        }
-
-        if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( coordinates ) ) {
-          wasGeodetic = true;
-          coordinates = $.geo.proj.fromGeodetic( coordinates );
-        }
-
-        for ( ; curCoord < coordinates.length; curCoord++ ) {
-          result[0] = Math.min(coordinates[curCoord][0], result[0]);
-          result[1] = Math.min(coordinates[curCoord][1], result[1]);
-          result[2] = Math.max(coordinates[curCoord][0], result[2]);
-          result[3] = Math.max(coordinates[curCoord][1], result[3]);
-        }
-      }
-
-      return wasGeodetic ? $.geo.proj.toGeodetic(result) : result;
-    },
-
-    // centroid
-    
-    centroid: function( geom, _ignoreGeo /* Internal Use Only */ ) {
-      switch (geom.type) {
-        case "Point":
-          return $.extend({}, geom);
-
-        case "LineString":
-        case "Polygon":
-          var a = 0,
-              c = [0, 0],
-              coords = $.merge( [ ], geom.type == "Polygon" ? geom.coordinates[0] : geom.coordinates ),
-              i = 1, j, n,
-              bbox = [ pos_oo, pos_oo, neg_oo, neg_oo ];
-
-          var wasGeodetic = false;
-          if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( coords ) ) {
-            wasGeodetic = true;
-            coords = $.geo.proj.fromGeodetic(coords);
-          }
-
-          //if (coords[0][0] != coords[coords.length - 1][0] || coords[0][1] != coords[coords.length - 1][1]) {
-          //  coords.push(coords[0]);
-          //}
-
-          for (; i <= coords.length; i++) {
-            j = i % coords.length;
-
-            bbox[0] = Math.min(coords[j][0], bbox[0]);
-            bbox[1] = Math.min(coords[j][1], bbox[1]);
-            bbox[2] = Math.max(coords[j][0], bbox[2]);
-            bbox[3] = Math.max(coords[j][1], bbox[3]);
-
-            n = (coords[i - 1][0] * coords[j][1]) - (coords[j][0] * coords[i - 1][1]);
-            a += n;
-            c[0] += (coords[i - 1][0] + coords[j][0]) * n;
-            c[1] += (coords[i - 1][1] + coords[j][1]) * n;
-          }
-
-          if (a === 0) {
-            if (coords.length > 0) {
-              c[0] = Math.min( Math.max( coords[0][0], bbox[ 0 ] ), bbox[ 2 ] );
-              c[1] = Math.min( Math.max( coords[0][1], bbox[ 1 ] ), bbox[ 3 ] );
-              return { type: "Point", coordinates: wasGeodetic ? $.geo.proj.toGeodetic(c) : c };
-            } else {
-              return undefined;
-            }
-          }
-
-          a *= 3;
-          //c[0] /= a;
-          //c[1] /= a;
-
-          c[0] = Math.min( Math.max( c[0] / a, bbox[ 0 ] ), bbox[ 2 ] );
-          c[1] = Math.min( Math.max( c[1] / a, bbox[ 1 ] ), bbox[ 3 ] );
-
-          return { type: "Point", coordinates: wasGeodetic ? $.geo.proj.toGeodetic(c) : c };
-      }
-      return undefined;
-    },
-
-    // contains
-
-    contains: function (geom1, geom2) {
-      if (geom1.type != "Polygon") {
-        return false;
-      }
-
-      switch (geom2.type) {
-        case "Point":
-          return this._containsPolygonPoint(geom1.coordinates, geom2.coordinates);
-
-        case "LineString":
-          return this._containsPolygonLineString(geom1.coordinates, geom2.coordinates);
-
-        case "Polygon":
-          return this._containsPolygonLineString(geom1.coordinates, geom2.coordinates[0]);
-
-        default:
-          return false;
-      }
-    },
-
-    _containsPolygonPoint: function (polygonCoordinates, pointCoordinate) {
-      if (polygonCoordinates.length === 0 || polygonCoordinates[0].length < 4) {
-        return false;
-      }
-
-      var rayCross = 0,
-          a = polygonCoordinates[0][0],
-          i = 1,
-          b,
-          x;
-
-      for (; i < polygonCoordinates[0].length; i++) {
-        b = polygonCoordinates[0][i];
-
-        if ((a[1] <= pointCoordinate[1] && pointCoordinate[1] < b[1]) || (b[1] <= pointCoordinate[1] && pointCoordinate[1] < a[1]) && (pointCoordinate[0] < a[0] || pointCoordinate[0] < b[0])) {
-          x = a[0] + (b[0] - a[0]) * (pointCoordinate[1] - a[1]) / (b[1] - a[1]);
-
-          if (x > pointCoordinate[0]) {
-            rayCross++;
-          }
-        }
-
-        a = b;
-      }
-
-      return rayCross % 2 == 1;
-    },
-
-    _containsPolygonLineString: function (polygonCoordinates, lineStringCoordinates) {
-      for (var i = 0; i < lineStringCoordinates.length; i++) {
-        if (!this._containsPolygonPoint(polygonCoordinates, lineStringCoordinates[i])) {
-          return false;
-        }
-      }
-      return true;
-    },
-
-    // distance
-
-    distance: function ( geom1, geom2, _ignoreGeo /* Internal Use Only */ ) {
-      var geom1CoordinatesProjected = ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom1.coordinates ) ) ? $.geo.proj.fromGeodetic(geom1.coordinates) : geom1.coordinates,
-          geom2CoordinatesProjected = ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom2.coordinates ) ) ? $.geo.proj.fromGeodetic(geom2.coordinates) : geom2.coordinates;
-
-      switch (geom1.type) {
-        case "Point":
-          switch (geom2.type) {
-            case "Point":
-              return this._distancePointPoint(geom2CoordinatesProjected, geom1CoordinatesProjected);
-            case "LineString":
-              return this._distanceLineStringPoint(geom2CoordinatesProjected, geom1CoordinatesProjected);
-            case "Polygon":
-              return this._containsPolygonPoint(geom2CoordinatesProjected, geom1CoordinatesProjected) ? 0 : this._distanceLineStringPoint(geom2CoordinatesProjected[0], geom1CoordinatesProjected);
-            default:
-              return undefined;
-          }
-          break;
-
-        case "LineString":
-          switch (geom2.type) {
-            case "Point":
-              return this._distanceLineStringPoint(geom1CoordinatesProjected, geom2CoordinatesProjected);
-            case "LineString":
-              return this._distanceLineStringLineString(geom1CoordinatesProjected, geom2CoordinatesProjected);
-            case "Polygon":
-              return this._containsPolygonLineString(geom2CoordinatesProjected, geom1CoordinatesProjected) ? 0 : this._distanceLineStringLineString(geom2CoordinatesProjected[0], geom1CoordinatesProjected);
-            default:
-              return undefined;
-          }
-          break;
-
-        case "Polygon":
-          switch (geom2.type) {
-            case "Point":
-              return this._containsPolygonPoint(geom1CoordinatesProjected, geom2CoordinatesProjected) ? 0 : this._distanceLineStringPoint(geom1CoordinatesProjected[0], geom2CoordinatesProjected);
-            case "LineString":
-              return this._containsPolygonLineString(geom1CoordinatesProjected, geom2CoordinatesProjected) ? 0 : this._distanceLineStringLineString(geom1CoordinatesProjected[0], geom2CoordinatesProjected);
-            case "Polygon":
-              return this._containsPolygonLineString(geom1CoordinatesProjected, geom2CoordinatesProjected[0]) ? 0 : this._distanceLineStringLineString(geom1CoordinatesProjected[0], geom2CoordinatesProjected[0]);
-            default:
-              return undefined;
-          }
-          break;
-      }
-    },
-
-    _distancePointPoint: function (coordinate1, coordinate2) {
-      var dx = coordinate2[0] - coordinate1[0],
-          dy = coordinate2[1] - coordinate1[1];
-      return Math.sqrt((dx * dx) + (dy * dy));
-    },
-
-    _distanceLineStringPoint: function (lineStringCoordinates, pointCoordinate) {
-      var minDist = pos_oo;
-
-      if (lineStringCoordinates.length > 0) {
-        var a = lineStringCoordinates[0],
-
-            apx = pointCoordinate[0] - a[0],
-            apy = pointCoordinate[1] - a[1];
-
-        if (lineStringCoordinates.length == 1) {
-          return Math.sqrt(apx * apx + apy * apy);
-        } else {
-          for (var i = 1; i < lineStringCoordinates.length; i++) {
-            var b = lineStringCoordinates[i],
-
-                abx = b[0] - a[0],
-                aby = b[1] - a[1],
-                bpx = pointCoordinate[0] - b[0],
-                bpy = pointCoordinate[1] - b[1],
-
-                d = this._distanceSegmentPoint(abx, aby, apx, apy, bpx, bpy);
-
-            if (d === 0) {
-              return 0;
-            }
-
-            if (d < minDist) {
-              minDist = d;
-            }
-
-            a = b;
-            apx = bpx;
-            apy = bpy;
-          }
-        }
-      }
-
-      return Math.sqrt(minDist);
-    },
-
-    _distanceSegmentPoint: function (abx, aby, apx, apy, bpx, bpy) {
-      var dot1 = abx * apx + aby * apy;
-
-      if (dot1 <= 0) {
-        return apx * apx + apy * apy;
-      }
-
-      var dot2 = abx * abx + aby * aby;
-
-      if (dot1 >= dot2) {
-        return bpx * bpx + bpy * bpy;
-      }
-
-      return apx * apx + apy * apy - dot1 * dot1 / dot2;
-    },
-
-    _distanceLineStringLineString: function (lineStringCoordinates1, lineStringCoordinates2) {
-      var minDist = pos_oo;
-      for (var i = 0; i < lineStringCoordinates2.length; i++) {
-        minDist = Math.min(minDist, this._distanceLineStringPoint(lineStringCoordinates1, lineStringCoordinates2[i]));
-      }
-      return minDist;
-    },
-
-    // buffer
-
-    _buffer: function( geom, distance, _ignoreGeo /* Internal Use Only */ ) {
-      var wasGeodetic = false,
-          coords = geom.coordinates;
-
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom.coordinates ) ) {
-        wasGeodetic = true;
-        coords = $.geo.proj.fromGeodetic( geom.coordinates );
-      }
-
-      if ( geom.type === "Point" ) {
-        var resultCoords = [],
-            slices = 180,
-            i = 0,
-            a;
-
-        for ( ; i <= slices; i++ ) {
-          a = ( i * 360 / slices ) * ( Math.PI / 180 );
-          resultCoords.push( [
-            coords[ 0 ] + Math.cos( a ) * distance,
-            coords[ 1 ] + Math.sin( a ) * distance
-          ] );
-        }
-
-        return {
-          type: "Polygon",
-          coordinates: [ ( wasGeodetic ? $.geo.proj.toGeodetic( resultCoords ) : resultCoords ) ]
-        };
-      } else {
-        return undefined;
-      }
-    },
-
-    
-    //
-    // feature
-    //
-
-    _flatten: function (geom) {
-      // return an array of all basic geometries
-      // not in JTS
-      var geometries = [],
-          curGeom = 0;
-      switch (geom.type) {
-        case "Feature":
-          $.merge(geometries, this._flatten(geom.geometry));
-          break;
-
-        case "FeatureCollection":
-          for (; curGeom < geom.features.length; curGeom++) {
-            $.merge(geometries, this._flatten(geom.features[curGeom].geometry));
-          }
-          break;
-
-        case "GeometryCollection":
-          for (; curGeom < geom.geometries.length; curGeom++) {
-            $.merge(geometries, this._flatten(geom.geometries[curGeom]));
-          }
-          break;
-
-        default:
-          geometries[0] = geom;
-          break;
-      }
-      return geometries;
-    },
-
-    length: function( geom, _ignoreGeo /* Internal Use Only */ ) {
-      var sum = 0,
-          lineStringCoordinates,
-          i = 1, dx, dy;
-
-      switch ( geom.type ) {
-        case "Point":
-          return 0;
-
-        case "LineString":
-          lineStringCoordinates = geom.coordinates;
-          break;
-
-        case "Polygon":
-          lineStringCoordinates = geom.coordinates[ 0 ];
-          break;
-      }
-
-      if ( lineStringCoordinates ) {
-        if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( lineStringCoordinates ) ) {
-          lineStringCoordinates = $.geo.proj.fromGeodetic( lineStringCoordinates );
-        }
-
-        for ( ; i < lineStringCoordinates.length; i++ ) {
-          dx = lineStringCoordinates[ i ][0] - lineStringCoordinates[ i - 1 ][0];
-          dy = lineStringCoordinates[ i ][1] - lineStringCoordinates[ i - 1 ][1];
-          sum += Math.sqrt((dx * dx) + (dy * dy));
-        }
-
-        return sum;
-      }
-
-      // return undefined;
-    },
-
-    area: function( geom, _ignoreGeo /* Internal Use Only */ ) {
-      var sum = 0,
-          polygonCoordinates,
-          i = 1, j;
-
-      switch ( geom.type ) {
-        case "Point":
-        case "LineString":
-          return 0;
-
-        case "Polygon":
-          polygonCoordinates = geom.coordinates[ 0 ];
-          break;
-      }
-
-      if ( polygonCoordinates ) {
-        if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( polygonCoordinates ) ) {
-          polygonCoordinates = $.geo.proj.fromGeodetic( polygonCoordinates );
-        }
-
-        for ( ; i <= polygonCoordinates.length; i++) {
-          j = i %  polygonCoordinates.length;
-          sum += ( polygonCoordinates[ i - 1 ][ 0 ] - polygonCoordinates[ j ][ 0 ] ) * ( polygonCoordinates[ i - 1 ][ 1 ] + polygonCoordinates[ j ][ 1 ] ) / 2;
-        }
-
-        return Math.abs( sum );
-      }
-    },
-
-    pointAlong: function( geom, percentage, _ignoreGeo /* Internal Use Only */ ) {
-      var totalLength = 0,
-          previousPercentageSum = 0,
-          percentageSum = 0,
-          remainderPercentageSum,
-          len,
-          lineStringCoordinates,
-          segmentLengths = [],
-          i = 1, dx, dy,
-          c, c0, c1,
-          wasGeodetic = false;
-
-      switch ( geom.type ) {
-        case "Point":
-          return $.extend( { }, geom );
-
-        case "LineString":
-          lineStringCoordinates = geom.coordinates;
-          break;
-
-        case "Polygon":
-          lineStringCoordinates = geom.coordinates[ 0 ];
-          break;
-      }
-
-      if ( lineStringCoordinates ) {
-        if ( percentage === 0 ) {
-          return {
-            type: "Point",
-            coordinates: [ lineStringCoordinates[ 0 ][ 0 ], lineStringCoordinates[ 0 ][ 1 ] ]
-          };
-        } else if ( percentage === 1 ) {
-          i = lineStringCoordinates.length - 1;
-          return {
-            type: "Point",
-            coordinates: [ lineStringCoordinates[ i ][ 0 ], lineStringCoordinates[ i ][ 1 ] ]
-          };
-        } else {
-          if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( lineStringCoordinates ) ) {
-            wasGeodetic = true;
-            lineStringCoordinates = $.geo.proj.fromGeodetic( lineStringCoordinates );
-          }
-
-          for ( ; i < lineStringCoordinates.length; i++ ) {
-            dx = lineStringCoordinates[ i ][ 0 ] - lineStringCoordinates[ i - 1 ][ 0 ];
-            dy = lineStringCoordinates[ i ][ 1 ] - lineStringCoordinates[ i - 1 ][ 1 ];
-            len = Math.sqrt((dx * dx) + (dy * dy));
-            segmentLengths.push( len );
-            totalLength += len;
-          }
-
-          for ( i = 0; i < segmentLengths.length && percentageSum < percentage; i++ ) {
-            previousPercentageSum = percentageSum;
-            percentageSum += ( segmentLengths[ i ] / totalLength );
-          }
-
-          remainderPercentageSum = percentage - previousPercentageSum;
-
-          c0 = lineStringCoordinates[ i - 1 ];
-          c1 = lineStringCoordinates[ i ];
-
-          c = [
-            c0[ 0 ] + ( remainderPercentageSum * ( c1[ 0 ] - c0[ 0 ] ) ),
-            c0[ 1 ] + ( remainderPercentageSum * ( c1[ 1 ] - c0[ 1 ] ) )
-          ];
-
-          return {
-            type: "Point",
-            coordinates: wasGeodetic ? $.geo.proj.toGeodetic(c) : c
-          };
-        }
-      }
-    },
-
-    //
-    // WKT functions
-    //
-
-    _WKT: (function () {
-      function pointToString(value) {
-        return "POINT " + pointToUntaggedString(value.coordinates);
-      }
-
-      function pointToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMPTY";
-        } else {
-          return "(" + coordinates.join(" ") + ")";
-        }
-      }
-
-      function lineStringToString(value) {
-        return "LINESTRING " + lineStringToUntaggedString(value.coordinates);
-      }
-
-      function lineStringToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMPTY";
-        } else {
-          var points = [];
-
-          for (var i = 0; i < coordinates.length; i++) {
-            points.push(coordinates[i].join(" "));
-          }
-
-          return "(" + points + ")";
-        }
-      }
-
-      function polygonToString(value) {
-        return "POLYGON " + polygonToUntaggedString(value.coordinates);
-      }
-
-      function polygonToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMTPY";
-        } else {
-          var lineStrings = [];
-
-          for (var i = 0; i < coordinates.length; i++) {
-            lineStrings.push(lineStringToUntaggedString(coordinates[i]));
-          }
-
-          return "(" + lineStrings + ")";
-        }
-      }
-
-      function multiPointToString(value) {
-        return "MULTIPOINT " + lineStringToUntaggedString(value.coordinates);
-      }
-
-      function multiLineStringToString(value) {
-        return "MULTILINSTRING " + polygonToUntaggedString(value.coordinates);
-      }
-
-      function multiPolygonToString(value) {
-        return "MULTIPOLYGON " + multiPolygonToUntaggedString(value.coordinates);
-      }
-
-      function multiPolygonToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMPTY";
-        } else {
-          var polygons = [];
-          for (var i = 0; i < coordinates.length; i++) {
-            polygons.push(polygonToUntaggedString(coordinates[i]));
-          }
-          return "(" + polygons + ")";
-        }
-      }
-
-      function geometryCollectionToString(value) {
-        return "GEOMETRYCOLLECTION " + geometryCollectionToUntaggedString(value.geometries);
-      }
-
-      function geometryCollectionToUntaggedString(geometries) {
-        if (!(geometries && geometries.length)) {
-          return "EMPTY";
-        } else {
-          var geometryText = [];
-          for (var i = 0; i < geometries.length; i++) {
-            geometryText.push(stringify(geometries[i]));
-          }
-          return "(" + geometries + ")";
-        }
-      }
-
-      function stringify(value) {
-        if (!(value && value.type)) {
-          return "";
-        } else {
-          switch (value.type) {
-            case "Point":
-              return pointToString(value);
-
-            case "LineString":
-              return lineStringToString(value);
-
-            case "Polygon":
-              return polygonToString(value);
-
-            case "MultiPoint":
-              return multiPointToString(value);
-
-            case "MultiLineString":
-              return multiLineStringToString(value);
-
-            case "MultiPolygon":
-              return multiPolygonToString(value);
-
-            case "GeometryCollection":
-              return geometryCollectionToString(value);
-
-            default:
-              return "";
-          }
-        }
-      }
-
-      function pointParseUntagged(wkt) {
-        var pointString = wkt.match( /\(\s*([\d\.\-]+)\s+([\d\.\-]+)\s*\)/ );
-        return pointString && pointString.length > 2 ? {
-          type: "Point",
-          coordinates: [
-            parseFloat(pointString[1]),
-            parseFloat(pointString[2])
-          ]
-        } : null;
-      }
-
-      function lineStringParseUntagged(wkt) {
-        var lineString = wkt.match( /\s*\((.*)\)/ ),
-            coords = [],
-            pointStrings,
-            pointParts,
-            i = 0;
-
-        if ( lineString && lineString.length > 1 ) {
-          pointStrings = lineString[ 1 ].match( /[\d\.\-]+\s+[\d\.\-]+/g );
-
-          for ( ; i < pointStrings.length; i++ ) {
-            pointParts = pointStrings[ i ].match( /\s*([\d\.\-]+)\s+([\d\.\-]+)\s*/ );
-            coords[ i ] = [ parseFloat( pointParts[ 1 ] ), parseFloat( pointParts[ 2 ] ) ];
-          }
-
-          return {
-            type: "LineString",
-            coordinates: coords
-          };
-        } else {
-          return null;
-        }
-      }
-
-      function polygonParseUntagged(wkt) {
-        var polygon = wkt.match( /\s*\(\s*\((.*)\)\s*\)/ ),
-            coords = [],
-            pointStrings,
-            pointParts,
-            i = 0;
-
-        if ( polygon && polygon.length > 1 ) {
-          pointStrings = polygon[ 1 ].match( /[\d\.\-]+\s+[\d\.\-]+/g );
-
-          for ( ; i < pointStrings.length; i++ ) {
-            pointParts = pointStrings[ i ].match( /\s*([\d\.\-]+)\s+([\d\.\-]+)\s*/ );
-            coords[ i ] = [ parseFloat( pointParts[ 1 ] ), parseFloat( pointParts[ 2 ] ) ];
-          }
-
-          return {
-            type: "Polygon",
-            coordinates: [ coords ]
-          };
-        } else {
-          return null;
-        }
-      }
-
-      function multiPointParseUntagged(wkt) {
-        var multiSomething;
-
-        if ( wkt.indexOf( "((" ) === -1 ) {
-          multiSomething = lineStringParseUntagged( wkt );
-        } else {
-          multiSomething = multiLineStringParseUntagged( wkt );
-          multiSomething.coordinates = $.geo._allCoordinates( multiSomething );
-        }
-
-        multiSomething.type = "MultiPoint";
-
-        return multiSomething;
-      }
-
-      function multiLineStringParseUntagged(wkt) {
-        var lineStringsWkt = wkt.substr( 1, wkt.length - 2 ),
-            lineStrings = lineStringsWkt.split( ")),((" ),
-            i = 0,
-            multiLineString = {
-              type: "MultiLineString",
-              coordinates: [ ]
-            };
-
-        for ( ; i < lineStrings.length; i++ ) {
-          multiLineString.coordinates.push( lineStringParseUntagged( lineStrings[ i ] ).coordinates );
-        }
-
-        return multiLineString;
-      }
-
-      function multiPolygonParseUntagged(wkt) {
-        var polygonsWkt = wkt.substr( 1, wkt.length - 2 ),
-            polygons = polygonsWkt.split( ")),((" ),
-            i = 0,
-            multiPolygon = {
-              type: "MultiPolygon",
-              coordinates: [ ]
-            };
-
-        for ( ; i < polygons.length; i++ ) {
-          multiPolygon.coordinates.push( polygonParseUntagged( polygons[ i ] ).coordinates );
-        }
-
-        return multiPolygon;
-      }
-
-      function geometryCollectionParseUntagged( wkt ) {
-        var geometriesWkt = wkt.substr( 1, wkt.length - 2 ),
-            geometries = geometriesWkt.match( /\),[a-zA-Z]/g ),
-            geometryCollection = {
-              type: "GeometryCollection",
-              geometries: [ ]
-            },
-            curGeom,
-            i = 0, curStart = 0, curLen;
-
-        if ( geometries && geometries.length > 0 ) {
-          for ( ; i < geometries.length; i++ ) {
-            curLen = geometriesWkt.indexOf( geometries[ i ], curStart ) - curStart + 1;
-            curGeom = parse( geometriesWkt.substr( curStart, curLen ) );
-            if ( curGeom ) {
-              geometryCollection.geometries.push( curGeom );
-            }
-            curStart += curLen + 1;
-          }
-
-          // one more
-          curGeom = parse( geometriesWkt.substr( curStart ) );
-          if ( curGeom ) {
-            geometryCollection.geometries.push( curGeom );
-          }
-
-          return geometryCollection;
-        } else {
-          return null;
-        }
-      }
-
-      function parse(wkt) {
-        wkt = $.trim(wkt);
-
-        var typeIndex = wkt.indexOf( "(" ),
-            untagged = wkt.substr( typeIndex  );
-
-        switch ($.trim(wkt.substr(0, typeIndex)).toUpperCase()) {
-          case "POINT":
-            return pointParseUntagged( untagged );
-
-          case "LINESTRING":
-            return lineStringParseUntagged( untagged );
-
-          case "POLYGON":
-            return polygonParseUntagged( untagged );
-
-          case "MULTIPOINT":
-            return multiPointParseUntagged( untagged );
-
-          case "MULTILINESTRING":
-            return multiLineStringParseUntagged( untagged );
-
-          case "MULTIPOLYGON":
-            return multiPolygonParseUntagged( untagged );
-
-          case "GEOMETRYCOLLECTION":
-            return geometryCollectionParseUntagged( untagged );
-
-          default:
-            return null;
-        }
-      }
-
-      return {
-        stringify: stringify,
-
-        parse: parse
-      };
-    }()),
-
-    //
-    // projection functions
-    //
-
-    proj: (function () {
-      var halfPi = 1.5707963267948966192,
-          quarterPi = 0.7853981633974483096,
-          radiansPerDegree = 0.0174532925199432958,
-          degreesPerRadian = 57.295779513082320877,
-          semiMajorAxis = 6378137;
-
-      return {
-        fromGeodeticPos: function (coordinate) {
-          return [
-            semiMajorAxis * coordinate[ 0 ] * radiansPerDegree,
-            semiMajorAxis * Math.log(Math.tan(quarterPi + coordinate[ 1 ] * radiansPerDegree / 2))
-          ];
-        },
-
-        fromGeodetic: function ( coordinates ) {
-          if ( ! $.geo._isGeodetic( coordinates ) ) {
-            return coordinates;
-          }
-
-          var isMultiPointOrLineString = $.isArray(coordinates[ 0 ]),
-              fromGeodeticPos = this.fromGeodeticPos;
-
-          if (!isMultiPointOrLineString && coordinates.length == 4) {
-            // bbox
-            var min = fromGeodeticPos([ coordinates[ 0 ], coordinates[ 1 ] ]),
-                max = fromGeodeticPos([ coordinates[ 2 ], coordinates[ 3 ] ]);
-            return [ min[ 0 ], min[ 1 ], max[ 0 ], max[ 1 ] ];
-          } else {
-            // geometry
-            var isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray(coordinates[ 0 ][ 0 ]),
-                isMultiPolygon = isMultiLineStringOrPolygon && $.isArray(coordinates[ 0 ][ 0 ][ 0 ]),
-                result = [ ],
-                i, j, k;
-
-            if (!isMultiPolygon) {
-              if (!isMultiLineStringOrPolygon) {
-                if (!isMultiPointOrLineString) {
-                  coordinates = [ coordinates ];
-                }
-                coordinates = [ coordinates ];
-              }
-              coordinates = [ coordinates ];
-            }
-
-            for ( i = 0; i < coordinates.length; i++ ) {
-              result[ i ] = [ ];
-              for ( j = 0; j < coordinates[ i ].length; j++ ) {
-                result[ i ][ j ] = [ ];
-                for ( k = 0; k < coordinates[ i ][ j ].length; k++ ) {
-                  result[ i ][ j ][ k ] = fromGeodeticPos(coordinates[ i ][ j ][ k ]);
-                }
-              }
-            }
-
-            return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-          }
-        },
-
-        toGeodeticPos: function (coordinate) {
-          return [
-            (coordinate[ 0 ] / semiMajorAxis) * degreesPerRadian,
-            (halfPi - 2 * Math.atan(1 / Math.exp(coordinate[ 1 ] / semiMajorAxis))) * degreesPerRadian
-          ];
-        },
-
-        toGeodetic: function (coordinates) {
-          if ( $.geo._isGeodetic( coordinates ) ) {
-            return coordinates;
-          }
-
-          var isMultiPointOrLineString = $.isArray(coordinates[ 0 ]),
-              toGeodeticPos = this.toGeodeticPos;
-
-          if (!isMultiPointOrLineString && coordinates.length == 4) {
-            // bbox
-            var min = toGeodeticPos([ coordinates[ 0 ], coordinates[ 1 ] ]),
-                max = toGeodeticPos([ coordinates[ 2 ], coordinates[ 3 ] ]);
-            return [ min[ 0 ], min[ 1 ], max[ 0 ], max[ 1 ] ];
-          } else {
-            // geometry
-            var isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray(coordinates[ 0 ][ 0 ]),
-                isMultiPolygon = isMultiLineStringOrPolygon && $.isArray(coordinates[ 0 ][ 0 ][ 0 ]),
-                result = [ ],
-                i, j, k;
-
-            if (!isMultiPolygon) {
-              if (!isMultiLineStringOrPolygon) {
-                if (!isMultiPointOrLineString) {
-                  coordinates = [ coordinates ];
-                }
-                coordinates = [ coordinates ];
-              }
-              coordinates = [ coordinates ];
-            }
-
-            for ( i = 0; i < coordinates.length; i++ ) {
-              result[ i ] = [ ];
-              for ( j = 0; j < coordinates[ i ].length; j++ ) {
-                result[ i ][ j ] = [ ];
-                for ( k = 0; k < coordinates[ i ][ j ].length; k++ ) {
-                  result[ i ][ j ][ k ] = toGeodeticPos(coordinates[ i ][ j ][ k ]);
-                }
-              }
-            }
-
-            return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-          }
-        }
-      };
-    }()),
-
-    //
-    // service types (defined in other files)
-    //
-
-    _serviceTypes: {}
-  };
-}(jQuery, this));
-
-(function ($, undefined) {
-  var _ieVersion = ( function () {
-    var v = 5, div = document.createElement("div"), a = div.all || [];
-    do {
-      div.innerHTML = "<!--[if gt IE " + (++v) + "]><br><![endif]-->";
-    } while ( a[0] );
-    return v > 6 ? v : !v;
-  }() );
-
-  $.widget("geo.geographics", {
-    _$elem: undefined,
-    _options: {},
-    _trueCanvas: true,
-
-    _width: 0,
-    _height: 0,
-
-    _$canvas: undefined,
-    _context: undefined,
-
-    _blitcanvas: undefined,
-    _blitcontext: undefined,
-
-    _$labelsContainer: undefined,
-
-    options: {
-      style: {
-        borderRadius: "8px",
-        color: "#7f0000",
-        //fill: undefined,
-        fillOpacity: 0.2,
-        height: "8px",
-        opacity: 1,
-        //stroke: undefined,
-        strokeOpacity: 1,
-        strokeWidth: "2px",
-        visibility: "visible",
-        width: "8px"
-      }
-    },
-
-    _create: function () {
-      this._$elem = this.element;
-      this._options = this.options;
-
-      this._$elem.css({ display: "inline-block", overflow: "hidden", textAlign: "left" });
-
-      if (this._$elem.css("position") == "static") {
-        this._$elem.css("position", "relative");
-      }
-
-      this._$elem.addClass( "geo-graphics" );
-
-      this._width = this._$elem.width();
-      this._height = this._$elem.height();
-
-      if (!(this._width && this._height)) {
-        this._width = parseInt(this._$elem.css("width"), 10);
-        this._height = parseInt(this._$elem.css("height"), 10);
-      }
-
-      var posCss = 'position:absolute;left:0;top:0;margin:0;padding:0;',
-          sizeCss = 'width:' + this._width + 'px;height:' + this._height + 'px;',
-          sizeAttr = 'width="' + this._width + '" height="' + this._height + '"';
-
-      if (document.createElement('canvas').getContext) {
-        this._$elem.append('<canvas ' + sizeAttr + ' style="-webkit-transform:translateZ(0);' + posCss + '"></canvas>');
-        this._$canvas = this._$elem.children(':last');
-        this._context = this._$canvas[0].getContext("2d");
-
-        this._blitcanvas = document.createElement( "canvas" );
-        this._blitcanvas.width = this._width;
-        this._blitcanvas.height = this._height;
-        this._blitcontext = this._blitcanvas.getContext("2d");
-      } else if (_ieVersion <= 8) {
-        this._trueCanvas = false;
-        this._$elem.append( '<div ' + sizeAttr + ' style="' + posCss + sizeCss + '"></div>');
-        this._$canvas = this._$elem.children(':last');
-
-        G_vmlCanvasManager.initElement(this._$canvas[0]);
-        this._context = this._$canvas[0].getContext("2d");
-        this._$canvas.children().css({ backgroundColor: "transparent", width: this._width, height: this._height });
-      }
-
-      this._$elem.append('<div class="geo-labels-container" style="-webkit-transform:translateZ(0);' + posCss + sizeCss + '"></div>');
-      this._$labelsContainer = this._$elem.children(':last');
-    },
-
-    _setOption: function (key, value) {
-      if (key == "style") {
-        value = $.extend({}, this._options.style, value);
-      }
-      $.Widget.prototype._setOption.apply(this, arguments);
-    },
-
-    destroy: function () {
-      $.Widget.prototype.destroy.apply(this, arguments);
-      this._$elem.html("");
-      this._$elem.removeClass( "geo-graphics" );
-    },
-
-    clear: function () {
-      this._context.clearRect(0, 0, this._width, this._height);
-      this._$labelsContainer.html("");
-    },
-
-    drawArc: function (coordinates, startAngle, sweepAngle, style) {
-      style = this._getGraphicStyle(style);
-
-      if (style.visibility != "hidden" && style.opacity > 0 && style.widthValue > 0 && style.heightValue > 0) {
-        var r = Math.min(style.widthValue, style.heightValue) / 2;
-
-        startAngle = (startAngle * Math.PI / 180);
-        sweepAngle = (sweepAngle * Math.PI / 180);
-
-        this._context.save();
-        this._context.translate(coordinates[0], coordinates[1]);
-        if (style.widthValue > style.heightValue) {
-          this._context.scale(style.widthValue / style.heightValue, 1);
-        } else {
-          this._context.scale(1, style.heightValue / style.widthValue);
-        }
-
-        this._context.beginPath();
-        this._context.arc(0, 0, r, startAngle, sweepAngle, false);
-
-        if (this._trueCanvas) {
-          this._context.restore();
-        }
-
-        if (style.doFill) {
-          this._context.fillStyle = style.fill;
-          this._context.globalAlpha = style.opacity * style.fillOpacity;
-          this._context.fill();
-        }
-
-        if (style.doStroke) {
-          this._context.lineJoin = "round";
-          this._context.lineWidth = style.strokeWidthValue;
-          this._context.strokeStyle = style.stroke;
-
-          this._context.globalAlpha = style.opacity * style.strokeOpacity;
-          this._context.stroke();
-        }
-
-        if (!this._trueCanvas) {
-          this._context.restore();
-        }
-      }
-    },
-
-    drawPoint: function (coordinates, style) {
-      style = this._getGraphicStyle(style);
-      if (style.widthValue == style.heightValue && style.heightValue == style.borderRadiusValue) {
-        this.drawArc(coordinates, 0, 360, style);
-      } else if (style.visibility != "hidden" && style.opacity > 0) {
-        style.borderRadiusValue = Math.min(Math.min(style.widthValue, style.heightValue) / 2, style.borderRadiusValue);
-        coordinates[0] -= style.widthValue / 2;
-        coordinates[1] -= style.heightValue / 2;
-        this._context.beginPath();
-        this._context.moveTo(coordinates[0] + style.borderRadiusValue, coordinates[1]);
-        this._context.lineTo(coordinates[0] + style.widthValue - style.borderRadiusValue, coordinates[1]);
-        this._context.quadraticCurveTo(coordinates[0] + style.widthValue, coordinates[1], coordinates[0] + style.widthValue, coordinates[1] + style.borderRadiusValue);
-        this._context.lineTo(coordinates[0] + style.widthValue, coordinates[1] + style.heightValue - style.borderRadiusValue);
-        this._context.quadraticCurveTo(coordinates[0] + style.widthValue, coordinates[1] + style.heightValue, coordinates[0] + style.widthValue - style.borderRadiusValue, coordinates[1] + style.heightValue);
-        this._context.lineTo(coordinates[0] + style.borderRadiusValue, coordinates[1] + style.heightValue);
-        this._context.quadraticCurveTo(coordinates[0], coordinates[1] + style.heightValue, coordinates[0], coordinates[1] + style.heightValue - style.borderRadiusValue);
-        this._context.lineTo(coordinates[0], coordinates[1] + style.borderRadiusValue);
-        this._context.quadraticCurveTo(coordinates[0], coordinates[1], coordinates[0] + style.borderRadiusValue, coordinates[1]);
-        this._context.closePath();
-
-        if (style.doFill) {
-          this._context.fillStyle = style.fill;
-          this._context.globalAlpha = style.opacity * style.fillOpacity;
-          this._context.fill();
-        }
-
-        if (style.doStroke) {
-          this._context.lineJoin = "round";
-          this._context.lineWidth = style.strokeWidthValue;
-          this._context.strokeStyle = style.stroke;
-
-          this._context.globalAlpha = style.opacity * style.strokeOpacity;
-
-          this._context.stroke();
-        }
-      }
-    },
-
-    drawLineString: function (coordinates, style) {
-      this._drawLines([coordinates], false, style);
-    },
-
-    drawPolygon: function (coordinates, style) {
-      if ( !this._trueCanvas || coordinates.length == 1 ) {
-        // either we don't have fancy rendering or there's no need for it (no holes)
-        this._drawLines( coordinates, true, style );
-      } else {
-        if ( !coordinates || !coordinates.length || coordinates[ 0 ].length < 3 ) {
-          // this is not a Polygon or it doesn't have a proper outer ring
-          return;
-        }
-
-        style = this._getGraphicStyle(style);
-
-        var pixelBbox, i, j;
-
-        if ( style.visibility != "hidden" && style.opacity > 0 ) {
-          this._blitcontext.clearRect(0, 0, this._width, this._height);
-
-          if ( style.doFill ) {
-            if ( coordinates.length > 1 ) {
-              // stencil inner rings
-              this._blitcontext.globalCompositeOperation = "source-out";
-              this._blitcontext.globalAlpha = 1;
-
-              for ( i = 1; i < coordinates.length; i++ ) {
-                this._blitcontext.beginPath();
-                this._blitcontext.moveTo( coordinates[ i ][ 0 ][ 0 ], coordinates[ i ][ 0 ][ 1 ] );
-                for ( j = 1; j < coordinates[ i ].length; j++ ) {
-                  this._blitcontext.lineTo( coordinates[ i ][ j ][ 0 ], coordinates[ i ][ j ][ 1 ] );
-                }
-                this._blitcontext.closePath();
-
-                this._blitcontext.fill( );
-              }
-            }
-          }
-
-          // path outer ring
-          this._blitcontext.beginPath();
-          this._blitcontext.moveTo( coordinates[ 0 ][ 0 ][ 0 ], coordinates[ 0 ][ 0 ][ 1 ] );
-
-          pixelBbox = [ coordinates[ 0 ][ 0 ][ 0 ] - style.strokeWidthValue, coordinates[ 0 ][ 0 ][ 1 ] - style.strokeWidthValue, coordinates[ 0 ][ 0 ][ 0 ] + style.strokeWidthValue, coordinates[ 0 ][ 0 ][ 1 ] + style.strokeWidthValue ];
-
-          for ( i = 1; i < coordinates[ 0 ].length - 1; i++ ) {
-            this._blitcontext.lineTo( coordinates[ 0 ][ i ][ 0 ], coordinates[ 0 ][ i ][ 1 ] );
-
-            pixelBbox[ 0 ] = Math.min( coordinates[ 0 ][ i ][ 0 ] - style.strokeWidthValue, pixelBbox[ 0 ] );
-            pixelBbox[ 1 ] = Math.min( coordinates[ 0 ][ i ][ 1 ] - style.strokeWidthValue, pixelBbox[ 1 ] );
-            pixelBbox[ 2 ] = Math.max( coordinates[ 0 ][ i ][ 0 ] + style.strokeWidthValue, pixelBbox[ 2 ] );
-            pixelBbox[ 3 ] = Math.max( coordinates[ 0 ][ i ][ 1 ] + style.strokeWidthValue, pixelBbox[ 3 ] );
-          }
-
-          this._blitcontext.closePath();
-
-          this._blitcontext.globalCompositeOperation = "source-out";
-          if ( style.doFill ) {
-            // fill outer ring
-            this._blitcontext.fillStyle = style.fill;
-            this._blitcontext.globalAlpha = style.opacity * style.fillOpacity;
-            this._blitcontext.fill( );
-          }
-
-          this._blitcontext.globalCompositeOperation = "source-over";
-          if ( style.doStroke ) {
-            // stroke outer ring
-            this._blitcontext.lineCap = this._blitcontext.lineJoin = "round";
-            this._blitcontext.lineWidth = style.strokeWidthValue;
-            this._blitcontext.strokeStyle = style.stroke;
-
-            this._blitcontext.globalAlpha = style.opacity * style.strokeOpacity;
-            this._blitcontext.stroke( );
-
-            if ( coordinates.length > 1 ) {
-              // stroke inner rings
-              for ( i = 1; i < coordinates.length; i++ ) {
-                this._blitcontext.beginPath();
-                this._blitcontext.moveTo( coordinates[ i ][ 0 ][ 0 ], coordinates[ i ][ 0 ][ 1 ] );
-                for ( j = 1; j < coordinates[ i ].length; j++ ) {
-                  this._blitcontext.lineTo( coordinates[ i ][ j ][ 0 ], coordinates[ i ][ j ][ 1 ] );
-                }
-                this._blitcontext.closePath();
-
-                this._blitcontext.stroke( );
-              }
-            }
-          }
-
-          // blit
-          pixelBbox[ 0 ] = Math.min( Math.max( pixelBbox[ 0 ], 0), this._width );
-          pixelBbox[ 1 ] = Math.min( Math.max( pixelBbox[ 1 ], 0), this._height );
-          pixelBbox[ 2 ] = Math.min( Math.max( pixelBbox[ 2 ], 0), this._width );
-          pixelBbox[ 3 ] = Math.min( Math.max( pixelBbox[ 3 ], 0), this._height );
-
-          if ( pixelBbox[ 0 ] !== pixelBbox[ 2 ] && pixelBbox[ 1 ] !== pixelBbox[ 3 ] ) {
-            this._context.drawImage(this._blitcanvas, pixelBbox[ 0 ], pixelBbox[ 1 ], pixelBbox[ 2 ] - pixelBbox[ 0 ], pixelBbox[ 3 ] - pixelBbox[ 1 ], pixelBbox[ 0 ], pixelBbox[ 1 ], pixelBbox[ 2 ] - pixelBbox[ 0 ], pixelBbox[ 3 ] - pixelBbox[ 1 ] );
-          }
-        }
-      }
-    },
-
-    drawBbox: function (bbox, style) {
-      this._drawLines([[
-        [bbox[0], bbox[1]],
-        [bbox[0], bbox[3]],
-        [bbox[2], bbox[3]],
-        [bbox[2], bbox[1]],
-        [bbox[0], bbox[1]]
-      ]], true, style);
-    },
-
-    drawLabel: function( coordinates, label ) {
-      this._$labelsContainer.append( '<div class="geo-label" style="-webkit-transform:translateZ(0);position:absolute; left:' + coordinates[ 0 ] + 'px; top:' + coordinates[ 1 ] + 'px;">' + label + '</div>');
-    },
-
-    resize: function( ) {
-      this._width = this._$elem.width();
-      this._height = this._$elem.height();
-
-      if (!(this._width && this._height)) {
-        this._width = parseInt(this._$elem.css("width"), 10);
-        this._height = parseInt(this._$elem.css("height"), 10);
-      }
-
-      if ( this._trueCanvas ) {
-        this._$canvas[0].width = this._width;
-        this._$canvas[0].height = this._height;
-      } else {
-      }
-
-      this._$labelsContainer.css( {
-        width: this._width,
-        height: this._height
-      } );
-    },
-
-    _getGraphicStyle: function (style) {
-      function safeParse(value) {
-        value = parseInt(value, 10);
-        return (+value + '') === value ? +value : value;
-      }
-
-      style = $.extend({}, this._options.style, style);
-      style.borderRadiusValue = safeParse(style.borderRadius);
-      style.fill = style.fill || style.color;
-      style.doFill = style.fill && style.fillOpacity > 0;
-      style.stroke = style.stroke || style.color;
-      style.strokeWidthValue = safeParse(style.strokeWidth);
-      style.doStroke = style.stroke && style.strokeOpacity > 0 && style.strokeWidthValue > 0;
-      style.widthValue = safeParse(style.width);
-      style.heightValue = safeParse(style.height);
-      return style;
-    },
-
-    _drawLines: function (coordinates, close, style) {
-      if (!coordinates || !coordinates.length || coordinates[0].length < 2) {
-        return;
-      }
-
-      var i, j;
-      style = this._getGraphicStyle(style);
-
-      if (style.visibility != "hidden" && style.opacity > 0) {
-        this._context.beginPath();
-
-        for (i = 0; i < coordinates.length; i++) {
-          this._context.moveTo(coordinates[i][0][0], coordinates[i][0][1]);
-          for (j = 1; j < coordinates[i].length; j++) {
-            this._context.lineTo(coordinates[i][j][0], coordinates[i][j][1]);
-          }
-        }
-
-        if (close) {
-          this._context.closePath();
-        }
-
-        if (close && style.doFill) {
-          this._context.fillStyle = style.fill;
-          this._context.globalAlpha = style.opacity * style.fillOpacity;
-          this._context.fill();
-        }
-
-        if (style.doStroke) {
-          this._context.lineCap = this._context.lineJoin = "round";
-          this._context.lineWidth = style.strokeWidthValue;
-          this._context.strokeStyle = style.stroke;
-
-          this._context.globalAlpha = style.opacity * style.strokeOpacity;
-          this._context.stroke();
-        }
-      }
-    }
-  });
-}(jQuery));
-
-
-(function ($, undefined) {
-  var _widgetIdSeed = 0,
-      _ieVersion = ( function () {
-        var v = 5, div = document.createElement("div"), a = div.all || [];
-        do {
-          div.innerHTML = "<!--[if gt IE " + (++v) + "]><br><![endif]-->";
-        } while ( a[0] );
-        return v > 6 ? v : !v;
-      }() ),
-
-      _defaultOptions = {
-        bbox: [-180, -85, 180, 85],
-        bboxMax: [-180, -85, 180, 85],
-        center: [0, 0],
-        cursors: {
-          "static": "default",
-          pan: "url(data:image/vnd.microsoft.icon;base64,AAACAAEAICACAAgACAAwAQAAFgAAACgAAAAgAAAAQAAAAAEAAQAAAAAAAAEAAAAAAAAAAAAAAgAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8AAAA/AAAAfwAAAP+AAAH/gAAB/8AAA//AAAd/wAAGf+AAAH9gAADbYAAA2yAAAZsAAAGbAAAAGAAAAAAAAA//////////////////////////////////////////////////////////////////////////////////////gH///4B///8Af//+AD///AA///wAH//4AB//8AAf//AAD//5AA///gAP//4AD//8AF///AB///5A////5///8=), move",
-          zoom: "crosshair",
-          dragBox: "crosshair",
-          dragCircle: "crosshair",
-          drawPoint: "crosshair",
-          drawLineString: "crosshair",
-          drawPolygon: "crosshair",
-          measureLength: "crosshair",
-          measureArea: "crosshair"
-        },
-        measureLabels: {
-          length: "{{:length.toFixed( 2 )}} m",
-          area: "{{:area.toFixed( 2 )}} sq m"
-        },
-        drawStyle: {},
-        shapeStyle: {},
-        mode: "pan",
-        pannable: true,
-        scroll: "default",
-        shift: "default",
-        services: [
-            {
-              "class": "osm",
-              type: "tiled",
-              src: function (view) {
-                return "http://otile" + ((view.index % 4) + 1) + ".mqcdn.com/tiles/1.0.0/osm/" + view.zoom + "/" + view.tile.column + "/" + view.tile.row + ".png";
-              },
-              attr: "Tiles Courtesy of <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png'>"
-            }
-          ],
-        tilingScheme: {
-          tileWidth: 256,
-          tileHeight: 256,
-          levels: 18,
-          basePixelSize: 156543.03392799936,
-          origin: [-20037508.342787, 20037508.342787]
-        },
-        axisLayout: "map",
-        zoom: 0,
-        zoomMin: 0,
-        zoomMax: Number.POSITIVE_INFINITY,
-        pixelSize: 0
-      };
-
-  $.widget("geo.geomap", {
-    // private widget members
-    _$elem: undefined, //< map div for maps, service div for services
-    _map: undefined, //< only defined in services
-    _created: false,
-    _createdGraphics: false,
-    _widgetId: 0,
-    _tmplLengthId: "",
-    _tmplAreaId: "",
-
-    _contentBounds: {},
-
-    _$resizeContainer: undefined, //< all elements that should match _contentBounds' size
-
-    _$eventTarget: undefined,
-    _$contentFrame: undefined,
-    _$existingChildren: undefined,
-    _$attrList: undefined,
-    _$servicesContainer: undefined,
-    _$shapesContainers: undefined, //< all shapesContainer divs (map only)
-
-    _$panContainer: undefined, //< all non-service elements that move while panning
-    _$shapesContainer: undefined, //< just "our" shapesContainer div (map & service)
-    _$drawContainer: undefined,
-    _$measureContainer: undefined,
-    _$measureLabel: undefined,
-
-    _dpi: 96,
-
-    _currentServices: [], //< internal copy
-
-    _center: undefined,
-    _pixelSize: undefined,
-    _centerMax: undefined,
-    _pixelSizeMax: undefined,
-
-    _userGeodetic: true,
-
-    _centerInteractive: undefined,
-    _pixelSizeInteractive: undefined,
-    _timeoutInteractive: null,
-    _triggerInteractive: false,
-
-    _loadCount: 0,
-
-    _wheelTimeout: null,
-    _wheelLevel: 0,
-
-    _zoomFactor: 2, //< determines what a zoom level means
-
-    _fullZoomFactor: 2, //< interactiveScale factor needed to zoom a whole level
-    _partialZoomFactor: 1.18920711500273, //< interactiveScale factor needed to zoom a fraction of a level (the fourth root of 2)
-
-    _mouseDown: undefined,
-    _inOp: undefined,
-    _toolPan: undefined,
-    _shiftDown: undefined,
-    _anchor: undefined,
-    _current: undefined,
-    _downDate: undefined,
-    _moveDate: undefined,
-    _clickDate: undefined,
-    _lastMove: undefined,
-    _lastDrag: undefined,
-
-    _windowHandler: null,
-    _resizeTimeout: null,
-
-    _panning: undefined,
-    _velocity: undefined,
-    _friction: undefined,
-
-    _supportTouch: undefined,
-    _softDblClick: undefined,
-    _isTap: undefined,
-    _isDbltap: undefined,
-
-    _isMultiTouch: undefined,
-    _multiTouchAnchor: [], //< TouchList
-    _multiTouchAnchorBbox: undefined, //< bbox
-    _multiTouchCurrentBbox: undefined, //< bbox
-
-    _drawTimeout: null, //< used in drawPoint mode so we don't send two shape events on dbltap
-    _drawPixels: [], //< an array of coordinate arrays for drawing lines & polygons, in pixel coordinates
-    _drawCoords: [],
-
-    _graphicShapes: [], //< an array of objects containing style object refs & GeoJSON object refs
-
-    _initOptions: {},
-
-    _options: {},
-
-    options: $.extend({}, _defaultOptions),
-
-    _createWidget: function (options, element) {
-      this._$elem = $(element);
-
-      if (this._$elem.is(".geo-service")) {
-        this._graphicShapes = [];
-        $.Widget.prototype._createWidget.apply(this, arguments);
-        return;
-      }
-
-      this._widgetId = _widgetIdSeed++;
-      this._tmplLengthId = "geoMeasureLength" + this._widgetId;
-      this._tmplAreaId = "geoMeasureArea" + this._widgetId;
-
-      this._$elem.addClass("geo-map").css( {
-        webkitTransform: "translateZ(0)"
-      } );
-        
-
-      this._initOptions = options || {};
-
-      this._forcePosition(this._$elem);
-
-      this._$elem.css("text-align", "left");
-
-      var size = this._findMapSize();
-      this._contentBounds = {
-        x: parseInt(this._$elem.css("padding-left"), 10),
-        y: parseInt(this._$elem.css("padding-top"), 10),
-        width: size["width"],
-        height: size["height"]
-      };
-
-      this._createChildren();
-
-      this._center = [ 0, 0 ];
-      this._centerMax = [ 0, 0 ];
-      this._centerInteractive = [ 0, 0 ];
-
-      this.options["pixelSize"] = this._pixelSize = this._pixelSizeMax = 156543.03392799936;
-
-      this._mouseDown =
-          this._inOp =
-          this._toolPan =
-          this._shiftDown =
-          this._panning =
-          this._isTap =
-          this._isDbltap = false;
-
-      this._anchor = [ 0, 0 ];
-      this._current = [ 0, 0 ];
-      this._lastMove = [ 0, 0 ];
-      this._lastDrag = [ 0, 0 ];
-      this._velocity = [ 0, 0 ];
-
-      this._friction = [0.8, 0.8];
-
-      this._downDate =
-          this._moveDate =
-          this._clickDate = 0;
-
-      this._drawPixels = [];
-      this._drawCoords =  [];
-      this._graphicShapes = [];
-
-
-      $.Widget.prototype._createWidget.apply(this, arguments);
-    },
-
-    _create: function () {
-      this._options = this.options;
-
-      if (this._$elem.is(".geo-service")) {
-        this._map = this._$elem.data( "geoMap" );
-        this._$elem.data( "geoService", this );
-        return;
-      }
-
-      this._map = this;
-
-      this._supportTouch = "ontouchend" in document;
-      this._softDblClick = this._supportTouch || _ieVersion == 7;
-
-      var geomap = this,
-          touchStartEvent = this._supportTouch ? "touchstart" : "mousedown",
-          touchStopEvent = this._supportTouch ? "touchend touchcancel" : "mouseup",
-          touchMoveEvent = this._supportTouch ? "touchmove" : "mousemove";
-
-      $(document).keydown($.proxy(this._document_keydown, this));
-
-      this._$eventTarget.dblclick($.proxy(this._eventTarget_dblclick, this));
-
-      this._$eventTarget.bind(touchStartEvent, $.proxy(this._eventTarget_touchstart, this));
-
-      var dragTarget = (this._$eventTarget[0].setCapture) ? this._$eventTarget : $(document);
-      dragTarget.bind(touchMoveEvent, $.proxy(this._dragTarget_touchmove, this));
-      dragTarget.bind(touchStopEvent, $.proxy(this._dragTarget_touchstop, this));
-
-      this._$eventTarget.mousewheel($.proxy(this._eventTarget_mousewheel, this));
-
-      this._windowHandler = function () {
-        if (geomap._resizeTimeout) {
-          clearTimeout(geomap._resizeTimeout);
-        }
-        geomap._resizeTimeout = setTimeout(function () {
-          if (geomap._created) {
-            geomap._$elem.geomap( "resize", true );
-          }
-        }, 500);
-      };
-
-      $(window).resize(this._windowHandler);
-
-      this._$drawContainer.geographics({ style: this._initOptions.drawStyle || {} });
-      this._options["drawStyle"] = this._$drawContainer.geographics("option", "style");
-
-      this._$shapesContainer.geographics( { style: this._initOptions.shapeStyle || { } } );
-      this._createdGraphics = true;
-
-      this._options["shapeStyle"] = this._$shapesContainer.geographics("option", "style");
-
-      if (this._initOptions) {
-        // always init tilingScheme right away, even if it's null
-        if ( this._initOptions.tilingScheme !== undefined ) {
-          this._setOption("tilingScheme", this._initOptions.tilingScheme || null, false);
-        }
-
-        if ( this._initOptions.services ) {
-          // jQuery UI Widget Factory merges user services with our default, we want to clobber the default
-          this._options[ "services" ] = $.merge( [ ], this._initOptions.services );
-        }
-        if (this._initOptions.bboxMax) {
-          this._setOption("bboxMax", this._initOptions.bboxMax, false);
-          this._setOption("bbox", this._initOptions.bboxMax, false);
-        }
-        if (this._initOptions.zoomMin !== undefined) {
-          this._setOption("zoomMin", this._initOptions.zoomMin, false);
-        }
-        if (this._initOptions.zoomMax !== undefined) {
-          this._setOption("zoomMax", this._initOptions.zoomMax, false);
-        }
-        if (this._initOptions.bbox) {
-          this._setOption("bbox", this._initOptions.bbox, false);
-        }
-        if (this._initOptions.center) {
-          this._setOption("center", this._initOptions.center, false);
-        }
-        if (this._initOptions.zoom !== undefined) {
-          this._setOption("zoom", this._initOptions.zoom, false);
-        }
-      }
-
-      $.templates( this._tmplLengthId, this._options[ "measureLabels" ].length );
-      $.templates( this._tmplAreaId, this._options[ "measureLabels" ].area );
-
-      this._$eventTarget.css("cursor", this._options["cursors"][this._options["mode"]]);
-
-      this._createServices();
-      this._refresh();
-
-      this._created = true;
-    },
-
-    _setOption: function (key, value, refresh) {
-      if ( key == "pixelSize" ) {
-        return;
-      }
-
-      refresh = (refresh === undefined || refresh);
-
-      if ( this._$elem.is( ".geo-map" ) ) {
-        this._panFinalize();
-      }
-
-      var center, pixelSize, bbox, zoom;
-
-      switch (key) {
-        case "bbox":
-          if ( this._created ) {
-            this._clearInteractiveTimeout( );
-          }
-
-          this._userGeodetic = $.geo.proj && $.geo._isGeodetic( value );
-          if ( this._userGeodetic ) {
-            value = $.geo.proj.fromGeodetic( value );
-          }
-
-          center = [value[0] + (value[2] - value[0]) / 2, value[1] + (value[3] - value[1]) / 2];
-          pixelSize = Math.max($.geo.width(value, true) / this._contentBounds.width, $.geo.height(value, true) / this._contentBounds.height);
-
-          // clamp to zoom
-          zoom = this._getZoom( center, pixelSize );
-
-          if ( this._options[ "tilingScheme" ] ) {
-            pixelSize = this._getPixelSize( Math.min( Math.max( zoom, this._options[ "zoomMin" ] ), this._options[ "zoomMax" ] ) );
-          } else {
-            if ( zoom < this._options[ "zoomMin" ] ) {
-              pixelSize = this._getPixelSize( this._options[ "zoomMin" ] );
-            } else if ( zoom > this._options[ "zoomMax" ] ) {
-              pixelSize = this._getPixelSize( this._options[ "zoomMax" ] );
-            }
-          }
-
-          if ( this._created ) {
-            this._setInteractiveCenterAndSize( center, pixelSize );
-            this._setInteractiveTimeout( false );
-          } else {
-            this._setCenterAndSize( center, pixelSize, false, refresh );
-          }
-
-          value = this._getBbox( center, pixelSize );
-          break;
-
-        case "bboxMax":
-          this._userGeodetic = $.geo.proj && $.geo._isGeodetic( value );
-          break;
-
-        case "center":
-          if ( this._created ) {
-            this._clearInteractiveTimeout( );
-          }
-
-          this._userGeodetic = $.geo.proj && $.geo._isGeodetic( value );
-          if ( this._userGeodetic ) {
-            value = $.geo.proj.fromGeodetic( value );
-          }
-
-          if ( this._created ) {
-            this._setInteractiveCenterAndSize( value, this._pixelSizeInteractive );
-            this._interactiveTransform( );
-            this._setInteractiveTimeout( false );
-          } else {
-            this._setCenterAndSize( value, this._pixelSize, false, refresh );
-          }
-          break;
-
-        case "measureLabels":
-          value = $.extend( this._options[ "measureLabels" ], value );
-
-
-          $.templates( this._tmplLengthId, this._options[ "measureLabels" ].length );
-          $.templates( this._tmplAreaId, this._options[ "measureLabels" ].area );
-
-          break;
-
-        case "drawStyle":
-          if (this._$drawContainer) {
-            this._$drawContainer.geographics("option", "style", value);
-            value = this._$drawContainer.geographics("option", "style");
-          }
-          break;
-
-        case "shapeStyle":
-          if ( this._$elem.is( ".geo-service" ) && !this._createdGraphics ) {
-            this._createServiceGraphics( );
-          }
-
-          if ( this._createdGraphics ) {
-            this._$shapesContainer.geographics("option", "style", value);
-            value = this._$shapesContainer.geographics("option", "style");
-          }
-          break;
-
-        case "mode":
-          this._resetDrawing( );
-          this._$eventTarget.css("cursor", this._options["cursors"][value]);
-          break;
-
-        case "zoom":
-          if ( this._created ) {
-            this._setZoom(value, false, refresh);
-          } else {
-            value = Math.max( value, 0 );
-            this._setCenterAndSize( this._center, this._getPixelSize( value ), false, refresh );
-          }
-          break;
-      }
-
-      $.Widget.prototype._setOption.apply(this, arguments);
-
-      switch ( key ) {
-        case "bbox":
-        case "center":
-          if ( this._userGeodetic ) {
-            this._options[ "bbox" ] = $.geo.proj.toGeodetic( this._options[ "bbox" ] );
-            this._options[ "center" ] = $.geo.proj.toGeodetic( this._center );
-          }
-          break;
-
-        case "tilingScheme":
-          if ( value !== null ) {
-            this._pixelSizeMax = this._getPixelSize( 0 );
-            this._centerMax = [
-              value.origin[ 0 ] + this._pixelSizeMax * value.tileWidth / 2,
-              value.origin[ 1 ] + this._pixelSizeMax * value.tileHeight / 2
-            ];
-          }
-          break;
-
-        case "bboxMax":
-          if ( $.geo.proj && $.geo._isGeodetic( value ) ) {
-            bbox = $.geo.proj.fromGeodetic( value );
-          } else {
-            bbox = value;
-          }
-
-          this._centerMax = $.geo.center( bbox );
-          this._pixelSizeMax = Math.max( $.geo.width( bbox, true ) / this._contentBounds.width, $.geo.height( bbox, true ) / this._contentBounds.height );
-          break;
-
-        case "services":
-          this._createServices();
-          if (refresh) {
-            this._refresh();
-          }
-          break;
-
-        case "shapeStyle":
-          if ( refresh && this._createdGraphics ) {
-            this._$shapesContainer.geographics("clear");
-            this._refreshShapes( this._$shapesContainer, this._graphicShapes, this._graphicShapes, this._graphicShapes );
-          }
-          break;
-      }
-    },
-
-    destroy: function () {
-      if ( this._$elem.is(".geo-service") ) {
-        if ( this._createdGraphics ) {
-          this._$shapesContainer.geographics("destroy");
-          this._$shapesContainer = undefined;
-          this._createdGraphics = false;
-        }
-      } else {
-        clearTimeout( this._timeoutInteractive );
-        this._timeoutInteractive = null;
-
-        this._created = false;
-
-        $(window).unbind("resize", this._windowHandler);
-
-        for ( var i = 0; i < this._currentServices.length; i++ ) {
-          this._currentServices[ i ].serviceContainer.geomap("destroy");
-          $.geo["_serviceTypes"][this._currentServices[i].type].destroy(this, this._$servicesContainer, this._currentServices[i]);
-        }
-
-        this._$shapesContainer.geographics("destroy");
-        this._$shapesContainer = undefined;
-        this._createdGraphics = false;
-
-        this._$drawContainer.geographics("destroy");
-        this._$drawContainer = undefined;
-
-        this._$existingChildren.detach();
-        this._$elem.html("");
-        this._$elem.append(this._$existingChildren);
-        this._$elem.removeClass("geo-map");
-      }
-
-      $.Widget.prototype.destroy.apply(this, arguments);
-    },
-
-    toMap: function (p) {
-      p = this._toMap(p);
-      return this._userGeodetic ? $.geo.proj.toGeodetic(p) : p;
-    },
-
-    toPixel: function ( p, _center /* Internal Use Only */, _pixelSize /* Internal Use Only */ ) {
-      return this._toPixel( $.geo.proj ? $.geo.proj.fromGeodetic( p ) : p, _center, _pixelSize );
-    },
-
-    opacity: function ( value, _serviceContainer ) {
-      if ( this._$elem.is( ".geo-service" ) ) {
-        this._$elem.closest( ".geo-map" ).geomap( "opacity", value, this._$elem );
-      } else {
-        if ( value >= 0 || value <= 1 ) {
-          for ( var i = 0; i < this._currentServices.length; i++ ) {
-            var service = this._currentServices[ i ];
-            if ( !_serviceContainer || service.serviceContainer[ 0 ] == _serviceContainer[ 0 ] ) {
-              service.style.opacity = value;
-
-              // update the original service object's style property
-              service.serviceObject.style = $.extend( { }, service.serviceObject.style, service.style );
-
-              $.geo[ "_serviceTypes" ][ service.type ].opacity( this, service );
-            }
-          }
-        }
-      }
-    },
-
-    toggle: function ( value, _serviceContainer ) {
-      if ( this._$elem.is( ".geo-service" ) ) {
-        this._$elem.closest( ".geo-map" ).geomap( "toggle", value, this._$elem );
-      } else {
-
-        for ( var i = 0; i < this._currentServices.length; i++ ) {
-          var service = this._currentServices[ i ];
-
-          if ( !_serviceContainer || service.serviceContainer[ 0 ] == _serviceContainer[ 0 ] ) {
-            if ( value === undefined ) {
-              // toggle visibility
-              value = ( service.style.visibility !== "visible" );
-            }
-
-            service.style.visibility = ( value ? "visible" : "hidden" );
-
-            // update the original service object's style property
-            service.serviceObject.style = $.extend( { }, service.serviceObject.style, service.style );
-
-            service.serviceContainer.toggle( value );
-
-            if ( value ) {
-              $.geo[ "_serviceTypes" ][ service.type ].refresh( this, service );
-            }
-          }
-        }
-      }
-    },
-
-    zoom: function (numberOfLevels) {
-      if (numberOfLevels !== null) {
-        this._setZoom(this._options["zoom"] + numberOfLevels, false, true);
-      }
-    },
-
-    refresh: function ( force, _serviceContainer ) {
-      if ( this._$elem.is( ".geo-service" ) ) {
-        this._$elem.closest( ".geo-map" ).geomap( "refresh", force, this._$elem );
-      } else {
-        this._refresh( force, _serviceContainer );
-      }
-    },
-
-    resize: function ( _trigger /* Internal Use Only */ ) {
-      var size = this._findMapSize(),
-          dx = size["width"]/2 - this._contentBounds.width/2,
-          dy = size["height"]/2 - this._contentBounds.height/2,
-          i;
-
-      this._contentBounds = {
-        x: parseInt(this._$elem.css("padding-left"), 10),
-        y: parseInt(this._$elem.css("padding-top"), 10),
-        width: size["width"],
-        height: size["height"]
-      };
-
-      this._$resizeContainer.css( {
-        width: size["width"],
-        height: size["height"]
-      } );
-
-      for (i = 0; i < this._currentServices.length; i++) {
-        $.geo["_serviceTypes"][this._currentServices[i].type].resize(this, this._currentServices[i]);
-      }
-
-      this._$elem.find( ".geo-graphics" ).css( {
-        width: size["width"],
-        height: size["height"]
-      }).geographics( "resize" );
-
-      for (i = 0; i < this._drawPixels.length; i++) {
-        this._drawPixels[i][0] += dx;
-        this._drawPixels[i][1] += dy;
-      }
-
-      this._setCenterAndSize(this._center, this._pixelSize, _trigger, true);
-    },
-
-    append: function ( shape, style, label, refresh ) {
-      if ( shape && ( $.isPlainObject( shape ) || ( $.isArray( shape ) && shape.length > 0 ) ) ) {
-        if ( !this._createdGraphics ) {
-          this._createServiceGraphics( );
-        }
-
-        var shapes, arg, i, realStyle, realLabel, realRefresh;
-
-        if ( $.isArray( shape ) ) {
-          shapes = shape;
-        } else if ( shape.type == "FeatureCollection" ) {
-          shapes = shape.features;
-        } else {
-          shapes = [ shape ];
-        }
-
-        for ( i = 1; i < arguments.length; i++ ) {
-          arg = arguments[ i ];
-
-          if ( typeof arg === "object" ) {
-            realStyle = arg;
-          } else if ( typeof arg === "number" || typeof arg === "string" ) {
-            realLabel = arg;
-          } else if ( typeof arg === "boolean" ) {
-            realRefresh = arg;
-          }
-        }
-
-        for ( i = 0; i < shapes.length; i++ ) {
-          if ( shapes[ i ].type != "Point" ) {
-            var bbox = $.geo.bbox( shapes[ i ] );
-            if ( $.geo.proj && $.geo._isGeodetic( bbox ) ) {
-              bbox = $.geo.proj.fromGeodetic( bbox );
-            }
-            $.data( shapes[ i ], "geoBbox", bbox );
-          }
-
-          this._graphicShapes.push( {
-            shape: shapes[ i ],
-            style: realStyle,
-            label: realLabel
-          } );
-        }
-
-        if ( realRefresh === undefined || realRefresh ) {
-          if ( this._$elem.is( ".geo-service" ) ) {
-            this._refresh( false, this._$elem );
-          } else {
-            this._refresh( );
-          }
-        }
-      }
-    },
-
-    empty: function ( refresh ) {
-      for ( var i = 0; i < this._graphicShapes.length; i++ ) {
-        $.removeData( this._graphicShapes[ i ].shape, "geoBbox" );
-      }
-
-      this._graphicShapes = [];
-
-      if ( refresh === undefined || refresh ) {
-        if ( this._$elem.is( ".geo-service" ) ) {
-          this._refresh( false, this._$elem );
-        } else {
-          this._refresh( );
-        }
-      }
-    },
-
-    find: function ( selector, pixelTolerance ) {
-      var isPoint = $.isPlainObject( selector ),
-          searchPixel = isPoint ? this._map.toPixel( selector.coordinates ) : undefined,
-          mapTol = this._map._pixelSize * pixelTolerance,
-          result = [],
-          graphicShape,
-          geometries,
-          curGeom,
-          i = 0;
-
-      for ( ; i < this._graphicShapes.length; i++ ) {
-        graphicShape = this._graphicShapes[ i ];
-
-        if ( isPoint ) {
-          if ( graphicShape.shape.type == "Point" ) {
-            if ( $.geo.distance( graphicShape.shape, selector ) <= mapTol ) {
-              result.push( graphicShape.shape );
-            }
-          } else {
-            var bbox = $.data( graphicShape.shape, "geoBbox" ),
-                bboxPolygon = {
-                  type: "Polygon",
-                  coordinates: [ [
-                    [bbox[0], bbox[1]],
-                    [bbox[0], bbox[3]],
-                    [bbox[2], bbox[3]],
-                    [bbox[2], bbox[1]],
-                    [bbox[0], bbox[1]]
-                  ] ]
-                },
-                projectedPoint = {
-                  type: "Point",
-                  coordinates: $.geo.proj && $.geo._isGeodetic( selector.coordinates ) ? $.geo.proj.fromGeodetic( selector.coordinates ) : selector.coordinates
-                };
-
-            if ( $.geo.distance( bboxPolygon, projectedPoint, true ) <= mapTol ) {
-              geometries = $.geo._flatten( graphicShape.shape );
-              for ( curGeom = 0; curGeom < geometries.length; curGeom++ ) {
-                if ( $.geo.distance( geometries[ curGeom ], selector ) <= mapTol ) {
-                  result.push( graphicShape.shape );
-                  break;
-                }
-              }
-            }
-          }
-        } else {
-          result.push( graphicShape.shape );
-        }
-      }
-
-      if ( this._$elem.is( ".geo-map" ) ) {
-        this._$elem.find( ".geo-service" ).each( function( ) {
-          result = $.merge( result, $( this ).geomap( "find", selector, pixelTolerance ) );
-        } );
-      }
-
-      return result;
-    },
-
-    remove: function ( shape, refresh ) {
-      if ( shape && ( $.isPlainObject( shape ) || ( $.isArray( shape ) && shape.length > 0 ) ) ) {
-        var shapes = $.isArray( shape ) ? shape : [ shape ],
-            rest;
-
-        for ( var i = 0; i < this._graphicShapes.length; i++ ) {
-          if ( $.inArray( this._graphicShapes[ i ].shape, shapes ) >= 0 ) {
-            $.removeData( shape, "geoBbox" );
-            rest = this._graphicShapes.slice( i + 1 );
-            this._graphicShapes.length = i;
-            this._graphicShapes.push.apply( this._graphicShapes, rest );
-            i--;
-          }
-        }
-
-        if ( refresh === undefined || refresh ) {
-          if ( this._$elem.is( ".geo-service" ) ) {
-            this._refresh( false, this._$elem );
-          } else {
-            this._refresh( );
-          }
-        }
-      }
-    },
-
-    _getBbox: function (center, pixelSize) {
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      // calculate the internal bbox
-      var halfWidth = this._contentBounds[ "width" ] / 2 * pixelSize,
-          halfHeight = this._contentBounds[ "height" ] / 2 * pixelSize;
-      return [ center[ 0 ] - halfWidth, center[ 1 ] - halfHeight, center[ 0 ] + halfWidth, center[ 1 ] + halfHeight ];
-    },
-
-    _setBbox: function (value, trigger, refresh) {
-      var center = [value[0] + (value[2] - value[0]) / 2, value[1] + (value[3] - value[1]) / 2],
-          pixelSize = Math.max($.geo.width(value, true) / this._contentBounds.width, $.geo.height(value, true) / this._contentBounds.height),
-          zoom = this._getZoom( center, pixelSize );
-
-      // clamp to zoom
-      if ( this._options[ "tilingScheme" ] ) {
-        pixelSize = this._getPixelSize( Math.min( Math.max( zoom, this._options[ "zoomMin" ] ), this._options[ "zoomMax" ] ) );
-      } else {
-        if ( zoom < this._options[ "zoomMin" ] ) {
-          pixelSize = this._getPixelSize( this._options[ "zoomMin" ] );
-        } else if ( zoom > this._options[ "zoomMax" ] ) {
-          pixelSize = this._getPixelSize( this._options[ "zoomMax" ] );
-        }
-      }
-
-      this._setInteractiveCenterAndSize( center, pixelSize );
-      this._interactiveTransform( );
-    },
-
-    _getBboxMax: function () {
-      // calculate the internal bboxMax
-      var halfWidth = this._contentBounds["width"] / 2 * this._pixelSizeMax,
-        halfHeight = this._contentBounds["height"] / 2 * this._pixelSizeMax;
-      return [this._centerMax[0] - halfWidth, this._centerMax[1] - halfHeight, this._centerMax[0] + halfWidth, this._centerMax[1] + halfHeight];
-    },
-
-    _getCenter: function () {
-      return this._center;
-    },
-
-    _getContentBounds: function () {
-      return this._contentBounds;
-    },
-
-    _getServicesContainer: function () {
-      return this._$servicesContainer;
-    },
-
-    _getZoom: function ( center, pixelSize ) {
-      // calculate the internal zoom level, vs. public zoom property
-      // this does not take zoomMin or zoomMax into account
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      var tilingScheme = this._options["tilingScheme"];
-      if ( tilingScheme ) {
-        if ( tilingScheme.pixelSizes ) {
-          var roundedPixelSize = Math.floor(pixelSize * 1000),
-              levels = tilingScheme.pixelSizes.length,
-              i = levels - 1;
-
-          for ( ; i >= 0; i-- ) {
-            if ( Math.floor( tilingScheme.pixelSizes[ i ] * 1000 ) >= roundedPixelSize ) {
-              return i;
-            }
-          }
-
-          return 0;
-        } else {
-          return Math.round( Math.log( tilingScheme.basePixelSize / pixelSize) / Math.log( 2 ) );
-        }
-      } else {
-        var ratio = this._contentBounds["width"] / this._contentBounds["height"],
-            bbox = $.geo.reaspect( this._getBbox( center, pixelSize ), ratio, true ),
-            bboxMax = $.geo.reaspect(this._getBboxMax(), ratio, true);
-
-        return Math.round( Math.log($.geo.width(bboxMax, true) / $.geo.width(bbox, true)) / Math.log(this._zoomFactor) );
-      }
-    },
-
-    _setZoom: function ( value, trigger, refresh ) {
-      // set the map widget's zoom, taking zoomMin and zoomMax into account
-      this._clearInteractiveTimeout( );
-
-      value = Math.min( Math.max( value, this._options[ "zoomMin" ] ), this._options[ "zoomMax" ] );
-      this._setInteractiveCenterAndSize( this._centerInteractive, this._getPixelSize( value ) );
-      this._interactiveTransform( );
-
-      this._setInteractiveTimeout( trigger );
-    },
-
-    _createChildren: function () {
-      this._$existingChildren = this._$elem.children();
-
-      this._forcePosition(this._$existingChildren);
-
-      this._$existingChildren.detach().css( {
-        mozUserSelect: "none"
-      } );
-
-
-      var contentSizeCss = "width:" + this._contentBounds["width"] + "px; height:" + this._contentBounds["height"] + "px; margin:0; padding:0;",
-          contentPosCss = "position:absolute; left:0; top:0;";
-
-      this._$elem.prepend('<div class="geo-event-target geo-content-frame" style="position:absolute; left:' + this._contentBounds.x + 'px; top:' + this._contentBounds.y + 'px;' + contentSizeCss + 'overflow:hidden; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none;" unselectable="on"></div>');
-      this._$eventTarget = this._$contentFrame = this._$elem.children(':first');
-
-      this._$contentFrame.append('<div class="geo-services-container" style="' + contentPosCss + contentSizeCss + '"></div>');
-      this._$servicesContainer = this._$contentFrame.children(':last');
-
-      this._$contentFrame.append('<div class="geo-shapes-container" style="' + contentPosCss + contentSizeCss + '"></div>');
-      this._$shapesContainer = this._$contentFrame.children(':last');
-
-      this._$contentFrame.append( '<ul style="position: absolute; bottom: 8px; left: 8px; list-style-type: none; max-width: 50%; padding: 0; margin: 0;"></ul>' );
-      this._$attrList = this._$contentFrame.children( ":last" );
-
-      this._$contentFrame.append('<div class="geo-draw-container" style="' + contentPosCss + contentSizeCss + '"></div>');
-      this._$drawContainer = this._$contentFrame.children(':last');
-
-      this._$contentFrame.append('<div class="geo-measure-container" style="' + contentPosCss + contentSizeCss + '"><span class="geo-measure-label" style="' + contentPosCss + '; display: none;"></span></div>');
-      this._$measureContainer = this._$contentFrame.children(':last');
-      this._$measureLabel = this._$measureContainer.children();
-
-      this._$panContainer = $( [ this._$shapesContainer[ 0 ], this._$drawContainer[ 0 ], this._$measureContainer[ 0 ] ] );
-
-      this._$resizeContainer = $( [ this._$contentFrame[ 0 ], this._$servicesContainer[ 0 ], this._$eventTarget[ 0 ], this._$measureContainer[ 0 ] ] ); 
-
-      this._$contentFrame.append(this._$existingChildren);
-
-      if ( ! $("#geo-measure-style").length ) {
-        $("head").prepend( '<style type="text/css" id="geo-measure-style">.geo-measure-label { margin: 4px 0 0 6px; font-family: sans-serif;' + ( _ieVersion ? 'letter-spacing: 2px; color: #444; filter:progid:DXImageTransform.Microsoft.DropShadow(Color=white, OffX=1, OffY=2, Positive=true);' : 'color: #000; text-shadow: #fff 1px 2px; font-weight: bold;' ) + ' }</style>' );
-      }
-    },
-
-    _createServices: function () {
-      var service, i;
-
-      for ( i = 0; i < this._currentServices.length; i++ ) {
-        this._currentServices[ i ].serviceContainer.geomap( "destroy" );
-        $.geo[ "_serviceTypes" ][ this._currentServices[ i ].type ].destroy( this, this._$servicesContainer, this._currentServices[ i ] );
-      }
-
-      this._currentServices = [ ];
-      this._$servicesContainer.html( "" );
-      this._$attrList.html( "" );
-
-      for ( i = 0; i < this._options[ "services" ].length; i++ ) {
-        service = this._currentServices[ i ] = $.extend( { }, this._options[ "services" ][ i ] );
-
-        // keep a reference to the original
-        service.serviceObject = this._options[ "services" ][ i ];
-
-        // default the service style property on our copy
-        service.style = $.extend( {
-                          visibility: "visible",
-                          opacity: 1
-                        }, service.style );
-
-        var idString = service.id ? ' id="' + service.id + '"' : "",
-            classString = 'class="geo-service ' + ( service["class"] ? service["class"] : '' ) + '"',
-            scHtml = '<div ' + idString + classString + ' style="-webkit-transform:translateZ(0);position:absolute; left:0; top:0; width:32px; height:32px; margin:0; padding:0; display:' + ( service.style.visibility === "visible" ? "block" : "none" ) + ';"></div>',
-            servicesContainer;
-
-        this._$servicesContainer.append( scHtml );
-        serviceContainer = this._$servicesContainer.children( ":last" );
-        service.serviceContainer = serviceContainer;
-        
-        $.geo[ "_serviceTypes" ][ service.type ].create( this, serviceContainer, service, i );
-
-        serviceContainer.data( "geoMap", this ).geomap();
-
-        if ( service.attr ) {
-          this._$attrList.append( '<li>' + service.attr + '</li>' );
-        }
-      }
-
-      // start with our map-level shapesContainer
-      this._$shapesContainers = this._$shapesContainer;
-
-      this._$attrList.find( "a" ).css( {
-        position: "relative",
-        zIndex: 100
-      } );
-    },
-
-    _createServiceGraphics: function( ) { 
-      // only called in the context of a service-level geomap
-      var $contentFrame = this._$elem.closest( ".geo-content-frame" );
-      this._$elem.append('<div class="geo-shapes-container" style="position:absolute; left:0; top:0; width:' + $contentFrame.css( "width" ) + '; height:' + $contentFrame.css( "height" ) + '; margin:0; padding:0;"></div>');
-      this._$shapesContainer = this._$elem.children(':last');
-
-      this._map._$shapesContainers = this._map._$shapesContainers.add( this._$shapesContainer );
-
-      this._$shapesContainer.geographics( );
-      this._createdGraphics = true;
-
-      this._options["shapeStyle"] = this._$shapesContainer.geographics("option", "style");
-    },
-
-    _refreshDrawing: function ( ) {
-      this._$drawContainer.geographics("clear");
-
-      if ( this._drawPixels.length > 0 ) {
-        var mode = this._options[ "mode" ],
-            pixels = this._drawPixels,
-            coords = this._drawCoords,
-            label,
-            labelShape,
-            labelPixel,
-            widthOver,
-            heightOver;
-
-        switch ( mode ) {
-          case "measureLength":
-            mode = "drawLineString";
-            labelShape = {
-              type: "LineString",
-              coordinates: coords
-            };
-            label = $.render[ this._tmplLengthId ]( { length: $.geo.length( labelShape, true ) } );
-            labelPixel = $.merge( [], pixels[ pixels.length - 1 ] );
-            break;
-
-          case "measureArea":
-            mode = "drawPolygon";
-
-            labelShape = {
-              type: "Polygon",
-              coordinates: [ $.merge( [ ], coords ) ]
-            };
-            labelShape.coordinates[ 0 ].push( coords[ 0 ] );
-
-            label = $.render[ this._tmplAreaId ]( { area: $.geo.area( labelShape, true ) } );
-            labelPixel = this._toPixel( $.geo.centroid( labelShape ).coordinates );
-            pixels = [ pixels ];
-            break;
-
-          case "drawPolygon":
-            pixels = [ pixels ];
-            break;
-        }
-
-        this._$drawContainer.geographics( mode, pixels );
-        
-        if ( label ) {
-          this._$measureLabel.html( label );
-
-          widthOver = this._contentBounds.width - ( this._$measureLabel.outerWidth( true ) + labelPixel[ 0 ] );
-          heightOver = this._contentBounds.height - ( this._$measureLabel.outerHeight( true ) + labelPixel[ 1 ] );
-
-          if ( widthOver < 0 ) {
-            labelPixel[ 0 ] += widthOver;
-          }
-
-          if ( heightOver < 0 ) {
-            labelPixel[ 1 ] += heightOver;
-          }
-
-          this._$measureLabel.css( {
-            left: Math.max( labelPixel[ 0 ], 0 ),
-            top: Math.max( labelPixel[ 1 ], 0 )
-          } ).show();
-        }
-      }
-    },
-
-    _resetDrawing: function () {
-      this._drawPixels = [];
-      this._drawCoords = [];
-      this._$drawContainer.geographics("clear");
-      this._$measureLabel.hide();
-    },
-
-    _refreshShapes: function (geographics, shapes, styles, labels, center, pixelSize) {
-      var i, mgi,
-          shape,
-          shapeBbox,
-          style,
-          label,
-          hasLabel,
-          labelPixel,
-          bbox = this._map._getBbox(center, pixelSize);
-
-      for (i = 0; i < shapes.length; i++) {
-        shape = shapes[i].shape || shapes[i];
-        shape = shape.geometry || shape;
-        shapeBbox = $.data(shape, "geoBbox");
-
-        if ( shapeBbox && $.geo._bboxDisjoint( bbox, shapeBbox ) ) {
-          continue;
-        }
-
-        style = $.isArray(styles) ? styles[i].style : styles;
-        label = $.isArray(labels) ? labels[i].label : labels;
-        hasLabel = ( label !== undefined );
-        labelPixel = undefined;
-
-        switch (shape.type) {
-          case "Point":
-            labelPixel = this._map.toPixel( shape.coordinates, center, pixelSize );
-            this._$shapesContainer.geographics("drawPoint", labelPixel, style);
-            break;
-          case "LineString":
-            this._$shapesContainer.geographics("drawLineString", this._map.toPixel(shape.coordinates, center, pixelSize), style);
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.pointAlong( shape, 0.5 ).coordinates, center, pixelSize );
-            }
-            break;
-          case "Polygon":
-            this._$shapesContainer.geographics("drawPolygon", this._map.toPixel(shape.coordinates, center, pixelSize), style);
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize );
-            }
-            break;
-          case "MultiPoint":
-            for (mgi = 0; mgi < shape.coordinates.length; mgi++) {
-              this._$shapesContainer.geographics("drawPoint", this._map.toPixel(shape.coordinates[mgi], center, pixelSize), style);
-            }
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize );
-            }
-            break;
-          case "MultiLineString":
-            for (mgi = 0; mgi < shape.coordinates.length; mgi++) {
-              this._$shapesContainer.geographics("drawLineString", this._map.toPixel(shape.coordinates[mgi], center, pixelSize), style);
-            }
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize );
-            }
-            break;
-          case "MultiPolygon":
-            for (mgi = 0; mgi < shape.coordinates.length; mgi++) {
-              this._$shapesContainer.geographics("drawPolygon", this._map.toPixel(shape.coordinates[mgi], center, pixelSize), style);
-            }
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize );
-            }
-            break;
-
-          case "GeometryCollection":
-            this._refreshShapes(geographics, shape.geometries, style, label, center, pixelSize);
-            break;
-        }
-
-        if ( hasLabel && labelPixel ) {
-          this._$shapesContainer.geographics( "drawLabel", labelPixel, label );
-        }
-      }
-    },
-
-    _findMapSize: function () {
-      // really, really attempt to find a size for this thing
-      // even if it's hidden (look at parents)
-      var size = { width: 0, height: 0 },
-        sizeContainer = this._$elem;
-
-      while (sizeContainer.size() && !(size["width"] > 0 && size["height"] > 0)) {
-        size = { width: sizeContainer.width(), height: sizeContainer.height() };
-        if (size["width"] <= 0 || size["height"] <= 0) {
-          size = { width: parseInt(sizeContainer.css("width"), 10), height: parseInt(sizeContainer.css("height"), 10) };
-        }
-        sizeContainer = sizeContainer.parent();
-      }
-      return size;
-    },
-
-    _forcePosition: function (elem) {
-      var cssPosition = elem.css("position");
-      if (cssPosition != "relative" && cssPosition != "absolute" && cssPosition != "fixed") {
-        elem.css("position", "relative");
-      }
-    },
-
-    _getPixelSize: function ( zoom ) {
-      var tilingScheme = this._options["tilingScheme"];
-      if (tilingScheme !== null) {
-        if (zoom === 0) {
-          return tilingScheme.pixelSizes ? tilingScheme.pixelSizes[0] : tilingScheme.basePixelSize;
-        }
-
-        zoom = Math.round(zoom);
-        zoom = Math.max(zoom, 0);
-        var levels = tilingScheme.pixelSizes ? tilingScheme.pixelSizes.length : tilingScheme.levels;
-        zoom = Math.min(zoom, levels - 1);
-
-        if ( tilingScheme.pixelSizes ) {
-          return tilingScheme.pixelSizes[zoom];
-        } else {
-          return tilingScheme.basePixelSize / Math.pow(2, zoom);
-        }
-      } else {
-        var bbox = $.geo.scaleBy( this._getBboxMax(), 1 / Math.pow( this._zoomFactor, zoom ), true );
-        return Math.max( $.geo.width( bbox, true ) / this._contentBounds.width, $.geo.height( bbox, true ) / this._contentBounds.height );
-      }
-    },
-
-    _getZoomCenterAndSize: function ( anchor, zoomDelta, full ) {
-      var zoomFactor = ( full ? this._fullZoomFactor : this._partialZoomFactor ),
-          scale = Math.pow( zoomFactor, -zoomDelta ),
-          pixelSize = this._pixelSizeInteractive * scale,
-          zoom = this._getZoom(this._centerInteractive, pixelSize);
-
-      // clamp to zoom
-      if ( full && this._options[ "tilingScheme" ] ) {
-        pixelSize = this._getPixelSize( Math.min( Math.max( zoom, this._options[ "zoomMin" ] ), this._options[ "zoomMax" ] ) );
-      } else {
-        if ( zoomDelta < 0 && zoom < this._options[ "zoomMin" ] ) {
-          pixelSize = this._pixelSizeInteractive;
-        } else if ( zoomDelta > 0 && zoom > this._options[ "zoomMax" ] ) {
-          pixelSize = this._pixelSizeInteractive;
-        }
-      }
-
-      var ratio = pixelSize / this._pixelSizeInteractive,
-          anchorMapCoord = this._toMap( anchor, this._centerInteractive, this._pixelSizeInteractive ),
-          centerDelta = [(this._centerInteractive[0] - anchorMapCoord[0]) * ratio, (this._centerInteractive[1] - anchorMapCoord[1]) * ratio],
-          scaleCenter = [anchorMapCoord[0] + centerDelta[0], anchorMapCoord[1] + centerDelta[1]];
-
-      return { pixelSize: pixelSize, center: scaleCenter };
-    },
-
-    _mouseWheelFinish: function ( refresh ) {
-      this._wheelTimeout = null;
-
-      if (this._wheelLevel !== 0) {
-        var wheelCenterAndSize = this._getZoomCenterAndSize( this._anchor, this._wheelLevel, this._options[ "tilingScheme" ] !== null );
-
-        this._wheelLevel = 0;
-      } else if ( refresh ) {
-        this._refresh();
-      }
-    },
-
-    _panFinalize: function () {
-      if (this._panning) {
-        this._velocity = [0, 0];
-
-        var dx = this._current[0] - this._anchor[0],
-            dy = this._current[1] - this._anchor[1],
-            image = this._options[ "axisLayout" ] === "image",
-            dxMap = -dx * this._pixelSize,
-            dyMap = ( image ? -1 : 1 ) * dy * this._pixelSize;
-
-        this._$eventTarget.css("cursor", this._options["cursors"][this._options["mode"]]);
-
-        this._inOp = false;
-        this._anchor = this._current;
-        this._mouseDown = this._toolPan = this._panning = false;
-      }
-    },
-
-    _panMove: function () {
-      if ( ! this._options[ "pannable" ] ) {
-        return;
-      }
-
-      var dx = this._current[0] - this._lastDrag[0],
-          dy = this._current[1] - this._lastDrag[1],
-          i = 0,
-          service,
-          translateObj;
-
-      if (this._toolPan || dx > 3 || dx < -3 || dy > 3 || dy < -3) {
-        if (!this._toolPan) {
-          this._toolPan = true;
-          this._$eventTarget.css("cursor", this._options["cursors"]["pan"]);
-        }
-
-        if (this._mouseDown) {
-          this._velocity = [dx, dy];
-        }
-
-        if (dx !== 0 || dy !== 0) {
-          this._panning = true;
-          this._lastDrag = this._current;
-
-          this._centerInteractive[ 0 ] -= ( dx * this._pixelSizeInteractive );
-          this._centerInteractive[ 1 ] += ( ( this._options[ "axisLayout" ] === "image" ? -1 : 1 ) * dy * this._pixelSizeInteractive );
-          this._setInteractiveCenterAndSize( this._centerInteractive, this._pixelSizeInteractive );
-          this._interactiveTransform( );
-        }
-      }
-    },
-
-    _clearInteractiveTimeout: function() {
-      if ( this._timeoutInteractive ) {
-        clearTimeout( this._timeoutInteractive );
-        this._timeoutInteractive = null;
-        return true;
-      } else {
-        this._centerInteractive[ 0 ] = this._center[ 0 ];
-        this._centerInteractive[ 1 ] = this._center[ 1 ];
-        this._pixelSizeInteractive = this._pixelSize;
-        return false;
-      }
-    },
-
-    _interactiveTransform: function( ) {
-      if ( this._$shapesContainers ) {
-        this._$shapesContainers.geographics("clear");
-      }
-
-      for ( var i = 0; i < this._currentServices.length; i++ ) {
-        service = this._currentServices[ i ];
-        $.geo[ "_serviceTypes" ][ service.type ].interactiveTransform( this, service, this._centerInteractive, this._pixelSizeInteractive );
-      }
-
-      if (this._drawCoords.length > 0) {
-        this._drawPixels = this._toPixel( this._drawCoords, this._centerInteractive, this._pixelSizeInteractive );
-        this._refreshDrawing();
-      }
-    },
-
-    _setInteractiveTimeout: function( trigger ) {
-      var geomap = this;
-
-      function interactiveTimeoutCallback( ) {
-        if ( geomap._isMultiTouch ) {
-          geomap._timeoutInteractive = setTimeout( interactiveTimeoutCallback, 128 );
-        } else if ( geomap._created && geomap._timeoutInteractive ) {
-          geomap._setCenterAndSize( geomap._centerInteractive, geomap._pixelSizeInteractive, geomap._triggerInteractive, true );
-          geomap._timeoutInteractive = null;
-          geomap._triggerInteractive = false;
-        }
-      }
-
-      this._timeoutInteractive = setTimeout( interactiveTimeoutCallback, 128 );
-      this._triggerInteractive |= trigger;
-    },
-
-    _refresh: function ( force, _serviceContainer ) {
-      var service,
-          geoService,
-          i = 0;
-
-      for ( ; i < this._currentServices.length; i++ ) {
-        service = this._currentServices[ i ];
-        if ( !_serviceContainer || service.serviceContainer[ 0 ] == _serviceContainer[ 0 ] ) {
-          $.geo[ "_serviceTypes" ][ service.type ].refresh( this, service, force );
-          geoService = service.serviceContainer.data( "geoService" );
-
-          if ( geoService._createdGraphics ) {
-            geoService._$shapesContainer.geographics( "clear" );
-            if ( geoService._graphicShapes.length > 0 ) {
-              geoService._refreshShapes( geoService._$shapesContainer, geoService._graphicShapes, geoService._graphicShapes, geoService._graphicShapes );
-            }
-          }
-        }
-      }
-
-      if ( this._createdGraphics ) {
-        this._$shapesContainer.geographics( "clear" );
-        if ( this._graphicShapes.length > 0 ) {
-          this._refreshShapes( this._$shapesContainer, this._graphicShapes, this._graphicShapes, this._graphicShapes );
-        }
-      }
-    },
-
-    _setInteractiveCenterAndSize: function ( center, pixelSize ) {
-      // set the temporary (interactive) center & size
-      // also, update the public-facing options
-      // this does not take zoomMin or zoomMax into account
-      this._centerInteractive[ 0 ] = center[ 0 ];
-      this._centerInteractive[ 1 ] = center[ 1 ];
-      this._pixelSizeInteractive = pixelSize;
-
-      if ( this._userGeodetic ) {
-        this._options["bbox"] = $.geo.proj.toGeodetic( this._getBbox( center, pixelSize ) );
-        this._options["center"] = $.geo.proj.toGeodetic( center );
-      } else {
-        this._options["bbox"] = this._getBbox( center, pixelSize );
-        this._options["center"][ 0 ] = center[ 0 ];
-        this._options["center"][ 1 ] = center[ 1 ];
-      }
-
-      this._options["pixelSize"] = pixelSize;
-      this._options["zoom"] = this._getZoom( center, pixelSize );
-    },
-
-    _setCenterAndSize: function (center, pixelSize, trigger, refresh) {
-      if ( ! $.isArray( center ) || center.length != 2 || typeof center[ 0 ] !== "number" || typeof center[ 1 ] !== "number" ) {
-        return;
-      }
-
-      // the final call during any extent change
-      // only called by timeoutInteractive & resize
-      // clamp to zoom
-      var zoom = this._getZoom( center, pixelSize );
-
-      if ( this._options[ "tilingScheme" ] ) {
-        this._pixelSizeInteractive = pixelSize = this._getPixelSize( Math.min( Math.max( zoom, this._options[ "zoomMin" ] ), this._options[ "zoomMax" ] ) );
-      } else {
-        if ( zoom < this._options[ "zoomMin" ] ) {
-          this._pixelSizeInteractive = pixelSize = this._getPixelSize( this._options[ "zoomMin" ] );
-        } else if ( zoom > this._options[ "zoomMax" ] ) {
-          this._pixelSizeInteractive = pixelSize = this._getPixelSize( this._options[ "zoomMax" ] );
-        }
-      }
-
-      this._center[ 0 ] = center[ 0 ];
-      this._center[ 1 ] = center[ 1 ];
-      this._options["pixelSize"] = this._pixelSize = pixelSize;
-
-      if ( this._userGeodetic ) {
-        this._options["bbox"] = $.geo.proj.toGeodetic( this._getBbox() );
-        this._options["center"] = $.geo.proj.toGeodetic( this._center );
-      } else {
-        this._options["bbox"] = this._getBbox();
-        this._options["center"] = $.merge( [ ], center );
-      }
-
-      this._options["zoom"] = zoom;
-
-      if (trigger) {
-        this._trigger("bboxchange", window.event, { bbox: $.merge( [ ], this._options["bbox"] ) });
-      }
-
-      if (refresh) {
-        this._refresh();
-        this._refreshDrawing();
-      }
-    },
-
-    _requestQueued: function ( ) {
-      if ( this._loadCount === 0 ) {
-        this._trigger( "loadstart", window.event );
-      }
-      this._loadCount++;
-    },
-
-    _requestComplete: function ( ) {
-      this._loadCount--;
-      if ( this._loadCount <= 0 ) {
-        this._loadCount = 0;
-        this._trigger( "loadend", window.event );
-      }
-    },
-
-    _toMap: function (p, center, pixelSize) {
-      // ignores $.geo.proj
-
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      var isMultiPointOrLineString = $.isArray( p[ 0 ] ),
-          isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray( p[ 0 ][ 0 ] ),
-          isMultiPolygon = isMultiLineStringOrPolygon && $.isArray( p[ 0 ][ 0 ][ 0 ] ),
-          width = this._contentBounds["width"],
-          height = this._contentBounds["height"],
-          halfWidth = width / 2 * pixelSize,
-          halfHeight = height / 2 * pixelSize,
-          bbox = [center[0] - halfWidth, center[1] - halfHeight, center[0] + halfWidth, center[1] + halfHeight],
-          xRatio = $.geo.width(bbox, true) / width,
-          yRatio = $.geo.height(bbox, true) / height,
-          yOffset,
-          image = this._options[ "axisLayout" ] === "image",
-          result = [],
-          i, j, k;
-
-      if ( !isMultiPolygon ) {
-        if ( !isMultiLineStringOrPolygon ) {
-          if ( !isMultiPointOrLineString ) {
-            p = [ p ];
-          }
-          p = [ p ];
-        }
-        p = [ p ];
-      }
-
-      for ( i = 0; i < p.length; i++ ) {
-        result[ i ] = [ ];
-        for ( j = 0; j < p[ i ].length; j++ ) {
-          result[ i ][ j ] = [ ];
-          for ( k = 0; k < p[ i ][ j ].length; k++ ) {
-            yOffset = (p[ i ][ j ][ k ][1] * yRatio);
-            result[ i ][ j ][ k ] = [
-              bbox[ 0 ] + ( p[ i ][ j ][ k ][ 0 ] * xRatio ),
-              image ? bbox[ 1 ] + yOffset : bbox[ 3 ] - yOffset
-            ];
-          }
-        }
-      }
-
-      return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-    },
-
-    _toPixel: function (p, center, pixelSize) {
-      // ignores $.geo.proj
-
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      var isMultiPointOrLineString = $.isArray( p[ 0 ] ),
-          isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray( p[ 0 ][ 0 ] ),
-          isMultiPolygon = isMultiLineStringOrPolygon && $.isArray( p[ 0 ][ 0 ][ 0 ] ),
-          width = this._contentBounds["width"],
-          height = this._contentBounds["height"],
-          halfWidth = width / 2 * pixelSize,
-          halfHeight = height / 2 * pixelSize,
-          bbox = [center[0] - halfWidth, center[1] - halfHeight, center[0] + halfWidth, center[1] + halfHeight],
-          bboxWidth = $.geo.width(bbox, true),
-          bboxHeight = $.geo.height(bbox, true),
-          image = this._options[ "axisLayout" ] === "image",
-          xRatio = width / bboxWidth,
-          yRatio = height / bboxHeight,
-          result = [ ],
-          i, j, k;
-
-      if ( !isMultiPolygon ) {
-        if ( !isMultiLineStringOrPolygon ) {
-          if ( !isMultiPointOrLineString ) {
-            p = [ p ];
-          }
-          p = [ p ];
-        }
-        p = [ p ];
-      }
-
-      for ( i = 0; i < p.length; i++ ) {
-        result[ i ] = [ ];
-        for ( j = 0; j < p[ i ].length; j++ ) {
-          result[ i ][ j ] = [ ];
-          for ( k = 0; k < p[ i ][ j ].length; k++ ) {
-            result[ i ][ j ][ k ] = [
-              Math.round( ( p[ i ][ j ][ k ][ 0 ] - bbox[ 0 ] ) * xRatio ),
-              Math.round( ( image ? p[ i ][ j ][ k ][ 1 ] - bbox[ 1 ] : bbox[ 3 ] - p[ i ][ j ][ k ][ 1 ] ) * yRatio )
-            ];
-          }
-        }
-      }
-
-      return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-    },
-
-    _document_keydown: function (e) {
-      var len = this._drawCoords.length;
-      if (len > 0 && e.which == 27) {
-        if (len <= 2) {
-          this._resetDrawing();
-          this._inOp = false;
-        } else {
-          this._drawCoords[len - 2] = $.merge( [], this._drawCoords[ len - 1 ] );
-          this._drawPixels[len - 2] = $.merge( [], this._drawPixels[ len - 1 ] );
-
-          this._drawCoords.length--;
-          this._drawPixels.length--;
-
-          this._refreshDrawing();
-        }
-      }
-    },
-
-    _eventTarget_dblclick_zoom: function(e) {
-      var doInteractiveTimeout = this._clearInteractiveTimeout( );
-
-      this._trigger("dblclick", e, { type: "Point", coordinates: this._toMap(this._current, this._centerInteractive, this._pixelSizeInteractive ) });
-
-      if (!e.isDefaultPrevented()) {
-        var centerAndSize = this._getZoomCenterAndSize(this._current, 1, true );
-
-        this._setInteractiveCenterAndSize( centerAndSize.center, centerAndSize.pixelSize );
-        this._interactiveTransform( );
-
-        doInteractiveTimeout = true;
-      }
-
-      if ( doInteractiveTimeout ) {
-        this._setInteractiveTimeout( true );
-      }
-    },
-
-    _eventTarget_dblclick: function (e) {
-      if ( this._options[ "mode" ] === "static" ) {
-        return;
-      }
-
-      if (this._drawTimeout) {
-        window.clearTimeout(this._drawTimeout);
-        this._drawTimeout = null;
-      }
-
-      var offset = $(e.currentTarget).offset();
-
-      switch (this._options["mode"]) {
-        case "drawLineString":
-        case "measureLength":
-          if ( this._drawCoords.length > 1 && ! ( this._drawCoords[0][0] == this._drawCoords[1][0] &&
-                                                  this._drawCoords[0][1] == this._drawCoords[1][1] ) ) {
-              this._drawCoords.length--;
-              this._trigger( "shape", e, {
-                type: "LineString",
-                coordinates: this._userGeodetic ? $.geo.proj.toGeodetic(this._drawCoords) : this._drawCoords
-              } );
-          } else {
-            this._eventTarget_dblclick_zoom(e);
-          }
-          this._resetDrawing();
-          break;
-
-        case "drawPolygon":
-        case "measureArea":
-          if ( this._drawCoords.length > 1 && ! ( this._drawCoords[0][0] == this._drawCoords[1][0] &&
-                                                  this._drawCoords[0][1] == this._drawCoords[1][1] ) ) {
-            var endIndex = this._drawCoords.length - 1;
-            if (endIndex > 2) {
-              this._drawCoords[endIndex] = $.merge( [], this._drawCoords[0] );
-              this._trigger( "shape", e, {
-                type: "Polygon",
-                coordinates: [ this._userGeodetic ? $.geo.proj.toGeodetic(this._drawCoords) : this._drawCoords ]
-              } );
-            }
-          } else {
-            this._eventTarget_dblclick_zoom(e);
-          }
-          this._resetDrawing();
-          break;
-
-        default:
-          this._eventTarget_dblclick_zoom(e);
-          break;
-      }
-
-      this._inOp = false;
-    },
-
-    _eventTarget_touchstart: function (e) {
-      var mode = this._options[ "mode" ],
-          shift = this._options[ "shift" ];
-
-      if ( mode === "static" ) {
-        return;
-      }
-
-      if ( !this._supportTouch && e.which != 1 ) {
-        return;
-      }
-
-      var doInteractiveTimeout = this._clearInteractiveTimeout( );
-
-      var offset = $(e.currentTarget).offset(),
-          touches = e.originalEvent.changedTouches;
-
-      if ( this._supportTouch ) {
-        this._multiTouchAnchor = $.merge( [ ], touches );
-
-        this._isMultiTouch = this._multiTouchAnchor.length > 1;
-
-        if ( this._isMultiTouch ) {
-          this._multiTouchCurrentBbox = [
-            touches[0].pageX - offset.left,
-            touches[0].pageY - offset.top,
-            touches[1].pageX - offset.left,
-            touches[1].pageY - offset.top
-          ];
-
-          this._multiTouchAnchorBbox = $.merge( [ ], this._multiTouchCurrentBbox );
-
-          this._current = $.geo.center( this._multiTouchCurrentBbox, true );
-        } else {
-          this._multiTouchCurrentBbox = [
-            touches[0].pageX - offset.left,
-            touches[0].pageY - offset.top,
-            NaN,
-            NaN
-          ];
-
-          this._current = [ touches[0].pageX - offset.left, touches[0].pageY - offset.top ];
-        }
-      } else {
-        this._current = [e.pageX - offset.left, e.pageY - offset.top];
-      }
-
-      if (this._softDblClick) {
-        var downDate = $.now();
-        if (downDate - this._downDate < 750) {
-          if (this._isTap) {
-            var dx = this._current[0] - this._anchor[0],
-                dy = this._current[1] - this._anchor[1],
-                distance = Math.sqrt((dx * dx) + (dy * dy));
-            if (distance > 8) {
-              this._isTap = false;
-            } else {
-              this._current = $.merge( [ ], this._anchor );
-            }
-          }
-
-          if (this._isDbltap) {
-            this._isDbltap = false;
-          } else {
-            this._isDbltap = this._isTap;
-          }
-        } else {
-          this._isDbltap = false;
-        }
-        this._isTap = true;
-        this._downDate = downDate;
-      }
-
-      this._mouseDown = true;
-      this._anchor = $.merge( [ ], this._current );
-
-      if (!this._inOp && e.shiftKey && shift !== "off") {
-        this._shiftDown = true;
-        this._$eventTarget.css( "cursor", this._options[ "cursors" ][ shift === "default" ? "zoom" : shift ] );
-      } else if ( !this._isMultiTouch && ( this._options[ "pannable" ] || mode === "dragBox" || mode === "dragCircle" ) ) {
-        this._inOp = true;
-
-        if ( mode !== "zoom" && mode !== "dragBox" && mode !== "dragCircle" ) {
-          this._lastDrag = this._current;
-
-          if (e.currentTarget.setCapture) {
-            e.currentTarget.setCapture();
-          }
-        }
-      }
-
-      e.preventDefault();
-
-      if ( doInteractiveTimeout ) {
-        this._setInteractiveTimeout( true );
-      }
-
-      return false;
-    },
-
-    _dragTarget_touchmove: function (e) {
-      if ( this._options[ "mode" ] === "static" ) {
-        return;
-      }
-
-      var doInteractiveTimeout = false;
-      if ( this._mouseDown ) {
-        doInteractiveTimeout = this._clearInteractiveTimeout( );
-      }
-
-      var offset = this._$eventTarget.offset(),
-          drawCoordsLen = this._drawCoords.length,
-          touches = e.originalEvent.changedTouches,
-          current,
-          service,
-          i = 0;
-
-      if ( this._supportTouch ) {
-        if ( !this._isMultiTouch && this._mouseDown && this._multiTouchAnchor.length > 0 && touches[ 0 ].identifier !== this._multiTouchAnchor[ 0 ].identifier ) {
-          // switch to multitouch
-          this._mouseDown = false;
-          this._isMultiTouch = true;
-          this._wheelLevel = 0;
-
-          this._multiTouchAnchor.push( touches[ 0 ] );
-
-
-
-
-          this._multiTouchCurrentBbox = [
-            this._multiTouchCurrentBbox[ 0 ],
-            this._multiTouchCurrentBbox[ 1 ],
-            this._multiTouchAnchor[1].pageX - offset.left,
-            this._multiTouchAnchor[1].pageY - offset.top
-          ];
-
-          this._multiTouchAnchorBbox = $.merge( [ ], this._multiTouchCurrentBbox );
-
-          this._mouseDown = true;
-          this._anchor = this._current = $.geo.center( this._multiTouchCurrentBbox, true );
-
-
-          if ( doInteractiveTimeout ) {
-            this._setInteractiveTimeout( true );
-          }
-          return false;
-        }
-
-        if ( this._isMultiTouch ) {
-
-          for ( ; i < touches.length; i++ ) {
-            if ( touches[ i ].identifier === this._multiTouchAnchor[ 0 ].identifier ) {
-              this._multiTouchCurrentBbox[ 0 ] = touches[ i ].pageX - offset.left;
-              this._multiTouchCurrentBbox[ 1 ] = touches[ i ].pageY - offset.top;
-            } else if ( touches[ i ].identifier === this._multiTouchAnchor[ 1 ].identifier ) {
-              this._multiTouchCurrentBbox[ 2 ] = touches[ i ].pageX - offset.left;
-              this._multiTouchCurrentBbox[ 3 ] = touches[ i ].pageY - offset.top;
-            }
-          }
-
-          var anchorDistance = $.geo._distancePointPoint( [ this._multiTouchAnchorBbox[ 0 ], this._multiTouchAnchorBbox[ 1 ] ], [ this._multiTouchAnchorBbox[ 2 ], this._multiTouchAnchorBbox[ 3 ] ] ),
-              currentDistance = $.geo._distancePointPoint( [ this._multiTouchCurrentBbox[ 0 ], this._multiTouchCurrentBbox[ 1 ] ], [ this._multiTouchCurrentBbox[ 2 ], this._multiTouchCurrentBbox[ 3 ] ] );
-
-          current = $.geo.center( this._multiTouchCurrentBbox, true );
-
-          var wheelLevel = ( ( currentDistance - anchorDistance ) / anchorDistance );
-
-          if ( wheelLevel > 0 ) {
-            wheelLevel *= 5;
-          } else {
-            wheelLevel *= 10;
-          }
-
-          var delta = wheelLevel - this._wheelLevel;
-
-          this._wheelLevel = wheelLevel;
-
-          var pinchCenterAndSize = this._getZoomCenterAndSize( this._anchor, delta, false );
-
-          this._setInteractiveCenterAndSize( pinchCenterAndSize.center, pinchCenterAndSize.pixelSize );
-          this._interactiveTransform( );
-
-          doInteractiveTimeout = true;
-
-          current = $.geo.center( this._multiTouchCurrentBbox, true );
-        } else {
-          current = [e.originalEvent.changedTouches[0].pageX - offset.left, e.originalEvent.changedTouches[0].pageY - offset.top];
-        }
-      } else {
-        current = [e.pageX - offset.left, e.pageY - offset.top];
-      }
-
-      if (current[0] === this._lastMove[0] && current[1] === this._lastMove[1]) {
-        if ( this._inOp ) {
-          e.preventDefault();
-          if ( doInteractiveTimeout ) {
-            this._setInteractiveTimeout( true );
-          }
-          return false;
-        }
-      }
-
-      if ( _ieVersion == 7 ) {
-        this._isDbltap = this._isTap = false;
-      }
-
-      if (this._mouseDown) {
-        this._current = current;
-        this._moveDate = $.now();
-      }
-
-      if ( this._isMultiTouch ) {
-        e.preventDefault( );
-        this._isDbltap = this._isTap = false;
-        if ( doInteractiveTimeout ) {
-          this._setInteractiveTimeout( true );
-        }
-        return false;
-      }
-
-      var shift = this._options[ "shift" ],
-          mode = this._shiftDown ? ( shift === "default" ? "zoom" : shift ) : this._options["mode"],
-          dx, dy, circleSize;
-
-      switch (mode) {
-        case "zoom":
-        case "dragBox":
-          if ( this._mouseDown ) {
-            this._$drawContainer.geographics( "clear" );
-            this._$drawContainer.geographics( "drawBbox", [
-              this._anchor[ 0 ],
-              this._anchor[ 1 ],
-              current[ 0 ],
-              current[ 1 ]
-            ] );
-          } else {
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-
-        case "dragCircle":
-          if ( this._mouseDown ) {
-            dx = current[ 0 ] - this._anchor[ 0 ];
-            dy = current[ 1 ] - this._anchor[ 1 ];
-            circleSize = Math.sqrt( ( dx * dx) + ( dy * dy ) ) * 2;
-            //circleSize = Math.max( Math.abs( current[ 0 ] - this._anchor[ 0 ] ), Math.abs( current[ 1 ] - this._anchor[ 1 ] ) ) * 2;
-
-            // not part of _refreshDrawing
-            this._$drawContainer.geographics( "clear" );
-            this._$drawContainer.geographics( "drawArc", this._anchor, 0, 360, {
-              width: circleSize,
-              height: circleSize
-            } );
-          } else {
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-
-        case "drawLineString":
-        case "drawPolygon":
-        case "measureLength":
-        case "measureArea":
-          if (this._mouseDown || this._toolPan) {
-            this._panMove();
-            doInteractiveTimeout = true;
-          } else {
-            if (drawCoordsLen > 0) {
-              this._drawCoords[drawCoordsLen - 1] = this._toMap( current, this._centerInteractive, this._pixelSizeInteractive );
-              this._drawPixels[drawCoordsLen - 1] = current;
-
-              this._refreshDrawing();
-            }
-
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-
-        default:
-          if (this._mouseDown || this._toolPan) {
-            this._panMove();
-            doInteractiveTimeout = true;
-          } else {
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-      }
-
-      this._lastMove = current;
-
-      if ( doInteractiveTimeout ) {
-        this._setInteractiveTimeout( true );
-      }
-
-      if ( this._inOp ) {
-        e.preventDefault();
-        return false;
-      }
-    },
-
-    _dragTarget_touchstop: function (e) {
-      if ( this._options[ "mode" ] === "static" ) {
-        return;
-      }
-
-      if ( !this._mouseDown ) {
-        if ( _ieVersion == 7 ) {
-          // ie7 doesn't appear to trigger dblclick on this._$eventTarget,
-          // we fake regular click here to cause soft dblclick
-          this._eventTarget_touchstart(e);
-        } else {
-          // Chrome & Firefox trigger a rogue mouseup event when doing a dblclick maximize in Windows(/Linux?)
-          // ignore it
-          return false;
-        }
-      }
-
-      var doInteractiveTimeout = this._clearInteractiveTimeout( );
-
-      var mouseWasDown = this._mouseDown,
-          wasToolPan = this._toolPan,
-          offset = this._$eventTarget.offset(),
-          shift = this._options[ "shift" ],
-          mode = this._shiftDown ? ( shift === "default" ? "zoom" : shift ) : this._options["mode"],
-          current, i, clickDate,
-          dx, dy,
-          coordBuffer,
-          triggerShape;
-
-
-      if (this._supportTouch) {
-        current = [e.originalEvent.changedTouches[0].pageX - offset.left, e.originalEvent.changedTouches[0].pageY - offset.top];
-        this._multiTouchAnchor = [];
-        this._inOp = false;
-      } else {
-        current = [e.pageX - offset.left, e.pageY - offset.top];
-      }
-
-      if (this._softDblClick) {
-        if (this._isTap) {
-          dx = current[0] - this._anchor[0];
-          dy = current[1] - this._anchor[1];
-          if (Math.sqrt((dx * dx) + (dy * dy)) <= 8) {
-            current = $.merge( [ ], this._anchor );
-          }
-        }
-      }
-
-      dx = current[0] - this._anchor[0];
-      dy = current[1] - this._anchor[1];
-
-      this._$eventTarget.css("cursor", this._options["cursors"][this._options["mode"]]);
-
-      this._shiftDown = this._mouseDown = this._toolPan = false;
-
-      if ( this._isMultiTouch ) {
-        e.preventDefault( );
-        this._isMultiTouch = false;
-
-        this._wheelLevel = 0;
-
-        if ( doInteractiveTimeout ) {
-          this._setInteractiveTimeout( true );
-        }
-        return;
-      }
-
-      if (document.releaseCapture) {
-        document.releaseCapture();
-      }
-
-      if (mouseWasDown) {
-        clickDate = $.now();
-        this._current = current;
-
-        switch ( mode ) {
-          case "zoom":
-          case "dragBox":
-            if ( dx !== 0 || dy !== 0 ) {
-              var minSize = this._pixelSize * 6,
-                  bboxCoords = this._toMap( [ [
-                      Math.min( this._anchor[ 0 ], current[ 0 ] ),
-                      Math.max( this._anchor[ 1 ], current[ 1 ] )
-                    ], [
-                      Math.max( this._anchor[ 0 ], current[ 0 ] ),
-                      Math.min( this._anchor[ 1 ], current[ 1 ] )
-                    ]
-                  ] ),
-                  bbox = [
-                    bboxCoords[0][0],
-                    bboxCoords[0][1],
-                    bboxCoords[1][0],
-                    bboxCoords[1][1]
-                  ];
-
-              if ( mode === "zoom" ) {
-                if ( ( bbox[2] - bbox[0] ) < minSize && ( bbox[3] - bbox[1] ) < minSize ) {
-                  bbox = $.geo.scaleBy( this._getBbox( $.geo.center( bbox, true ) ), 0.5, true );
-                }
-
-                this._setBbox(bbox, true, true);
-                doInteractiveTimeout = true;
-              } else {
-                triggerShape = $.geo.polygonize( bbox, true );
-                triggerShape.bbox = bbox;
-
-                if ( this._userGeodetic ) {
-                  triggerShape.coordinates = $.geo.proj.toGeodetic( triggerShape.coordinates );
-                  triggerShape.bbox = $.geo.proj.toGeodetic( triggerShape.bbox );
-                }
-                this._trigger( "shape", e, triggerShape );
-              }
-            } else {
-              if ( mode === "dragBox" ) {
-                coordBuffer = this._toMap( current );
-
-                triggerShape = {
-                  type: "Point",
-                  coordinates: [ coordBuffer[ 0 ], coordBuffer[ 1 ] ],
-                  bbox: [ coordBuffer[ 0 ], coordBuffer[ 1 ], coordBuffer[ 0 ], coordBuffer[ 1 ] ]
-                };
-
-                if ( this._userGeodetic ) {
-                  triggerShape.coordinates = $.geo.proj.toGeodetic( triggerShape.coordinates );
-                  triggerShape.bbox = $.geo.proj.toGeodetic( triggerShape.bbox );
-                }
-
-                this._trigger( "shape", e, triggerShape );
-              }
-            }
-
-            this._resetDrawing();
-            break;
-
-          case "dragCircle":
-            if ( dx !== 0 || dy !== 0 ) {
-              var image = this._options[ "axisLayout" ] === "image",
-                  d = Math.sqrt( ( dx * dx) + ( dy * dy ) ),
-                  n = 180,
-                  a;
-
-              this._drawPixels.length = n + 1;
-
-              for ( i = 0; i < n; i++ ) {
-                a = ( i * 360 / n ) * ( Math.PI / 180 );
-                this._drawPixels[ i ] = [
-                  this._anchor[ 0 ] + Math.cos( a ) * d,
-                  this._anchor[ 1 ] + Math.sin( a ) * d
-                ];
-              }
-
-              this._drawPixels[ n ] = [
-                this._drawPixels[ 0 ][ 0 ],
-                this._drawPixels[ 0 ][ 1 ]
-              ];
-
-              // using coordBuffer for bbox coords
-              coordBuffer = this._toMap( [
-                [ this._anchor[ 0 ] - d, this._anchor[ 1 ] + ( image ? -d : d ) ],
-                [ this._anchor[ 0 ] + d, this._anchor[ 1 ] + ( image ? d : -d ) ]
-              ] );
-
-              triggerShape = {
-                type: "Polygon",
-                coordinates: [ this._toMap( this._drawPixels ) ],
-                bbox: [ coordBuffer[ 0 ][ 0 ], coordBuffer[ 0 ][ 1 ], coordBuffer[ 1 ][ 0 ], coordBuffer[ 1 ][ 1 ] ]
-              };
-
-              if ( this._userGeodetic ) {
-                triggerShape.coordinates = $.geo.proj.toGeodetic( triggerShape.coordinates );
-                triggerShape.bbox = $.geo.proj.toGeodetic( triggerShape.bbox );
-              }
-
-              this._trigger( "shape", e, triggerShape );
-
-              this._resetDrawing();
-            } else {
-              coordBuffer = this._toMap( current );
-
-              triggerShape = {
-                type: "Point",
-                coordinates: [ coordBuffer[ 0 ], coordBuffer[ 1 ] ],
-                bbox: [ coordBuffer[ 0 ], coordBuffer[ 1 ], coordBuffer[ 0 ], coordBuffer[ 1 ] ]
-              };
-
-              if ( this._userGeodetic ) {
-                triggerShape.coordinates = $.geo.proj.toGeodetic( triggerShape.coordinates );
-                triggerShape.bbox = $.geo.proj.toGeodetic( triggerShape.bbox );
-              }
-
-              this._trigger( "shape", e, triggerShape );
-            }
-            break;
-
-          case "drawPoint":
-            if (this._drawTimeout) {
-              window.clearTimeout(this._drawTimeout);
-              this._drawTimeout = null;
-            }
-
-            if (wasToolPan) {
-              this._panFinalize();
-            } else {
-              if (clickDate - this._clickDate > 100) {
-                var geomap = this;
-                this._drawTimeout = setTimeout(function () {
-                  if (geomap._drawTimeout) {
-                    geomap._trigger("shape", e, { type: "Point", coordinates: geomap.toMap(current) });
-                    geomap._inOp = false;
-                    geomap._drawTimeout = null;
-                  }
-                }, 250);
-              }
-            }
-            break;
-
-          case "drawLineString":
-          case "drawPolygon":
-          case "measureLength":
-          case "measureArea":
-            if (wasToolPan) {
-              this._panFinalize();
-            } else {
-              i = (this._drawCoords.length === 0 ? 0 : this._drawCoords.length - 1);
-
-              this._drawCoords[i] = this._toMap(current);
-              this._drawPixels[i] = current;
-
-              if (i < 2 || !(this._drawCoords[i][0] == this._drawCoords[i-1][0] &&
-                             this._drawCoords[i][1] == this._drawCoords[i-1][1])) {
-                this._drawCoords[i + 1] = this._toMap( current, this._centerInteractive, this._pixelSizeInteractive );
-                this._drawPixels[i + 1] = current;
-              }
-
-              this._refreshDrawing();
-            }
-            break;
-
-          default:
-            if (wasToolPan) {
-              this._panFinalize();
-            } else {
-              if (clickDate - this._clickDate > 100) {
-                this._trigger("click", e, { type: "Point", coordinates: this.toMap(current) });
-                this._inOp = false;
-              }
-            }
-            break;
-        }
-
-        this._clickDate = clickDate;
-
-        if (this._softDblClick && this._isDbltap) {
-          this._isDbltap = this._isTap = false;
-          if ( doInteractiveTimeout ) {
-            this._setInteractiveTimeout( true );
-          }
-          this._$eventTarget.trigger("dblclick", e);
-          return false;
-        }
-      }
-
-      if ( doInteractiveTimeout ) {
-        this._setInteractiveTimeout( true );
-      }
-
-      if ( this._inOp ) {
-        e.preventDefault();
-        return false;
-      }
-    },
-
-    _eventTarget_mousewheel: function (e, delta) {
-      if ( this._options[ "mode" ] === "static" || this._options[ "scroll" ] === "off" ) {
-        return;
-      }
-
-      e.preventDefault();
-
-      if ( this._mouseDown ) {
-        return false;
-      }
-
-      if (delta !== 0) {
-        this._clearInteractiveTimeout( );
-
-        if ( delta > 0 ) {
-          delta = Math.ceil( delta );
-        } else { 
-          delta = Math.floor( delta );
-        }
-
-        var offset = $(e.currentTarget).offset();
-        this._anchor = [e.pageX - offset.left, e.pageY - offset.top];
-
-        var wheelCenterAndSize = this._getZoomCenterAndSize( this._anchor, delta, this._options[ "tilingScheme" ] !== null ),
-            service,
-            i = 0;
-
-        this._setInteractiveCenterAndSize( wheelCenterAndSize.center, wheelCenterAndSize.pixelSize );
-        this._interactiveTransform( );
-
-        this._setInteractiveTimeout( true );
-      }
-
-      return false;
-    }
-  }
-  );
-}(jQuery));
-
-
-(function ($, undefined) {
-  $.geo._serviceTypes.tiled = (function () {
-    return {
-      create: function (map, serviceContainer, service, index) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( !serviceState ) {
-          serviceState = {
-            loadCount: 0,
-            reloadTiles: false
-          };
-
-          var scHtml = '<div data-geo-service="tiled" style="-webkit-transform:translateZ(0); position:absolute; left:0; top:0; width:8px; height:8px; margin:0; padding:0;"></div>';
-
-          serviceContainer.append(scHtml);
-
-          serviceState.serviceContainer = serviceContainer.children( ":last" );
-
-          $.data(service, "geoServiceState", serviceState);
-        }
-
-        return serviceState.serviceContainer;
-      },
-
-      destroy: function (map, serviceContainer, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        serviceState.serviceContainer.remove();
-
-        $.removeData(service, "geoServiceState");
-      },
-
-      interactiveTransform: function ( map, service, center, pixelSize ) {
-        //console.log( "tiled.interactiveTransform( " + center.join( ", " ) + ", " + pixelSize + ")" );
-        var serviceState = $.data( service, "geoServiceState" ),
-            tilingScheme = map.options[ "tilingScheme" ];
-
-        if ( serviceState ) {
-          this._cancelUnloaded( map, service );
-
-          serviceState.serviceContainer.children( ).each( function ( i ) {
-            var $scaleContainer = $(this),
-                scalePixelSize = $scaleContainer.data("pixelSize"),
-                scaleRatio = scalePixelSize / pixelSize;
-
-            if ( scalePixelSize > 0 ) {
-              scaleRatio = Math.round(scaleRatio * 1000) / 1000;
-
-              var oldMapCoord = $scaleContainer.data("scaleOrigin"),
-                  newPixelPoint = map._toPixel(oldMapCoord, center, pixelSize);
-
-              $scaleContainer.css( {
-                left: Math.round(newPixelPoint[0]) + "px",
-                top: Math.round(newPixelPoint[1]) + "px",
-                width: tilingScheme.tileWidth * scaleRatio,
-                height: tilingScheme.tileHeight * scaleRatio
-              } );
-
-              /*
-              if ( $("body")[0].filters !== undefined ) {
-                $scaleContainer.children().each( function ( i ) {
-                  $( this ).css( "filter", "progid:DXImageTransform.Microsoft.Matrix(FilterType=bilinear,M11=" + scaleRatio + ",M22=" + scaleRatio + ",sizingmethod='auto expand')" );
-                } );
-              }
-              */
-            }
-          });
-        }
-      },
-
-      refresh: function (map, service, force) {
-        //console.log( "tiled.refresh( " + map._center.join( ", " ) + ", " + map._pixelSize + ")" );
-        var serviceState = $.data( service, "geoServiceState" );
-
-        this._cancelUnloaded(map, service);
-
-        if ( serviceState && force ) {
-          // if hidden atm, we want to make sure we reload this service after it becomes visible
-          serviceState.reloadTiles = true;
-        }
-
-        if ( serviceState && service && service.style.visibility === "visible" && !( serviceState.serviceContainer.is( ":hidden" ) ) ) {
-          var bbox = map._getBbox(),
-              pixelSize = map._pixelSize,
-
-              serviceObj = this,
-              $serviceContainer = serviceState.serviceContainer,
-
-              contentBounds = map._getContentBounds(),
-              mapWidth = contentBounds["width"],
-              mapHeight = contentBounds["height"],
-
-              image = map.options[ "axisLayout" ] === "image",
-              ySign = image ? +1 : -1,
-
-              tilingScheme = map.options["tilingScheme"],
-              tileWidth = tilingScheme.tileWidth,
-              tileHeight = tilingScheme.tileHeight,
-
-              tileX = Math.floor((bbox[0] - tilingScheme.origin[0]) / (pixelSize * tileWidth)),
-              tileY = Math.max( Math.floor( ( image ? bbox[1] - tilingScheme.origin[1] : tilingScheme.origin[1] - bbox[ 3 ] ) / (pixelSize * tileHeight) ), 0 ),
-              tileX2 = Math.ceil((bbox[2] - tilingScheme.origin[0]) / (pixelSize * tileWidth)),
-              tileY2 = Math.ceil( ( image ? bbox[3] - tilingScheme.origin[1] : tilingScheme.origin[1] - bbox[ 1 ] ) / (pixelSize * tileHeight) ),
-
-              bboxMax = map._getBboxMax(),
-              pixelSizeAtZero = map._getPixelSize(0),
-              ratio = pixelSizeAtZero / pixelSize,
-              fullXAtScale = Math.floor((bboxMax[0] - tilingScheme.origin[0]) / (pixelSizeAtZero * tileWidth)) * ratio,
-              fullYAtScale = Math.floor((tilingScheme.origin[1] + ySign * bboxMax[3]) / (pixelSizeAtZero * tileHeight)) * ratio,
-
-              fullXMinX = tilingScheme.origin[0] + (fullXAtScale * tileWidth) * pixelSize,
-              fullYMinOrMaxY = tilingScheme.origin[1] + ySign * (fullYAtScale * tileHeight) * pixelSize,
-
-              serviceLeft = Math.round((fullXMinX - bbox[0]) / pixelSize),
-              serviceTop = Math.round( ( image ? fullYMinOrMaxY - bbox[1] : bbox[3] - fullYMinOrMaxY ) / pixelSize),
-
-              scaleContainers = $serviceContainer.children().show(),
-              scaleContainer = scaleContainers.filter("[data-pixel-size='" + pixelSize + "']").appendTo($serviceContainer),
-
-              opacity = service.style.opacity,
-
-              x, y,
-
-              loadImageDeferredDone = function( url ) {
-                // when a Deferred call is done, add the image to the map
-                // a reference to the correct img element is on the Deferred object itself
-                serviceObj._loadImage( $.data( this, "img" ), url, pixelSize, map, serviceState, opacity );
-              },
-
-              loadImageDeferredFail = function( ) {
-                $.data( this, "img" ).remove( );
-                serviceState.loadCount--;
-                map._requestComplete();
-              };
-
-          if (serviceState.reloadTiles) {
-            scaleContainers.find("img").attr("data-dirty", "true");
-          }
-
-          if (!scaleContainer.size()) {
-            $serviceContainer.append("<div style='-webkit-transform:translateZ(0);position:absolute; left:" + serviceLeft % tileWidth + "px; top:" + serviceTop % tileHeight + "px; width:" + tileWidth + "px; height:" + tileHeight + "px; margin:0; padding:0;' data-pixel-size='" + pixelSize + "'></div>");
-            scaleContainer = $serviceContainer.children(":last").data("scaleOrigin", map._toMap( [ (serviceLeft % tileWidth), (serviceTop % tileHeight) ] ) );
-          } else {
-            scaleContainer.css({
-              left: (serviceLeft % tileWidth) + "px",
-              top: (serviceTop % tileHeight) + "px"
-            }).data("scaleOrigin", map._toMap( [ (serviceLeft % tileWidth), (serviceTop % tileHeight) ] ) );
-
-            scaleContainer.children().each(function (i) {
-              var 
-              $img = $(this),
-              tile = $img.attr("data-tile").split(",");
-
-              $img.css({
-                left: Math.round(((parseInt(tile[0], 10) - fullXAtScale) * 100) + (serviceLeft - (serviceLeft % tileWidth)) / tileWidth * 100) + "%",
-                top: Math.round(((parseInt(tile[1], 10) - fullYAtScale) * 100) + (serviceTop - (serviceTop % tileHeight)) / tileHeight * 100) + "%"
-              });
-
-              if (opacity < 1) {
-                $img.fadeTo(0, opacity);
-              }
-            });
-          }
-
-          for (x = tileX; x < tileX2; x++) {
-            for (y = tileY; y < tileY2; y++) {
-              var tileStr = "" + x + "," + y,
-                  $img = scaleContainer.children("[data-tile='" + tileStr + "']").removeAttr("data-dirty");
-
-              if ($img.size() === 0 || serviceState.reloadTiles) {
-                var bottomLeft = [
-                      tilingScheme.origin[0] + (x * tileWidth) * pixelSize,
-                      tilingScheme.origin[1] + ySign * (y * tileHeight) * pixelSize
-                    ],
-
-                    topRight = [
-                      tilingScheme.origin[0] + ((x + 1) * tileWidth - 1) * pixelSize,
-                      tilingScheme.origin[1] + ySign * ((y + 1) * tileHeight - 1) * pixelSize
-                    ],
-
-                    tileBbox = [bottomLeft[0], bottomLeft[1], topRight[0], topRight[1]],
-
-                    urlProp = ( service.hasOwnProperty( "src" ) ? "src" : "getUrl" ),
-                    urlArgs = {
-                      bbox: tileBbox,
-                      width: tileWidth,
-                      height: tileHeight,
-                      zoom: map._getZoom(),
-                      tile: {
-                        row: y,
-                        column: x
-                      },
-                      index: Math.abs(y + x)
-                    },
-                    isFunc = $.isFunction( service[ urlProp ] ),
-                    imageUrl;
-
-                if ( isFunc ) {
-                  imageUrl = service[ urlProp ]( urlArgs );
-                } else {
-                  $.templates( "geoSrc", service[ urlProp ] );
-                  imageUrl = $.render[ "geoSrc" ]( urlArgs );
-                }
-
-                serviceState.loadCount++;
-                map._requestQueued();
-
-                if (serviceState.reloadTiles && $img.size() > 0) {
-                  $img.attr("src", imageUrl);
-                } else {
-                  var imgMarkup = "<img style='-webkit-transform:translateZ(0);position:absolute; " +
-                    "left:" + (((x - fullXAtScale) * 100) + (serviceLeft - (serviceLeft % tileWidth)) / tileWidth * 100) + "%; " +
-                    "top:" + (((y - fullYAtScale) * 100) + (serviceTop - (serviceTop % tileHeight)) / tileHeight * 100) + "%; ";
-
-                  imgMarkup += "width: 100%; height: 100%;";
-
-                  // #newpanzoom
-                  /*
-                  if ($("body")[0].filters === undefined) {
-                    imgMarkup += "width: 100%; height: 100%;";
-                  }
-                  */
-
-                  imgMarkup += "margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;' unselectable='on' data-tile='" + tileStr + "' />";
-
-                  scaleContainer.append(imgMarkup);
-                  $img = scaleContainer.children(":last");
-                }
-
-                if ( typeof imageUrl === "string" ) {
-                  serviceObj._loadImage( $img, imageUrl, pixelSize, map, serviceState, opacity );
-                } else if ( imageUrl ) {
-                  // assume Deferred
-                  $.data( imageUrl, "img", $img );
-                  imageUrl.done( loadImageDeferredDone ).fail( loadImageDeferredFail );
-                } else {
-                  $img.remove( );
-                }
-              }
-            }
-          }
-
-          scaleContainers.find("[data-dirty]").remove();
-          serviceState.reloadTiles = false;
-        }
-      },
-
-      resize: function (map, service) {
-      },
-
-      opacity: function ( map, service ) {
-        var serviceState = $.data( service, "geoServiceState" );
-        serviceState.serviceContainer.find( "img" ).stop( true ).fadeTo( "fast", service.style.opacity );
-      },
-
-      toggle: function ( map, service ) {
-        var serviceState = $.data( service, "geoServiceState" );
-        serviceState.serviceContainer.css( "display", service.style.visibility === "visible" ? "block" : "none" );
-      },
-
-      _cancelUnloaded: function (map, service) {
-        var serviceState = $.data( service, "geoServiceState" );
-
-        if (serviceState && serviceState.loadCount > 0) {
-          serviceState.serviceContainer.find("img:hidden").remove();
-          while (serviceState.loadCount > 0) {
-            serviceState.loadCount--;
-            map._requestComplete();
-          }
-        }
-      },
-
-      _loadImage: function ( $img, url, pixelSize, map, serviceState, opacity ) {
-        var serviceContainer = serviceState.serviceContainer;
-
-        $img.load(function (e) {
-          if (opacity < 1) {
-            $(e.target).fadeTo(0, opacity);
-          } else {
-            $(e.target).show();
-          }
-
-          serviceState.loadCount--;
-          map._requestComplete();
-
-          if (serviceState.loadCount <= 0) {
-            serviceContainer.children(":not([data-pixel-size='" + pixelSize + "'])").remove();
-            serviceState.loadCount = 0;
-          }
-        }).error(function (e) {
-          $(e.target).remove();
-          serviceState.loadCount--;
-          map._requestComplete();
-
-          if (serviceState.loadCount <= 0) {
-            serviceContainer.children(":not([data-pixel-size='" + pixelSize + "'])").remove();
-            serviceState.loadCount = 0;
-          }
-        }).attr("src", url);
-      }
-    };
-  }());
-}(jQuery));
-
-(function ($, undefined) {
-  $.geo._serviceTypes.shingled = (function () {
-    return {
-      create: function (map, serviceContainer, service, index) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( !serviceState ) {
-          serviceState = {
-            loadCount: 0
-          };
-
-          var scHtml = '<div data-geo-service="shingled" style="-webkit-transform:translateZ(0);position:absolute; left:0; top:0; width:16px; height:16px; margin:0; padding:0;"></div>';
-
-          serviceContainer.append(scHtml);
-
-          serviceState.serviceContainer = serviceContainer.children(":last");
-          $.data(service, "geoServiceState", serviceState);
-        }
-
-        return serviceState.serviceContainer;
-      },
-
-      destroy: function (map, serviceContainer, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        serviceState.serviceContainer.remove();
-
-        $.removeData(service, "geoServiceState");
-      },
-
-      interactiveTransform: function ( map, service, center, pixelSize ) {
-        var serviceState = $.data( service, "geoServiceState" ),
-
-            contentBounds = map._getContentBounds(),
-            mapWidth = contentBounds[ "width" ],
-            mapHeight = contentBounds[ "height" ],
-
-            halfWidth = mapWidth / 2,
-            halfHeight = mapHeight / 2,
-
-            bbox = [ center[ 0 ] - halfWidth, center[ 1 ] - halfHeight, center[ 0 ] + halfWidth, center[ 1 ] + halfHeight ];
-
-        if ( serviceState ) {
-          this._cancelUnloaded( map, service );
-
-          serviceState.serviceContainer.children( ).each( function ( i ) {
-            var $scaleContainer = $(this),
-                scalePixelSize = $scaleContainer.data( "pixelSize" ),
-                scaleRatio = scalePixelSize / pixelSize;
-                
-            if ( scalePixelSize > 0 ) {
-              scaleRatio = Math.round(scaleRatio * 1000) / 1000;
-
-              var oldMapOrigin = $scaleContainer.data( "origin" ),
-                  newPixelPoint = map._toPixel( oldMapOrigin, center, pixelSize );
-
-              $scaleContainer.css( {
-                left: Math.round( newPixelPoint[ 0 ] ),
-                top: Math.round( newPixelPoint[ 1 ] ),
-                width: mapWidth * scaleRatio,
-                height: mapHeight * scaleRatio
-              } );
-              
-              
-              // #newpanzoom
-              /*
-             .children("img").each(function (i) {
-                var $img = $(this),
-                    imgCenter = $img.data("center"),
-                    x = (Math.round((imgCenter[0] - center[0]) / scalePixelSize) - halfWidth) * scaleRatio,
-                    y = (Math.round((center[1] - imgCenter[1]) / scalePixelSize) - halfHeight) * scaleRatio;
-
-                $img.css({ left: x + "px", top: y + "px" });
-              });
-              */
-            }
-          });
-        }
-      },
-
-      refresh: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        this._cancelUnloaded(map, service);
-
-        if ( serviceState && service && service.style.visibility === "visible" && !( serviceState.serviceContainer.is( ":hidden" ) ) ) {
-
-          var bbox = map._getBbox(),
-              pixelSize = map._pixelSize,
-
-              serviceObj = this,
-              serviceContainer = serviceState.serviceContainer,
-
-              contentBounds = map._getContentBounds(),
-              mapWidth = contentBounds["width"],
-              mapHeight = contentBounds["height"],
-
-              scaleContainer = serviceContainer.children('[data-pixel-size="' + pixelSize + '"]'),
-
-              opacity = service.style.opacity,
-
-              $img;
-
-          if (opacity < 1) {
-            serviceContainer.find("img").attr("data-keep-alive", "0");
-          }
-
-          if ( !scaleContainer.size() ) {
-            serviceContainer.append('<div style="-webkit-transform:translateZ(0);position:absolute; left:0px; top: 0px; width:' + mapWidth + 'px; height:' + mapHeight + 'px; margin:0; padding:0;" data-pixel-size="' + pixelSize + '" data-origin="[' + map._toMap( [ 0, 0 ] ) + ']"></div>');
-            scaleContainer = serviceContainer.children(":last");
-          }
-
-          var urlProp = ( service.hasOwnProperty("src") ? "src" : "getUrl" ),
-              urlArgs = {
-                bbox: bbox,
-                width: mapWidth,
-                height: mapHeight,
-                zoom: map._getZoom(),
-                tile: null,
-                index: 0
-              },
-              isFunc = $.isFunction( service[ urlProp ] ),
-              imageUrl,
-              imagePos = scaleContainer.position( );
-
-          imagePos.left = - ( imagePos.left );
-          imagePos.top = - ( imagePos.top );
-
-          if ( isFunc ) {
-            imageUrl = service[ urlProp ]( urlArgs );
-          } else {
-            $.templates( "geoSrc", service[ urlProp ] );
-            imageUrl = $.render[ "geoSrc" ]( urlArgs );
-          }
-
-          serviceState.loadCount++;
-          map._requestQueued();
-
-          scaleContainer.append('<img style="-webkit-transform:translateZ(0);position:absolute; left:' + ( imagePos.left / scaleContainer.width( ) * 100 ) + '%; top:' + ( imagePos.top / scaleContainer.height( ) * 100 ) + '%; width:100%; height:100%; margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;" unselectable="on" />');
-          $img = scaleContainer.children(":last").data("center", map._center);
-
-          if ( typeof imageUrl === "string" ) {
-            serviceObj._loadImage( $img, imageUrl, pixelSize, map, serviceState, opacity );
-          } else {
-            // assume Deferred
-            imageUrl.done( function( url ) {
-              serviceObj._loadImage( $img, url, pixelSize, map, serviceState, opacity );
-            } ).fail( function( ) {
-              $img.remove( );
-              serviceState.loadCount--;
-              map._requestComplete();
-            } );
-          }
-
-        }
-      },
-
-      resize: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( serviceState && service && service.style.visibility === "visible" ) {
-          this._cancelUnloaded(map, service);
-
-          var serviceContainer = serviceState.serviceContainer,
-
-              contentBounds = map._getContentBounds(),
-              mapWidth = contentBounds["width"],
-              mapHeight = contentBounds["height"],
-
-              scaleContainers = serviceContainer.children();
-
-          scaleContainers.attr("data-pixel-size", "0");
-
-          scaleContainers.each( function ( i ) {
-            var $scaleContainer = $(this),
-                position = $scaleContainer.position( );
-
-            var oldMapOrigin = $scaleContainer.data( "origin" ),
-                newPixelPoint = map._toPixel( oldMapOrigin );
-
-            $scaleContainer.css( {
-              left: position.left + ( mapWidth - $scaleContainer.width( ) ) / 2,
-              top: position.top + ( mapHeight - $scaleContainer.height( ) ) / 2
-            } );
-
-          } );
-            
-
-          /*
-          scaleContainer.css({
-            left: halfWidth + 'px',
-            top: halfHeight + 'px'
-          });
-          */
-        }
-      },
-
-      opacity: function ( map, service ) {
-        var serviceState = $.data( service, "geoServiceState" );
-        serviceState.serviceContainer.find( "img" ).stop( true ).fadeTo( "fast", service.style.opacity );
-      },
-
-      toggle: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-        serviceState.serviceContainer.css("display", service.style.visibility === "visible" ? "block" : "none");
-      },
-
-      _cancelUnloaded: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if (serviceState && serviceState.loadCount > 0) {
-          serviceState.serviceContainer.find("img:hidden").remove();
-          while (serviceState.loadCount > 0) {
-            serviceState.loadCount--;
-            map._requestComplete();
-          }
-        }
-      },
-
-      _loadImage: function ( $img, url, pixelSize, map, serviceState, opacity ) {
-        var serviceContainer = serviceState.serviceContainer;
-
-        $img.load(function (e) {
-          if ( !$.contains(document.body, e.target.jquery ? e.target[0] : e.target) ) {
-            // this image has been canceled and removed from the DOM
-            return;
-          }
-
-          if (opacity < 1) {
-            $(e.target).fadeTo(0, opacity);
-          } else {
-            $(e.target).show();
-          }
-
-          serviceState.loadCount--;
-          map._requestComplete();
-
-          if (serviceState.loadCount <= 0) {
-            // #newpanzoom
-            serviceContainer.children(':not([data-pixel-size="' + pixelSize + '"])').remove();
-
-            serviceContainer.find( "img[data-keep-alive]" ).remove( );
-
-            serviceState.loadCount = 0;
-          }
-        }).error(function (e) {
-          if ( !$.contains(document.body, e.target.jquery ? e.target[0] : e.target) ) {
-            // this image has been canceled and removed from the DOM
-            return;
-          }
-
-          $(e.target).remove();
-          serviceState.loadCount--;
-          map._requestComplete();
-
-          if (serviceState.loadCount <= 0) {
-            serviceContainer.children(":not([data-pixel-size='" + pixelSize + "'])").remove();
-            serviceState.loadCount = 0;
-          }
-        }).attr("src", url);
-      }
-    };
-  }());
-}(jQuery));
diff --git a/libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0b1.1.min.js b/libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0b1.1.min.js
deleted file mode 100755 (executable)
index 8f92661..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! jQuery Geo - v1.0b1.1 - 2012-08-24
- * http://jquerygeo.com
- * Copyright (c) 2012 Ryan Westphal/Applied Geographics, Inc.; Licensed MIT, GPL */
-document.createElement("canvas").getContext||function(){function j(){return this.context_||(this.context_=new I(this))}function l(a,b,c){var d=k.call(arguments,2);return function(){return a.apply(b,d.concat(k.call(arguments)))}}function m(a){return String(a).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}function n(a,b,c){a.namespaces[b]||a.namespaces.add(b,c,"#default#VML")}function o(a){n(a,"g_vml_","urn:schemas-microsoft-com:vml"),n(a,"g_o_","urn:schemas-microsoft-com:office:office");if(!a.styleSheets.ex_canvas_){var b=a.createStyleSheet();b.owningElement.id="ex_canvas_",b.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function q(a){var b=a.srcElement;switch(a.propertyName){case"width":b.getContext().clearRect(),b.style.width=b.attributes.width.nodeValue+"px",b.firstChild.style.width=b.clientWidth+"px";break;case"height":b.getContext().clearRect(),b.style.height=b.attributes.height.nodeValue+"px",b.firstChild.style.height=b.clientHeight+"px"}}function r(a){var b=a.srcElement;b.firstChild&&(b.firstChild.style.width=b.clientWidth+"px",b.firstChild.style.height=b.clientHeight+"px")}function v(){return[[1,0,0],[0,1,0],[0,0,1]]}function w(a,b){var c=v();for(var d=0;d<3;d++)for(var e=0;e<3;e++){var f=0;for(var g=0;g<3;g++)f+=a[d][g]*b[g][e];c[d][e]=f}return c}function x(a,b){b.fillStyle=a.fillStyle,b.lineCap=a.lineCap,b.lineJoin=a.lineJoin,b.lineWidth=a.lineWidth,b.miterLimit=a.miterLimit,b.shadowBlur=a.shadowBlur,b.shadowColor=a.shadowColor,b.shadowOffsetX=a.shadowOffsetX,b.shadowOffsetY=a.shadowOffsetY,b.strokeStyle=a.strokeStyle,b.globalAlpha=a.globalAlpha,b.font=a.font,b.textAlign=a.textAlign,b.textBaseline=a.textBaseline,b.arcScaleX_=a.arcScaleX_,b.arcScaleY_=a.arcScaleY_,b.lineScale_=a.lineScale_}function y(a){var b=a.indexOf("(",3),c=a.indexOf(")",b+1),d=a.substring(b+1,c).split(",");if(d.length!=4||a.charAt(3)!="a")d[3]=1;return d}function z(a){return parseFloat(a)/100}function A(a,b,c){return Math.min(c,Math.max(b,a))}function B(a){var b,c,d,e,f,g;e=parseFloat(a[0])/360%360,e<0&&e++,f=A(z(a[1]),0,1),g=A(z(a[2]),0,1);if(f==0)b=c=d=g;else{var h=g<.5?g*(1+f):g+f-g*f,i=2*g-h;b=C(i,h,e+1/3),c=C(i,h,e),d=C(i,h,e-1/3)}return"#"+s[Math.floor(b*255)]+s[Math.floor(c*255)]+s[Math.floor(d*255)]}function C(a,b,c){return c<0&&c++,c>1&&c--,6*c<1?a+(b-a)*6*c:2*c<1?b:3*c<2?a+(b-a)*(2/3-c)*6:a}function E(a){if(a in D)return D[a];var b,c=1;a=String(a);if(a.charAt(0)=="#")b=a;else if(/^rgb/.test(a)){var d=y(a),b="#",e;for(var f=0;f<3;f++)d[f].indexOf("%")!=-1?e=Math.floor(z(d[f])*255):e=+d[f],b+=s[A(e,0,255)];c=+d[3]}else if(/^hsl/.test(a)){var d=y(a);b=B(d),c=d[3]}else b=a;return D[a]={color:b,alpha:c}}function H(a){return G[a]||"square"}function I(a){this.m_=v(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=g*1,this.globalAlpha=1,this.canvas=a;var b="width:"+a.clientWidth+"px;height:"+a.clientHeight+"px;overflow:hidden;position:absolute",c=a.ownerDocument.createElement("div");c.style.cssText=b,a.appendChild(c);var d=c.cloneNode(!1);d.style.backgroundColor="red",d.style.filter="alpha(opacity=0)",a.appendChild(d),this.element_=c,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function K(a,b,c,d){a.currentPath_.push({type:"bezierCurveTo",cp1x:b.x,cp1y:b.y,cp2x:c.x,cp2y:c.y,x:d.x,y:d.y}),a.currentX_=d.x,a.currentY_=d.y}function L(a,b){var c=E(a.strokeStyle),d=c.color,e=c.alpha*a.globalAlpha,f=a.lineScale_*a.lineWidth;f<1&&(e*=f),b.push("<g_vml_:stroke",' opacity="',e,'"',' joinstyle="',a.lineJoin,'"',' miterlimit="',a.miterLimit,'"',' endcap="',H(a.lineCap),'"',' weight="',f,'px"',' color="',d,'" />')}function M(a,b,c,d){var e=a.fillStyle,f=a.arcScaleX_,g=a.arcScaleY_,h=d.x-c.x,i=d.y-c.y,j=E(a.fillStyle),k=j.color,l=j.alpha*a.globalAlpha;b.push('<g_vml_:fill color="',k,'" opacity="',l,'" />')}function N(a,b,c){var d=a.m_;return{x:g*(b*d[0][0]+c*d[1][0]+d[2][0])-h,y:g*(b*d[0][1]+c*d[1][1]+d[2][1])-h}}function O(a){return isFinite(a[0][0])&&isFinite(a[0][1])&&isFinite(a[1][0])&&isFinite(a[1][1])&&isFinite(a[2][0])&&isFinite(a[2][1])}function P(a,b,c){if(!O(b))return;a.m_=b;if(c){var d=b[0][0]*b[1][1]-b[0][1]*b[1][0];a.lineScale_=f(e(d))}}function Q(a){throw new R(a)}function R(a){this.code=this[a],this.message=a+": DOM Exception "+this.code}var a=Math,b=a.round,c=a.sin,d=a.cos,e=a.abs,f=a.sqrt,g=10,h=g/2,i=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],k=Array.prototype.slice;o(document);var p={init:function(a){var b=a||document;b.createElement("canvas"),b.attachEvent("onreadystatechange",l(this.init_,this,b))},init_:function(a){var b=a.getElementsByTagName("canvas");for(var c=0;c<b.length;c++)this.initElement(b[c])},initElement:function(a){if(!a.getContext){a.getContext=j,o(a.ownerDocument),a.innerHTML="",a.attachEvent("onpropertychange",q),a.attachEvent("onresize",r);var b=a.attributes;b.width&&b.width.specified?a.style.width=b.width.nodeValue+"px":a.width=a.clientWidth,b.height&&b.height.specified?a.style.height=b.height.nodeValue+"px":a.height=a.clientHeight}return a}};p.init();var s=[];for(var t=0;t<16;t++)for(var u=0;u<16;u++)s[t*16+u]=t.toString(16)+u.toString(16);var D={},F={style:"normal",variant:"normal",weight:"normal",size:10,family:"sans-serif"},G={butt:"flat",round:"round"},J=I.prototype;J.clearRect=function(){this.textMeasureEl_&&(this.textMeasureEl_.removeNode(!0),this.textMeasureEl_=null),this.element_.innerHTML=""},J.beginPath=function(){this.currentPath_=[]},J.moveTo=function(a,b){var c=N(this,a,b);this.currentPath_.push({type:"moveTo",x:c.x,y:c.y}),this.currentX_=c.x,this.currentY_=c.y},J.lineTo=function(a,b){var c=N(this,a,b);this.currentPath_.push({type:"lineTo",x:c.x,y:c.y}),this.currentX_=c.x,this.currentY_=c.y},J.bezierCurveTo=function(a,b,c,d,e,f){var g=N(this,e,f),h=N(this,a,b),i=N(this,c,d);K(this,h,i,g)},J.quadraticCurveTo=function(a,b,c,d){var e=N(this,a,b),f=N(this,c,d),g={x:this.currentX_+2/3*(e.x-this.currentX_),y:this.currentY_+2/3*(e.y-this.currentY_)},h={x:g.x+(f.x-this.currentX_)/3,y:g.y+(f.y-this.currentY_)/3};K(this,g,h,f)},J.arc=function(a,b,e,f,i,j){e*=g;var k=j?"at":"wa",l=a+d(f)*e-h,m=b+c(f)*e-h,n=a+d(i)*e-h,o=b+c(i)*e-h;l==n&&!j&&(l+=.125);var p=N(this,a,b),q=N(this,l,m),r=N(this,n,o);this.currentPath_.push({type:k,x:p.x,y:p.y,radius:e,xStart:q.x,yStart:q.y,xEnd:r.x,yEnd:r.y})},J.stroke=function(a){var c=[],d=!1,e=10,f=10;c.push("<g_vml_:shape",' filled="',!!a,'"',' style="position:absolute;width:',e,"px;height:",f,'px;"',' coordorigin="0,0"',' coordsize="',g*e,",",g*f,'"',' stroked="',!a,'"',' path="');var h=!1,i={x:null,y:null},j={x:null,y:null};for(var k=0;k<this.currentPath_.length;k++){var l=this.currentPath_[k],m;switch(l.type){case"moveTo":m=l,c.push(" m ",b(l.x),",",b(l.y));break;case"lineTo":c.push(" l ",b(l.x),",",b(l.y));break;case"close":c.push(" x "),l=null;break;case"bezierCurveTo":c.push(" c ",b(l.cp1x),",",b(l.cp1y),",",b(l.cp2x),",",b(l.cp2y),",",b(l.x),",",b(l.y));break;case"at":case"wa":c.push(" ",l.type," ",b(l.x-this.arcScaleX_*l.radius),",",b(l.y-this.arcScaleY_*l.radius)," ",b(l.x+this.arcScaleX_*l.radius),",",b(l.y+this.arcScaleY_*l.radius)," ",b(l.xStart),",",b(l.yStart)," ",b(l.xEnd),",",b(l.yEnd))}if(l){if(i.x==null||l.x<i.x)i.x=l.x;if(j.x==null||l.x>j.x)j.x=l.x;if(i.y==null||l.y<i.y)i.y=l.y;if(j.y==null||l.y>j.y)j.y=l.y}}c.push(' ">'),a?M(this,c,i,j):L(this,c),c.push("</g_vml_:shape>"),this.element_.insertAdjacentHTML("beforeEnd",c.join(""))},J.fill=function(){this.stroke(!0)},J.closePath=function(){this.currentPath_.push({type:"close"})},J.save=function(){var a={};x(this,a),this.aStack_.push(a),this.mStack_.push(this.m_),this.m_=w(v(),this.m_)},J.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},J.translate=function(a,b){var c=[[1,0,0],[0,1,0],[a,b,1]];P(this,w(c,this.m_),!1)},J.scale=function(a,b){this.arcScaleX_*=a,this.arcScaleY_*=b;var c=[[a,0,0],[0,b,0],[0,0,1]];P(this,w(c,this.m_),!0)};var S=R.prototype=new Error;S.INDEX_SIZE_ERR=1,S.DOMSTRING_SIZE_ERR=2,S.HIERARCHY_REQUEST_ERR=3,S.WRONG_DOCUMENT_ERR=4,S.INVALID_CHARACTER_ERR=5,S.NO_DATA_ALLOWED_ERR=6,S.NO_MODIFICATION_ALLOWED_ERR=7,S.NOT_FOUND_ERR=8,S.NOT_SUPPORTED_ERR=9,S.INUSE_ATTRIBUTE_ERR=10,S.INVALID_STATE_ERR=11,S.SYNTAX_ERR=12,S.INVALID_MODIFICATION_ERR=13,S.NAMESPACE_ERR=14,S.INVALID_ACCESS_ERR=15,S.VALIDATION_ERR=16,S.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=p,CanvasRenderingContext2D=I,DOMException=R}(),this.jsviews||this.jQuery&&jQuery.views||function(a,b){function A(a,b){var c="\\"+a.charAt(0),d="\\"+a.charAt(1),g="\\"+b.charAt(0),h="\\"+b.charAt(1);return z.rTag=e=d+"(?:(?:(\\w+(?=[\\/\\s"+g+"]))|(?:(\\w+)?(:)|(>)|(\\*)))"+"\\s*((?:[^"+g+"]|"+g+"(?!"+h+"))*?)"+"(\\/)?|(?:\\/(\\w+)))"+g,e=new RegExp(c+e+h,"g"),f=new RegExp("<.*>|"+a+".*"+b),this}function B(a){var c=this,d=c.tmpl.helpers||{};return a=(c.ctx[a]!==b?c.ctx:d[a]!==b?d:I[a]!==b?I:{})[a],typeof a!="function"?a:function(){return a.apply(c,arguments)}}function C(a,b,c){var d=b.tmpl.converters;return a=d&&d[a]||J[a],a?a.call(b,c):c}function D(a,c,d,e,f){f.props=f.props||{};var h,i=f.props.tmpl,k=c.tmpl.tags,l=c.tmpl.templates,m=arguments,n=k&&k[a]||H[a];return n?(e=e&&c.tmpl.tmpls[e-1],i=i||e||b,f.tmpl=""+i===i?l&&l[i]||G[i]||G(i):i,f.isTag=j,f.converter=d,f.view=c,f.renderContent=K,c.ctx&&g(f.ctx,c.ctx),h=n.apply(f,m.length>5?x.call(m,5):[]),h||(h==b?"":h.toString())):""}function E(a,c,e,f,g,h){var i=e.views,j={tmpl:g,path:c,parent:e,data:f,ctx:a,views:d.isArray(f)?[]:{},hlp:B};return d.isArray(i)?i.splice(j.index=h!==b?h:i.length,0,j):i[j.index="_"+r++]=j,j}function F(a,c,d,e,f){var g,i;if(d&&typeof d=="object"&&!d.nodeType){for(g in d)c(g,d[g]);return a}if(!d||e===b)f&&(e=f(b,e||d));else if(""+d===d)if(e===null)delete c[d];else if(e=f?f(d,e):e)c[d]=e;return(i=h.onStoreItem)&&i(c,d,e,f),e}function G(a,b){return F(this,G,a,b,O)}function H(a,b){return F(this,H,a,b)}function I(a,b){return F(this,I,a,b)}function J(a,b){return F(this,J,a,b)}function K(a,c,e,f,k){var l,m,n,o,p,q,r,s,t,u,v={},w=k===j,x=this,y="";x.isTag?(t=x.tmpl,c=c||x.ctx,e=e||x.view,f=f||x.path,k=k||x.index,v=x.props):t=x.jquery&&x[0]||x,e=e||z.topView,s=e.ctx,u=t.layout,a===e&&(a=e.data,u=j),c=c&&c===s?s:s?(s=g({},s),c)?g(s,c):s:c||{},v.link===i&&(c.link=i),t.fn||(t=G[t]||G(t)),p=c.link&&h.onRenderItem,q=c.link&&h.onRenderItems;if(t){if(d.isArray(a)&&!u){o=w?e:k!==b&&e||E(c,f,e,a,t,k);for(l=0,m=a.length;l<m;l++)n=a[l],r=t.fn(n,E(c,f,o,n,t,(k||0)+l),z),y+=p?p(r,v):r}else o=w?e:E(c,f,e,a,t,k),y+=a||u?t.fn(a,o,z):"";return e.topKey=o.index,q?q(y,f,o.index,t,v):y}return""}function L(){throw"Syntax error"}function M(a,b,c){function I(b){b-=D,b&&F.push(a.substr(D,b).replace(n,"\\n"))}function J(b,e,f,g,h,i,k,l,m,n){h&&(g=":",f="html");var p="",r="",s=!l&&!g;e=e||g,I(n),D=n+b.length,i?z&&F.push(["*",k.replace(o,"$1")]):e?(e==="else"&&(G[5]=a.substring(G[5],n),G=E.pop(),F=G[3],s=j),k=k?N(k,c).replace(q,function(a,b,c){return b?r+=c+",":p+=c+",",""}):"",p=p.slice(0,-1),k=k.slice(0,-1),d=[e,f||"",k,s&&[],"{"+(p?"props:{"+p+"},":"")+"path:'"+k+"'"+(r?",ctx:{"+r.slice(0,-1)+"}":"")+"}"],s&&(E.push(G),G=d,G[5]=D),F.push(d)):m&&(G[5]=a.substring(G[5],n),G=E.pop());if(!G)throw"Expected block tag";F=G[3]}var d,f,g,h,i,k,l,m,r,s,t,u,w,x,y,z,A=b?{allowCode:z=b.allowCode,debug:b.debug}:{},B=b&&b.tmpls,C=[],D=0,E=[],F=C,G=[,,,C],H=0;a=a.replace(p,"\\$1"),a.replace(e,J),I(a.length),h=C.length,i=h?"":'"";';for(g=0;g<h;g++)f=C[g],f[0]==="*"?i=i.slice(0,g?-1:-3)+";"+f[1]+(g+1<h?"ret+=":""):""+f===f?i+='"'+f+'"+':(t=f[0],u=f[1],w=f[2],F=f[3],x=f[4],a=f[5],F&&(y=P(a,A,b,H++),M(a,y),B.push(y)),s=s||x.indexOf("view")>-1,i+=(t===":"?u==="html"?(l=j,"e("+w):u?(r=j,'c("'+u+'",view,'+w):(m=j,"((v="+w+')!=u?v:""'):(k=j,'t("'+t+'",view,"'+(u||"")+'",'+(F?B.length:'""')+","+x+(w?",":"")+w))+")+");return i=new Function("data, view, j, b, u",v+(m?"v,":"")+(k?"t=j.tag,":"")+(r?"c=j.convert,":"")+(l?"e=j.converters.html,":"")+"ret; try{\n\n"+(A.debug?"debugger;":"")+(z?"ret=":"return ")+i.slice(0,-1)+";\n\n"+(z?"return ret;":"")+"}catch(e){return j.err(e);}"),b&&(b.fn=i,b.useVw=r||s||k),i}function N(a,b){function h(a,h,k,m,n,o,p,q,r,s,t,u,v,w,x,y){function z(a,c,d,e,f,g,h){if(c){var i=(d?'view.hlp("'+d+'")':e?"view":"data")+(h?(f?"."+f:d?"":e?"":"."+c)+(g||""):(h=d?"":e?f||"":c,""));return b&&r!=="("&&(i="b("+i+',"'+h+'")'),i+(h?"."+h:"")}return a}n=n||"",k=k||h||t,m=m||q,r=r||x||"",n=n||"";if(o)L();else return g?(g=!u,g?a:'"'):f?(f=!v,f?a:'"'):(k?(e++,k):"")+(y?e?"":c?(c=i,"\b"):",":p?(e&&L(),c=j,"\b"+m+":"):m?m.replace(l,z)+(r?(d[++e]=j,r):n):n?a:w?(d[e--]=i,w)+(r?(d[++e]=j,r):""):s?(d[e]||L(),","):h?"":(g=u,f=v,'"'))}var c,d={},e=0,f=i,g=i;return a=(a+" ").replace(m,h),a}function O(a,c,d,e){function n(b){if(""+b===b||b.nodeType>0)return i=b.nodeType>0?b:!f.test(b)&&k&&k(b)[0],i&&i.type&&(b=G[i.getAttribute(u)],b||(a=a||"_"+s++,i.setAttribute(u,a),b=O(a,i.innerHTML,d,e),G[a]=b)),b}var h,i,j,l,m;h=n(c),e=e||(c.markup?c:{}),e.name=a,l=e.templates,!h&&c.markup&&(h=n(c.markup))&&h.fn&&(h.debug!==c.debug||h.allowCode!==c.allowCode)&&(h=h.markup);if(h!==b){a&&!d&&(y[a]=function(){return c.render.apply(c,arguments)}),h.fn||c.fn?h.fn&&(a&&a!==h.name?c=g(g({},h),e):c=h):(c=P(h,e,d,0),M(h,c));for(j in l)m=l[j],m.name!==j&&(l[j]=O(j,m,c));return c}}function P(a,b,c,d){function e(a){c[a]&&(f[a]=g(g({},c[a]),b[a]))}b=b||{};var f={markup:a,tmpls:[],links:[],render:K};return c&&(c.templates&&(f.templates=g(g({},c.templates),b.templates)),f.parent=c,f.name=c.name+"["+d+"]",f.index=d),g(f,b),c&&(e("templates"),e("tags"),e("helpers"),e("converters")),f}function Q(a){return t[a]||(t[a]="&#"+a.charCodeAt(0)+";")}var c="v1.0pre",d,e,f,g,h={},i=!1,j=!0,k=a.jQuery,l=/^(?:null|true|false|\d[\d.]*|([\w$]+|~([\w$]+)|#(view|([\w$]+))?)([\w$.]*?)(?:[.[]([\w$]+)\]?)?|(['"]).*\8)$/g,m=/(\()(?=|\s*\()|(?:([([])\s*)?(?:([#~]?[\w$.]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*!:?\/]|(=))\s*|([#~]?[\w$.]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*([)\]])([([]?))|(\s+)/g,n=/\r?\n/g,o=/\\(['"])/g,p=/\\?(['"])/g,q=/\x08(~)?([^\x08]+)\x08/g,r=0,s=0,t={"&":"&amp;","<":"&lt;",">":"&gt;"},u="data-jsv-tmpl",v="var j=j||"+(k?"jQuery.":"js")+"views,",w=/[\x00"&'<>]/g,x=Array.prototype.slice,y={},z={jsviews:c,sub:h,debugMode:j,err:function(a){return z.debugMode?"<br/><b>Error:</b> <em> "+(a.message||a)+". </em>":'""'},tmplFn:M,render:y,templates:G,tags:H,helpers:I,converters:J,View:E,convert:C,delimiters:A,tag:D};k?(d=k,d.templates=G,d.render=y,d.views=z,d.fn.render=K):(d=a.jsviews=z,d.extend=function(a,b){var c;a=a||{};for(c in b)a[c]=b[c];return a},d.isArray=Array&&Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"}),g=d.extend,z.topView={views:{},tmpl:{},hlp:B,ctx:z.helpers},H({"if":function(){var a=this,c=a.view;return c.onElse=function(a,d){var e=0,f=d.length;while(f&&!d[e++])if(e===f)return"";return c.onElse=b,a.path="",a.renderContent(c)},c.onElse(this,arguments)},"else":function(){var a=this.view;return a.onElse?a.onElse(this,arguments):""},"for":function(){var a,b=this,c="",d=arguments,e=d.length;b.props.layout&&(b.tmpl.layout=j);for(a=0;a<e;a++)c+=b.renderContent(d[a]);return c},"=":function(a){return a},"*":function(a){return a}}),J({html:function(a){return a!=b?String(a).replace(w,Q):""}}),A("{{","}}")}(this),function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}(jQuery),$.widget||function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){return c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}}),d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;return e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e,f&&e.charAt(0)==="_"?h:(f?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b)return h=f,!1}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))}),h)}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0)return a.extend({},this.options);if(typeof c=="string"){if(d===b)return this.options[c];e={},e[c]=d}return this._setOptions(e),this},_setOptions:function(b){var c=this;return a.each(b,function(a,b){c._setOption(a,b)}),this},_setOption:function(a,b){return this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e in f)e in c||(c[e]=f[e]);return this.element.trigger(c,d),!(a.isFunction(g)&&g.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}}(jQuery),function(a,b,c){var d=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY;a.geo={_allCoordinates:function(b){var c=this._flatten(b),d=0,e=[];for(;d<c.length;d++){var f=c[d].coordinates,g=f&&a.isArray(f[0]),h=g&&a.isArray(f[0][0]),i=h&&a.isArray(f[0][0][0]),j,k,l;i||(h||(g||(f=[f]),f=[f]),f=[f]);for(j=0;j<f.length;j++)for(k=0;k<f[j].length;k++)for(l=0;l<f[j][k].length;l++)e.push(f[j][k][l])}return e},_isGeodetic:function(b){while(a.isArray(b)){if(b.length>1&&!a.isArray(b[0]))return b[0]>=-180&&b[0]<=180&&b[1]>=-85&&b[1]<=85;b=b[0]}return!1},center:function(b,c){var d=!1;!c&&a.geo.proj&&this._isGeodetic(b)&&(d=!0,b=a.geo.proj.fromGeodetic(b));var e=[(b[0]+b[2])/2,(b[1]+b[3])/2];return d?a.geo.proj.toGeodetic(e):e},expandBy:function(b,c,d,e){var f=!1;return!e&&a.geo.proj&&this._isGeodetic(b)&&(f=!0,b=a.geo.proj.fromGeodetic(b)),b=[b[0]-c,b[1]-d,b[2]+c,b[3]+d],f?a.geo.proj.toGeodetic(b):b},height:function(b,c){return!c&&a.geo.proj&&this._isGeodetic(b)&&(b=a.geo.proj.fromGeodetic(b)),b[3]-b[1]},_in:function(a,b){return a[0]<=b[0]&&a[1]<=b[1]&&a[2]>=b[2]&&a[3]>=b[3]},_bboxDisjoint:function(a,b){return b[0]>a[2]||b[2]<a[0]||b[1]>a[3]||b[3]<a[1]},include:function(b,c,f){if(!c||!a.isArray(c))return b;var g=!1;return!f&&a.geo.proj&&this._isGeodetic(b||c)&&(g=!0),b?g&&(b=a.geo.proj.fromGeodetic(b)):b=[d,d,e,e],c.length===2&&(c=[c[0],c[1],c[0],c[1]]),c=a.geo.proj.fromGeodetic(c),b[0]=Math.min(c[0],b[0]),b[1]=Math.min(c[1],b[1]),b[2]=Math.max(c[2],b[2]),b[3]=Math.max(c[3],b[3]),g?a.geo.proj.toGeodetic(b):b},polygonize:function(b,c){var d=!1;!c&&a.geo.proj&&this._isGeodetic(b)&&(d=!0,b=a.geo.proj.fromGeodetic(b));var e={type:"Polygon",coordinates:[[[b[0],b[1]],[b[0],b[3]],[b[2],b[3]],[b[2],b[1]],[b[0],b[1]]]]};return d&&(e.coordinates=a.geo.proj.toGeodetic(e.coordinates)),e},reaspect:function(b,c,d){var e=!1;!d&&a.geo.proj&&this._isGeodetic(b)&&(e=!0,b=a.geo.proj.fromGeodetic(b));var f=this.width(b,!0),g=this.height(b,!0),h=this.center(b,!0),i,j;return f!==0&&g!==0&&c>0&&(f/g>c?(i=f/2,j=i/c):(j=g/2,i=j*c),b=[h[0]-i,h[1]-j,h[0]+i,h[1]+j]),e?a.geo.proj.toGeodetic(b):b},recenter:function(b,c,d){var e=!1;!d&&a.geo.proj&&(this._isGeodetic(b)&&(e=!0,b=a.geo.proj.fromGeodetic(b)),this._isGeodetic(c)&&(c=a.geo.proj.fromGeodetic(c)));var f=(b[2]-b[0])/2,g=(b[3]-b[1])/2;return b=[c[0]-f,c[1]-g,c[0]+f,c[1]+g],e?a.geo.proj.toGeodetic(b):b},scaleBy:function(b,c,d){var e=!1;!d&&a.geo.proj&&this._isGeodetic(b)&&(e=!0,b=a.geo.proj.fromGeodetic(b));var f=this.center(b,!0),g=(b[2]-b[0])*c/2,h=(b[3]-b[1])*c/2;return b=[f[0]-g,f[1]-h,f[0]+g,f[1]+h],e?a.geo.proj.toGeodetic(b):b},width:function(b,c){return!c&&a.geo.proj&&this._isGeodetic(b)&&(b=a.geo.proj.fromGeodetic(b)),b[2]-b[0]},bbox:function(b,f){var g,h=!1;if(!b)return c;if(b.bbox)g=!f&&a.geo.proj&&this._isGeodetic(b.bbox)?a.geo.proj.fromGeodetic(b.bbox):b.bbox;else{g=[d,d,e,e];var i=this._allCoordinates(b),j=0;if(i.length===0)return c;!f&&a.geo.proj&&this._isGeodetic(i)&&(h=!0,i=a.geo.proj.fromGeodetic(i));for(;j<i.length;j++)g[0]=Math.min(i[j][0],g[0]),g[1]=Math.min(i[j][1],g[1]),g[2]=Math.max(i[j][0],g[2]),g[3]=Math.max(i[j][1],g[3])}return h?a.geo.proj.toGeodetic(g):g},centroid:function(b,f){switch(b.type){case"Point":return a.extend({},b);case"LineString":case"Polygon":var g=0,h=[0,0],i=a.merge([],b.type=="Polygon"?b.coordinates[0]:b.coordinates),j=1,k,l,m=[d,d,e,e],n=!1;!f&&a.geo.proj&&this._isGeodetic(i)&&(n=!0,i=a.geo.proj.fromGeodetic(i));for(;j<=i.length;j++)k=j%i.length,m[0]=Math.min(i[k][0],m[0]),m[1]=Math.min(i[k][1],m[1]),m[2]=Math.max(i[k][0],m[2]),m[3]=Math.max(i[k][1],m[3]),l=i[j-1][0]*i[k][1]-i[k][0]*i[j-1][1],g+=l,h[0]+=(i[j-1][0]+i[k][0])*l,h[1]+=(i[j-1][1]+i[k][1])*l;if(g===0)return i.length>0?(h[0]=Math.min(Math.max(i[0][0],m[0]),m[2]),h[1]=Math.min(Math.max(i[0][1],m[1]),m[3]),{type:"Point",coordinates:n?a.geo.proj.toGeodetic(h):h}):c;return g*=3,h[0]=Math.min(Math.max(h[0]/g,m[0]),m[2]),h[1]=Math.min(Math.max(h[1]/g,m[1]),m[3]),{type:"Point",coordinates:n?a.geo.proj.toGeodetic(h):h}}return c},contains:function(a,b){if(a.type!="Polygon")return!1;switch(b.type){case"Point":return this._containsPolygonPoint(a.coordinates,b.coordinates);case"LineString":return this._containsPolygonLineString(a.coordinates,b.coordinates);case"Polygon":return this._containsPolygonLineString(a.coordinates,b.coordinates[0]);default:return!1}},_containsPolygonPoint:function(a,b){if(a.length===0||a[0].length<4)return!1;var c=0,d=a[0][0],e=1,f,g;for(;e<a[0].length;e++){f=a[0][e];if(d[1]<=b[1]&&b[1]<f[1]||f[1]<=b[1]&&b[1]<d[1]&&(b[0]<d[0]||b[0]<f[0]))g=d[0]+(f[0]-d[0])*(b[1]-d[1])/(f[1]-d[1]),g>b[0]&&c++;d=f}return c%2==1},_containsPolygonLineString:function(a,b){for(var c=0;c<b.length;c++)if(!this._containsPolygonPoint(a,b[c]))return!1;return!0},distance:function(b,d,e){var f=!e&&a.geo.proj&&this._isGeodetic(b.coordinates)?a.geo.proj.fromGeodetic(b.coordinates):b.coordinates,g=!e&&a.geo.proj&&this._isGeodetic(d.coordinates)?a.geo.proj.fromGeodetic(d.coordinates):d.coordinates;switch(b.type){case"Point":switch(d.type){case"Point":return this._distancePointPoint(g,f);case"LineString":return this._distanceLineStringPoint(g,f);case"Polygon":return this._containsPolygonPoint(g,f)?0:this._distanceLineStringPoint(g[0],f);default:return c}break;case"LineString":switch(d.type){case"Point":return this._distanceLineStringPoint(f,g);case"LineString":return this._distanceLineStringLineString(f,g);case"Polygon":return this._containsPolygonLineString(g,f)?0:this._distanceLineStringLineString(g[0],f);default:return c}break;case"Polygon":switch(d.type){case"Point":return this._containsPolygonPoint(f,g)?0:this._distanceLineStringPoint(f[0],g);case"LineString":return this._containsPolygonLineString(f,g)?0:this._distanceLineStringLineString(f[0],g);case"Polygon":return this._containsPolygonLineString(f,g[0])?0:this._distanceLineStringLineString(f[0],g[0]);default:return c}}},_distancePointPoint:function(a,b){var c=b[0]-a[0],d=b[1]-a[1];return Math.sqrt(c*c+d*d)},_distanceLineStringPoint:function(a,b){var c=d;if(a.length>0){var e=a[0],f=b[0]-e[0],g=b[1]-e[1];if(a.length==1)return Math.sqrt(f*f+g*g);for(var h=1;h<a.length;h++){var i=a[h],j=i[0]-e[0],k=i[1]-e[1],l=b[0]-i[0],m=b[1]-i[1],n=this._distanceSegmentPoint(j,k,f,g,l,m);if(n===0)return 0;n<c&&(c=n),e=i,f=l,g=m}}return Math.sqrt(c)},_distanceSegmentPoint:function(a,b,c,d,e,f){var g=a*c+b*d;if(g<=0)return c*c+d*d;var h=a*a+b*b;return g>=h?e*e+f*f:c*c+d*d-g*g/h},_distanceLineStringLineString:function(a,b){var c=d;for(var e=0;e<b.length;e++)c=Math.min(c,this._distanceLineStringPoint(a,b[e]));return c},_buffer:function(b,d,e){var f=!1,g=b.coordinates;!e&&a.geo.proj&&this._isGeodetic(b.coordinates)&&(f=!0,g=a.geo.proj.fromGeodetic(b.coordinates));if(b.type==="Point"){var h=[],i=180,j=0,k;for(;j<=i;j++)k=j*360/i*(Math.PI/180),h.push([g[0]+Math.cos(k)*d,g[1]+Math.sin(k)*d]);return{type:"Polygon",coordinates:[f?a.geo.proj.toGeodetic(h):h]}}return c},_flatten:function(b){var c=[],d=0;switch(b.type){case"Feature":a.merge(c,this._flatten(b.geometry));break;case"FeatureCollection":for(;d<b.features.length;d++)a.merge(c,this._flatten(b.features[d].geometry));break;case"GeometryCollection":for(;d<b.geometries.length;d++)a.merge(c,this._flatten(b.geometries[d]));break;default:c[0]=b}return c},length:function(b,c){var d=0,e,f=1,g,h;switch(b.type){case"Point":return 0;case"LineString":e=b.coordinates;break;case"Polygon":e=b.coordinates[0]}if(e){!c&&a.geo.proj&&this._isGeodetic(e)&&(e=a.geo.proj.fromGeodetic(e));for(;f<e.length;f++)g=e[f][0]-e[f-1][0],h=e[f][1]-e[f-1][1],d+=Math.sqrt(g*g+h*h);return d}},area:function(b,c){var d=0,e,f=1,g;switch(b.type){case"Point":case"LineString":return 0;case"Polygon":e=b.coordinates[0]}if(e){!c&&a.geo.proj&&this._isGeodetic(e)&&(e=a.geo.proj.fromGeodetic(e));for(;f<=e.length;f++)g=f%e.length,d+=(e[f-1][0]-e[g][0])*(e[f-1][1]+e[g][1])/2;return Math.abs(d)}},pointAlong:function(b,c,d){var e=0,f=0,g=0,h,i,j,k=[],l=1,m,n,o,p,q,r=!1;switch(b.type){case"Point":return a.extend({},b);case"LineString":j=b.coordinates;break;case"Polygon":j=b.coordinates[0]}if(j){if(c===0)return{type:"Point",coordinates:[j[0][0],j[0][1]]};if(c===1)return l=j.length-1,{type:"Point",coordinates:[j[l][0],j[l][1]]};!d&&a.geo.proj&&this._isGeodetic(j)&&(r=!0,j=a.geo.proj.fromGeodetic(j));for(;l<j.length;l++)m=j[l][0]-j[l-1][0],n=j[l][1]-j[l-1][1],i=Math.sqrt(m*m+n*n),k.push(i),e+=i;for(l=0;l<k.length&&g<c;l++)f=g,g+=k[l]/e;return h=c-f,p=j[l-1],q=j[l],o=[p[0]+h*(q[0]-p[0]),p[1]+h*(q[1]-p[1])],{type:"Point",coordinates:r?a.geo.proj.toGeodetic(o):o}}},_WKT:function(){function b(a){return"POINT "+c(a.coordinates)}function c(a){return!a||!a.length?"EMPTY":"("+a.join(" ")+")"}function d(a){return"LINESTRING "+e(a.coordinates)}function e(a){if(!a||!a.length)return"EMPTY";var b=[];for(var c=0;c<a.length;c++)b.push(a[c].join(" "));return"("+b+")"}function f(a){return"POLYGON "+g(a.coordinates)}function g(a){if(!a||!a.length)return"EMTPY";var b=[];for(var c=0;c<a.length;c++)b.push(e(a[c]));return"("+b+")"}function h(a){return"MULTIPOINT "+e(a.coordinates)}function i(a){return"MULTILINSTRING "+g(a.coordinates)}function j(a){return"MULTIPOLYGON "+k(a.coordinates)}function k(a){if(!a||!a.length)return"EMPTY";var b=[];for(var c=0;c<a.length;c++)b.push(g(a[c]));return"("+b+")"}function l(a){return"GEOMETRYCOLLECTION "+m(a.geometries)}function m(a){if(!a||!a.length)return"EMPTY";var b=[];for(var c=0;c<a.length;c++)b.push(n(a[c]));return"("+a+")"}function n(a){if(!a||!a.type)return"";switch(a.type){case"Point":return b(a);case"LineString":return d(a);case"Polygon":return f(a);case"MultiPoint":return h(a);case"MultiLineString":return i(a);case"MultiPolygon":return j(a);case"GeometryCollection":return l(a);default:return""}}function o(a){var b=a.match(/\(\s*([\d\.\-]+)\s+([\d\.\-]+)\s*\)/);return b&&b.length>2?{type:"Point",coordinates:[parseFloat(b[1]),parseFloat(b[2])]}:null}function p(a){var b=a.match(/\s*\((.*)\)/),c=[],d,e,f=0;if(b&&b.length>1){d=b[1].match(/[\d\.\-]+\s+[\d\.\-]+/g);for(;f<d.length;f++)e=d[f].match(/\s*([\d\.\-]+)\s+([\d\.\-]+)\s*/),c[f]=[parseFloat(e[1]),parseFloat(e[2])];return{type:"LineString",coordinates:c}}return null}function q(a){var b=a.match(/\s*\(\s*\((.*)\)\s*\)/),c=[],d,e,f=0;if(b&&b.length>1){d=b[1].match(/[\d\.\-]+\s+[\d\.\-]+/g);for(;f<d.length;f++)e=d[f].match(/\s*([\d\.\-]+)\s+([\d\.\-]+)\s*/),c[f]=[parseFloat(e[1]),parseFloat(e[2])];return{type:"Polygon",coordinates:[c]}}return null}function r(b){var c;return b.indexOf("((")===-1?c=p(b):(c=s(b),c.coordinates=a.geo._allCoordinates(c)),c.type="MultiPoint",c}function s(a){var b=a.substr(1,a.length-2),c=b.split(")),(("),d=0,e={type:"MultiLineString",coordinates:[]};for(;d<c.length;d++)e.coordinates.push(p(c[d]).coordinates);return e}function t(a){var b=a.substr(1,a.length-2),c=b.split(")),(("),d=0,e={type:"MultiPolygon",coordinates:[]};for(;d<c.length;d++)e.coordinates.push(q(c[d]).coordinates);return e}function u(a){var b=a.substr(1,a.length-2),c=b.match(/\),[a-zA-Z]/g),d={type:"GeometryCollection",geometries:[]},e,f=0,g=0,h;if(c&&c.length>0){for(;f<c.length;f++)h=b.indexOf(c[f],g)-g+1,e=v(b.substr(g,h)),e&&d.geometries.push(e),g+=h+1;return e=v(b.substr(g)),e&&d.geometries.push(e),d}return null}function v(b){b=a.trim(b);var c=b.indexOf("("),d=b.substr(c);switch(a.trim(b.substr(0,c)).toUpperCase()){case"POINT":return o(d);case"LINESTRING":return p(d);case"POLYGON":return q(d);case"MULTIPOINT":return r(d);case"MULTILINESTRING":return s(d);case"MULTIPOLYGON":return t(d);case"GEOMETRYCOLLECTION":return u(d);default:return null}}return{stringify:n,parse:v}}(),proj:function(){var b=1.5707963267948966,c=.7853981633974483,d=.017453292519943295,e=57.29577951308232,f=6378137;return{fromGeodeticPos:function(a){return[f*a[0]*d,f*Math.log(Math.tan(c+a[1]*d/2))]},fromGeodetic:function(b){if(!a.geo._isGeodetic(b))return b;var c=a.isArray(b[0]),d=this.fromGeodeticPos;if(!c&&b.length==4){var e=d([b[0],b[1]]),f=d([b[2],b[3]]);return[e[0],e[1],f[0],f[1]]}var g=c&&a.isArray(b[0][0]),h=g&&a.isArray(b[0][0][0]),i=[],j,k,l;h||(g||(c||(b=[b]),b=[b]),b=[b]);for(j=0;j<b.length;j++){i[j]=[];for(k=0;k<b[j].length;k++){i[j][k]=[];for(l=0;l<b[j][k].length;l++)i[j][k][l]=d(b[j][k][l])}}return h?i:g?i[0]:c?i[0][0]:i[0][0][0]},toGeodeticPos:function(a){return[a[0]/f*e,(b-2*Math.atan(1/Math.exp(a[1]/f)))*e]},toGeodetic:function(b){if(a.geo._isGeodetic(b))return b;var c=a.isArray(b[0]),d=this.toGeodeticPos;if(!c&&b.length==4){var e=d([b[0],b[1]]),f=d([b[2],b[3]]);return[e[0],e[1],f[0],f[1]]}var g=c&&a.isArray(b[0][0]),h=g&&a.isArray(b[0][0][0]),i=[],j,k,l;h||(g||(c||(b=[b]),b=[b]),b=[b]);for(j=0;j<b.length;j++){i[j]=[];for(k=0;k<b[j].length;k++){i[j][k]=[];for(l=0;l<b[j][k].length;l++)i[j][k][l]=d(b[j][k][l])}}return h?i:g?i[0]:c?i[0][0]:i[0][0][0]}}}(),_serviceTypes:{}}}(jQuery,this),function(a,b){var c=function(){var a=5,b=document.createElement("div"),c=b.all||[];do b.innerHTML="<!--[if gt IE "+ ++a+"]><br><![endif]-->";while(c[0]);return a>6?a:!a}();a.widget("geo.geographics",{_$elem:b,_options:{},_trueCanvas:!0,_width:0,_height:0,_$canvas:b,_context:b,_blitcanvas:b,_blitcontext:b,_$labelsContainer:b,options:{style:{borderRadius:"8px",color:"#7f0000",fillOpacity:.2,height:"8px",opacity:1,strokeOpacity:1,strokeWidth:"2px",visibility:"visible",width:"8px"}},_create:function(){this._$elem=this.element,this._options=this.options,this._$elem.css({display:"inline-block",overflow:"hidden",textAlign:"left"}),this._$elem.css("position")=="static"&&this._$elem.css("position","relative"),this._$elem.addClass("geo-graphics"),this._width=this._$elem.width(),this._height=this._$elem.height();if(!this._width||!this._height)this._width=parseInt(this._$elem.css("width"),10),this._height=parseInt(this._$elem.css("height"),10);var a="position:absolute;left:0;top:0;margin:0;padding:0;",b="width:"+this._width+"px;height:"+this._height+"px;",d='width="'+this._width+'" height="'+this._height+'"';document.createElement("canvas").getContext?(this._$elem.append("<canvas "+d+' style="-webkit-transform:translateZ(0);'+a+'"></canvas>'),this._$canvas=this._$elem.children(":last"),this._context=this._$canvas[0].getContext("2d"),this._blitcanvas=document.createElement("canvas"),this._blitcanvas.width=this._width,this._blitcanvas.height=this._height,this._blitcontext=this._blitcanvas.getContext("2d")):c<=8&&(this._trueCanvas=!1,this._$elem.append("<div "+d+' style="'+a+b+'"></div>'),this._$canvas=this._$elem.children(":last"),G_vmlCanvasManager.initElement(this._$canvas[0]),this._context=this._$canvas[0].getContext("2d"),this._$canvas.children().css({backgroundColor:"transparent",width:this._width,height:this._height})),this._$elem.append('<div class="geo-labels-container" style="-webkit-transform:translateZ(0);'+a+b+'"></div>'),this._$labelsContainer=this._$elem.children(":last")},_setOption:function(b,c){b=="style"&&(c=a.extend({},this._options.style,c)),a.Widget.prototype._setOption.apply(this,arguments)},destroy:function(){a.Widget.prototype.destroy.apply(this,arguments),this._$elem.html(""),this._$elem.removeClass("geo-graphics")},clear:function(){this._context.clearRect(0,0,this._width,this._height),this._$labelsContainer.html("")},drawArc:function(a,b,c,d){d=this._getGraphicStyle(d);if(d.visibility!="hidden"&&d.opacity>0&&d.widthValue>0&&d.heightValue>0){var e=Math.min(d.widthValue,d.heightValue)/2;b=b*Math.PI/180,c=c*Math.PI/180,this._context.save(),this._context.translate(a[0],a[1]),d.widthValue>d.heightValue?this._context.scale(d.widthValue/d.heightValue,1):this._context.scale(1,d.heightValue/d.widthValue),this._context.beginPath(),this._context.arc(0,0,e,b,c,!1),this._trueCanvas&&this._context.restore(),d.doFill&&(this._context.fillStyle=d.fill,this._context.globalAlpha=d.opacity*d.fillOpacity,this._context.fill()),d.doStroke&&(this._context.lineJoin="round",this._context.lineWidth=d.strokeWidthValue,this._context.strokeStyle=d.stroke,this._context.globalAlpha=d.opacity*d.strokeOpacity,this._context.stroke()),this._trueCanvas||this._context.restore()}},drawPoint:function(a,b){b=this._getGraphicStyle(b),b.widthValue==b.heightValue&&b.heightValue==b.borderRadiusValue?this.drawArc(a,0,360,b):b.visibility!="hidden"&&b.opacity>0&&(b.borderRadiusValue=Math.min(Math.min(b.widthValue,b.heightValue)/2,b.borderRadiusValue),a[0]-=b.widthValue/2,a[1]-=b.heightValue/2,this._context.beginPath(),this._context.moveTo(a[0]+b.borderRadiusValue,a[1]),this._context.lineTo(a[0]+b.widthValue-b.borderRadiusValue,a[1]),this._context.quadraticCurveTo(a[0]+b.widthValue,a[1],a[0]+b.widthValue,a[1]+b.borderRadiusValue),this._context.lineTo(a[0]+b.widthValue,a[1]+b.heightValue-b.borderRadiusValue),this._context.quadraticCurveTo(a[0]+b.widthValue,a[1]+b.heightValue,a[0]+b.widthValue-b.borderRadiusValue,a[1]+b.heightValue),this._context.lineTo(a[0]+b.borderRadiusValue,a[1]+b.heightValue),this._context.quadraticCurveTo(a[0],a[1]+b.heightValue,a[0],a[1]+b.heightValue-b.borderRadiusValue),this._context.lineTo(a[0],a[1]+b.borderRadiusValue),this._context.quadraticCurveTo(a[0],a[1],a[0]+b.borderRadiusValue,a[1]),this._context.closePath(),b.doFill&&(this._context.fillStyle=b.fill,this._context.globalAlpha=b.opacity*b.fillOpacity,this._context.fill()),b.doStroke&&(this._context.lineJoin="round",this._context.lineWidth=b.strokeWidthValue,this._context.strokeStyle=b.stroke,this._context.globalAlpha=b.opacity*b.strokeOpacity,this._context.stroke()))},drawLineString:function(a,b){this._drawLines([a],!1,b)},drawPolygon:function(a,b){if(!this._trueCanvas||a.length==1)this._drawLines(a,!0,b);else{if(!a||!a.length||a[0].length<3)return;b=this._getGraphicStyle(b);var c,d,e;if(b.visibility!="hidden"&&b.opacity>0){this._blitcontext.clearRect(0,0,this._width,this._height);if(b.doFill&&a.length>1){this._blitcontext.globalCompositeOperation="source-out",this._blitcontext.globalAlpha=1;for(d=1;d<a.length;d++){this._blitcontext.beginPath(),this._blitcontext.moveTo(a[d][0][0],a[d][0][1]);for(e=1;e<a[d].length;e++)this._blitcontext.lineTo(a[d][e][0],a[d][e][1]);this._blitcontext.closePath(),this._blitcontext.fill()}}this._blitcontext.beginPath(),this._blitcontext.moveTo(a[0][0][0],a[0][0][1]),c=[a[0][0][0]-b.strokeWidthValue,a[0][0][1]-b.strokeWidthValue,a[0][0][0]+b.strokeWidthValue,a[0][0][1]+b.strokeWidthValue];for(d=1;d<a[0].length-1;d++)this._blitcontext.lineTo(a[0][d][0],a[0][d][1]),c[0]=Math.min(a[0][d][0]-b.strokeWidthValue,c[0]),c[1]=Math.min(a[0][d][1]-b.strokeWidthValue,c[1]),c[2]=Math.max(a[0][d][0]+b.strokeWidthValue,c[2]),c[3]=Math.max(a[0][d][1]+b.strokeWidthValue,c[3]);this._blitcontext.closePath(),this._blitcontext.globalCompositeOperation="source-out",b.doFill&&(this._blitcontext.fillStyle=b.fill,this._blitcontext.globalAlpha=b.opacity*b.fillOpacity,this._blitcontext.fill()),this._blitcontext.globalCompositeOperation="source-over";if(b.doStroke){this._blitcontext.lineCap=this._blitcontext.lineJoin="round",this._blitcontext.lineWidth=b.strokeWidthValue,this._blitcontext.strokeStyle=b.stroke,this._blitcontext.globalAlpha=b.opacity*b.strokeOpacity,this._blitcontext.stroke();if(a.length>1)for(d=1;d<a.length;d++){this._blitcontext.beginPath(),this._blitcontext.moveTo(a[d][0][0],a[d][0][1]);for(e=1;e<a[d].length;e++)this._blitcontext.lineTo(a[d][e][0],a[d][e][1]);this._blitcontext.closePath(),this._blitcontext.stroke()}}c[0]=Math.min(Math.max(c[0],0),this._width),c[1]=Math.min(Math.max(c[1],0),this._height),c[2]=Math.min(Math.max(c[2],0),this._width),c[3]=Math.min(Math.max(c[3],0),this._height),c[0]!==c[2]&&c[1]!==c[3]&&this._context.drawImage(this._blitcanvas,c[0],c[1],c[2]-c[0],c[3]-c[1],c[0],c[1],c[2]-c[0],c[3]-c[1])}}},drawBbox:function(a,b){this._drawLines([[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]],[a[0],a[1]]]],!0,b)},drawLabel:function(a,b){this._$labelsContainer.append('<div class="geo-label" style="-webkit-transform:translateZ(0);position:absolute; left:'+a[0]+"px; top:"+a[1]+'px;">'+b+"</div>")},resize:function(){this._width=this._$elem.width(),this._height=this._$elem.height();if(!this._width||!this._height)this._width=parseInt(this._$elem.css("width"),10),this._height=parseInt(this._$elem.css("height"),10);this._trueCanvas&&(this._$canvas[0].width=this._width,this._$canvas[0].height=this._height),this._$labelsContainer.css({width:this._width,height:this._height})},_getGraphicStyle:function(b){function c(a){return a=parseInt(a,10),+a+""===a?+a:a}return b=a.extend({},this._options.style,b),b.borderRadiusValue=c(b.borderRadius),b.fill=b.fill||b.color,b.doFill=b.fill&&b.fillOpacity>0,b.stroke=b.stroke||b.color,b.strokeWidthValue=c(b.strokeWidth),b.doStroke=b.stroke&&b.strokeOpacity>0&&b.strokeWidthValue>0,b.widthValue=c(b.width),b.heightValue=c(b.height),b},_drawLines:function(a,b,c){if(!a||!a.length||a[0].length<2)return;var d,e;c=this._getGraphicStyle(c);if(c.visibility!="hidden"&&c.opacity>0){this._context.beginPath();for(d=0;d<a.length;d++){this._context.moveTo(a[d][0][0],a[d][0][1]);for(e=1;e<a[d].length;e++)this._context.lineTo(a[d][e][0],a[d][e][1])}b&&this._context.closePath(),b&&c.doFill&&(this._context.fillStyle=c.fill,this._context.globalAlpha=c.opacity*c.fillOpacity,this._context.fill()),c.doStroke&&(this._context.lineCap=this._context.lineJoin="round",this._context.lineWidth=c.strokeWidthValue,this._context.strokeStyle=c.stroke,this._context.globalAlpha=c.opacity*c.strokeOpacity,this._context.stroke())}}})}(jQuery),function(a,b){var c=0,d=function(){var a=5,b=document.createElement("div"),c=b.all||[];do b.innerHTML="<!--[if gt IE "+ ++a+"]><br><![endif]-->";while(c[0]);return a>6?a:!a}(),e={bbox:[-180,-85,180,85],bboxMax:[-180,-85,180,85],center:[0,0],cursors:{"static":"default",pan:"url(data:image/vnd.microsoft.icon;base64,AAACAAEAICACAAgACAAwAQAAFgAAACgAAAAgAAAAQAAAAAEAAQAAAAAAAAEAAAAAAAAAAAAAAgAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8AAAA/AAAAfwAAAP+AAAH/gAAB/8AAA//AAAd/wAAGf+AAAH9gAADbYAAA2yAAAZsAAAGbAAAAGAAAAAAAAA//////////////////////////////////////////////////////////////////////////////////////gH///4B///8Af//+AD///AA///wAH//4AB//8AAf//AAD//5AA///gAP//4AD//8AF///AB///5A////5///8=), move",zoom:"crosshair",dragBox:"crosshair",dragCircle:"crosshair",drawPoint:"crosshair",drawLineString:"crosshair",drawPolygon:"crosshair",measureLength:"crosshair",measureArea:"crosshair"},measureLabels:{length:"{{:length.toFixed( 2 )}} m",area:"{{:area.toFixed( 2 )}} sq m"},drawStyle:{},shapeStyle:{},mode:"pan",pannable:!0,scroll:"default",shift:"default",services:[{"class":"osm",type:"tiled",src:function(a){return"http://otile"+(a.index%4+1)+".mqcdn.com/tiles/1.0.0/osm/"+a.zoom+"/"+a.tile.column+"/"+a.tile.row+".png"},attr:"Tiles Courtesy of <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png'>"}],tilingScheme:{tileWidth:256,tileHeight:256,levels:18,basePixelSize:156543.03392799935,origin:[-20037508.342787,20037508.342787]},axisLayout:"map",zoom:0,zoomMin:0,zoomMax:Number.POSITIVE_INFINITY,pixelSize:0};a.widget("geo.geomap",{_$elem:b,_map:b,_created:!1,_createdGraphics:!1,_widgetId:0,_tmplLengthId:"",_tmplAreaId:"",_contentBounds:{},_$resizeContainer:b,_$eventTarget:b,_$contentFrame:b,_$existingChildren:b,_$attrList:b,_$servicesContainer:b,_$shapesContainers:b,_$panContainer:b,_$shapesContainer:b,_$drawContainer:b,_$measureContainer:b,_$measureLabel:b,_dpi:96,_currentServices:[],_center:b,_pixelSize:b,_centerMax:b,_pixelSizeMax:b,_userGeodetic:!0,_centerInteractive:b,_pixelSizeInteractive:b,_timeoutInteractive:null,_triggerInteractive:!1,_loadCount:0,_wheelTimeout:null,_wheelLevel:0,_zoomFactor:2,_fullZoomFactor:2,_partialZoomFactor:1.18920711500273,_mouseDown:b,_inOp:b,_toolPan:b,_shiftDown:b,_anchor:b,_current:b,_downDate:b,_moveDate:b,_clickDate:b,_lastMove:b,_lastDrag:b,_windowHandler:null,_resizeTimeout:null,_panning:b,_velocity:b,_friction:b,_supportTouch:b,_softDblClick:b,_isTap:b,_isDbltap:b,_isMultiTouch:b,_multiTouchAnchor:[],_multiTouchAnchorBbox:b,_multiTouchCurrentBbox:b,_drawTimeout:null,_drawPixels:[],_drawCoords:[],_graphicShapes:[],_initOptions:{},_options:{},options:a.extend({},e),_createWidget:function(b,d){this._$elem=a(d);if(this._$elem.is(".geo-service")){this._graphicShapes=[],a.Widget.prototype._createWidget.apply(this,arguments);return}this._widgetId=c++,this._tmplLengthId="geoMeasureLength"+this._widgetId,this._tmplAreaId="geoMeasureArea"+this._widgetId,this._$elem.addClass("geo-map").css({webkitTransform:"translateZ(0)"}),this._initOptions=b||{},this._forcePosition(this._$elem),this._$elem.css("text-align","left");var e=this._findMapSize();this._contentBounds={x:parseInt(this._$elem.css("padding-left"),10),y:parseInt(this._$elem.css("padding-top"),10),width:e.width,height:e.height},this._createChildren(),this._center=[0,0],this._centerMax=[0,0],this._centerInteractive=[0,0],this.options.pixelSize=this._pixelSize=this._pixelSizeMax=156543.03392799935,this._mouseDown=this._inOp=this._toolPan=this._shiftDown=this._panning=this._isTap=this._isDbltap=!1,this._anchor=[0,0],this._current=[0,0],this._lastMove=[0,0],this._lastDrag=[0,0],this._velocity=[0,0],this._friction=[.8,.8],this._downDate=this._moveDate=this._clickDate=0,this._drawPixels=[],this._drawCoords=[],this._graphicShapes=[],a.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this._options=this.options;if(this._$elem.is(".geo-service")){this._map=this._$elem.data("geoMap"),this._$elem.data("geoService",this);return}this._map=this,this._supportTouch="ontouchend"in document,this._softDblClick=this._supportTouch||d==7;var c=this,e=this._supportTouch?"touchstart":"mousedown",f=this._supportTouch?"touchend touchcancel":"mouseup",g=this._supportTouch?"touchmove":"mousemove";a(document).keydown(a.proxy(this._document_keydown,this)),this._$eventTarget.dblclick(a.proxy(this._eventTarget_dblclick,this)),this._$eventTarget.bind(e,a.proxy(this._eventTarget_touchstart,this));var h=this._$eventTarget[0].setCapture?this._$eventTarget:a(document);h.bind(g,a.proxy(this._dragTarget_touchmove,this)),h.bind(f,a.proxy(this._dragTarget_touchstop,this)),this._$eventTarget.mousewheel(a.proxy(this._eventTarget_mousewheel,this)),this._windowHandler=function(){c._resizeTimeout&&clearTimeout(c._resizeTimeout),c._resizeTimeout=setTimeout(function(){c._created&&c._$elem.geomap("resize",!0)},500)},a(window).resize(this._windowHandler),this._$drawContainer.geographics({style:this._initOptions.drawStyle||{}}),this._options.drawStyle=this._$drawContainer.geographics("option","style"),this._$shapesContainer.geographics({style:this._initOptions.shapeStyle||{}}),this._createdGraphics=!0,this._options.shapeStyle=this._$shapesContainer.geographics("option","style"),this._initOptions&&(this._initOptions.tilingScheme!==b&&this._setOption("tilingScheme",this._initOptions.tilingScheme||null,!1),this._initOptions.services&&(this._options.services=a.merge([],this._initOptions.services)),this._initOptions.bboxMax&&(this._setOption("bboxMax",this._initOptions.bboxMax,!1),this._setOption("bbox",this._initOptions.bboxMax,!1)),this._initOptions.zoomMin!==b&&this._setOption("zoomMin",this._initOptions.zoomMin,!1),this._initOptions.zoomMax!==b&&this._setOption("zoomMax",this._initOptions.zoomMax,!1),this._initOptions.bbox&&this._setOption("bbox",this._initOptions.bbox,!1),this._initOptions.center&&this._setOption("center",this._initOptions.center,!1),this._initOptions.zoom!==b&&this._setOption("zoom",this._initOptions.zoom,!1)),a.templates(this._tmplLengthId,this._options.measureLabels.length),a.templates(this._tmplAreaId,this._options.measureLabels.area),this._$eventTarget.css("cursor",this._options.cursors[this._options.mode]),this._createServices(),this._refresh(),this._created=!0},_setOption:function(c,d,e){if(c=="pixelSize")return;e=e===b||e,this._$elem.is(".geo-map")&&this._panFinalize();var f,g,h,i;switch(c){case"bbox":this._created&&this._clearInteractiveTimeout(),this._userGeodetic=a.geo.proj&&a.geo._isGeodetic(d),this._userGeodetic&&(d=a.geo.proj.fromGeodetic(d)),f=[d[0]+(d[2]-d[0])/2,d[1]+(d[3]-d[1])/2],g=Math.max(a.geo.width(d,!0)/this._contentBounds.width,a.geo.height(d,!0)/this._contentBounds.height),i=this._getZoom(f,g),this._options.tilingScheme?g=this._getPixelSize(Math.min(Math.max(i,this._options.zoomMin),this._options.zoomMax)):i<this._options.zoomMin?g=this._getPixelSize(this._options.zoomMin):i>this._options.zoomMax&&(g=this._getPixelSize(this._options.zoomMax)),this._created?(this._setInteractiveCenterAndSize(f,g),this._setInteractiveTimeout(!1)):this._setCenterAndSize(f,g,!1,e),d=this._getBbox(f,g);break;case"bboxMax":this._userGeodetic=a.geo.proj&&a.geo._isGeodetic(d);break;case"center":this._created&&this._clearInteractiveTimeout(),this._userGeodetic=a.geo.proj&&a.geo._isGeodetic(d),this._userGeodetic&&(d=a.geo.proj.fromGeodetic(d)),this._created?(this._setInteractiveCenterAndSize(d,this._pixelSizeInteractive),this._interactiveTransform(),this._setInteractiveTimeout(!1)):this._setCenterAndSize(d,this._pixelSize,!1,e);break;case"measureLabels":d=a.extend(this._options.measureLabels,d),a.templates(this._tmplLengthId,this._options.measureLabels.length),a.templates(this._tmplAreaId,this._options.measureLabels.area);break;case"drawStyle":this._$drawContainer&&(this._$drawContainer.geographics("option","style",d),d=this._$drawContainer.geographics("option","style"));break;case"shapeStyle":this._$elem.is(".geo-service")&&!this._createdGraphics&&this._createServiceGraphics(),this._createdGraphics&&(this._$shapesContainer.geographics("option","style",d),d=this._$shapesContainer.geographics("option","style"));break;case"mode":this._resetDrawing(),this._$eventTarget.css("cursor",this._options.cursors[d]);break;case"zoom":this._created?this._setZoom(d,!1,e):(d=Math.max(d,0),this._setCenterAndSize(this._center,this._getPixelSize(d),!1,e))}a.Widget.prototype._setOption.apply(this,arguments);switch(c){case"bbox":case"center":this._userGeodetic&&(this._options.bbox=a.geo.proj.toGeodetic(this._options.bbox),this._options.center=a.geo.proj.toGeodetic(this._center));break;case"tilingScheme":d!==null&&(this._pixelSizeMax=this._getPixelSize(0),this._centerMax=[d.origin[0]+this._pixelSizeMax*d.tileWidth/2,d.origin[1]+this._pixelSizeMax*d.tileHeight/2]);break;case"bboxMax":a.geo.proj&&a.geo._isGeodetic(d)?h=a.geo.proj.fromGeodetic(d):h=d,this._centerMax=a.geo.center(h),this._pixelSizeMax=Math.max(a.geo.width(h,!0)/this._contentBounds.width,a.geo.height(h,!0)/this._contentBounds.height);break;case"services":this._createServices(),e&&this._refresh();break;case"shapeStyle":e&&this._createdGraphics&&(this._$shapesContainer.geographics("clear"),this._refreshShapes(this._$shapesContainer,this._graphicShapes,this._graphicShapes,this._graphicShapes))}},destroy:function(){if(this._$elem.is(".geo-service"))this._createdGraphics&&(this._$shapesContainer.geographics("destroy"),this._$shapesContainer=b,this._createdGraphics=!1);else{clearTimeout(this._timeoutInteractive),this._timeoutInteractive=null,this._created=!1,a(window).unbind("resize",this._windowHandler);for(var c=0;c<this._currentServices.length;c++)this._currentServices[c].serviceContainer.geomap("destroy"),a.geo._serviceTypes[this._currentServices[c].type].destroy(this,this._$servicesContainer,this._currentServices[c]);this._$shapesContainer.geographics("destroy"),this._$shapesContainer=b,this._createdGraphics=!1,this._$drawContainer.geographics("destroy"),this._$drawContainer=b,this._$existingChildren.detach(),this._$elem.html(""),this._$elem.append(this._$existingChildren),this._$elem.removeClass("geo-map")}a.Widget.prototype.destroy.apply(this,arguments)},toMap:function(b){return b=this._toMap(b),this._userGeodetic?a.geo.proj.toGeodetic(b):b},toPixel:function(b,c,d){return this._toPixel(a.geo.proj?a.geo.proj.fromGeodetic(b):b,c,d)},opacity:function(b,c){if(this._$elem.is(".geo-service"))this._$elem.closest(".geo-map").geomap("opacity",b,this._$elem);else if(b>=0||b<=1)for(var d=0;d<this._currentServices.length;d++){var e=this._currentServices[d];if(!c||e.serviceContainer[0]==c[0])e.style.opacity=b,e.serviceObject.style=a.extend({},e.serviceObject.style,e.style),a.geo._serviceTypes[e.type].opacity(this,e)}},toggle:function(c,d){if(this._$elem.is(".geo-service"))this._$elem.closest(".geo-map").geomap("toggle",c,this._$elem);else for(var e=0;e<this._currentServices.length;e++){var f=this._currentServices[e];if(!d||f.serviceContainer[0]==d[0])c===b&&(c=f.style.visibility!=="visible"),f.style.visibility=c?"visible":"hidden",f.serviceObject.style=a.extend({},f.serviceObject.style,f.style),f.serviceContainer.toggle(c),c&&a.geo._serviceTypes[f.type].refresh(this,f)}},zoom:function(a){a!==null&&this._setZoom(this._options.zoom+a,!1,!0)},refresh:function(a,b){this._$elem.is(".geo-service")?this._$elem.closest(".geo-map").geomap("refresh",a,this._$elem):this._refresh(a,b)},resize:function(b){var c=this._findMapSize(),d=c.width/2-this._contentBounds.width/2,e=c.height/2-this._contentBounds.height/2,f;this._contentBounds={x:parseInt(this._$elem.css("padding-left"),10),y:parseInt(this._$elem.css("padding-top"),10),width:c.width,height:c.height},this._$resizeContainer.css({width:c.width,height:c.height});for(f=0;f<this._currentServices.length;f++)a.geo._serviceTypes[this._currentServices[f].type].resize(this,this._currentServices[f]);this._$elem.find(".geo-graphics").css({width:c.width,height:c.height}).geographics("resize");for(f=0;f<this._drawPixels.length;f++)this._drawPixels[f][0]+=d,this._drawPixels[f][1]+=e;this._setCenterAndSize(this._center,this._pixelSize,b,!0)},append:function(c,d,e,f){if(c&&(a.isPlainObject(c)||a.isArray(c)&&c.length>0)){this._createdGraphics||this._createServiceGraphics();var g,h,i,j,k,l;a.isArray(c)?g=c:c.type=="FeatureCollection"?g=c.features:g=[c];for(i=1;i<arguments.length;i++)h=arguments[i],typeof h=="object"?j=h:typeof h=="number"||typeof h=="string"?k=h:typeof h=="boolean"&&(l=h);for(i=0;i<g.length;i++){if(g[i].type!="Point"){var m=a.geo.bbox(g[i]);a.geo.proj&&a.geo._isGeodetic(m)&&(m=a.geo.proj.fromGeodetic(m)),a.data(g[i],"geoBbox",m)}this._graphicShapes.push({shape:g[i],style:j,label:k})}if(l===b||l)this._$elem.is(".geo-service")?this._refresh(!1,this._$elem):this._refresh()}},empty:function(c){for(var d=0;d<this._graphicShapes.length;d++)a.removeData(this._graphicShapes[d].shape,"geoBbox");this._graphicShapes=[];if(c===b||c)this._$elem.is(".geo-service")?this._refresh(!1,this._$elem):this._refresh()},find:function(c,d){var e=a.isPlainObject(c),f=e?this._map.toPixel(c.coordinates):b,g=this._map._pixelSize*d,h=[],i,j,k,l=0;for(;l<this._graphicShapes.length;l++){i=this._graphicShapes[l];if(e)if(i.shape.type=="Point")a.geo.distance(i.shape,c)<=g&&h.push(i.shape);else{var m=a.data(i.shape,"geoBbox"),n={type:"Polygon",coordinates:[[[m[0],m[1]],[m[0],m[3]],[m[2],m[3]],[m[2],m[1]],[m[0],m[1]]]]},o={type:"Point",coordinates:a.geo.proj&&a.geo._isGeodetic(c.coordinates)?a.geo.proj.fromGeodetic(c.coordinates):c.coordinates};if(a.geo.distance(n,o,!0)<=g){j=a.geo._flatten(i.shape);for(k=0;k<j.length;k++)if(a.geo.distance(j[k],c)<=g){h.push(i.shape);break}}}else h.push(i.shape)}return this._$elem.is(".geo-map")&&this._$elem.find(".geo-service").each(function(){h=a.merge(h,a(this).geomap("find",c,d))}),h},remove:function(c,d){if(c&&(a.isPlainObject(c)||a.isArray(c)&&c.length>0)){var e=a.isArray(c)?c:[c],f;for(var g=0;g<this._graphicShapes.length;g++)a.inArray(this._graphicShapes[g].shape,e)>=0&&(a.removeData(c,"geoBbox"),f=this._graphicShapes.slice(g+1),this._graphicShapes.length=g,this._graphicShapes.push.apply(this._graphicShapes,f),g--);if(d===b||d)this._$elem.is(".geo-service")?this._refresh(!1,this._$elem):this._refresh()}},_getBbox:function(a,b){a=a||this._center,b=b||this._pixelSize;var c=this._contentBounds.width/2*b,d=this._contentBounds.height/2*b;return[a[0]-c,a[1]-d,a[0]+c,a[1]+d]},_setBbox:function(b,c,d){var e=[b[0]+(b[2]-b[0])/2,b[1]+(b[3]-b[1])/2],f=Math.max(a.geo.width(b,!0)/this._contentBounds.width,a.geo.height(b,!0)/this._contentBounds.height),g=this._getZoom(e,f);this._options.tilingScheme?f=this._getPixelSize(Math.min(Math.max(g,this._options.zoomMin),this._options.zoomMax)):g<this._options.zoomMin?f=this._getPixelSize(this._options.zoomMin):g>this._options.zoomMax&&(f=this._getPixelSize(this._options.zoomMax)),this._setInteractiveCenterAndSize(e,f),this._interactiveTransform()},_getBboxMax:function(){var a=this._contentBounds.width/2*this._pixelSizeMax,b=this._contentBounds.height/2*this._pixelSizeMax;return[this._centerMax[0]-a,this._centerMax[1]-b,this._centerMax[0]+a,this._centerMax[1]+b]},_getCenter:function(){return this._center},_getContentBounds:function(){return this._contentBounds},_getServicesContainer:function(){return this._$servicesContainer},_getZoom:function(b,c){b=b||this._center,c=c||this._pixelSize;var d=this._options.tilingScheme;if(d){if(d.pixelSizes){var e=Math.floor(c*1e3),f=d.pixelSizes.length,g=f-1;for(;g>=0;g--)if(Math.floor(d.pixelSizes[g]*1e3)>=e)return g;return 0}return Math.round(Math.log(d.basePixelSize/c)/Math.log(2))}var h=this._contentBounds.width/this._contentBounds.height,i=a.geo.reaspect(this._getBbox(b,c),h,!0),j=a.geo.reaspect(this._getBboxMax(),h,!0);return Math.round(Math.log(a.geo.width(j,!0)/a.geo.width(i,!0))/Math.log(this._zoomFactor))},_setZoom:function(a,b,c){this._clearInteractiveTimeout(),a=Math.min(Math.max(a,this._options.zoomMin),this._options.zoomMax),this._setInteractiveCenterAndSize(this._centerInteractive,this._getPixelSize(a)),this._interactiveTransform(),this._setInteractiveTimeout(b)},_createChildren:function(){this._$existingChildren=this._$elem.children(),this._forcePosition(this._$existingChildren),this._$existingChildren.detach().css({mozUserSelect:"none"});var b="width:"+this._contentBounds.width+"px; height:"+this._contentBounds.height+"px; margin:0; padding:0;",c="position:absolute; left:0; top:0;";this._$elem.prepend('<div class="geo-event-target geo-content-frame" style="position:absolute; left:'+this._contentBounds.x+"px; top:"+this._contentBounds.y+"px;"+b+'overflow:hidden; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none;" unselectable="on"></div>'),this._$eventTarget=this._$contentFrame=this._$elem.children(":first"),this._$contentFrame.append('<div class="geo-services-container" style="'+c+b+'"></div>'),this._$servicesContainer=this._$contentFrame.children(":last"),this._$contentFrame.append('<div class="geo-shapes-container" style="'+c+b+'"></div>'),this._$shapesContainer=this._$contentFrame.children(":last"),this._$contentFrame.append('<ul style="position: absolute; bottom: 8px; left: 8px; list-style-type: none; max-width: 50%; padding: 0; margin: 0;"></ul>'),this._$attrList=this._$contentFrame.children(":last"),this._$contentFrame.append('<div class="geo-draw-container" style="'+c+b+'"></div>'),this._$drawContainer=this._$contentFrame.children(":last"),this._$contentFrame.append('<div class="geo-measure-container" style="'+c+b+'"><span class="geo-measure-label" style="'+c+'; display: none;"></span></div>'),this._$measureContainer=this._$contentFrame.children(":last"),this._$measureLabel=this._$measureContainer.children(),this._$panContainer=a([this._$shapesContainer[0],this._$drawContainer[0],this._$measureContainer[0]]),this._$resizeContainer=a([this._$contentFrame[0],this._$servicesContainer[0],this._$eventTarget[0],this._$measureContainer[0]]),this._$contentFrame.append(this._$existingChildren),a("#geo-measure-style").length||a("head").prepend('<style type="text/css" id="geo-measure-style">.geo-measure-label { margin: 4px 0 0 6px; font-family: sans-serif;'+(d?"letter-spacing: 2px; color: #444; filter:progid:DXImageTransform.Microsoft.DropShadow(Color=white, OffX=1, OffY=2, Positive=true);":"color: #000; text-shadow: #fff 1px 2px; font-weight: bold;")+" }</style>")},_createServices:function(){var b,c;for(c=0;c<this._currentServices.length;c++)this._currentServices[c].serviceContainer.geomap("destroy"),a.geo._serviceTypes[this._currentServices[c].type].destroy(this,this._$servicesContainer,this._currentServices[c]);this._currentServices=[],this._$servicesContainer.html(""),this._$attrList.html("");for(c=0;c<this._options.services.length;c++){b=this._currentServices[c]=a.extend({},this._options.services[c]),b.serviceObject=this._options.services[c],b.style=a.extend({visibility:"visible",opacity:1},b.style);var d=b.id?' id="'+b.id+'"':"",e='class="geo-service '+(b["class"]?b["class"]:"")+'"',f="<div "+d+e+' style="-webkit-transform:translateZ(0);position:absolute; left:0; top:0; width:32px; height:32px; margin:0; padding:0; display:'+(b.style.visibility==="visible"?"block":"none")+';"></div>',g;this._$servicesContainer.append(f),serviceContainer=this._$servicesContainer.children(":last"),b.serviceContainer=serviceContainer,a.geo._serviceTypes[b.type].create(this,serviceContainer,b,c),serviceContainer.data("geoMap",this).geomap(),b.attr&&this._$attrList.append("<li>"+b.attr+"</li>")}this._$shapesContainers=this._$shapesContainer,this._$attrList.find("a").css({position:"relative",zIndex:100})},_createServiceGraphics:function(){var a=this._$elem.closest(".geo-content-frame");this._$elem.append('<div class="geo-shapes-container" style="position:absolute; left:0; top:0; width:'+a.css("width")+"; height:"+a.css("height")+'; margin:0; padding:0;"></div>'),this._$shapesContainer=this._$elem.children(":last"),this._map._$shapesContainers=this._map._$shapesContainers.add(this._$shapesContainer),this._$shapesContainer.geographics(),this._createdGraphics=!0,this._options.shapeStyle=this._$shapesContainer.geographics("option","style")},_refreshDrawing:function(){this._$drawContainer.geographics("clear");if(this._drawPixels.length>0){var b=this._options.mode,c=this._drawPixels,d=this._drawCoords,e,f,g,h,i;switch(b){case"measureLength":b="drawLineString",f={type:"LineString",coordinates:d},e=a.render[this._tmplLengthId]({length:a.geo.length(f,!0)}),g=a.merge([],c[c.length-1]);break;case"measureArea":b="drawPolygon",f={type:"Polygon",coordinates:[a.merge([],d)]},f.coordinates[0].push(d[0]),e=a.render[this._tmplAreaId]({area:a.geo.area(f,!0)}),g=this._toPixel(a.geo.centroid(f).coordinates),c=[c];break;case"drawPolygon":c=[c]}this._$drawContainer.geographics(b,c),e&&(this._$measureLabel.html(e),h=this._contentBounds.width-(this._$measureLabel.outerWidth(!0)+g[0]),i=this._contentBounds.height-(this._$measureLabel.outerHeight(!0)+g[1]),h<0&&(g[0]+=h),i<0&&(g[1]+=i),this._$measureLabel.css({left:Math.max(g[0],0),top:Math.max(g[1],0)}).show())}},_resetDrawing:function(){this._drawPixels=[],this._drawCoords=[],this._$drawContainer.geographics("clear"),this._$measureLabel.hide()},_refreshShapes:function(c,d,e,f,g,h){var i,j,k,l,m,n,o,p,q=this._map._getBbox(g,h);for(i=0;i<d.length;i++){k=d[i].shape||d[i],k=k.geometry||k,l=a.data(k,"geoBbox");if(l&&a.geo._bboxDisjoint(q,l))continue;m=a.isArray(e)?e[i].style:e,n=a.isArray(f)?f[i].label:f,o=n!==b,p=b;switch(k.type){case"Point":p=this._map.toPixel(k.coordinates,g,h),this._$shapesContainer.geographics("drawPoint",p,m);break;case"LineString":this._$shapesContainer.geographics("drawLineString",this._map.toPixel(k.coordinates,g,h),m),o&&(p=this._map.toPixel(a.geo.pointAlong(k,.5).coordinates,g,h));break;case"Polygon":this._$shapesContainer.geographics("drawPolygon",this._map.toPixel(k.coordinates,g,h),m),o&&(p=this._map.toPixel(a.geo.centroid(k).coordinates,g,h));break;case"MultiPoint":for(j=0;j<k.coordinates.length;j++)this._$shapesContainer.geographics("drawPoint",this._map.toPixel(k.coordinates[j],g,h),m);o&&(p=this._map.toPixel(a.geo.centroid(k).coordinates,g,h));break;case"MultiLineString":for(j=0;j<k.coordinates.length;j++)this._$shapesContainer.geographics("drawLineString",this._map.toPixel(k.coordinates[j],g,h),m);o&&(p=this._map.toPixel(a.geo.centroid(k).coordinates,g,h));break;case"MultiPolygon":for(j=0;j<k.coordinates.length;j++)this._$shapesContainer.geographics("drawPolygon",this._map.toPixel(k.coordinates[j],g,h),m);o&&(p=this._map.toPixel(a.geo.centroid(k).coordinates,g,h));break;case"GeometryCollection":this._refreshShapes(c,k.geometries,m,n,g,h)}o&&p&&this._$shapesContainer.geographics("drawLabel",p,n)}},_findMapSize:function(){var a={width:0,height:0},b=this._$elem;while(b.size()&&!(a.width>0&&a.height>0)){a={width:b.width(),height:b.height()};if(a.width<=0||a.height<=0)a={width:parseInt(b.css("width"),10),height:parseInt(b.css("height"),10)};b=b.parent()}return a},_forcePosition:function(a){var b=a.css("position");b!="relative"&&b!="absolute"&&b!="fixed"&&a.css("position","relative")},_getPixelSize:function(b){var c=this._options.tilingScheme;if(c!==null){if(b===0)return c.pixelSizes?c.pixelSizes[0]:c.basePixelSize;b=Math.round(b),b=Math.max(b,0);var d=c.pixelSizes?c.pixelSizes.length:c.levels;return b=Math.min(b,d-1),c.pixelSizes?c.pixelSizes[b]:c.basePixelSize/Math.pow(2,b)}var e=a.geo.scaleBy(this._getBboxMax(),1/Math.pow(this._zoomFactor,b),!0);return Math.max(a.geo.width(e,!0)/this._contentBounds.width,a.geo.height(e,!0)/this._contentBounds.height)},_getZoomCenterAndSize:function(a,b,c){var d=c?this._fullZoomFactor:this._partialZoomFactor,e=Math.pow(d,-b),f=this._pixelSizeInteractive*e,g=this._getZoom(this._centerInteractive,f);c&&this._options.tilingScheme?f=this._getPixelSize(Math.min(Math.max(g,this._options.zoomMin),this._options.zoomMax)):b<0&&g<this._options.zoomMin?f=this._pixelSizeInteractive:b>0&&g>this._options.zoomMax&&(f=this._pixelSizeInteractive);var h=f/this._pixelSizeInteractive,i=this._toMap(a,this._centerInteractive,this._pixelSizeInteractive),j=[(this._centerInteractive[0]-i[0])*h,(this._centerInteractive[1]-i[1])*h],k=[i[0]+j[0],i[1]+j[1]];return{pixelSize:f,center:k}},_mouseWheelFinish:function(a){this._wheelTimeout=null;if(this._wheelLevel!==0){var b=this._getZoomCenterAndSize(this._anchor,this._wheelLevel,this._options.tilingScheme!==null);this._wheelLevel=0}else a&&this._refresh()},_panFinalize:function(){if(this._panning){this._velocity=[0,0];var a=this._current[0]-this._anchor[0],b=this._current[1]-this._anchor[1],c=this._options.axisLayout==="image",d=-a*this._pixelSize,e=(c?-1:1)*b*this._pixelSize;this._$eventTarget.css("cursor",this._options.cursors[this._options.mode]),this._inOp=!1,this._anchor=this._current,this._mouseDown=this._toolPan=this._panning=!1}},_panMove:function(){if(!this._options.pannable)return;var a=this._current[0]-this._lastDrag[0],b=this._current[1]-this._lastDrag[1],c=0,d,e;if(this._toolPan||a>3||a<-3||b>3||b<-3){this._toolPan||(this._toolPan=!0,this._$eventTarget.css("cursor",this._options.cursors.pan)),this._mouseDown&&(this._velocity=[a,b]);if(a!==0||b!==0)this._panning=!0,this._lastDrag=this._current,this._centerInteractive[0]-=a*this._pixelSizeInteractive,this._centerInteractive[1]+=(this._options.axisLayout==="image"?-1:1)*b*this._pixelSizeInteractive,this._setInteractiveCenterAndSize(this._centerInteractive,this._pixelSizeInteractive),this._interactiveTransform()}},_clearInteractiveTimeout:function(){return this._timeoutInteractive?(clearTimeout(this._timeoutInteractive),this._timeoutInteractive=null,!0):(this._centerInteractive[0]=this._center[0],this._centerInteractive[1]=this._center[1],this._pixelSizeInteractive=this._pixelSize,!1)},_interactiveTransform:function(){this._$shapesContainers&&this._$shapesContainers.geographics("clear");for(var b=0;b<this._currentServices.length;b++)service=this._currentServices[b],a.geo._serviceTypes[service.type].interactiveTransform(this,service,this._centerInteractive,this._pixelSizeInteractive);this._drawCoords.length>0&&(this._drawPixels=this._toPixel(this._drawCoords,this._centerInteractive,this._pixelSizeInteractive),this._refreshDrawing())},_setInteractiveTimeout:function(a){function c(){b._isMultiTouch?b._timeoutInteractive=setTimeout(c,128):b._created&&b._timeoutInteractive&&(b._setCenterAndSize(b._centerInteractive,b._pixelSizeInteractive,b._triggerInteractive,!0),b._timeoutInteractive=null,b._triggerInteractive=!1)}var b=this;this._timeoutInteractive=setTimeout(c,128),this._triggerInteractive|=a},_refresh:function(b,c){var d,e,f=0;for(;f<this._currentServices.length;f++){d=this._currentServices[f];if(!c||d.serviceContainer[0]==c[0])a.geo._serviceTypes[d.type].refresh(this,d,b),e=d.serviceContainer.data("geoService"),e._createdGraphics&&(e._$shapesContainer.geographics("clear"),e._graphicShapes.length>0&&e._refreshShapes(e._$shapesContainer,e._graphicShapes,e._graphicShapes,e._graphicShapes))}this._createdGraphics&&(this._$shapesContainer.geographics("clear"),this._graphicShapes.length>0&&this._refreshShapes(this._$shapesContainer,this._graphicShapes,this._graphicShapes,this._graphicShapes))},_setInteractiveCenterAndSize:function(b,c){this._centerInteractive[0]=b[0],this._centerInteractive[1]=b[1],this._pixelSizeInteractive=c,this._userGeodetic?(this._options.bbox=a.geo.proj.toGeodetic(this._getBbox(b,c)),this._options.center=a.geo.proj.toGeodetic(b)):(this._options.bbox=this._getBbox(b,c),this._options.center[0]=b[0],this._options.center[1]=b[1]),this._options.pixelSize=c,this._options.zoom=this._getZoom(b,c)},_setCenterAndSize:function(b,c,d,e){if(!a.isArray(b)||b.length!=2||typeof b[0]!="number"||typeof b[1]!="number")return;var f=this._getZoom(b,c);this._options.tilingScheme?this._pixelSizeInteractive=c=this._getPixelSize(Math.min(Math.max(f,this._options.zoomMin),this._options.zoomMax)):f<this._options.zoomMin?this._pixelSizeInteractive=c=this._getPixelSize(this._options.zoomMin):f>this._options.zoomMax&&(this._pixelSizeInteractive=c=this._getPixelSize(this._options.zoomMax)),this._center[0]=b[0],this._center[1]=b[1],this._options.pixelSize=this._pixelSize=c,this._userGeodetic?(this._options.bbox=a.geo.proj.toGeodetic(this._getBbox()),this._options.center=a.geo.proj.toGeodetic(this._center)):(this._options.bbox=this._getBbox(),this._options.center=a.merge([],b)),this._options.zoom=f,d&&this._trigger("bboxchange",window.event,{bbox:a.merge([],this._options.bbox)}),e&&(this._refresh(),this._refreshDrawing())},_requestQueued:function(){this._loadCount===0&&this._trigger("loadstart",window.event),this._loadCount++},_requestComplete:function(){this._loadCount--,this._loadCount<=0&&(this._loadCount=0,this._trigger("loadend",window.event))},_toMap:function(b,c,d){c=c||this._center,d=d||this._pixelSize;var e=a.isArray(b[0]),f=e&&a.isArray(b[0][0]),g=f&&a.isArray(b[0][0][0]),h=this._contentBounds.width,i=this._contentBounds.height,j=h/2*d,k=i/2*d,l=[c[0]-j,c[1]-k,c[0]+j,c[1]+k],m=a.geo.width(l,!0)/h,n=a.geo.height(l,!0)/i,o,p=this._options.axisLayout==="image",q=[],r,s,t;g||(f||(e||(b=[b]),b=[b]),b=[b]);for(r=0;r<b.length;r++){q[r]=[];for(s=0;s<b[r].length;s++){q[r][s]=[];for(t=0;t<b[r][s].length;t++)o=b[r][s][t][1]*n,q[r][s][t]=[l[0]+b[r][s][t][0]*m,p?l[1]+o:l[3]-o]}}return g?q:f?q[0]:e?q[0][0]:q[0][0][0]},_toPixel:function(b,c,d){c=c||this._center,d=d||this._pixelSize;var e=a.isArray(b[0]),f=e&&a.isArray(b[0][0]),g=f&&a.isArray(b[0][0][0]),h=this._contentBounds.width,i=this._contentBounds.height,j=h/2*d,k=i/2*d,l=[c[0]-j,c[1]-k,c[0]+j,c[1]+k],m=a.geo.width(l,!0),n=a.geo.height(l,!0),o=this._options.axisLayout==="image",p=h/m,q=i/n,r=[],s,t,u;g||(f||(e||(b=[b]),b=[b]),b=[b]);for(s=0;s<b.length;s++){r[s]=[];for(t=0;t<b[s].length;t++){r[s][t]=[];for(u=0;u<b[s][t].length;u++)r[s][t][u]=[Math.round((b[s][t][u][0]-l[0])*p),Math.round((o?b[s][t][u][1]-l[1]:l[3]-b[s][t][u][1])*q)]}}return g?r:f?r[0]:e?r[0][0]:r[0][0][0]},_document_keydown:function(b){var c=this._drawCoords.length;c>0&&b.which==27&&(c<=2?(this._resetDrawing(),this._inOp=!1):(this._drawCoords[c-2]=a.merge([],this._drawCoords[c-1]),this._drawPixels[c-2]=a.merge([],this._drawPixels[c-1]),this._drawCoords.length--,this._drawPixels.length--,this._refreshDrawing()))},_eventTarget_dblclick_zoom:function(a){var b=this._clearInteractiveTimeout();this._trigger("dblclick",a,{type:"Point",coordinates:this._toMap(this._current,this._centerInteractive,this._pixelSizeInteractive)});if(!a.isDefaultPrevented()){var c=this._getZoomCenterAndSize(this._current,1,!0);this._setInteractiveCenterAndSize(c.center,c.pixelSize),this._interactiveTransform(),b=!0}b&&this._setInteractiveTimeout(!0)},_eventTarget_dblclick:function(b){if(this._options.mode==="static")return;this._drawTimeout&&(window.clearTimeout(this._drawTimeout),this._drawTimeout=null);var c=a(b.currentTarget).offset();switch(this._options.mode){case"drawLineString":case"measureLength":this._drawCoords.length>1&&(this._drawCoords[0][0]!=this._drawCoords[1][0]||this._drawCoords[0][1]!=this._drawCoords[1][1])?(this._drawCoords.length--,this._trigger("shape",b,{type:"LineString",coordinates:this._userGeodetic?a.geo.proj.toGeodetic(this._drawCoords):this._drawCoords})):this._eventTarget_dblclick_zoom(b),this._resetDrawing();break;case"drawPolygon":case"measureArea":if(this._drawCoords.length>1&&(this._drawCoords[0][0]!=this._drawCoords[1][0]||this._drawCoords[0][1]!=this._drawCoords[1][1])){var d=this._drawCoords.length-1;d>2&&(this._drawCoords[d]=a.merge([],this._drawCoords[0]),this._trigger("shape",b,{type:"Polygon",coordinates:[this._userGeodetic?a.geo.proj.toGeodetic(this._drawCoords):this._drawCoords]}))}else this._eventTarget_dblclick_zoom(b);this._resetDrawing();break;default:this._eventTarget_dblclick_zoom(b)}this._inOp=!1},_eventTarget_touchstart:function(b){var c=this._options.mode,d=this._options.shift;if(c==="static")return;if(!this._supportTouch&&b.which!=1)return;var e=this._clearInteractiveTimeout(),f=a(b.currentTarget).offset(),g=b.originalEvent.changedTouches;this._supportTouch?(this._multiTouchAnchor=a.merge([],g),this._isMultiTouch=this._multiTouchAnchor.length>1,this._isMultiTouch?(this._multiTouchCurrentBbox=[g[0].pageX-f.left,g[0].pageY-f.top,g[1].pageX-f.left,g[1].pageY-f.top],this._multiTouchAnchorBbox=a.merge([],this._multiTouchCurrentBbox),this._current=a.geo.center(this._multiTouchCurrentBbox,!0)):(this._multiTouchCurrentBbox=[g[0].pageX-f.left,g[0].pageY-f.top,NaN,NaN],this._current=[g[0].pageX-f.left,g[0].pageY-f.top])):this._current=[b.pageX-f.left,b.pageY-f.top];if(this._softDblClick){var h=a.now();if(h-this._downDate<750){if(this._isTap){var i=this._current[0]-this._anchor[0],j=this._current[1]-this._anchor[1],k=Math.sqrt(i*i+j*j);k>8?this._isTap=!1:this._current=a.merge([],this._anchor)}this._isDbltap?this._isDbltap=!1:this._isDbltap=this._isTap}else this._isDbltap=!1;this._isTap=!0,this._downDate=h}return this._mouseDown=!0,this._anchor=a.merge([],this._current),!this._inOp&&b.shiftKey&&d!=="off"?(this._shiftDown=!0,this._$eventTarget.css("cursor",this._options.cursors[d==="default"?"zoom":d])):!this._isMultiTouch&&(this._options.pannable||c==="dragBox"||c==="dragCircle")&&(this._inOp=!0,c!=="zoom"&&c!=="dragBox"&&c!=="dragCircle"&&(this._lastDrag=this._current,b.currentTarget.setCapture&&b.currentTarget.setCapture())),b.preventDefault(),e&&this._setInteractiveTimeout(!0),!1},_dragTarget_touchmove:function(b){if(this._options.mode==="static")return;var c=!1;this._mouseDown&&(c=this._clearInteractiveTimeout());var e=this._$eventTarget.offset(),f=this._drawCoords.length,g=b.originalEvent.changedTouches,h,i,j=0;if(this._supportTouch){if(!this._isMultiTouch&&this._mouseDown&&this._multiTouchAnchor.length>0&&g[0].identifier!==this._multiTouchAnchor[0].identifier)return this._mouseDown=!1,this._isMultiTouch=!0,this._wheelLevel=0,this._multiTouchAnchor.push(g[0]),this._multiTouchCurrentBbox=[this._multiTouchCurrentBbox[0],this._multiTouchCurrentBbox[1],this._multiTouchAnchor[1].pageX-e.left,this._multiTouchAnchor[1].pageY-e.top],this._multiTouchAnchorBbox=a.merge([],this._multiTouchCurrentBbox),this._mouseDown=!0,this._anchor=this._current=a.geo.center(this._multiTouchCurrentBbox,!0),c&&this._setInteractiveTimeout(!0),!1;if(this._isMultiTouch){for(;j<g.length;j++)g[j].identifier===this._multiTouchAnchor[0].identifier?(this._multiTouchCurrentBbox[0]=g[j].pageX-e.left,this._multiTouchCurrentBbox[1]=g[j].pageY-e.top):g[j].identifier===this._multiTouchAnchor[1].identifier&&(this._multiTouchCurrentBbox[2]=g[j].pageX-e.left,this._multiTouchCurrentBbox[3]=g[j].pageY-e.top);var k=a.geo._distancePointPoint([this._multiTouchAnchorBbox[0],this._multiTouchAnchorBbox[1]],[this._multiTouchAnchorBbox[2],this._multiTouchAnchorBbox[3]]),l=a.geo._distancePointPoint([this._multiTouchCurrentBbox[0],this._multiTouchCurrentBbox[1]],[this._multiTouchCurrentBbox[2],this._multiTouchCurrentBbox[3]]);h=a.geo.center(this._multiTouchCurrentBbox,!0);var m=(l-k)/k;m>0?m*=5:m*=10;var n=m-this._wheelLevel;this._wheelLevel=m;var o=this._getZoomCenterAndSize(this._anchor,n,!1);this._setInteractiveCenterAndSize(o.center,o.pixelSize),this._interactiveTransform(),c=!0,h=a.geo.center(this._multiTouchCurrentBbox,!0)}else h=[b.originalEvent.changedTouches[0].pageX-e.left,b.originalEvent.changedTouches[0].pageY-e.top]}else h=[b.pageX-e.left,b.pageY-e.top];if(h[0]===this._lastMove[0]&&h[1]===this._lastMove[1]&&this._inOp)return b.preventDefault(),c&&this._setInteractiveTimeout(!0),!1;d==7&&(this._isDbltap=this._isTap=!1),this._mouseDown&&(this._current=h,this._moveDate=a.now());if(this._isMultiTouch)return b.preventDefault(),this._isDbltap=this._isTap=!1,c&&this._setInteractiveTimeout(!0),!1;var p=this._options.shift,q=this._shiftDown?p==="default"?"zoom":p:this._options.mode,r,s,t;switch(q){case"zoom":case"dragBox":this._mouseDown?(this._$drawContainer.geographics("clear"),this._$drawContainer.geographics("drawBbox",[this._anchor[0],this._anchor[1],h[0],h[1]])):this._trigger("move",b,{type:"Point",coordinates:this.toMap(h)});break;case"dragCircle":this._mouseDown?(r=h[0]-this._anchor[0],s=h[1]-this._anchor[1],t=Math.sqrt(r*r+s*s)*2,this._$drawContainer.geographics("clear"),this._$drawContainer.geographics("drawArc",this._anchor,0,360,{width:t,height:t})):this._trigger("move",b,{type:"Point",coordinates:this.toMap(h)});break;case"drawLineString":case"drawPolygon":case"measureLength":case"measureArea":this._mouseDown||this._toolPan?(this._panMove(),c=!0):(f>0&&(this._drawCoords[f-1]=this._toMap(h,this._centerInteractive,this._pixelSizeInteractive),this._drawPixels[f-1]=h,this._refreshDrawing()),this._trigger("move",b,{type:"Point",coordinates:this.toMap(h)}));break;default:this._mouseDown||this._toolPan?(this._panMove(),c=!0):this._trigger("move",b,{type:"Point",coordinates:this.toMap(h)})}this._lastMove=h,c&&this._setInteractiveTimeout(!0);if(this._inOp)return b.preventDefault(),!1},_dragTarget_touchstop:function(b){if(this._options.mode==="static")return;if(!this._mouseDown)if(d==7)this._eventTarget_touchstart(b);else return!1;var c=this._clearInteractiveTimeout(),e=this._mouseDown,f=this._toolPan,g=this._$eventTarget.offset(),h=this._options.shift,i=this._shiftDown?h==="default"?"zoom":h:this._options.mode,j,k,l,m,n,o,p;this._supportTouch?(j=[b.originalEvent.changedTouches[0].pageX-g.left,b.originalEvent.changedTouches[0].pageY-g.top],this._multiTouchAnchor=[],this._inOp=!1):j=[b.pageX-g.left,b.pageY-g.top],this._softDblClick&&this._isTap&&(m=j[0]-this._anchor[0],n=j[1]-this._anchor[1],Math.sqrt(m*m+n*n)<=8&&(j=a.merge([],this._anchor))),m=j[0]-this._anchor[0],n=j[1]-this._anchor[1],this._$eventTarget.css("cursor",this._options.cursors[this._options.mode]),this._shiftDown=this._mouseDown=this._toolPan=!1;if(this._isMultiTouch){b.preventDefault(),this._isMultiTouch=!1,this._wheelLevel=0,c&&this._setInteractiveTimeout(!0);return}document.releaseCapture&&document.releaseCapture();if(e){l=a.now(),this._current=j;switch(i){case"zoom":case"dragBox":if(m!==0||n!==0){var q=this._pixelSize*6,r=this._toMap([[Math.min(this._anchor[0],j[0]),Math.max(this._anchor[1],j[1])],[Math.max(this._anchor[0],j[0]),Math.min(this._anchor[1],j[1])]]),s=[r[0][0],r[0][1],r[1][0],r[1][1]];i==="zoom"?(s[2]-s[0]<q&&s[3]-s[1]<q&&(s=a.geo.scaleBy(this._getBbox(a.geo.center(s,!0)),.5,!0)),this._setBbox(s,!0,!0),c=!0):(p=a.geo.polygonize(s,!0),p.bbox=s,this._userGeodetic&&(p.coordinates=a.geo.proj.toGeodetic(p.coordinates),p.bbox=a.geo.proj.toGeodetic(p.bbox)),this._trigger("shape",b,p))}else i==="dragBox"&&(o=this._toMap(j),p={type:"Point",coordinates:[o[0],o[1]],bbox:[o[0],o[1],o[0],o[1]]},this._userGeodetic&&(p.coordinates=a.geo.proj.toGeodetic(p.coordinates),p.bbox=a.geo.proj.toGeodetic(p.bbox)),this._trigger("shape",b,p));this._resetDrawing();break;case"dragCircle":if(m!==0||n!==0){var t=this._options.axisLayout==="image",u=Math.sqrt(m*m+n*n),v=180,w;this._drawPixels.length=v+1;for(k=0;k<v;k++)w=k*360/v*(Math.PI/180),this._drawPixels[k]=[this._anchor[0]+Math.cos(w)*u,this._anchor[1]+Math.sin(w)*u];this._drawPixels[v]=[this._drawPixels[0][0],this._drawPixels[0][1]],o=this._toMap([[this._anchor[0]-u,this._anchor[1]+(t?-u:u)],[this._anchor[0]+u,this._anchor[1]+(t?u:-u)]]),p={type:"Polygon",coordinates:[this._toMap(this._drawPixels)],bbox:[o[0][0],o[0][1],o[1][0],o[1][1]]},this._userGeodetic&&(p.coordinates=a.geo.proj.toGeodetic(p.coordinates),p.bbox=a.geo.proj.toGeodetic(p.bbox)),this._trigger("shape",b,p),this._resetDrawing()}else o=this._toMap(j),p={type:"Point",coordinates:[o[0],o[1]],bbox:[o[0],o[1],o[0],o[1]]},this._userGeodetic&&(p.coordinates=a.geo.proj.toGeodetic(p.coordinates),p.bbox=a.geo.proj.toGeodetic(p.bbox)),this._trigger("shape",b,p);break;case"drawPoint":this._drawTimeout&&(window.clearTimeout(this._drawTimeout),this._drawTimeout=null);if(f)this._panFinalize();else if(l-this._clickDate>100){var x=this;this._drawTimeout=setTimeout(function(){x._drawTimeout&&(x._trigger("shape",b,{type:"Point",coordinates:x.toMap(j)}),x._inOp=!1,x._drawTimeout=null)},250)}break;case"drawLineString":case"drawPolygon":case"measureLength":case"measureArea":if(f)this._panFinalize();else{k=this._drawCoords.length===0?0:this._drawCoords.length-1,this._drawCoords[k]=this._toMap(j),this._drawPixels[k]=j;if(k<2||this._drawCoords[k][0]!=this._drawCoords[k-1][0]||this._drawCoords[k][1]!=this._drawCoords[k-1][1])this._drawCoords[k+1]=this._toMap(j,this._centerInteractive,this._pixelSizeInteractive),this._drawPixels[k+1]=j;this._refreshDrawing()}break;default:f?this._panFinalize():l-this._clickDate>100&&(this._trigger("click",b,{type:"Point",coordinates:this.toMap(j)}),this._inOp=!1)}this._clickDate=l;if(this._softDblClick&&this._isDbltap)return this._isDbltap=this._isTap=!1,c&&this._setInteractiveTimeout(!0),this._$eventTarget.trigger("dblclick",b),!1}c&&this._setInteractiveTimeout(!0);if(this._inOp)return b.preventDefault(),!1},_eventTarget_mousewheel:function(b,c){if(this._options.mode==="static"||this._options.scroll==="off")return;b.preventDefault();if(this._mouseDown)return!1;if(c!==0){this._clearInteractiveTimeout(),c>0?c=Math.ceil(c):c=Math.floor(c);var d=a(b.currentTarget).offset();this._anchor=[b.pageX-d.left,b.pageY-d.top];var e=this._getZoomCenterAndSize(this._anchor,c,this._options.tilingScheme!==null),f,g=0;this._setInteractiveCenterAndSize(e.center,e.pixelSize),this._interactiveTransform(),this._setInteractiveTimeout(!0)}return!1}})}(jQuery),function(a,b){a.geo._serviceTypes.tiled=function(){return{create:function(b,c,d,e){var f=a.data(d,"geoServiceState");if(!f){f={loadCount:0,reloadTiles:!1};var g='<div data-geo-service="tiled" style="-webkit-transform:translateZ(0); position:absolute; left:0; top:0; width:8px; height:8px; margin:0; padding:0;"></div>';c.append(g),f.serviceContainer=c.children(":last"),a.data(d,"geoServiceState",f)}return f.serviceContainer},destroy:function(b,c,d){var e=a.data(d,"geoServiceState");e.serviceContainer.remove(),a.removeData(d,"geoServiceState")},interactiveTransform:function(b,c,d,e){var f=a.data(c,"geoServiceState"),g=b.options.tilingScheme;f&&(this._cancelUnloaded(b,c),f.serviceContainer.children().each(function(c){var f=a(this),h=f.data("pixelSize"),i=h/e;if(h>0){i=Math.round(i*1e3)/1e3;var j=f.data("scaleOrigin"),k=b._toPixel(j,d,e);f.css({left:Math.round(k[0])+"px",top:Math.round(k[1])+"px",width:g.tileWidth*i,height:g.tileHeight*i})}}))},refresh:function(b,c,d){var e=a.data(c,"geoServiceState");this._cancelUnloaded(b,c),e&&d&&(e.reloadTiles=!0);if(e&&c&&c.style.visibility==="visible"&&!e.serviceContainer.is(":hidden")){var f=b._getBbox(),g=b._pixelSize,h=this,i=e.serviceContainer,j=b._getContentBounds(),k=j.width,l=j.height,m=b.options.axisLayout==="image",n=m?1:-1,o=b.options.tilingScheme,p=o.tileWidth,q=o.tileHeight,r=Math.floor((f[0]-o.origin[0])/(g*p)),s=Math.max(Math.floor((m?f[1]-o.origin[1]:o.origin[1]-f[3])/(g*q)),0),t=Math.ceil((f[2]-o.origin[0])/(g*p)),u=Math.ceil((m?f[3]-o.origin[1]:o.origin[1]-f[1])/(g*q)),v=b._getBboxMax(),w=b._getPixelSize(0),x=w/g,y=Math.floor((v[0]-o.origin[0])/(w*p))*x,z=Math.floor((o.origin[1]+n*v[3])/(w*q))*x,A=o.origin[0]+y*p*g,B=o.origin[1]+n*z*q*g,C=Math.round((A-f[0])/g),D=Math.round((m?B-f[1]:f[3]-B)/g),E=i.children().show(),F=E.filter("[data-pixel-size='"+g+"']").appendTo(i),G=c.style.opacity,H,I,J=function(c){h._loadImage(a.data(this,"img"),c,g,b,e,G)},K=function(){a.data(this,"img").remove(),e.loadCount--,b._requestComplete()};e.reloadTiles&&E.find("img").attr("data-dirty","true"),F.size()?(F.css({left:C%p+"px",top:D%q+"px"}).data("scaleOrigin",b._toMap([C%p,D%q])),F.children().each(function(b){var c=a(this),d=c.attr("data-tile").split(",");c.css({left:Math.round((parseInt(d[0],10)-y)*100+(C-C%p)/p*100)+"%",top:Math.round((parseInt(d[1],10)-z)*100+(D-D%q)/q*100)+"%"}),G<1&&c.fadeTo(0,G)})):(i.append("<div style='-webkit-transform:translateZ(0);position:absolute; left:"+C%p+"px; top:"+D%q+"px; width:"+p+"px; height:"+q+"px; margin:0; padding:0;' data-pixel-size='"+g+"'></div>"),F=i.children(":last").data("scaleOrigin",b._toMap([C%p,D%q])));for(H=r;H<t;H++)for(I=s;I<u;I++){var L=""+H+","+I,M=F.children("[data-tile='"+L+"']").removeAttr("data-dirty");if(M.size()===0||e.reloadTiles){var N=[o.origin[0]+H*p*g,o.origin[1]+n*I*q*g],O=[o.origin[0]+((H+1)*p-1)*g,o.origin[1]+n*((I+1)*q-1)*g],P=[N[0],N[1],O[0],O[1]],Q=c.hasOwnProperty("src")?"src":"getUrl",R={bbox:P,width:p,height:q,zoom:b._getZoom(),tile:{row:I,column:H},index:Math.abs(I+H)},S=a.isFunction(c[Q]),T;S?T=c[Q](R):(a.templates("geoSrc",c[Q]),T=a.render.geoSrc(R)),e.loadCount++,b._requestQueued();if(e.reloadTiles&&M.size()>0)M.attr("src",T);else{var U="<img style='-webkit-transform:translateZ(0);position:absolute; left:"+((H-y)*100+(C-C%p)/p*100)+"%; "+"top:"+((I-z)*100+(D-D%q)/q*100)+"%; ";U+="width: 100%; height: 100%;",U+="margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;' unselectable='on' data-tile='"+L+"' />",F.append(U),M=F.children(":last")}typeof T=="string"?h._loadImage(M,T,g,b,e,G):T?(a.data(T,"img",M),T.done(J).fail(K)):M.remove()}}E.find("[data-dirty]").remove(),e.reloadTiles=!1}},resize:function(a,b){},opacity:function(b,c){var d=a.data(c,"geoServiceState");d.serviceContainer.find("img").stop(!0).fadeTo("fast",c.style.opacity)},toggle:function(b,c){var d=a.data(c,"geoServiceState");d.serviceContainer.css("display",c.style.visibility==="visible"?"block":"none")},_cancelUnloaded:function(b,c){var d=a.data(c,"geoServiceState");if(d&&d.loadCount>0){d.serviceContainer.find("img:hidden").remove();while(d.loadCount>0)d.loadCount--,b._requestComplete()}},_loadImage:function(b,c,d,e,f,g){var h=f.serviceContainer;b.load(function(b){g<1?a(b.target).fadeTo(0,g):a(b.target).show(),f.loadCount--,e._requestComplete(),f.loadCount<=0&&(h.children(":not([data-pixel-size='"+d+"'])").remove(),f.loadCount=0)}).error(function(b){a(b.target).remove(),f.loadCount--,e._requestComplete(),f.loadCount<=0&&(h.children(":not([data-pixel-size='"+d+"'])").remove(),f.loadCount=0)}).attr("src",c)}}}()}(jQuery),function(a,b){a.geo._serviceTypes.shingled=function(){return{create:function(b,c,d,e){var f=a.data(d,"geoServiceState");if(!f){f={loadCount:0};var g='<div data-geo-service="shingled" style="-webkit-transform:translateZ(0);position:absolute; left:0; top:0; width:16px; height:16px; margin:0; padding:0;"></div>';c.append(g),f.serviceContainer=c.children(":last"),a.data(d,"geoServiceState",f)}return f.serviceContainer},destroy:function(b,c,d){var e=a.data(d,"geoServiceState");e.serviceContainer.remove(),a.removeData(d,"geoServiceState")},interactiveTransform:function(b,c,d,e){var f=a.data(c,"geoServiceState"),g=b._getContentBounds(),h=g.width,i=g.height,j=h/2,k=i/2,l=[d[0]-j,d[1]-k,d[0]+j,d[1]+k];f&&(this._cancelUnloaded(b,c),f.serviceContainer.children().each(function(c){var f=a(this),g=f.data("pixelSize"),j=g/e;if(g>0){j=Math.round(j*1e3)/1e3;var k=f.data("origin"),l=b._toPixel(k,d,e);f.css({left:Math.round(l[0]),top:Math.round(l[1]),width:h*j,height:i*j})}}))},refresh:function(b,c){var d=a.data(c,"geoServiceState");this._cancelUnloaded(b,c);if(d&&c&&c.style.visibility==="visible"&&!d.serviceContainer.is(":hidden")){var e=b._getBbox(),f=b._pixelSize,g=this,h=d.serviceContainer,i=b._getContentBounds(),j=i.width,k=i.height,l=h.children('[data-pixel-size="'+f+'"]'),m=c.style.opacity,n;m<1&&h.find("img").attr("data-keep-alive","0"),l.size()||(h.append('<div style="-webkit-transform:translateZ(0);position:absolute; left:0px; top: 0px; width:'+j+"px; height:"+k+'px; margin:0; padding:0;" data-pixel-size="'+f+'" data-origin="['+b._toMap([0,0])+']"></div>'),l=h.children(":last"));var o=c.hasOwnProperty("src")?"src":"getUrl",p={bbox:e,width:j,height:k,zoom:b._getZoom(),tile:null,index:0},q=a.isFunction(c[o]),r,s=l.position();s.left=-s.left,s.top=-s.top,q?r=c[o](p):(a.templates("geoSrc",c[o]),r=a.render.geoSrc(p)),d.loadCount++,b._requestQueued(),l.append('<img style="-webkit-transform:translateZ(0);position:absolute; left:'+s.left/l.width()*100+"%; top:"+s.top/l.height()*100+'%; width:100%; height:100%; margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;" unselectable="on" />'),n=l.children(":last").data("center",b._center),typeof r=="string"?g._loadImage(n,r,f,b,d,m):r.done(function(a){g._loadImage(n,a,f,b,d,m)}).fail(function(){n.remove(),d.loadCount--,b._requestComplete()})}},resize:function(b,c){var d=a.data(c,"geoServiceState");if(d&&c&&c.style.visibility==="visible"){this._cancelUnloaded(b,c);var e=d.serviceContainer,f=b._getContentBounds(),g=f.width,h=f.height,i=e.children();i.attr("data-pixel-size","0"),i.each(function(c){var d=a(this),e=d.position(),f=d.data("origin"),i=b._toPixel(f);d.css({left:e.left+(g-d.width())/2,top:e.top+(h-d.height())/2})})}},opacity:function(b,c){var d=a.data(c,"geoServiceState");d.serviceContainer.find("img").stop(!0).fadeTo("fast",c.style.opacity)},toggle:function(b,c){var d=a.data(c,"geoServiceState");d.serviceContainer.css("display",c.style.visibility==="visible"?"block":"none")},_cancelUnloaded:function(b,c){var d=a.data(c,"geoServiceState");if(d&&d.loadCount>0){d.serviceContainer.find("img:hidden").remove();while(d.loadCount>0)d.loadCount--,b._requestComplete()}},_loadImage:function(b,c,d,e,f,g){var h=f.serviceContainer;b.load(function(b){if(!a.contains(document.body,b.target.jquery?b.target[0]:b.target))return;g<1?a(b.target).fadeTo(0,g):a(b.target).show(),f.loadCount--,e._requestComplete(),f.loadCount<=0&&(h.children(':not([data-pixel-size="'+d+'"])').remove(),h.find("img[data-keep-alive]").remove(),f.loadCount=0)}).error(function(b){if(!a.contains(document.body,b.target.jquery?b.target[0]:b.target))return;a(b.target).remove(),f.loadCount--,e._requestComplete(),f.loadCount<=0&&(h.children(":not([data-pixel-size='"+d+"'])").remove(),f.loadCount=0)}).attr("src",c)}}}()}(jQuery);
\ No newline at end of file
diff --git a/libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0b1.js b/libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0b1.js
deleted file mode 100755 (executable)
index 6a8c9c3..0000000
+++ /dev/null
@@ -1,6943 +0,0 @@
-/*! jQuery Geo - v1.0b1.0.1 - 2012-08-01
- * http://jquerygeo.com
- * Copyright (c) 2012 Ryan Westphal/Applied Geographics, Inc.; Licensed MIT, GPL */
-
-// Copyright 2006 Google Inc.
-//
-// 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.
-
-
-// Known Issues:
-//
-// * Patterns only support repeat.
-// * Radial gradient are not implemented. The VML version of these look very
-//   different from the canvas one.
-// * Clipping paths are not implemented.
-// * Coordsize. The width and height attribute have higher priority than the
-//   width and height style values which isn't correct.
-// * Painting mode isn't implemented.
-// * Canvas width/height should is using content-box by default. IE in
-//   Quirks mode will draw the canvas using border-box. Either change your
-//   doctype to HTML5
-//   (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype)
-//   or use Box Sizing Behavior from WebFX
-//   (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html)
-// * Non uniform scaling does not correctly scale strokes.
-// * Optimize. There is always room for speed improvements.
-
-// Only add this code if we do not already have a canvas implementation
-if (!document.createElement('canvas').getContext) {
-
-  (function () {
-
-    // alias some functions to make (compiled) code shorter
-    var m = Math;
-    var mr = m.round;
-    var ms = m.sin;
-    var mc = m.cos;
-    var abs = m.abs;
-    var sqrt = m.sqrt;
-
-    // this is used for sub pixel precision
-    var Z = 10;
-    var Z2 = Z / 2;
-
-    var IE_VERSION = +navigator.userAgent.match(/MSIE ([\d.]+)?/)[1];
-
-    /**
-    * This funtion is assigned to the <canvas> elements as element.getContext().
-    * @this {HTMLElement}
-    * @return {CanvasRenderingContext2D_}
-    */
-    function getContext() {
-      return this.context_ ||
-        (this.context_ = new CanvasRenderingContext2D_(this));
-    }
-
-    var slice = Array.prototype.slice;
-
-    /**
-    * Binds a function to an object. The returned function will always use the
-    * passed in {@code obj} as {@code this}.
-    *
-    * Example:
-    *
-    *   g = bind(f, obj, a, b)
-    *   g(c, d) // will do f.call(obj, a, b, c, d)
-    *
-    * @param {Function} f The function to bind the object to
-    * @param {Object} obj The object that should act as this when the function
-    *     is called
-    * @param {*} var_args Rest arguments that will be used as the initial
-    *     arguments when the function is called
-    * @return {Function} A new function that has bound this
-    */
-    function bind(f, obj, var_args) {
-      var a = slice.call(arguments, 2);
-      return function () {
-        return f.apply(obj, a.concat(slice.call(arguments)));
-      };
-    }
-
-    function encodeHtmlAttribute(s) {
-      return String(s).replace(/&/g, '&amp;').replace(/"/g, '&quot;');
-    }
-
-    function addNamespace(doc, prefix, urn) {
-      if (!doc.namespaces[prefix]) {
-        doc.namespaces.add(prefix, urn, '#default#VML');
-      }
-    }
-
-    function addNamespacesAndStylesheet(doc) {
-      addNamespace(doc, 'g_vml_', 'urn:schemas-microsoft-com:vml');
-      addNamespace(doc, 'g_o_', 'urn:schemas-microsoft-com:office:office');
-
-      // Setup default CSS.  Only add one style sheet per document
-      if (!doc.styleSheets['ex_canvas_']) {
-        var ss = doc.createStyleSheet();
-        ss.owningElement.id = 'ex_canvas_';
-        ss.cssText = 'canvas{display:inline-block;overflow:hidden;' +
-        // default size is 300x150 in Gecko and Opera
-          'text-align:left;width:300px;height:150px}';
-      }
-    }
-
-    // Add namespaces and stylesheet at startup.
-    addNamespacesAndStylesheet(document);
-
-    var G_vmlCanvasManager_ = {
-      init: function (opt_doc) {
-        var doc = opt_doc || document;
-        // Create a dummy element so that IE will allow canvas elements to be
-        // recognized.
-        doc.createElement('canvas');
-        doc.attachEvent('onreadystatechange', bind(this.init_, this, doc));
-      },
-
-      init_: function (doc) {
-        // find all canvas elements
-        var els = doc.getElementsByTagName('canvas');
-        for (var i = 0; i < els.length; i++) {
-          this.initElement(els[i]);
-        }
-      },
-
-      /**
-      * Public initializes a canvas element so that it can be used as canvas
-      * element from now on. This is called automatically before the page is
-      * loaded but if you are creating elements using createElement you need to
-      * make sure this is called on the element.
-      * @param {HTMLElement} el The canvas element to initialize.
-      * @return {HTMLElement} the element that was created.
-      */
-      initElement: function (el) {
-        if (!el.getContext) {
-          el.getContext = getContext;
-
-          // Add namespaces and stylesheet to document of the element.
-          addNamespacesAndStylesheet(el.ownerDocument);
-
-          // Remove fallback content. There is no way to hide text nodes so we
-          // just remove all childNodes. We could hide all elements and remove
-          // text nodes but who really cares about the fallback content.
-          el.innerHTML = '';
-
-          // do not use inline function because that will leak memory
-          el.attachEvent('onpropertychange', onPropertyChange);
-          el.attachEvent('onresize', onResize);
-
-          var attrs = el.attributes;
-          if (attrs.width && attrs.width.specified) {
-            // TODO: use runtimeStyle and coordsize
-            // el.getContext().setWidth_(attrs.width.nodeValue);
-            el.style.width = attrs.width.nodeValue + 'px';
-          } else {
-            el.width = el.clientWidth;
-          }
-          if (attrs.height && attrs.height.specified) {
-            // TODO: use runtimeStyle and coordsize
-            // el.getContext().setHeight_(attrs.height.nodeValue);
-            el.style.height = attrs.height.nodeValue + 'px';
-          } else {
-            el.height = el.clientHeight;
-          }
-          //el.getContext().setCoordsize_()
-        }
-        return el;
-      }
-    };
-
-    function onPropertyChange(e) {
-      var el = e.srcElement;
-
-      switch (e.propertyName) {
-        case 'width':
-          el.getContext().clearRect();
-          el.style.width = el.attributes.width.nodeValue + 'px';
-          // In IE8 this does not trigger onresize.
-          el.firstChild.style.width = el.clientWidth + 'px';
-          break;
-        case 'height':
-          el.getContext().clearRect();
-          el.style.height = el.attributes.height.nodeValue + 'px';
-          el.firstChild.style.height = el.clientHeight + 'px';
-          break;
-      }
-    }
-
-    function onResize(e) {
-      var el = e.srcElement;
-      if (el.firstChild) {
-        el.firstChild.style.width = el.clientWidth + 'px';
-        el.firstChild.style.height = el.clientHeight + 'px';
-      }
-    }
-
-    G_vmlCanvasManager_.init();
-
-    // precompute "00" to "FF"
-    var decToHex = [];
-    for (var i = 0; i < 16; i++) {
-      for (var j = 0; j < 16; j++) {
-        decToHex[i * 16 + j] = i.toString(16) + j.toString(16);
-      }
-    }
-
-    function createMatrixIdentity() {
-      return [
-      [1, 0, 0],
-      [0, 1, 0],
-      [0, 0, 1]
-    ];
-    }
-
-    function matrixMultiply(m1, m2) {
-      var result = createMatrixIdentity();
-
-      for (var x = 0; x < 3; x++) {
-        for (var y = 0; y < 3; y++) {
-          var sum = 0;
-
-          for (var z = 0; z < 3; z++) {
-            sum += m1[x][z] * m2[z][y];
-          }
-
-          result[x][y] = sum;
-        }
-      }
-      return result;
-    }
-
-    function copyState(o1, o2) {
-      o2.fillStyle     = o1.fillStyle;
-      o2.lineCap       = o1.lineCap;
-      o2.lineJoin      = o1.lineJoin;
-      o2.lineWidth     = o1.lineWidth;
-      o2.miterLimit    = o1.miterLimit;
-      o2.shadowBlur    = o1.shadowBlur;
-      o2.shadowColor   = o1.shadowColor;
-      o2.shadowOffsetX = o1.shadowOffsetX;
-      o2.shadowOffsetY = o1.shadowOffsetY;
-      o2.strokeStyle   = o1.strokeStyle;
-      o2.globalAlpha   = o1.globalAlpha;
-      o2.font          = o1.font;
-      o2.textAlign     = o1.textAlign;
-      o2.textBaseline  = o1.textBaseline;
-      o2.arcScaleX_    = o1.arcScaleX_;
-      o2.arcScaleY_    = o1.arcScaleY_;
-      o2.lineScale_    = o1.lineScale_;
-    }
-
-    //  var colorData = {
-    //    aliceblue: '#F0F8FF',
-    //    antiquewhite: '#FAEBD7',
-    //    aquamarine: '#7FFFD4',
-    //    azure: '#F0FFFF',
-    //    beige: '#F5F5DC',
-    //    bisque: '#FFE4C4',
-    //    black: '#000000',
-    //    blanchedalmond: '#FFEBCD',
-    //    blueviolet: '#8A2BE2',
-    //    brown: '#A52A2A',
-    //    burlywood: '#DEB887',
-    //    cadetblue: '#5F9EA0',
-    //    chartreuse: '#7FFF00',
-    //    chocolate: '#D2691E',
-    //    coral: '#FF7F50',
-    //    cornflowerblue: '#6495ED',
-    //    cornsilk: '#FFF8DC',
-    //    crimson: '#DC143C',
-    //    cyan: '#00FFFF',
-    //    darkblue: '#00008B',
-    //    darkcyan: '#008B8B',
-    //    darkgoldenrod: '#B8860B',
-    //    darkgray: '#A9A9A9',
-    //    darkgreen: '#006400',
-    //    darkgrey: '#A9A9A9',
-    //    darkkhaki: '#BDB76B',
-    //    darkmagenta: '#8B008B',
-    //    darkolivegreen: '#556B2F',
-    //    darkorange: '#FF8C00',
-    //    darkorchid: '#9932CC',
-    //    darkred: '#8B0000',
-    //    darksalmon: '#E9967A',
-    //    darkseagreen: '#8FBC8F',
-    //    darkslateblue: '#483D8B',
-    //    darkslategray: '#2F4F4F',
-    //    darkslategrey: '#2F4F4F',
-    //    darkturquoise: '#00CED1',
-    //    darkviolet: '#9400D3',
-    //    deeppink: '#FF1493',
-    //    deepskyblue: '#00BFFF',
-    //    dimgray: '#696969',
-    //    dimgrey: '#696969',
-    //    dodgerblue: '#1E90FF',
-    //    firebrick: '#B22222',
-    //    floralwhite: '#FFFAF0',
-    //    forestgreen: '#228B22',
-    //    gainsboro: '#DCDCDC',
-    //    ghostwhite: '#F8F8FF',
-    //    gold: '#FFD700',
-    //    goldenrod: '#DAA520',
-    //    grey: '#808080',
-    //    greenyellow: '#ADFF2F',
-    //    honeydew: '#F0FFF0',
-    //    hotpink: '#FF69B4',
-    //    indianred: '#CD5C5C',
-    //    indigo: '#4B0082',
-    //    ivory: '#FFFFF0',
-    //    khaki: '#F0E68C',
-    //    lavender: '#E6E6FA',
-    //    lavenderblush: '#FFF0F5',
-    //    lawngreen: '#7CFC00',
-    //    lemonchiffon: '#FFFACD',
-    //    lightblue: '#ADD8E6',
-    //    lightcoral: '#F08080',
-    //    lightcyan: '#E0FFFF',
-    //    lightgoldenrodyellow: '#FAFAD2',
-    //    lightgreen: '#90EE90',
-    //    lightgrey: '#D3D3D3',
-    //    lightpink: '#FFB6C1',
-    //    lightsalmon: '#FFA07A',
-    //    lightseagreen: '#20B2AA',
-    //    lightskyblue: '#87CEFA',
-    //    lightslategray: '#778899',
-    //    lightslategrey: '#778899',
-    //    lightsteelblue: '#B0C4DE',
-    //    lightyellow: '#FFFFE0',
-    //    limegreen: '#32CD32',
-    //    linen: '#FAF0E6',
-    //    magenta: '#FF00FF',
-    //    mediumaquamarine: '#66CDAA',
-    //    mediumblue: '#0000CD',
-    //    mediumorchid: '#BA55D3',
-    //    mediumpurple: '#9370DB',
-    //    mediumseagreen: '#3CB371',
-    //    mediumslateblue: '#7B68EE',
-    //    mediumspringgreen: '#00FA9A',
-    //    mediumturquoise: '#48D1CC',
-    //    mediumvioletred: '#C71585',
-    //    midnightblue: '#191970',
-    //    mintcream: '#F5FFFA',
-    //    mistyrose: '#FFE4E1',
-    //    moccasin: '#FFE4B5',
-    //    navajowhite: '#FFDEAD',
-    //    oldlace: '#FDF5E6',
-    //    olivedrab: '#6B8E23',
-    //    orange: '#FFA500',
-    //    orangered: '#FF4500',
-    //    orchid: '#DA70D6',
-    //    palegoldenrod: '#EEE8AA',
-    //    palegreen: '#98FB98',
-    //    paleturquoise: '#AFEEEE',
-    //    palevioletred: '#DB7093',
-    //    papayawhip: '#FFEFD5',
-    //    peachpuff: '#FFDAB9',
-    //    peru: '#CD853F',
-    //    pink: '#FFC0CB',
-    //    plum: '#DDA0DD',
-    //    powderblue: '#B0E0E6',
-    //    rosybrown: '#BC8F8F',
-    //    royalblue: '#4169E1',
-    //    saddlebrown: '#8B4513',
-    //    salmon: '#FA8072',
-    //    sandybrown: '#F4A460',
-    //    seagreen: '#2E8B57',
-    //    seashell: '#FFF5EE',
-    //    sienna: '#A0522D',
-    //    skyblue: '#87CEEB',
-    //    slateblue: '#6A5ACD',
-    //    slategray: '#708090',
-    //    slategrey: '#708090',
-    //    snow: '#FFFAFA',
-    //    springgreen: '#00FF7F',
-    //    steelblue: '#4682B4',
-    //    tan: '#D2B48C',
-    //    thistle: '#D8BFD8',
-    //    tomato: '#FF6347',
-    //    turquoise: '#40E0D0',
-    //    violet: '#EE82EE',
-    //    wheat: '#F5DEB3',
-    //    whitesmoke: '#F5F5F5',
-    //    yellowgreen: '#9ACD32'
-    //  };
-
-
-    function getRgbHslContent(styleString) {
-      var start = styleString.indexOf('(', 3);
-      var end = styleString.indexOf(')', start + 1);
-      var parts = styleString.substring(start + 1, end).split(',');
-      // add alpha if needed
-      if (parts.length != 4 || styleString.charAt(3) != 'a') {
-        parts[3] = 1;
-      }
-      return parts;
-    }
-
-    function percent(s) {
-      return parseFloat(s) / 100;
-    }
-
-    function clamp(v, min, max) {
-      return Math.min(max, Math.max(min, v));
-    }
-
-    function hslToRgb(parts) {
-      var r, g, b, h, s, l;
-      h = parseFloat(parts[0]) / 360 % 360;
-      if (h < 0)
-        h++;
-      s = clamp(percent(parts[1]), 0, 1);
-      l = clamp(percent(parts[2]), 0, 1);
-      if (s == 0) {
-        r = g = b = l; // achromatic
-      } else {
-        var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
-        var p = 2 * l - q;
-        r = hueToRgb(p, q, h + 1 / 3);
-        g = hueToRgb(p, q, h);
-        b = hueToRgb(p, q, h - 1 / 3);
-      }
-
-      return '#' + decToHex[Math.floor(r * 255)] +
-        decToHex[Math.floor(g * 255)] +
-        decToHex[Math.floor(b * 255)];
-    }
-
-    function hueToRgb(m1, m2, h) {
-      if (h < 0)
-        h++;
-      if (h > 1)
-        h--;
-
-      if (6 * h < 1)
-        return m1 + (m2 - m1) * 6 * h;
-      else if (2 * h < 1)
-        return m2;
-      else if (3 * h < 2)
-        return m1 + (m2 - m1) * (2 / 3 - h) * 6;
-      else
-        return m1;
-    }
-
-    var processStyleCache = {};
-
-    function processStyle(styleString) {
-      if (styleString in processStyleCache) {
-        return processStyleCache[styleString];
-      }
-
-      var str, alpha = 1;
-
-      styleString = String(styleString);
-      if (styleString.charAt(0) == '#') {
-        str = styleString;
-      } else if (/^rgb/.test(styleString)) {
-        var parts = getRgbHslContent(styleString);
-        var str = '#', n;
-        for (var i = 0; i < 3; i++) {
-          if (parts[i].indexOf('%') != -1) {
-            n = Math.floor(percent(parts[i]) * 255);
-          } else {
-            n = +parts[i];
-          }
-          str += decToHex[clamp(n, 0, 255)];
-        }
-        alpha = +parts[3];
-      } else if (/^hsl/.test(styleString)) {
-        var parts = getRgbHslContent(styleString);
-        str = hslToRgb(parts);
-        alpha = parts[3];
-      } else {
-        str = /*colorData[styleString] ||*/styleString;
-      }
-      return processStyleCache[styleString] = { color: str, alpha: alpha };
-    }
-
-    var DEFAULT_STYLE = {
-      style: 'normal',
-      variant: 'normal',
-      weight: 'normal',
-      size: 10,
-      family: 'sans-serif'
-    };
-
-    // Internal text style cache
-    //  var fontStyleCache = {};
-
-    //  function processFontStyle(styleString) {
-    //    if (fontStyleCache[styleString]) {
-    //      return fontStyleCache[styleString];
-    //    }
-
-    //    var el = document.createElement('div');
-    //    var style = el.style;
-    //    try {
-    //      style.font = styleString;
-    //    } catch (ex) {
-    //      // Ignore failures to set to invalid font.
-    //    }
-
-    //    return fontStyleCache[styleString] = {
-    //      style: style.fontStyle || DEFAULT_STYLE.style,
-    //      variant: style.fontVariant || DEFAULT_STYLE.variant,
-    //      weight: style.fontWeight || DEFAULT_STYLE.weight,
-    //      size: style.fontSize || DEFAULT_STYLE.size,
-    //      family: style.fontFamily || DEFAULT_STYLE.family
-    //    };
-    //  }
-
-    //  function getComputedStyle(style, element) {
-    //    var computedStyle = {};
-
-    //    for (var p in style) {
-    //      computedStyle[p] = style[p];
-    //    }
-
-    //    // Compute the size
-    //    var canvasFontSize = parseFloat(element.currentStyle.fontSize),
-    //        fontSize = parseFloat(style.size);
-
-    //    if (typeof style.size == 'number') {
-    //      computedStyle.size = style.size;
-    //    } else if (style.size.indexOf('px') != -1) {
-    //      computedStyle.size = fontSize;
-    //    } else if (style.size.indexOf('em') != -1) {
-    //      computedStyle.size = canvasFontSize * fontSize;
-    //    } else if(style.size.indexOf('%') != -1) {
-    //      computedStyle.size = (canvasFontSize / 100) * fontSize;
-    //    } else if (style.size.indexOf('pt') != -1) {
-    //      computedStyle.size = fontSize / .75;
-    //    } else {
-    //      computedStyle.size = canvasFontSize;
-    //    }
-
-    //    // Different scaling between normal text and VML text. This was found using
-    //    // trial and error to get the same size as non VML text.
-    //    computedStyle.size *= 0.981;
-
-    //    return computedStyle;
-    //  }
-
-    //  function buildStyle(style) {
-    //    return style.style + ' ' + style.variant + ' ' + style.weight + ' ' +
-    //        style.size + 'px ' + style.family;
-    //  }
-
-    var lineCapMap = {
-      'butt': 'flat',
-      'round': 'round'
-    };
-
-    function processLineCap(lineCap) {
-      return lineCapMap[lineCap] || 'square';
-    }
-
-    /**
-    * This class implements CanvasRenderingContext2D interface as described by
-    * the WHATWG.
-    * @param {HTMLElement} canvasElement The element that the 2D context should
-    * be associated with
-    */
-    function CanvasRenderingContext2D_(canvasElement) {
-      this.m_ = createMatrixIdentity();
-
-      this.mStack_ = [];
-      this.aStack_ = [];
-      this.currentPath_ = [];
-
-      // Canvas context properties
-      this.strokeStyle = '#000';
-      this.fillStyle = '#000';
-
-      this.lineWidth = 1;
-      this.lineJoin = 'miter';
-      this.lineCap = 'butt';
-      this.miterLimit = Z * 1;
-      this.globalAlpha = 1;
-      //this.font = '10px sans-serif';
-      //this.textAlign = 'left';
-      //this.textBaseline = 'alphabetic';
-      this.canvas = canvasElement;
-
-      var cssText = 'width:' + canvasElement.clientWidth + 'px;height:' +
-        canvasElement.clientHeight + 'px;overflow:hidden;position:absolute';
-      var el = canvasElement.ownerDocument.createElement('div');
-      el.style.cssText = cssText;
-      canvasElement.appendChild(el);
-
-      var overlayEl = el.cloneNode(false);
-      // Use a non transparent background.
-      overlayEl.style.backgroundColor = 'red';
-      overlayEl.style.filter = 'alpha(opacity=0)';
-      canvasElement.appendChild(overlayEl);
-
-      this.element_ = el;
-      this.arcScaleX_ = 1;
-      this.arcScaleY_ = 1;
-      this.lineScale_ = 1;
-    }
-
-    var contextPrototype = CanvasRenderingContext2D_.prototype;
-    contextPrototype.clearRect = function () {
-      if (this.textMeasureEl_) {
-        this.textMeasureEl_.removeNode(true);
-        this.textMeasureEl_ = null;
-      }
-      this.element_.innerHTML = '';
-    };
-
-    contextPrototype.beginPath = function () {
-      // TODO: Branch current matrix so that save/restore has no effect
-      //       as per safari docs.
-      this.currentPath_ = [];
-    };
-
-    contextPrototype.moveTo = function (aX, aY) {
-      var p = getCoords(this, aX, aY);
-      this.currentPath_.push({ type: 'moveTo', x: p.x, y: p.y });
-      this.currentX_ = p.x;
-      this.currentY_ = p.y;
-    };
-
-    contextPrototype.lineTo = function (aX, aY) {
-      var p = getCoords(this, aX, aY);
-      this.currentPath_.push({ type: 'lineTo', x: p.x, y: p.y });
-
-      this.currentX_ = p.x;
-      this.currentY_ = p.y;
-    };
-
-    contextPrototype.bezierCurveTo = function(aCP1x, aCP1y,
-                                              aCP2x, aCP2y,
-                                              aX, aY) {
-      var p = getCoords(this, aX, aY);
-      var cp1 = getCoords(this, aCP1x, aCP1y);
-      var cp2 = getCoords(this, aCP2x, aCP2y);
-      bezierCurveTo(this, cp1, cp2, p);
-    };
-
-    // Helper function that takes the already fixed cordinates.
-    function bezierCurveTo(self, cp1, cp2, p) {
-      self.currentPath_.push({
-        type: 'bezierCurveTo',
-        cp1x: cp1.x,
-        cp1y: cp1.y,
-        cp2x: cp2.x,
-        cp2y: cp2.y,
-        x: p.x,
-        y: p.y
-      });
-      self.currentX_ = p.x;
-      self.currentY_ = p.y;
-    }
-
-    contextPrototype.quadraticCurveTo = function(aCPx, aCPy, aX, aY) {
-      // the following is lifted almost directly from
-      // http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes
-
-      var cp = getCoords(this, aCPx, aCPy);
-      var p = getCoords(this, aX, aY);
-
-      var cp1 = {
-        x: this.currentX_ + 2.0 / 3.0 * (cp.x - this.currentX_),
-        y: this.currentY_ + 2.0 / 3.0 * (cp.y - this.currentY_)
-      };
-      var cp2 = {
-        x: cp1.x + (p.x - this.currentX_) / 3.0,
-        y: cp1.y + (p.y - this.currentY_) / 3.0
-      };
-
-      bezierCurveTo(this, cp1, cp2, p);
-    };
-
-    contextPrototype.arc = function (aX, aY, aRadius,
-                                  aStartAngle, aEndAngle, aClockwise) {
-      aRadius *= Z;
-      var arcType = aClockwise ? 'at' : 'wa';
-
-      var xStart = aX + mc(aStartAngle) * aRadius - Z2;
-      var yStart = aY + ms(aStartAngle) * aRadius - Z2;
-
-      var xEnd = aX + mc(aEndAngle) * aRadius - Z2;
-      var yEnd = aY + ms(aEndAngle) * aRadius - Z2;
-
-      // IE won't render arches drawn counter clockwise if xStart == xEnd.
-      if (xStart == xEnd && !aClockwise) {
-        xStart += 0.125; // Offset xStart by 1/80 of a pixel. Use something
-        // that can be represented in binary
-      }
-
-      var p = getCoords(this, aX, aY);
-      var pStart = getCoords(this, xStart, yStart);
-      var pEnd = getCoords(this, xEnd, yEnd);
-
-      this.currentPath_.push({ type: arcType,
-        x: p.x,
-        y: p.y,
-        radius: aRadius,
-        xStart: pStart.x,
-        yStart: pStart.y,
-        xEnd: pEnd.x,
-        yEnd: pEnd.y
-      });
-
-    };
-
-    //  contextPrototype.rect = function(aX, aY, aWidth, aHeight) {
-    //    this.moveTo(aX, aY);
-    //    this.lineTo(aX + aWidth, aY);
-    //    this.lineTo(aX + aWidth, aY + aHeight);
-    //    this.lineTo(aX, aY + aHeight);
-    //    this.closePath();
-    //  };
-
-    //  contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) {
-    //    var oldPath = this.currentPath_;
-    //    this.beginPath();
-
-    //    this.moveTo(aX, aY);
-    //    this.lineTo(aX + aWidth, aY);
-    //    this.lineTo(aX + aWidth, aY + aHeight);
-    //    this.lineTo(aX, aY + aHeight);
-    //    this.closePath();
-    //    this.stroke();
-
-    //    this.currentPath_ = oldPath;
-    //  };
-
-    //  contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) {
-    //    var oldPath = this.currentPath_;
-    //    this.beginPath();
-
-    //    this.moveTo(aX, aY);
-    //    this.lineTo(aX + aWidth, aY);
-    //    this.lineTo(aX + aWidth, aY + aHeight);
-    //    this.lineTo(aX, aY + aHeight);
-    //    this.closePath();
-    //    this.fill();
-
-    //    this.currentPath_ = oldPath;
-    //  };
-
-    //  contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) {
-    //    var gradient = new CanvasGradient_('gradient');
-    //    gradient.x0_ = aX0;
-    //    gradient.y0_ = aY0;
-    //    gradient.x1_ = aX1;
-    //    gradient.y1_ = aY1;
-    //    return gradient;
-    //  };
-
-    //  contextPrototype.createRadialGradient = function(aX0, aY0, aR0,
-    //                                                   aX1, aY1, aR1) {
-    //    var gradient = new CanvasGradient_('gradientradial');
-    //    gradient.x0_ = aX0;
-    //    gradient.y0_ = aY0;
-    //    gradient.r0_ = aR0;
-    //    gradient.x1_ = aX1;
-    //    gradient.y1_ = aY1;
-    //    gradient.r1_ = aR1;
-    //    return gradient;
-    //  };
-
-    //  contextPrototype.drawImage = function(image, var_args) {
-    //    var dx, dy, dw, dh, sx, sy, sw, sh;
-
-    //    // to find the original width we overide the width and height
-    //    var oldRuntimeWidth = image.runtimeStyle.width;
-    //    var oldRuntimeHeight = image.runtimeStyle.height;
-    //    image.runtimeStyle.width = 'auto';
-    //    image.runtimeStyle.height = 'auto';
-
-    //    // get the original size
-    //    var w = image.width;
-    //    var h = image.height;
-
-    //    // and remove overides
-    //    image.runtimeStyle.width = oldRuntimeWidth;
-    //    image.runtimeStyle.height = oldRuntimeHeight;
-
-    //    if (arguments.length == 3) {
-    //      dx = arguments[1];
-    //      dy = arguments[2];
-    //      sx = sy = 0;
-    //      sw = dw = w;
-    //      sh = dh = h;
-    //    } else if (arguments.length == 5) {
-    //      dx = arguments[1];
-    //      dy = arguments[2];
-    //      dw = arguments[3];
-    //      dh = arguments[4];
-    //      sx = sy = 0;
-    //      sw = w;
-    //      sh = h;
-    //    } else if (arguments.length == 9) {
-    //      sx = arguments[1];
-    //      sy = arguments[2];
-    //      sw = arguments[3];
-    //      sh = arguments[4];
-    //      dx = arguments[5];
-    //      dy = arguments[6];
-    //      dw = arguments[7];
-    //      dh = arguments[8];
-    //    } else {
-    //      throw Error('Invalid number of arguments');
-    //    }
-
-    //    var d = getCoords(this, dx, dy);
-
-    //    var w2 = sw / 2;
-    //    var h2 = sh / 2;
-
-    //    var vmlStr = [];
-
-    //    var W = 10;
-    //    var H = 10;
-
-    //    // For some reason that I've now forgotten, using divs didn't work
-    //    vmlStr.push(' <g_vml_:group',
-    //                ' coordsize="', Z * W, ',', Z * H, '"',
-    //                ' coordorigin="0,0"' ,
-    //                ' style="width:', W, 'px;height:', H, 'px;position:absolute;');
-
-    //    // If filters are necessary (rotation exists), create them
-    //    // filters are bog-slow, so only create them if abbsolutely necessary
-    //    // The following check doesn't account for skews (which don't exist
-    //    // in the canvas spec (yet) anyway.
-
-    //    if (this.m_[0][0] != 1 || this.m_[0][1] ||
-    //        this.m_[1][1] != 1 || this.m_[1][0]) {
-    //      var filter = [];
-
-    //      // Note the 12/21 reversal
-    //      filter.push('M11=', this.m_[0][0], ',',
-    //                  'M12=', this.m_[1][0], ',',
-    //                  'M21=', this.m_[0][1], ',',
-    //                  'M22=', this.m_[1][1], ',',
-    //                  'Dx=', mr(d.x / Z), ',',
-    //                  'Dy=', mr(d.y / Z), '');
-
-    //      // Bounding box calculation (need to minimize displayed area so that
-    //      // filters don't waste time on unused pixels.
-    //      var max = d;
-    //      var c2 = getCoords(this, dx + dw, dy);
-    //      var c3 = getCoords(this, dx, dy + dh);
-    //      var c4 = getCoords(this, dx + dw, dy + dh);
-
-    //      max.x = m.max(max.x, c2.x, c3.x, c4.x);
-    //      max.y = m.max(max.y, c2.y, c3.y, c4.y);
-
-    //      vmlStr.push('padding:0 ', mr(max.x / Z), 'px ', mr(max.y / Z),
-    //                  'px 0;filter:progid:DXImageTransform.Microsoft.Matrix(',
-    //                  filter.join(''), ", sizingmethod='clip');");
-
-    //    } else {
-    //      vmlStr.push('top:', mr(d.y / Z), 'px;left:', mr(d.x / Z), 'px;');
-    //    }
-
-    //    vmlStr.push(' ">' ,
-    //                '<g_vml_:image src="', image.src, '"',
-    //                ' style="width:', Z * dw, 'px;',
-    //                ' height:', Z * dh, 'px"',
-    //                ' cropleft="', sx / w, '"',
-    //                ' croptop="', sy / h, '"',
-    //                ' cropright="', (w - sx - sw) / w, '"',
-    //                ' cropbottom="', (h - sy - sh) / h, '"',
-    //                ' />',
-    //                '</g_vml_:group>');
-
-    //    this.element_.insertAdjacentHTML('BeforeEnd', vmlStr.join(''));
-    //  };
-
-    contextPrototype.stroke = function (aFill) {
-      var lineStr = [];
-      var lineOpen = false;
-
-      var W = 10;
-      var H = 10;
-
-      lineStr.push('<g_vml_:shape',
-                 ' filled="', !!aFill, '"',
-                 ' style="position:absolute;width:', W, 'px;height:', H, 'px;"',
-                 ' coordorigin="0,0"',
-                 ' coordsize="', Z * W, ',', Z * H, '"',
-                 ' stroked="', !aFill, '"',
-                 ' path="');
-
-      var newSeq = false;
-      var min = { x: null, y: null };
-      var max = { x: null, y: null };
-
-      for (var i = 0; i < this.currentPath_.length; i++) {
-        var p = this.currentPath_[i];
-        var c;
-
-        switch (p.type) {
-          case 'moveTo':
-            c = p;
-            lineStr.push(' m ', mr(p.x), ',', mr(p.y));
-            break;
-          case 'lineTo':
-            lineStr.push(' l ', mr(p.x), ',', mr(p.y));
-            break;
-          case 'close':
-            lineStr.push(' x ');
-            p = null;
-            break;
-          case 'bezierCurveTo':
-            lineStr.push(' c ',
-                       mr(p.cp1x), ',', mr(p.cp1y), ',',
-                       mr(p.cp2x), ',', mr(p.cp2y), ',',
-                       mr(p.x), ',', mr(p.y));
-            break;
-          case 'at':
-          case 'wa':
-            lineStr.push(' ', p.type, ' ',
-                       mr(p.x - this.arcScaleX_ * p.radius), ',',
-                       mr(p.y - this.arcScaleY_ * p.radius), ' ',
-                       mr(p.x + this.arcScaleX_ * p.radius), ',',
-                       mr(p.y + this.arcScaleY_ * p.radius), ' ',
-                       mr(p.xStart), ',', mr(p.yStart), ' ',
-                       mr(p.xEnd), ',', mr(p.yEnd));
-            break;
-        }
-
-
-        // TODO: Following is broken for curves due to
-        //       move to proper paths.
-
-        // Figure out dimensions so we can do gradient fills
-        // properly
-        if (p) {
-          if (min.x == null || p.x < min.x) {
-            min.x = p.x;
-          }
-          if (max.x == null || p.x > max.x) {
-            max.x = p.x;
-          }
-          if (min.y == null || p.y < min.y) {
-            min.y = p.y;
-          }
-          if (max.y == null || p.y > max.y) {
-            max.y = p.y;
-          }
-        }
-      }
-      lineStr.push(' ">');
-
-      if (!aFill) {
-        appendStroke(this, lineStr);
-      } else {
-        appendFill(this, lineStr, min, max);
-      }
-
-      lineStr.push('</g_vml_:shape>');
-
-      this.element_.insertAdjacentHTML('beforeEnd', lineStr.join(''));
-    };
-
-    function appendStroke(ctx, lineStr) {
-      var a = processStyle(ctx.strokeStyle);
-      var color = a.color;
-      var opacity = a.alpha * ctx.globalAlpha;
-      var lineWidth = ctx.lineScale_ * ctx.lineWidth;
-
-      // VML cannot correctly render a line if the width is less than 1px.
-      // In that case, we dilute the color to make the line look thinner.
-      if (lineWidth < 1) {
-        opacity *= lineWidth;
-      }
-
-      lineStr.push(
-      '<g_vml_:stroke',
-      ' opacity="', opacity, '"',
-      ' joinstyle="', ctx.lineJoin, '"',
-      ' miterlimit="', ctx.miterLimit, '"',
-      ' endcap="', processLineCap(ctx.lineCap), '"',
-      ' weight="', lineWidth, 'px"',
-      ' color="', color, '" />'
-    );
-    }
-
-    function appendFill(ctx, lineStr, min, max) {
-      var fillStyle = ctx.fillStyle;
-      var arcScaleX = ctx.arcScaleX_;
-      var arcScaleY = ctx.arcScaleY_;
-      var width = max.x - min.x;
-      var height = max.y - min.y;
-      //    if (fillStyle instanceof CanvasGradient_) {
-      //      // TODO: Gradients transformed with the transformation matrix.
-      //      var angle = 0;
-      //      var focus = {x: 0, y: 0};
-
-      //      // additional offset
-      //      var shift = 0;
-      //      // scale factor for offset
-      //      var expansion = 1;
-
-      //      if (fillStyle.type_ == 'gradient') {
-      //        var x0 = fillStyle.x0_ / arcScaleX;
-      //        var y0 = fillStyle.y0_ / arcScaleY;
-      //        var x1 = fillStyle.x1_ / arcScaleX;
-      //        var y1 = fillStyle.y1_ / arcScaleY;
-      //        var p0 = getCoords(ctx, x0, y0);
-      //        var p1 = getCoords(ctx, x1, y1);
-      //        var dx = p1.x - p0.x;
-      //        var dy = p1.y - p0.y;
-      //        angle = Math.atan2(dx, dy) * 180 / Math.PI;
-
-      //        // The angle should be a non-negative number.
-      //        if (angle < 0) {
-      //          angle += 360;
-      //        }
-
-      //        // Very small angles produce an unexpected result because they are
-      //        // converted to a scientific notation string.
-      //        if (angle < 1e-6) {
-      //          angle = 0;
-      //        }
-      //      } else {
-      //        var p0 = getCoords(ctx, fillStyle.x0_, fillStyle.y0_);
-      //        focus = {
-      //          x: (p0.x - min.x) / width,
-      //          y: (p0.y - min.y) / height
-      //        };
-
-      //        width  /= arcScaleX * Z;
-      //        height /= arcScaleY * Z;
-      //        var dimension = m.max(width, height);
-      //        shift = 2 * fillStyle.r0_ / dimension;
-      //        expansion = 2 * fillStyle.r1_ / dimension - shift;
-      //      }
-
-      //      // We need to sort the color stops in ascending order by offset,
-      //      // otherwise IE won't interpret it correctly.
-      //      var stops = fillStyle.colors_;
-      //      stops.sort(function(cs1, cs2) {
-      //        return cs1.offset - cs2.offset;
-      //      });
-
-      //      var length = stops.length;
-      //      var color1 = stops[0].color;
-      //      var color2 = stops[length - 1].color;
-      //      var opacity1 = stops[0].alpha * ctx.globalAlpha;
-      //      var opacity2 = stops[length - 1].alpha * ctx.globalAlpha;
-
-      //      var colors = [];
-      //      for (var i = 0; i < length; i++) {
-      //        var stop = stops[i];
-      //        colors.push(stop.offset * expansion + shift + ' ' + stop.color);
-      //      }
-
-      //      // When colors attribute is used, the meanings of opacity and o:opacity2
-      //      // are reversed.
-      //      lineStr.push('<g_vml_:fill type="', fillStyle.type_, '"',
-      //                   ' method="none" focus="100%"',
-      //                   ' color="', color1, '"',
-      //                   ' color2="', color2, '"',
-      //                   ' colors="', colors.join(','), '"',
-      //                   ' opacity="', opacity2, '"',
-      //                   ' g_o_:opacity2="', opacity1, '"',
-      //                   ' angle="', angle, '"',
-      //                   ' focusposition="', focus.x, ',', focus.y, '" />');
-      //    } else if (fillStyle instanceof CanvasPattern_) {
-      //      if (width && height) {
-      //        var deltaLeft = -min.x;
-      //        var deltaTop = -min.y;
-      //        lineStr.push('<g_vml_:fill',
-      //                     ' position="',
-      //                     deltaLeft / width * arcScaleX * arcScaleX, ',',
-      //                     deltaTop / height * arcScaleY * arcScaleY, '"',
-      //                     ' type="tile"',
-      //                     // TODO: Figure out the correct size to fit the scale.
-      //                     //' size="', w, 'px ', h, 'px"',
-      //                     ' src="', fillStyle.src_, '" />');
-      //       }
-      //    } else {
-      var a = processStyle(ctx.fillStyle);
-      var color = a.color;
-      var opacity = a.alpha * ctx.globalAlpha;
-      lineStr.push('<g_vml_:fill color="', color, '" opacity="', opacity,
-                   '" />');
-      //     }
-    }
-
-    contextPrototype.fill = function () {
-      this.stroke(true);
-    };
-
-    contextPrototype.closePath = function () {
-      this.currentPath_.push({ type: 'close' });
-    };
-
-    function getCoords(ctx, aX, aY) {
-      var m = ctx.m_;
-      return {
-        x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2,
-        y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2
-      };
-    };
-
-    contextPrototype.save = function () {
-      var o = {};
-      copyState(this, o);
-      this.aStack_.push(o);
-      this.mStack_.push(this.m_);
-      this.m_ = matrixMultiply(createMatrixIdentity(), this.m_);
-    };
-
-    contextPrototype.restore = function () {
-      if (this.aStack_.length) {
-        copyState(this.aStack_.pop(), this);
-        this.m_ = this.mStack_.pop();
-      }
-    };
-
-    function matrixIsFinite(m) {
-      return isFinite(m[0][0]) && isFinite(m[0][1]) &&
-        isFinite(m[1][0]) && isFinite(m[1][1]) &&
-        isFinite(m[2][0]) && isFinite(m[2][1]);
-    }
-
-    function setM(ctx, m, updateLineScale) {
-      if (!matrixIsFinite(m)) {
-        return;
-      }
-      ctx.m_ = m;
-
-      if (updateLineScale) {
-        // Get the line scale.
-        // Determinant of this.m_ means how much the area is enlarged by the
-        // transformation. So its square root can be used as a scale factor
-        // for width.
-        var det = m[0][0] * m[1][1] - m[0][1] * m[1][0];
-        ctx.lineScale_ = sqrt(abs(det));
-      }
-    }
-
-    contextPrototype.translate = function (aX, aY) {
-      var m1 = [
-      [1, 0, 0],
-      [0, 1, 0],
-      [aX, aY, 1]
-    ];
-
-      setM(this, matrixMultiply(m1, this.m_), false);
-    };
-
-    //  contextPrototype.rotate = function(aRot) {
-    //    var c = mc(aRot);
-    //    var s = ms(aRot);
-
-    //    var m1 = [
-    //      [c,  s, 0],
-    //      [-s, c, 0],
-    //      [0,  0, 1]
-    //    ];
-
-    //    setM(this, matrixMultiply(m1, this.m_), false);
-    //  };
-
-    contextPrototype.scale = function (aX, aY) {
-      this.arcScaleX_ *= aX;
-      this.arcScaleY_ *= aY;
-      var m1 = [
-      [aX, 0, 0],
-      [0, aY, 0],
-      [0, 0, 1]
-    ];
-
-      setM(this, matrixMultiply(m1, this.m_), true);
-    };
-
-    //  contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) {
-    //    var m1 = [
-    //      [m11, m12, 0],
-    //      [m21, m22, 0],
-    //      [dx,  dy,  1]
-    //    ];
-
-    //    setM(this, matrixMultiply(m1, this.m_), true);
-    //  };
-
-    //  contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) {
-    //    var m = [
-    //      [m11, m12, 0],
-    //      [m21, m22, 0],
-    //      [dx,  dy,  1]
-    //    ];
-
-    //    setM(this, m, true);
-    //  };
-
-    /**
-    * The text drawing function.
-    * The maxWidth argument isn't taken in account, since no browser supports
-    * it yet.
-    */
-    //  contextPrototype.drawText_ = function(text, x, y, maxWidth, stroke) {
-    //    var m = this.m_,
-    //        delta = 1000,
-    //        left = 0,
-    //        right = delta,
-    //        offset = {x: 0, y: 0},
-    //        lineStr = [];
-
-    //    var fontStyle = getComputedStyle(processFontStyle(this.font),
-    //                                     this.element_);
-
-    //    var fontStyleString = buildStyle(fontStyle);
-
-    //    var elementStyle = this.element_.currentStyle;
-    //    var textAlign = this.textAlign.toLowerCase();
-    //    switch (textAlign) {
-    //      case 'left':
-    //      case 'center':
-    //      case 'right':
-    //        break;
-    //      case 'end':
-    //        textAlign = elementStyle.direction == 'ltr' ? 'right' : 'left';
-    //        break;
-    //      case 'start':
-    //        textAlign = elementStyle.direction == 'rtl' ? 'right' : 'left';
-    //        break;
-    //      default:
-    //        textAlign = 'left';
-    //    }
-
-    //    // 1.75 is an arbitrary number, as there is no info about the text baseline
-    //    switch (this.textBaseline) {
-    //      case 'hanging':
-    //      case 'top':
-    //        offset.y = fontStyle.size / 1.75;
-    //        break;
-    //      case 'middle':
-    //        break;
-    //      default:
-    //      case null:
-    //      case 'alphabetic':
-    //      case 'ideographic':
-    //      case 'bottom':
-    //        offset.y = -fontStyle.size / 2.25;
-    //        break;
-    //    }
-
-    //    switch(textAlign) {
-    //      case 'right':
-    //        left = delta;
-    //        right = 0.05;
-    //        break;
-    //      case 'center':
-    //        left = right = delta / 2;
-    //        break;
-    //    }
-
-    //    var d = getCoords(this, x + offset.x, y + offset.y);
-
-    //    lineStr.push('<g_vml_:line from="', -left ,' 0" to="', right ,' 0.05" ',
-    //                 ' coordsize="100 100" coordorigin="0 0"',
-    //                 ' filled="', !stroke, '" stroked="', !!stroke,
-    //                 '" style="position:absolute;width:1px;height:1px;">');
-
-    //    if (stroke) {
-    //      appendStroke(this, lineStr);
-    //    } else {
-    //      // TODO: Fix the min and max params.
-    //      appendFill(this, lineStr, {x: -left, y: 0},
-    //                 {x: right, y: fontStyle.size});
-    //    }
-
-    //    var skewM = m[0][0].toFixed(3) + ',' + m[1][0].toFixed(3) + ',' +
-    //                m[0][1].toFixed(3) + ',' + m[1][1].toFixed(3) + ',0,0';
-
-    //    var skewOffset = mr(d.x / Z) + ',' + mr(d.y / Z);
-
-    //    lineStr.push('<g_vml_:skew on="t" matrix="', skewM ,'" ',
-    //                 ' offset="', skewOffset, '" origin="', left ,' 0" />',
-    //                 '<g_vml_:path textpathok="true" />',
-    //                 '<g_vml_:textpath on="true" string="',
-    //                 encodeHtmlAttribute(text),
-    //                 '" style="v-text-align:', textAlign,
-    //                 ';font:', encodeHtmlAttribute(fontStyleString),
-    //                 '" /></g_vml_:line>');
-
-    //    this.element_.insertAdjacentHTML('beforeEnd', lineStr.join(''));
-    //  };
-
-    //  contextPrototype.fillText = function(text, x, y, maxWidth) {
-    //    this.drawText_(text, x, y, maxWidth, false);
-    //  };
-
-    //  contextPrototype.strokeText = function(text, x, y, maxWidth) {
-    //    this.drawText_(text, x, y, maxWidth, true);
-    //  };
-
-    //  contextPrototype.measureText = function(text) {
-    //    if (!this.textMeasureEl_) {
-    //      var s = '<span style="position:absolute;' +
-    //          'top:-20000px;left:0;padding:0;margin:0;border:none;' +
-    //          'white-space:pre;"></span>';
-    //      this.element_.insertAdjacentHTML('beforeEnd', s);
-    //      this.textMeasureEl_ = this.element_.lastChild;
-    //    }
-    //    var doc = this.element_.ownerDocument;
-    //    this.textMeasureEl_.innerHTML = '';
-    //    this.textMeasureEl_.style.font = this.font;
-    //    // Don't use innerHTML or innerText because they allow markup/whitespace.
-    //    this.textMeasureEl_.appendChild(doc.createTextNode(text));
-    //    return {width: this.textMeasureEl_.offsetWidth};
-    //  };
-
-    /******** STUBS ********/
-    //  contextPrototype.clip = function() {
-    //    // TODO: Implement
-    //  };
-
-    //  contextPrototype.arcTo = function() {
-    //    // TODO: Implement
-    //  };
-
-    //  contextPrototype.createPattern = function(image, repetition) {
-    //    return new CanvasPattern_(image, repetition);
-    //  };
-
-    //  // Gradient / Pattern Stubs
-    //  function CanvasGradient_(aType) {
-    //    this.type_ = aType;
-    //    this.x0_ = 0;
-    //    this.y0_ = 0;
-    //    this.r0_ = 0;
-    //    this.x1_ = 0;
-    //    this.y1_ = 0;
-    //    this.r1_ = 0;
-    //    this.colors_ = [];
-    //  }
-
-    //  CanvasGradient_.prototype.addColorStop = function(aOffset, aColor) {
-    //    aColor = processStyle(aColor);
-    //    this.colors_.push({offset: aOffset,
-    //                       color: aColor.color,
-    //                       alpha: aColor.alpha});
-    //  };
-
-    //  function CanvasPattern_(image, repetition) {
-    //    assertImageIsValid(image);
-    //    switch (repetition) {
-    //      case 'repeat':
-    //      case null:
-    //      case '':
-    //        this.repetition_ = 'repeat';
-    //        break
-    //      case 'repeat-x':
-    //      case 'repeat-y':
-    //      case 'no-repeat':
-    //        this.repetition_ = repetition;
-    //        break;
-    //      default:
-    //        throwException('SYNTAX_ERR');
-    //    }
-
-    //    this.src_ = image.src;
-    //    this.width_ = image.width;
-    //    this.height_ = image.height;
-    //  }
-
-    function throwException(s) {
-      throw new DOMException_(s);
-    }
-
-    //  function assertImageIsValid(img) {
-    //    if (!img || img.nodeType != 1 || img.tagName != 'IMG') {
-    //      throwException('TYPE_MISMATCH_ERR');
-    //    }
-    //    if (img.readyState != 'complete') {
-    //      throwException('INVALID_STATE_ERR');
-    //    }
-    //  }
-
-    function DOMException_(s) {
-      this.code = this[s];
-      this.message = s + ': DOM Exception ' + this.code;
-    }
-    var p = DOMException_.prototype = new Error;
-    p.INDEX_SIZE_ERR = 1;
-    p.DOMSTRING_SIZE_ERR = 2;
-    p.HIERARCHY_REQUEST_ERR = 3;
-    p.WRONG_DOCUMENT_ERR = 4;
-    p.INVALID_CHARACTER_ERR = 5;
-    p.NO_DATA_ALLOWED_ERR = 6;
-    p.NO_MODIFICATION_ALLOWED_ERR = 7;
-    p.NOT_FOUND_ERR = 8;
-    p.NOT_SUPPORTED_ERR = 9;
-    p.INUSE_ATTRIBUTE_ERR = 10;
-    p.INVALID_STATE_ERR = 11;
-    p.SYNTAX_ERR = 12;
-    p.INVALID_MODIFICATION_ERR = 13;
-    p.NAMESPACE_ERR = 14;
-    p.INVALID_ACCESS_ERR = 15;
-    p.VALIDATION_ERR = 16;
-    p.TYPE_MISMATCH_ERR = 17;
-
-    // set up externs
-    G_vmlCanvasManager = G_vmlCanvasManager_;
-    CanvasRenderingContext2D = CanvasRenderingContext2D_;
-    //CanvasGradient = CanvasGradient_;
-    //CanvasPattern = CanvasPattern_;
-    DOMException = DOMException_;
-  })();
-
-} // if
-
-/*! JsRender v1.0pre: http://github.com/BorisMoore/jsrender */
-/*
- * Optimized version of jQuery Templates, for rendering to string.
- * Does not require jQuery, or HTML DOM
- * Integrates with JsViews (http://github.com/BorisMoore/jsviews)
- * Copyright 2012, Boris Moore
- * Released under the MIT License.
- */
-// informal pre beta commit counter: 3
-
-this.jsviews || this.jQuery && jQuery.views || (function( window, undefined ) {
-
-//========================== Top-level vars ==========================
-
-var versionNumber = "v1.0pre",
-
-       $, rTag, rTmplString, extend,
-       sub = {},
-       FALSE = false, TRUE = true,
-       jQuery = window.jQuery,
-
-       rPath = /^(?:null|true|false|\d[\d.]*|([\w$]+|~([\w$]+)|#(view|([\w$]+))?)([\w$.]*?)(?:[.[]([\w$]+)\]?)?|(['"]).*\8)$/g,
-       //                                 nil    object   helper    view  viewProperty pathTokens   leafToken     string
-
-       rParams = /(\()(?=|\s*\()|(?:([([])\s*)?(?:([#~]?[\w$.]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*!:?\/]|(=))\s*|([#~]?[\w$.]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*([)\]])([([]?))|(\s+)/g,
-       //          lftPrn        lftPrn2                path    operator err                                                eq         path2       prn    comma   lftPrn2   apos quot        rtPrn   prn2   space
-       // (left paren? followed by (path? followed by operator) or (path followed by paren?)) or comma or apos or quot or right paren or space
-
-    rNewLine = /\r?\n/g,
-       rUnescapeQuotes = /\\(['"])/g,
-       rEscapeQuotes = /\\?(['"])/g,
-       rBuildHash = /\x08(~)?([^\x08]+)\x08/g,
-
-       autoViewKey = 0,
-       autoTmplName = 0,
-       escapeMapForHtml = {
-               "&": "&amp;",
-               "<": "&lt;",
-               ">": "&gt;"
-       },
-       tmplAttr = "data-jsv-tmpl",
-       fnDeclStr = "var j=j||" + (jQuery ? "jQuery." : "js") + "views,",
-       htmlSpecialChar = /[\x00"&'<>]/g,
-       slice = Array.prototype.slice,
-
-       render = {},
-
-       // jsviews object ($.views if jQuery is loaded)
-       jsv = {
-               jsviews: versionNumber,
-               sub: sub, // subscription, e.g. JsViews integration
-               debugMode: TRUE,
-               err: function( e ) {
-                       return jsv.debugMode ? ("<br/><b>Error:</b> <em> " + (e.message || e) + ". </em>") : '""';
-               },
-               tmplFn: tmplFn,
-               render: render,
-               templates: templates,
-               tags: tags,
-               helpers: helpers,
-               converters: converters,
-               View: View,
-               convert: convert,
-               delimiters: setDelimiters,
-               tag: renderTag
-       };
-
-//========================== Top-level functions ==========================
-
-//===================
-// jsviews.delimiters
-//===================
-
-function setDelimiters( openChars, closeChars ) {
-       // Set the tag opening and closing delimiters. Default is "{{" and "}}"
-       // openChar, closeChars: opening and closing strings, each with two characters
-       var firstOpenChar = "\\" + openChars.charAt( 0 ), // Escape the characters - since they could be regex special characters
-               secondOpenChar = "\\" + openChars.charAt( 1 ),
-               firstCloseChar = "\\" + closeChars.charAt( 0 ),
-               secondCloseChar = "\\" + closeChars.charAt( 1 );
-       // Build regex with new delimiters
-       jsv.rTag = rTag // make rTag available to JsViews (or other components) for parsing binding expressions
-               = secondOpenChar
-                       //          tag    (followed by / space or })   or  colon     or  html or code
-               + "(?:(?:(\\w+(?=[\\/\\s" + firstCloseChar + "]))|(?:(\\w+)?(:)|(>)|(\\*)))"
-               //     params
-               + "\\s*((?:[^" + firstCloseChar + "]|" + firstCloseChar + "(?!" + secondCloseChar + "))*?)"
-               //  slash or closeBlock
-               + "(\\/)?|(?:\\/(\\w+)))"
-       //  }}
-       + firstCloseChar;
-
-       // Default rTag:    tag          converter colon  html  code     params         slash   closeBlock
-       //          /{{(?:(?:(\w+(?=[\/\s\}]))|(?:(\w+)?(:)|(>)|(\*)))\s*((?:[^}]|}(?!\}))*?)(\/)?|(?:\/(\w+)))}}
-
-       //      /{{(?:(?:(\w+(?=[\/!\s\}!]))|(?:(\w+)?(:)|(>)|(\*)))((?:[^\}]|}(?!}))*?)(\/)?|(?:\/(\w+)))}}/g;
-       rTag = new RegExp( firstOpenChar + rTag + secondCloseChar, "g" );
-       rTmplString = new RegExp( "<.*>|" + openChars + ".*" + closeChars );
-       return this;
-}
-
-//=================
-// View.hlp
-//=================
-
-function getHelper( helper ) {
-       // Helper method called as view.hlp() from compiled template, for helper functions or template parameters ~foo
-       var view = this,
-       tmplHelpers = view.tmpl.helpers || {};
-       helper = (view.ctx[ helper ] !== undefined ? view.ctx : tmplHelpers[ helper ] !== undefined ? tmplHelpers : helpers[ helper ] !== undefined ? helpers : {})[ helper ];
-       return typeof helper !== "function" ? helper : function() {
-               return helper.apply(view, arguments);
-       };
-}
-
-//=================
-// jsviews.convert
-//=================
-
-function convert( converter, view, text ) {
-       var tmplConverters = view.tmpl.converters;
-       converter = tmplConverters && tmplConverters[ converter ] || converters[ converter ];
-       return converter ? converter.call( view, text ) : text;
-}
-
-//=================
-// jsviews.tag
-//=================
-
-function renderTag( tag, parentView, converter, content, tagObject ) {
-       // Called from within compiled template function, to render a nested tag
-       // Returns the rendered tag
-       tagObject.props = tagObject.props || {};
-       var ret,
-               tmpl = tagObject.props.tmpl,
-               tmplTags = parentView.tmpl.tags,
-               nestedTemplates = parentView.tmpl.templates,
-               args = arguments,
-               tagFn = tmplTags && tmplTags[ tag ] || tags[ tag ];
-
-       if ( !tagFn ) {
-               return "";
-       }
-       // Set the tmpl property to the content of the block tag, unless set as an override property on the tag
-       content = content && parentView.tmpl.tmpls[ content - 1 ];
-       tmpl = tmpl || content || undefined;
-       tagObject.tmpl =
-               "" + tmpl === tmpl // if a string
-                       ? nestedTemplates && nestedTemplates[ tmpl ] || templates[ tmpl ] || templates( tmpl )
-                       : tmpl;
-
-       tagObject.isTag = TRUE;
-       tagObject.converter = converter;
-       tagObject.view = parentView;
-       tagObject.renderContent = renderContent;
-       if ( parentView.ctx ) {
-               extend( tagObject.ctx, parentView.ctx);
-       }
-
-       ret = tagFn.apply( tagObject, args.length > 5 ? slice.call( args, 5 ) : [] );
-       return ret || ( ret == undefined ? "" : ret.toString()); // (If ret is the value 0 or false, will render to string)
-}
-
-//=================
-// View constructor
-//=================
-
-function View( context, path, parentView, data, template, index ) {
-       // Constructor for view object in view hierarchy. (Augmented by JsViews if JsViews is loaded)
-       var views = parentView.views,
-//     TODO: add this, as part of smart re-linking on existing content ($.link method), or remove completely
-//                     self = parentView.views[ index ];
-//                     if ( !self ) { ... }
-               self = {
-                       tmpl: template,
-                       path: path,
-                       parent: parentView,
-                       data: data,
-                       ctx: context,
-                       views: $.isArray( data ) ? [] : {},
-                       hlp: getHelper
-               };
-
-       if ( $.isArray( views ))  {
-               views.splice(
-                       self.index = index !== undefined
-                               ? index
-                               : views.length, 0, self
-               );
-       } else {
-               views[ self.index = "_" + autoViewKey++ ] = self;
-       }
-       return self;
-}
-
-//=================
-// Registration
-//=================
-
-function addToStore( self, store, name, item, process ) {
-       // Add item to named store such as templates, helpers, converters...
-       var key, onStore;
-       if ( name && typeof name === "object" && !name.nodeType ) {
-               // If name is a map, iterate over map and call store for key
-               for ( key in name ) {
-                       store( key, name[ key ]);
-               }
-               return self;
-       }
-       if ( !name || item === undefined ) {
-               if ( process ) {
-                       item = process( undefined, item || name );
-               }
-       } else if ( "" + name === name ) { // name must be a string
-               if ( item === null ) {
-                       // If item is null, delete this entry
-                       delete store[name];
-               } else if ( item = process ? process( name, item ) : item ) {
-                       store[ name ] = item;
-               }
-       }
-       if ( onStore = sub.onStoreItem ) {
-               // e.g. JsViews integration
-               onStore( store, name, item, process );
-       }
-       return item;
-}
-
-function templates( name, tmpl ) {
-       // Register templates
-       // Setter: Use $.view.tags( name, tagFn ) or $.view.tags({ name: tagFn, ... }) to add additional tags to the registered tags collection.
-       // Getter: Use var tagFn = $.views.tags( name ) or $.views.tags[name] or $.views.tags.name to return the function for the registered tag.
-       // Remove: Use $.view.tags( name, null ) to remove a registered tag from $.view.tags.
-
-       // When registering for {{foo a b c==d e=f}}, tagFn should be a function with the signature:
-       // function(a,b). The 'this' pointer will be a hash with properties c and e.
-       return addToStore( this, templates, name, tmpl, compile );
-}
-
-function tags( name, tagFn ) {
-       // Register template tags
-       // Setter: Use $.view.tags( name, tagFn ) or $.view.tags({ name: tagFn, ... }) to add additional tags to the registered tags collection.
-       // Getter: Use var tagFn = $.views.tags( name ) or $.views.tags[name] or $.views.tags.name to return the function for the registered tag.
-       // Remove: Use $.view.tags( name, null ) to remove a registered tag from $.view.tags.
-
-       // When registering for {{foo a b c==d e=f}}, tagFn should be a function with the signature:
-       // function(a,b). The 'this' pointer will be a hash with properties c and e.
-       return addToStore( this, tags, name, tagFn );
-}
-
-function helpers( name, helperFn ) {
-       // Register helper functions for use in templates (or in data-link expressions if JsViews is loaded)
-       // Setter: Use $.view.helpers( name, helperFn ) or $.view.helpers({ name: helperFn, ... }) to add additional helpers to the registered helpers collection.
-       // Getter: Use var helperFn = $.views.helpers( name ) or $.views.helpers[name] or $.views.helpers.name to return the function.
-       // Remove: Use $.view.helpers( name, null ) to remove a registered helper function from $.view.helpers.
-       // Within a template, access the helper using the syntax: {{... ~myHelper(...) ...}}.
-       return addToStore( this, helpers, name, helperFn );
-}
-
-function converters( name, converterFn ) {
-       // Register converter functions for use in templates (or in data-link expressions if JsViews is loaded)
-       // Setter: Use $.view.converters( name, converterFn ) or $.view.converters({ name: converterFn, ... }) to add additional converters to the registered converters collection.
-       // Getter: Use var converterFn = $.views.converters( name ) or $.views.converters[name] or $.views.converters.name to return the converter function.
-       // Remove: Use $.view.converters( name, null ) to remove a registered converter from $.view.converters.
-       // Within a template, access the converter using the syntax: {{myConverter:...}}.
-       return addToStore( this, converters, name, converterFn );
-}
-
-//=================
-// renderContent
-//=================
-
-function renderContent( data, context, parentView, path, index ) {
-       // Render template against data as a tree of subviews (nested template), or as a string (top-level template).
-       // tagName parameter for internal use only. Used for rendering templates registered as tags (which may have associated presenter objects)
-       var i, l, dataItem, newView, itemWrap, itemsWrap, itemResult, parentContext, tmpl, layout,
-               props = {},
-               swapContent = index === TRUE,
-               self = this,
-               result = "";
-
-       if ( self.isTag ) {
-               // This is a call from renderTag
-               tmpl = self.tmpl;
-               context = context || self.ctx;
-               parentView = parentView || self.view;
-               path = path || self.path;
-               index = index || self.index;
-               props = self.props;
-       } else {
-               tmpl = self.jquery && self[0] // This is a call $.fn.render
-                       || self; // This is a call from tmpl.render
-       }
-       parentView = parentView || jsv.topView;
-       parentContext = parentView.ctx;
-       layout = tmpl.layout;
-       if ( data === parentView ) {
-               // Inherit the data from the parent view.
-               // This may be the contents of an {{if}} block
-               data = parentView.data;
-               layout = TRUE;
-       }
-
-       // Set additional context on views created here, (as modified context inherited from the parent, and be inherited by child views)
-       // Note: If no jQuery, extend does not support chained copies - so limit extend() to two parameters
-       context = (context && context === parentContext)
-               ? parentContext
-               : (parentContext
-                       // if parentContext, make copy
-                       ? ((parentContext = extend( {}, parentContext ), context)
-                               // If context, merge context with copied parentContext
-                               ? extend( parentContext, context )
-                               : parentContext)
-                       // if no parentContext, use context, or default to {}
-                       : context || {});
-
-       if ( props.link === FALSE ) {
-               // Override inherited value of link by an explicit setting in props: link=false
-               // The child views of an unlinked view are also unlinked. So setting child back to true will not have any effect.
-               context.link = FALSE;
-       }
-       if ( !tmpl.fn ) {
-               tmpl = templates[ tmpl ] || templates( tmpl );
-       }
-       itemWrap = context.link && sub.onRenderItem;
-       itemsWrap = context.link && sub.onRenderItems;
-
-       if ( tmpl ) {
-               if ( $.isArray( data ) && !layout ) {
-                       // Create a view for the array, whose child views correspond to each data item.
-                       // (Note: if index and parentView are passed in along with parent view, treat as
-                       // insert -e.g. from view.addViews - so parentView is already the view item for array)
-                       newView = swapContent ? parentView : (index !== undefined && parentView) || View( context, path, parentView, data, tmpl, index );
-
-                       for ( i = 0, l = data.length; i < l; i++ ) {
-                               // Create a view for each data item.
-                               dataItem = data[ i ];
-                               itemResult = tmpl.fn( dataItem, View( context, path, newView, dataItem, tmpl, (index||0) + i ), jsv );
-                               result += itemWrap ? itemWrap( itemResult, props ) : itemResult;
-                       }
-               } else {
-                       // Create a view for singleton data object.
-                       newView = swapContent ? parentView : View( context, path, parentView, data, tmpl, index );
-                       result += (data || layout) ? tmpl.fn( data, newView, jsv ) : "";
-               }
-               parentView.topKey = newView.index;
-               return itemsWrap ? itemsWrap( result, path, newView.index, tmpl, props ) : result;
-       }
-       return ""; // No tmpl. Could throw...
-}
-
-//===========================
-// Build and compile template
-//===========================
-
-// Generate a reusable function that will serve to render a template against data
-// (Compile AST then build template function)
-
-function syntaxError() {
-       throw "Syntax error";
-}
-
-function tmplFn( markup, tmpl, bind ) {
-       // Compile markup to AST (abtract syntax tree) then build the template function code from the AST nodes
-       // Used for compiling templates, and also by JsViews to build functions for data link expressions
-       var newNode, node, i, l, code, hasTag, hasEncoder, getsValue, hasConverter, hasViewPath, tag, converter, params, hash, nestedTmpl, allowCode,
-               tmplOptions = tmpl ? {
-                       allowCode: allowCode = tmpl.allowCode,
-                       debug: tmpl.debug
-               } : {},
-               nested = tmpl && tmpl.tmpls,
-               astTop = [],
-               loc = 0,
-               stack = [],
-               content = astTop,
-               current = [,,,astTop],
-               nestedIndex = 0;
-
-       //==== nested functions ====
-       function pushPreceedingContent( shift ) {
-               shift -= loc;
-               if ( shift ) {
-                       content.push( markup.substr( loc, shift ).replace( rNewLine, "\\n" ));
-               }
-       }
-
-       function parseTag( all, tagName, converter, colon, html, code, params, slash, closeBlock, index ) {
-               //                  tag           converter colon  html  code     params         slash   closeBlock
-               //      /{{(?:(?:(\w+(?=[\/!\s\}!]))|(?:(\w+)?(:)|(?:(>)|(\*)))((?:[^\}]|}(?!}))*?)(\/)?|(?:\/(\w+)))}}/g;
-               // Build abstract syntax tree (AST): [ tagName, converter, params, content, hash, contentMarkup ]
-               if ( html ) {
-                       colon = ":";
-                       converter = "html";
-               }
-               var hash = "",
-                       passedCtx = "",
-                       block = !slash && !colon; // Block tag if not self-closing and not {{:}} or {{>}} (special case)
-
-               //==== nested helper function ====
-
-               tagName = tagName || colon;
-               pushPreceedingContent( index );
-               loc = index + all.length; // location marker - parsed up to here
-               if ( code ) {
-                       if ( allowCode ) {
-                               content.push([ "*", params.replace( rUnescapeQuotes, "$1" ) ]);
-                       }
-               } else if ( tagName ) {
-                       if ( tagName === "else" ) {
-                               current[ 5 ] = markup.substring( current[ 5 ], index ); // contentMarkup for block tag
-                               current = stack.pop();
-                               content = current[ 3 ];
-                               block = TRUE;
-                       }
-                       params = (params
-                               ? parseParams( params, bind )
-                                       .replace( rBuildHash, function( all, isCtx, keyValue ) {
-                                               if ( isCtx ) {
-                                                       passedCtx += keyValue + ",";
-                                               } else {
-                                                       hash += keyValue + ",";
-                                               }
-                                               return "";
-                                       })
-                               : "");
-                       hash = hash.slice( 0, -1 );
-                       params = params.slice( 0, -1 );
-                       newNode = [
-                               tagName,
-                               converter || "",
-                               params,
-                               block && [],
-                               "{" + (hash ? ("props:{" + hash + "},"): "") + "path:'" + params + "'" + (passedCtx ? ",ctx:{" + passedCtx.slice( 0, -1 ) + "}" : "") + "}"
-                       ];
-                       if ( block ) {
-                               stack.push( current );
-                               current = newNode;
-                               current[ 5 ] = loc; // Store current location of open tag, to be able to add contentMarkup when we reach closing tag
-                       }
-                       content.push( newNode );
-               } else if ( closeBlock ) {
-                       //if ( closeBlock !== current[ 0 ]) {
-                       //      throw "unmatched close tag: /" + closeBlock + ". Expected /" + current[ 0 ];
-                       //}
-                       current[ 5 ] = markup.substring( current[ 5 ], index ); // contentMarkup for block tag
-                       current = stack.pop();
-               }
-               if ( !current ) {
-                       throw "Expected block tag";
-               }
-               content = current[ 3 ];
-       }
-       //==== /end of nested functions ====
-
-       markup = markup.replace( rEscapeQuotes, "\\$1" );
-
-       // Build the AST (abstract syntax tree) under astTop
-       markup.replace( rTag, parseTag );
-
-       pushPreceedingContent( markup.length );
-
-       // Use the AST (astTop) to build the template function
-       l = astTop.length;
-       code = (l ? "" : '"";');
-
-       for ( i = 0; i < l; i++ ) {
-               // AST nodes: [ tagName, converter, params, content, hash, contentMarkup ]
-               node = astTop[ i ];
-               if ( node[ 0 ] === "*" ) {
-                       code = code.slice( 0, i ? -1 : -3 ) + ";" + node[ 1 ] + (i + 1 < l ? "ret+=" : "");
-               } else if ( "" + node === node ) { // type string
-                       code += '"' + node + '"+';
-               } else {
-                       tag = node[ 0 ];
-                       converter = node[ 1 ];
-                       params = node[ 2 ];
-                       content = node[ 3 ];
-                       hash = node[ 4 ];
-                       markup = node[ 5 ];
-                       if ( content ) {
-                               // Create template object for nested template
-                               nestedTmpl = TmplObject( markup, tmplOptions, tmpl, nestedIndex++ );
-                               // Compile to AST and then to compiled function
-                               tmplFn( markup, nestedTmpl);
-                               nested.push( nestedTmpl );
-                       }
-                       hasViewPath = hasViewPath || hash.indexOf( "view" ) > -1;
-                       code += (tag === ":"
-                               ? (converter === "html"
-                                       ? (hasEncoder = TRUE, "e(" + params)
-                                       : converter
-                                               ? (hasConverter = TRUE, 'c("' + converter + '",view,' + params)
-                                               : (getsValue = TRUE, "((v=" + params + ')!=u?v:""')
-                               )
-                               : (hasTag = TRUE, 't("' + tag + '",view,"' + (converter || "") + '",'
-                                       + (content ? nested.length : '""') // For block tags, pass in the key (nested.length) to the nested content template
-                                       + "," + hash + (params ? "," : "") + params))
-                                       + ")+";
-               }
-       }
-       code =  new Function( "data, view, j, b, u", fnDeclStr
-               + (getsValue ? "v," : "")
-               + (hasTag ? "t=j.tag," : "")
-               + (hasConverter ? "c=j.convert," : "")
-               + (hasEncoder ? "e=j.converters.html," : "")
-               + "ret; try{\n\n"
-               + (tmplOptions.debug ? "debugger;" : "")
-               + (allowCode ? 'ret=' : 'return ')
-               + code.slice( 0, -1 ) + ";\n\n"
-               + (allowCode ? "return ret;" : "")
-               + "}catch(e){return j.err(e);}"
-       );
-
-       // Include only the var references that are needed in the code
-       if ( tmpl ) {
-               tmpl.fn = code;
-               tmpl.useVw = hasConverter || hasViewPath || hasTag;
-       }
-       return code;
-}
-
-function parseParams( params, bind ) {
-       var named,
-               fnCall = {},
-               parenDepth = 0,
-               quoted = FALSE, // boolean for string content in double quotes
-               aposed = FALSE; // or in single quotes
-
-       function parseTokens( all, lftPrn0, lftPrn, path, operator, err, eq, path2, prn, comma, lftPrn2, apos, quot, rtPrn, prn2, space ) {
-               // rParams = /(?:([([])\s*)?(?:([#~]?[\w$.]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*!:?\/]|(=))\s*|([#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*([)\]])([([]?))|(\s+)/g,
-               //            lftPrn                  path    operator err                                                eq         path2       prn    comma   lftPrn3   apos quot        rtPrn   prn2   space
-               // (left paren? followed by (path? followed by operator) or (path followed by paren?)) or comma or apos or quot or right paren or space
-               operator = operator || "";
-               lftPrn = lftPrn || lftPrn0 || lftPrn2;
-               path = path || path2;
-               prn = prn || prn2 || "";
-               operator = operator || "";
-
-               function parsePath( all, object, helper, view, viewProperty, pathTokens, leafToken ) {
-               // rPath = /^(?:null|true|false|\d[\d.]*|([\w$]+|~([\w$]+)|#(view|([\w$]+))?)([\w$.]*?)(?:[.[]([\w$]+)\]?)?|(['"]).*\8)$/g,
-               //                                        object   helper    view  viewProperty pathTokens   leafToken     string
-                       if ( object ) {
-                               var ret = (helper
-                                       ? 'view.hlp("' + helper + '")'
-                                       : view
-                                               ? "view"
-                                               : "data")
-                               + (leafToken
-                                       ? (viewProperty
-                                               ? "." + viewProperty
-                                               : helper
-                                                       ? ""
-                                                       : (view ? "" : "." + object)
-                                               ) + (pathTokens || "")
-                                       : (leafToken = helper ? "" : view ? viewProperty || "" : object, ""));
-
-                               if ( bind && prn !== "(" ) {
-                                       ret = "b(" + ret + ',"' + leafToken + '")';
-                               }
-                               return ret + (leafToken ? "." + leafToken : "");
-                       }
-                       return all;
-               }
-
-               if ( err ) {
-                       syntaxError();
-               } else {
-                       return (aposed
-                               // within single-quoted string
-                               ? (aposed = !apos, (aposed ? all : '"'))
-                               : quoted
-                                       // within double-quoted string
-                                       ? (quoted = !quot, (quoted ? all : '"'))
-                                       :
-                               (
-                                       (lftPrn
-                                                       ? (parenDepth++, lftPrn)
-                                                       : "")
-                                       + (space
-                                               ? (parenDepth
-                                                       ? ""
-                                                       : named
-                                                               ? (named = FALSE, "\b")
-                                                               : ","
-                                               )
-                                               : eq
-                                                       // named param
-                                                       ? (parenDepth && syntaxError(), named = TRUE, '\b' + path + ':')
-                                                       : path
-                                                               // path
-                                                               ? (path.replace( rPath, parsePath )
-                                                                       + (prn
-                                                                               ? (fnCall[ ++parenDepth ] = TRUE, prn)
-                                                                               : operator)
-                                                               )
-                                                               : operator
-                                                                       ? all
-                                                                       : rtPrn
-                                                                               // function
-                                                                               ? ((fnCall[ parenDepth-- ] = FALSE, rtPrn)
-                                                                                       + (prn
-                                                                                               ? (fnCall[ ++parenDepth ] = TRUE, prn)
-                                                                                               : "")
-                                                                               )
-                                                                               : comma
-                                                                                       ? (fnCall[ parenDepth ] || syntaxError(), ",") // We don't allow top-level literal arrays or objects
-                                                                                       : lftPrn0
-                                                                                               ? ""
-                                                                                               : (aposed = apos, quoted = quot, '"')
-                               ))
-                       );
-               }
-       }
-       params = (params + " " ).replace( rParams, parseTokens );
-       return params;
-}
-
-function compile( name, tmpl, parent, options ) {
-       // tmpl is either a template object, a selector for a template script block, the name of a compiled template, or a template object
-       // options is the set of template properties, c
-       var tmplOrMarkup, elem, key, nested, nestedItem;
-
-       //==== nested functions ====
-       function tmplOrMarkupFromStr( value ) {
-               // If value is of type string - treat as selector, or name of compiled template
-               // Return the template object, if already compiled, or the markup string
-
-               if ( ("" + value === value) || value.nodeType > 0 ) {
-                       // If selector is valid and returns at least one element, get first element
-                       elem = value.nodeType > 0 ? value : !rTmplString.test( value ) && jQuery && jQuery( value )[0];
-                       if ( elem && elem.type ) {
-                               // It is a script element
-                               // Create a name for data linking if none provided
-                               value = templates[ elem.getAttribute( tmplAttr )];
-                               if ( !value ) {
-                                       // Not already compiled and cached, so compile and cache the name
-                                       name = name || "_" + autoTmplName++;
-                                       elem.setAttribute( tmplAttr, name );
-                                       value = compile( name, elem.innerHTML, parent, options ); // Use tmpl as options
-                                       templates[ name ] = value;
-                               }
-                       }
-                       return value;
-               }
-               // If value is not a string or dom element, return undefined
-       }
-
-       //==== Compile the template ====
-       tmplOrMarkup = tmplOrMarkupFromStr( tmpl );
-
-       // If tmpl is a template object, use it for options
-       options = options || (tmpl.markup ? tmpl : {});
-       options.name = name;
-       nested = options.templates;
-
-       // If tmpl is not a markup string or a selector string, then it must be a template object
-       // In that case, get it from the markup property of the object
-       if ( !tmplOrMarkup && tmpl.markup && (tmplOrMarkup = tmplOrMarkupFromStr( tmpl.markup ))) {
-               if ( tmplOrMarkup.fn && (tmplOrMarkup.debug !== tmpl.debug || tmplOrMarkup.allowCode !== tmpl.allowCode )) {
-                       // if the string references a compiled template object, but the debug or allowCode props are different, need to recompile
-                       tmplOrMarkup = tmplOrMarkup.markup;
-               }
-       }
-       if ( tmplOrMarkup !== undefined ) {
-               if ( name && !parent ) {
-                       render[ name ] = function() {
-                               return tmpl.render.apply( tmpl, arguments );
-                       };
-               }
-               if ( tmplOrMarkup.fn || tmpl.fn ) {
-                       // tmpl is already compiled, so use it, or if different name is provided, clone it
-                       if ( tmplOrMarkup.fn ) {
-                               if ( name && name !== tmplOrMarkup.name ) {
-                                       tmpl = extend( extend( {}, tmplOrMarkup ), options);
-                               } else {
-                                       tmpl = tmplOrMarkup;
-                               }
-                       }
-               } else {
-                       // tmplOrMarkup is a markup string, not a compiled template
-                       // Create template object
-                       tmpl = TmplObject( tmplOrMarkup, options, parent, 0 );
-                       // Compile to AST and then to compiled function
-                       tmplFn( tmplOrMarkup, tmpl );
-               }
-               for ( key in nested ) {
-                       // compile nested template declarations
-                       nestedItem = nested[ key ];
-                       if ( nestedItem.name !== key ) {
-                               nested[ key ] = compile( key, nestedItem, tmpl );
-                       }
-               }
-               return tmpl;
-       }
-}
-//==== /end of function compile ====
-
-function TmplObject( markup, options, parent, index ) {
-       // Template object constructor
-
-       // nested helper function
-       function extendStore( storeName ) {
-               if ( parent[ storeName ]) {
-                       // Include parent items except if overridden by item of same name in options
-                       tmpl[ storeName ] = extend( extend( {}, parent[ storeName ] ), options[ storeName ] );
-               }
-       }
-
-       options = options || {};
-       var tmpl = {
-                       markup: markup,
-                       tmpls: [],
-                       links: [],
-                       render: renderContent
-               };
-       if ( parent ) {
-               if ( parent.templates ) {
-                       tmpl.templates = extend( extend( {}, parent.templates ), options.templates );
-               }
-               tmpl.parent = parent;
-               tmpl.name = parent.name + "[" + index + "]";
-               tmpl.index = index;
-       }
-
-       extend( tmpl, options );
-       if ( parent ) {
-               extendStore( "templates" );
-               extendStore( "tags" );
-               extendStore( "helpers" );
-               extendStore( "converters" );
-       }
-       return tmpl;
-}
-
-//========================== Initialize ==========================
-
-if ( jQuery ) {
-       ////////////////////////////////////////////////////////////////////////////////////////////////
-       // jQuery is loaded, so make $ the jQuery object
-       $ = jQuery;
-       $.templates = templates;
-       $.render = render;
-       $.views = jsv;
-       $.fn.render = renderContent;
-
-} else {
-       ////////////////////////////////////////////////////////////////////////////////////////////////
-       // jQuery is not loaded.
-
-       $ = window.jsviews = jsv;
-       $.extend = function( target, source ) {
-               var name;
-               target =  target || {};
-               for ( name in source ) {
-                       target[ name ] = source[ name ];
-               }
-               return target;
-       };
-
-       $.isArray = Array && Array.isArray || function( obj ) {
-               return Object.prototype.toString.call( obj ) === "[object Array]";
-       };
-}
-
-extend = $.extend;
-
-jsv.topView = { views: {}, tmpl: {}, hlp: getHelper, ctx: jsv.helpers };
-
-function replacerForHtml( ch ) {
-       // Original code from Mike Samuel <msamuel@google.com>
-       return escapeMapForHtml[ ch ]
-               // Intentional assignment that caches the result of encoding ch.
-               || (escapeMapForHtml[ ch ] = "&#" + ch.charCodeAt( 0 ) + ";");
-}
-
-//========================== Register tags ==========================
-
-tags({
-       "if": function() {
-               var ifTag = this,
-                       view = ifTag.view;
-
-               view.onElse = function( tagObject, args ) {
-                       var i = 0,
-                               l = args.length;
-
-                       while ( l && !args[ i++ ]) {
-                               // Only render content if args.length === 0 (i.e. this is an else with no condition) or if a condition argument is truey
-                               if ( i === l ) {
-                                       return "";
-                               }
-                       }
-                       view.onElse = undefined; // If condition satisfied, so won't run 'else'.
-                       tagObject.path = "";
-                       return tagObject.renderContent( view );
-                       // Test is satisfied, so render content, while remaining in current data context
-                       // By passing the view, we inherit data context from the parent view, and the content is treated as a layout template
-                       // (so if the data is an array, it will not iterate over the data
-               };
-               return view.onElse( this, arguments );
-       },
-       "else": function() {
-               var view = this.view;
-               return view.onElse ? view.onElse( this, arguments ) : "";
-       },
-       "for": function() {
-               var i,
-                       self = this,
-                       result = "",
-                       args = arguments,
-                       l = args.length;
-               if ( self.props.layout ) {
-                       self.tmpl.layout = TRUE;
-               }
-               for ( i = 0; i < l; i++ ) {
-                       result += self.renderContent( args[ i ]);
-               }
-               return result;
-       },
-       "=": function( value ) {
-               return value;
-       },
-       "*": function( value ) {
-               return value;
-       }
-});
-
-//========================== Register global helpers ==========================
-
-//     helpers({ // Global helper functions
-//             // TODO add any useful built-in helper functions
-//     });
-
-//========================== Register converters ==========================
-
-converters({
-       html: function( text ) {
-               // HTML encoding helper: Replace < > & and ' and " by corresponding entities.
-               // inspired by Mike Samuel <msamuel@google.com>
-               return text != undefined ? String( text ).replace( htmlSpecialChar, replacerForHtml ) : "";
-       }
-});
-
-//========================== Define default delimiters ==========================
-setDelimiters( "{{", "}}" );
-
-})( this );
-
-/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
- * Licensed under the MIT License (LICENSE.txt).
- *
- * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
- * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
- * Thanks to: Seamus Leahy for adding deltaX and deltaY
- *
- * Version: 3.0.6
- * 
- * Requires: 1.2.2+
- */
-
-(function($) {
-
-var types = ['DOMMouseScroll', 'mousewheel'];
-
-if ($.event.fixHooks) {
-    for ( var i=types.length; i; ) {
-        $.event.fixHooks[ types[--i] ] = $.event.mouseHooks;
-    }
-}
-
-$.event.special.mousewheel = {
-    setup: function() {
-        if ( this.addEventListener ) {
-            for ( var i=types.length; i; ) {
-                this.addEventListener( types[--i], handler, false );
-            }
-        } else {
-            this.onmousewheel = handler;
-        }
-    },
-    
-    teardown: function() {
-        if ( this.removeEventListener ) {
-            for ( var i=types.length; i; ) {
-                this.removeEventListener( types[--i], handler, false );
-            }
-        } else {
-            this.onmousewheel = null;
-        }
-    }
-};
-
-$.fn.extend({
-    mousewheel: function(fn) {
-        return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
-    },
-    
-    unmousewheel: function(fn) {
-        return this.unbind("mousewheel", fn);
-    }
-});
-
-
-function handler(event) {
-    var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
-    event = $.event.fix(orgEvent);
-    event.type = "mousewheel";
-    
-    // Old school scrollwheel delta
-    if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; }
-    if ( orgEvent.detail     ) { delta = -orgEvent.detail/3; }
-    
-    // New school multidimensional scroll (touchpads) deltas
-    deltaY = delta;
-    
-    // Gecko
-    if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
-        deltaY = 0;
-        deltaX = -1*delta;
-    }
-    
-    // Webkit
-    if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }
-    if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
-    
-    // Add event and delta to the front of the arguments
-    args.unshift(event, delta, deltaX, deltaY);
-    
-    return ($.event.dispatch || $.event.handle).apply(this, args);
-}
-
-})(jQuery);
-
-/*!
- * jQuery UI Widget 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Widget
- */
-
-if ( ! $.widget ) {
-
-(function( $, undefined ) {
-
-// jQuery 1.4+
-if ( $.cleanData ) {
-       var _cleanData = $.cleanData;
-       $.cleanData = function( elems ) {
-               for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
-                       try {
-                               $( elem ).triggerHandler( "remove" );
-                       // http://bugs.jquery.com/ticket/8235
-                       } catch( e ) {}
-               }
-               _cleanData( elems );
-       };
-} else {
-       var _remove = $.fn.remove;
-       $.fn.remove = function( selector, keepData ) {
-               return this.each(function() {
-                       if ( !keepData ) {
-                               if ( !selector || $.filter( selector, [ this ] ).length ) {
-                                       $( "*", this ).add( [ this ] ).each(function() {
-                                               try {
-                                                       $( this ).triggerHandler( "remove" );
-                                               // http://bugs.jquery.com/ticket/8235
-                                               } catch( e ) {}
-                                       });
-                               }
-                       }
-                       return _remove.call( $(this), selector, keepData );
-               });
-       };
-}
-
-$.widget = function( name, base, prototype ) {
-       var namespace = name.split( "." )[ 0 ],
-               fullName;
-       name = name.split( "." )[ 1 ];
-       fullName = namespace + "-" + name;
-
-       if ( !prototype ) {
-               prototype = base;
-               base = $.Widget;
-       }
-
-       // create selector for plugin
-       $.expr[ ":" ][ fullName ] = function( elem ) {
-               return !!$.data( elem, name );
-       };
-
-       $[ namespace ] = $[ namespace ] || {};
-       $[ namespace ][ name ] = function( options, element ) {
-               // allow instantiation without initializing for simple inheritance
-               if ( arguments.length ) {
-                       this._createWidget( options, element );
-               }
-       };
-
-       var basePrototype = new base();
-       // we need to make the options hash a property directly on the new instance
-       // otherwise we'll modify the options hash on the prototype that we're
-       // inheriting from
-//     $.each( basePrototype, function( key, val ) {
-//             if ( $.isPlainObject(val) ) {
-//                     basePrototype[ key ] = $.extend( {}, val );
-//             }
-//     });
-       basePrototype.options = $.extend( true, {}, basePrototype.options );
-       $[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
-               namespace: namespace,
-               widgetName: name,
-               widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
-               widgetBaseClass: fullName
-       }, prototype );
-
-       $.widget.bridge( name, $[ namespace ][ name ] );
-};
-
-$.widget.bridge = function( name, object ) {
-       $.fn[ name ] = function( options ) {
-               var isMethodCall = typeof options === "string",
-                       args = Array.prototype.slice.call( arguments, 1 ),
-                       returnValue = this;
-
-               // allow multiple hashes to be passed on init
-               options = !isMethodCall && args.length ?
-                       $.extend.apply( null, [ true, options ].concat(args) ) :
-                       options;
-
-               // prevent calls to internal methods
-               if ( isMethodCall && options.charAt( 0 ) === "_" ) {
-                       return returnValue;
-               }
-
-               if ( isMethodCall ) {
-                       this.each(function() {
-                               var instance = $.data( this, name ),
-                                       methodValue = instance && $.isFunction( instance[options] ) ?
-                                               instance[ options ].apply( instance, args ) :
-                                               instance;
-                               // TODO: add this back in 1.9 and use $.error() (see #5972)
-//                             if ( !instance ) {
-//                                     throw "cannot call methods on " + name + " prior to initialization; " +
-//                                             "attempted to call method '" + options + "'";
-//                             }
-//                             if ( !$.isFunction( instance[options] ) ) {
-//                                     throw "no such method '" + options + "' for " + name + " widget instance";
-//                             }
-//                             var methodValue = instance[ options ].apply( instance, args );
-                               if ( methodValue !== instance && methodValue !== undefined ) {
-                                       returnValue = methodValue;
-                                       return false;
-                               }
-                       });
-               } else {
-                       this.each(function() {
-                               var instance = $.data( this, name );
-                               if ( instance ) {
-                                       instance.option( options || {} )._init();
-                               } else {
-                                       $.data( this, name, new object( options, this ) );
-                               }
-                       });
-               }
-
-               return returnValue;
-       };
-};
-
-$.Widget = function( options, element ) {
-       // allow instantiation without initializing for simple inheritance
-       if ( arguments.length ) {
-               this._createWidget( options, element );
-       }
-};
-
-$.Widget.prototype = {
-       widgetName: "widget",
-       widgetEventPrefix: "",
-       options: {
-               disabled: false
-       },
-       _createWidget: function( options, element ) {
-               // $.widget.bridge stores the plugin instance, but we do it anyway
-               // so that it's stored even before the _create function runs
-               $.data( element, this.widgetName, this );
-               this.element = $( element );
-               this.options = $.extend( true, {},
-                       this.options,
-                       this._getCreateOptions(),
-                       options );
-
-               var self = this;
-               this.element.bind( "remove." + this.widgetName, function() {
-                       self.destroy();
-               });
-
-               this._create();
-               this._trigger( "create" );
-               this._init();
-       },
-       _getCreateOptions: function() {
-               return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];
-       },
-       _create: function() {},
-       _init: function() {},
-
-       destroy: function() {
-               this.element
-                       .unbind( "." + this.widgetName )
-                       .removeData( this.widgetName );
-               this.widget()
-                       .unbind( "." + this.widgetName )
-                       .removeAttr( "aria-disabled" )
-                       .removeClass(
-                               this.widgetBaseClass + "-disabled " +
-                               "ui-state-disabled" );
-       },
-
-       widget: function() {
-               return this.element;
-       },
-
-       option: function( key, value ) {
-               var options = key;
-
-               if ( arguments.length === 0 ) {
-                       // don't return a reference to the internal hash
-                       return $.extend( {}, this.options );
-               }
-
-               if  (typeof key === "string" ) {
-                       if ( value === undefined ) {
-                               return this.options[ key ];
-                       }
-                       options = {};
-                       options[ key ] = value;
-               }
-
-               this._setOptions( options );
-
-               return this;
-       },
-       _setOptions: function( options ) {
-               var self = this;
-               $.each( options, function( key, value ) {
-                       self._setOption( key, value );
-               });
-
-               return this;
-       },
-       _setOption: function( key, value ) {
-               this.options[ key ] = value;
-
-               if ( key === "disabled" ) {
-                       this.widget()
-                               [ value ? "addClass" : "removeClass"](
-                                       this.widgetBaseClass + "-disabled" + " " +
-                                       "ui-state-disabled" )
-                               .attr( "aria-disabled", value );
-               }
-
-               return this;
-       },
-
-       enable: function() {
-               return this._setOption( "disabled", false );
-       },
-       disable: function() {
-               return this._setOption( "disabled", true );
-       },
-
-       _trigger: function( type, event, data ) {
-               var prop, orig,
-                       callback = this.options[ type ];
-
-               data = data || {};
-               event = $.Event( event );
-               event.type = ( type === this.widgetEventPrefix ?
-                       type :
-                       this.widgetEventPrefix + type ).toLowerCase();
-               // the original event may come from any element
-               // so we need to reset the target on the new event
-               event.target = this.element[ 0 ];
-
-               // copy original event properties over to the new event
-               orig = event.originalEvent;
-               if ( orig ) {
-                       for ( prop in orig ) {
-                               if ( !( prop in event ) ) {
-                                       event[ prop ] = orig[ prop ];
-                               }
-                       }
-               }
-
-               this.element.trigger( event, data );
-
-               return !( $.isFunction(callback) &&
-                       callback.call( this.element[0], event, data ) === false ||
-                       event.isDefaultPrevented() );
-       }
-};
-
-})( jQuery );
-
-};
-
-
-(function ($, window, undefined) {
-  var pos_oo = Number.POSITIVE_INFINITY,
-      neg_oo = Number.NEGATIVE_INFINITY;
-
-  $.geo = {
-    //
-    // utility functions
-    //
-
-    _allCoordinates: function (geom) {
-      // return array of all positions in all geometries of geom
-      // not in JTS
-      var geometries = this._flatten(geom),
-          curGeom = 0,
-          result = [];
-
-      for (; curGeom < geometries.length; curGeom++) {
-        var coordinates = geometries[curGeom].coordinates,
-            isArray = coordinates && $.isArray(coordinates[0]),
-            isDblArray = isArray && $.isArray(coordinates[0][0]),
-            isTriArray = isDblArray && $.isArray(coordinates[0][0][0]),
-            i, j, k;
-
-        if (!isTriArray) {
-          if (!isDblArray) {
-            if (!isArray) {
-              coordinates = [coordinates];
-            }
-            coordinates = [coordinates];
-          }
-          coordinates = [coordinates];
-        }
-
-        for (i = 0; i < coordinates.length; i++) {
-          for (j = 0; j < coordinates[i].length; j++) {
-            for (k = 0; k < coordinates[i][j].length; k++) {
-              result.push(coordinates[i][j][k]);
-            }
-          }
-        }
-      }
-      return result;
-    },
-
-    _isGeodetic: function( coords ) {
-      // returns true if the first coordinate it can find is geodetic
-
-      while ( $.isArray( coords ) ) {
-        if ( coords.length > 1 && ! $.isArray( coords[ 0 ] ) ) {
-          return ( coords[ 0 ] >= -180 && coords[ 0 ] <= 180 && coords[ 1 ] >= -85 && coords[ 1 ] <= 85 );
-        } else {
-          coords = coords[ 0 ];
-        }
-      }
-
-      return false;
-    },
-
-    //
-    // bbox functions
-    //
-
-    center: function (bbox, _ignoreGeo /* Internal Use Only */) {
-      // Envelope.centre in JTS
-      // bbox only, use centroid for geom
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      var center = [(bbox[0] + bbox[2]) / 2, (bbox[1] + bbox[3]) / 2];
-      return wasGeodetic ? $.geo.proj.toGeodetic(center) : center;
-    },
-
-    expandBy: function (bbox, dx, dy, _ignoreGeo /* Internal Use Only */) {
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      bbox = [bbox[0] - dx, bbox[1] - dy, bbox[2] + dx, bbox[3] + dy];
-      return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    height: function (bbox, _ignoreGeo /* Internal Use Only */ ) {
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      return bbox[3] - bbox[1];
-    },
-
-    _in: function(bbox1, bbox2) {
-      return bbox1[0] <= bbox2[0] &&
-             bbox1[1] <= bbox2[1] &&
-             bbox1[2] >= bbox2[2] &&
-             bbox1[3] >= bbox2[3];
-    },
-
-    _bboxDisjoint: function( bbox1, bbox2 ) {
-      return bbox2[ 0 ] > bbox1[ 2 ] || 
-             bbox2[ 2 ] < bbox1[ 0 ] || 
-             bbox2[ 1 ] > bbox1[ 3 ] ||
-             bbox2[ 3 ] < bbox1[ 1 ];
-    },
-
-    include: function( bbox, value, _ignoreGeo /* Internal Use Only */ ) {
-      // similar to Envelope.expandToInclude in JTS
-      if ( !value || !$.isArray( value ) ) {
-        return bbox;
-      }
-
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox || value ) ) {
-        wasGeodetic = true;
-      }
-
-      if ( !bbox ) {
-        bbox = [ pos_oo, pos_oo, neg_oo, neg_oo ];
-      } else if ( wasGeodetic ) {
-        bbox = $.geo.proj.fromGeodetic( bbox );
-      }
-
-      if ( value.length === 2 ) {
-        value = [ value[ 0 ], value[ 1 ], value[ 0 ], value[ 1 ] ];
-      }
-
-      value = $.geo.proj.fromGeodetic( value );
-
-      bbox[0] = Math.min( value[ 0 ], bbox[ 0 ] );
-      bbox[1] = Math.min( value[ 1 ], bbox[ 1 ] );
-      bbox[2] = Math.max( value[ 2 ], bbox[ 2 ] );
-      bbox[3] = Math.max( value[ 3 ], bbox[ 3 ] );
-
-      return wasGeodetic ? $.geo.proj.toGeodetic( bbox ) : bbox;
-    },
-
-    polygonize: function( bbox, _ignoreGeo /* Internal Use Only */ ) {
-      // adaptation of Polygonizer class in JTS for use with bboxes
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      var polygon = {
-        type: "Polygon",
-        coordinates: [ [
-          [ bbox[ 0 ], bbox[ 1 ] ],
-          [ bbox[ 0 ], bbox[ 3 ] ],
-          [ bbox[ 2 ], bbox[ 3 ] ],
-          [ bbox[ 2 ], bbox[ 1 ] ],
-          [ bbox[ 0 ], bbox[ 1 ] ]
-        ] ]
-      };
-
-      if ( wasGeodetic ) {
-        polygon.coordinates = $.geo.proj.toGeodetic( polygon.coordinates );
-      }
-
-      return polygon;
-    },
-
-    reaspect: function (bbox, ratio, _ignoreGeo /* Internal Use Only */ ) {
-      // not in JTS
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      var width = this.width(bbox, true),
-          height = this.height(bbox, true),
-          center = this.center(bbox, true),
-          dx, dy;
-
-      if (width !== 0 && height !== 0 && ratio > 0) {
-        if (width / height > ratio) {
-          dx = width / 2;
-          dy = dx / ratio;
-        } else {
-          dy = height / 2;
-          dx = dy * ratio;
-        }
-
-        bbox = [center[0] - dx, center[1] - dy, center[0] + dx, center[1] + dy];
-      }
-
-      return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    recenter: function( bbox, center, _ignoreGeo /* Internal Use Only */ ) {
-      // not in JTS
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj ) {
-        if ( this._isGeodetic( bbox ) ) {
-          wasGeodetic = true;
-          bbox = $.geo.proj.fromGeodetic(bbox);
-        }
-
-        if ( this._isGeodetic( center ) ) {
-          center = $.geo.proj.fromGeodetic(center);
-        }
-      }
-
-      var halfWidth = ( bbox[ 2 ] - bbox[ 0 ] ) / 2,
-          halfHeight = ( bbox[ 3 ] - bbox[ 1 ] ) / 2;
-
-      bbox = [
-        center[ 0 ] - halfWidth,
-        center[ 1 ] - halfHeight,
-        center[ 0 ] + halfWidth,
-        center[ 1 ] + halfHeight
-      ];
-
-      return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    scaleBy: function ( bbox, scale, _ignoreGeo /* Internal Use Only */ ) {
-      // not in JTS
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      var c = this.center(bbox, true),
-          dx = (bbox[2] - bbox[0]) * scale / 2,
-          dy = (bbox[3] - bbox[1]) * scale / 2;
-
-      bbox = [c[0] - dx, c[1] - dy, c[0] + dx, c[1] + dy];
-
-      return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    width: function (bbox, _ignoreGeo /* Internal Use Only */ ) {
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      return bbox[2] - bbox[0];
-    },
-
-    //
-    // geometry functions
-    //
-
-    // bbox (Geometry.getEnvelope in JTS)
-
-    bbox: function ( geom, _ignoreGeo /* Internal Use Only */ ) {
-      var result, wasGeodetic = false;
-      if ( !geom ) {
-        return undefined;
-      } else if ( geom.bbox ) {
-        result = ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom.bbox ) ) ? $.geo.proj.fromGeodetic( geom.bbox ) : geom.bbox;
-      } else {
-        result = [ pos_oo, pos_oo, neg_oo, neg_oo ];
-
-        var coordinates = this._allCoordinates( geom ),
-            curCoord = 0;
-
-        if ( coordinates.length === 0 ) {
-          return undefined;
-        }
-
-        if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( coordinates ) ) {
-          wasGeodetic = true;
-          coordinates = $.geo.proj.fromGeodetic( coordinates );
-        }
-
-        for ( ; curCoord < coordinates.length; curCoord++ ) {
-          result[0] = Math.min(coordinates[curCoord][0], result[0]);
-          result[1] = Math.min(coordinates[curCoord][1], result[1]);
-          result[2] = Math.max(coordinates[curCoord][0], result[2]);
-          result[3] = Math.max(coordinates[curCoord][1], result[3]);
-        }
-      }
-
-      return wasGeodetic ? $.geo.proj.toGeodetic(result) : result;
-    },
-
-    // centroid
-    
-    centroid: function( geom, _ignoreGeo /* Internal Use Only */ ) {
-      switch (geom.type) {
-        case "Point":
-          return $.extend({}, geom);
-
-        case "LineString":
-        case "Polygon":
-          var a = 0,
-              c = [0, 0],
-              coords = $.merge( [ ], geom.type == "Polygon" ? geom.coordinates[0] : geom.coordinates ),
-              i = 1, j, n,
-              bbox = [ pos_oo, pos_oo, neg_oo, neg_oo ];
-
-          var wasGeodetic = false;
-          if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( coords ) ) {
-            wasGeodetic = true;
-            coords = $.geo.proj.fromGeodetic(coords);
-          }
-
-          //if (coords[0][0] != coords[coords.length - 1][0] || coords[0][1] != coords[coords.length - 1][1]) {
-          //  coords.push(coords[0]);
-          //}
-
-          for (; i <= coords.length; i++) {
-            j = i % coords.length;
-
-            bbox[0] = Math.min(coords[j][0], bbox[0]);
-            bbox[1] = Math.min(coords[j][1], bbox[1]);
-            bbox[2] = Math.max(coords[j][0], bbox[2]);
-            bbox[3] = Math.max(coords[j][1], bbox[3]);
-
-            n = (coords[i - 1][0] * coords[j][1]) - (coords[j][0] * coords[i - 1][1]);
-            a += n;
-            c[0] += (coords[i - 1][0] + coords[j][0]) * n;
-            c[1] += (coords[i - 1][1] + coords[j][1]) * n;
-          }
-
-          if (a === 0) {
-            if (coords.length > 0) {
-              c[0] = Math.min( Math.max( coords[0][0], bbox[ 0 ] ), bbox[ 2 ] );
-              c[1] = Math.min( Math.max( coords[0][1], bbox[ 1 ] ), bbox[ 3 ] );
-              return { type: "Point", coordinates: wasGeodetic ? $.geo.proj.toGeodetic(c) : c };
-            } else {
-              return undefined;
-            }
-          }
-
-          a *= 3;
-          //c[0] /= a;
-          //c[1] /= a;
-
-          c[0] = Math.min( Math.max( c[0] / a, bbox[ 0 ] ), bbox[ 2 ] );
-          c[1] = Math.min( Math.max( c[1] / a, bbox[ 1 ] ), bbox[ 3 ] );
-
-          return { type: "Point", coordinates: wasGeodetic ? $.geo.proj.toGeodetic(c) : c };
-      }
-      return undefined;
-    },
-
-    // contains
-
-    contains: function (geom1, geom2) {
-      if (geom1.type != "Polygon") {
-        return false;
-      }
-
-      switch (geom2.type) {
-        case "Point":
-          return this._containsPolygonPoint(geom1.coordinates, geom2.coordinates);
-
-        case "LineString":
-          return this._containsPolygonLineString(geom1.coordinates, geom2.coordinates);
-
-        case "Polygon":
-          return this._containsPolygonLineString(geom1.coordinates, geom2.coordinates[0]);
-
-        default:
-          return false;
-      }
-    },
-
-    _containsPolygonPoint: function (polygonCoordinates, pointCoordinate) {
-      if (polygonCoordinates.length === 0 || polygonCoordinates[0].length < 4) {
-        return false;
-      }
-
-      var rayCross = 0,
-          a = polygonCoordinates[0][0],
-          i = 1,
-          b,
-          x;
-
-      for (; i < polygonCoordinates[0].length; i++) {
-        b = polygonCoordinates[0][i];
-
-        if ((a[1] <= pointCoordinate[1] && pointCoordinate[1] < b[1]) || (b[1] <= pointCoordinate[1] && pointCoordinate[1] < a[1]) && (pointCoordinate[0] < a[0] || pointCoordinate[0] < b[0])) {
-          x = a[0] + (b[0] - a[0]) * (pointCoordinate[1] - a[1]) / (b[1] - a[1]);
-
-          if (x > pointCoordinate[0]) {
-            rayCross++;
-          }
-        }
-
-        a = b;
-      }
-
-      return rayCross % 2 == 1;
-    },
-
-    _containsPolygonLineString: function (polygonCoordinates, lineStringCoordinates) {
-      for (var i = 0; i < lineStringCoordinates.length; i++) {
-        if (!this._containsPolygonPoint(polygonCoordinates, lineStringCoordinates[i])) {
-          return false;
-        }
-      }
-      return true;
-    },
-
-    // distance
-
-    distance: function ( geom1, geom2, _ignoreGeo /* Internal Use Only */ ) {
-      var geom1CoordinatesProjected = ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom1.coordinates ) ) ? $.geo.proj.fromGeodetic(geom1.coordinates) : geom1.coordinates,
-          geom2CoordinatesProjected = ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom2.coordinates ) ) ? $.geo.proj.fromGeodetic(geom2.coordinates) : geom2.coordinates;
-
-      switch (geom1.type) {
-        case "Point":
-          switch (geom2.type) {
-            case "Point":
-              return this._distancePointPoint(geom2CoordinatesProjected, geom1CoordinatesProjected);
-            case "LineString":
-              return this._distanceLineStringPoint(geom2CoordinatesProjected, geom1CoordinatesProjected);
-            case "Polygon":
-              return this._containsPolygonPoint(geom2CoordinatesProjected, geom1CoordinatesProjected) ? 0 : this._distanceLineStringPoint(geom2CoordinatesProjected[0], geom1CoordinatesProjected);
-            default:
-              return undefined;
-          }
-          break;
-
-        case "LineString":
-          switch (geom2.type) {
-            case "Point":
-              return this._distanceLineStringPoint(geom1CoordinatesProjected, geom2CoordinatesProjected);
-            case "LineString":
-              return this._distanceLineStringLineString(geom1CoordinatesProjected, geom2CoordinatesProjected);
-            case "Polygon":
-              return this._containsPolygonLineString(geom2CoordinatesProjected, geom1CoordinatesProjected) ? 0 : this._distanceLineStringLineString(geom2CoordinatesProjected[0], geom1CoordinatesProjected);
-            default:
-              return undefined;
-          }
-          break;
-
-        case "Polygon":
-          switch (geom2.type) {
-            case "Point":
-              return this._containsPolygonPoint(geom1CoordinatesProjected, geom2CoordinatesProjected) ? 0 : this._distanceLineStringPoint(geom1CoordinatesProjected[0], geom2CoordinatesProjected);
-            case "LineString":
-              return this._containsPolygonLineString(geom1CoordinatesProjected, geom2CoordinatesProjected) ? 0 : this._distanceLineStringLineString(geom1CoordinatesProjected[0], geom2CoordinatesProjected);
-            case "Polygon":
-              return this._containsPolygonLineString(geom1CoordinatesProjected, geom2CoordinatesProjected[0]) ? 0 : this._distanceLineStringLineString(geom1CoordinatesProjected[0], geom2CoordinatesProjected[0]);
-            default:
-              return undefined;
-          }
-          break;
-      }
-    },
-
-    _distancePointPoint: function (coordinate1, coordinate2) {
-      var dx = coordinate2[0] - coordinate1[0],
-          dy = coordinate2[1] - coordinate1[1];
-      return Math.sqrt((dx * dx) + (dy * dy));
-    },
-
-    _distanceLineStringPoint: function (lineStringCoordinates, pointCoordinate) {
-      var minDist = pos_oo;
-
-      if (lineStringCoordinates.length > 0) {
-        var a = lineStringCoordinates[0],
-
-            apx = pointCoordinate[0] - a[0],
-            apy = pointCoordinate[1] - a[1];
-
-        if (lineStringCoordinates.length == 1) {
-          return Math.sqrt(apx * apx + apy * apy);
-        } else {
-          for (var i = 1; i < lineStringCoordinates.length; i++) {
-            var b = lineStringCoordinates[i],
-
-                abx = b[0] - a[0],
-                aby = b[1] - a[1],
-                bpx = pointCoordinate[0] - b[0],
-                bpy = pointCoordinate[1] - b[1],
-
-                d = this._distanceSegmentPoint(abx, aby, apx, apy, bpx, bpy);
-
-            if (d === 0) {
-              return 0;
-            }
-
-            if (d < minDist) {
-              minDist = d;
-            }
-
-            a = b;
-            apx = bpx;
-            apy = bpy;
-          }
-        }
-      }
-
-      return Math.sqrt(minDist);
-    },
-
-    _distanceSegmentPoint: function (abx, aby, apx, apy, bpx, bpy) {
-      var dot1 = abx * apx + aby * apy;
-
-      if (dot1 <= 0) {
-        return apx * apx + apy * apy;
-      }
-
-      var dot2 = abx * abx + aby * aby;
-
-      if (dot1 >= dot2) {
-        return bpx * bpx + bpy * bpy;
-      }
-
-      return apx * apx + apy * apy - dot1 * dot1 / dot2;
-    },
-
-    _distanceLineStringLineString: function (lineStringCoordinates1, lineStringCoordinates2) {
-      var minDist = pos_oo;
-      for (var i = 0; i < lineStringCoordinates2.length; i++) {
-        minDist = Math.min(minDist, this._distanceLineStringPoint(lineStringCoordinates1, lineStringCoordinates2[i]));
-      }
-      return minDist;
-    },
-
-    // buffer
-
-    _buffer: function( geom, distance, _ignoreGeo /* Internal Use Only */ ) {
-      var wasGeodetic = false,
-          coords = geom.coordinates;
-
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom.coordinates ) ) {
-        wasGeodetic = true;
-        coords = $.geo.proj.fromGeodetic( geom.coordinates );
-      }
-
-      if ( geom.type === "Point" ) {
-        var resultCoords = [],
-            slices = 180,
-            i = 0,
-            a;
-
-        for ( ; i <= slices; i++ ) {
-          a = ( i * 360 / slices ) * ( Math.PI / 180 );
-          resultCoords.push( [
-            coords[ 0 ] + Math.cos( a ) * distance,
-            coords[ 1 ] + Math.sin( a ) * distance
-          ] );
-        }
-
-        return {
-          type: "Polygon",
-          coordinates: [ ( wasGeodetic ? $.geo.proj.toGeodetic( resultCoords ) : resultCoords ) ]
-        };
-      } else {
-        return undefined;
-      }
-    },
-
-    
-    //
-    // feature
-    //
-
-    _flatten: function (geom) {
-      // return an array of all basic geometries
-      // not in JTS
-      var geometries = [],
-          curGeom = 0;
-      switch (geom.type) {
-        case "Feature":
-          $.merge(geometries, this._flatten(geom.geometry));
-          break;
-
-        case "FeatureCollection":
-          for (; curGeom < geom.features.length; curGeom++) {
-            $.merge(geometries, this._flatten(geom.features[curGeom].geometry));
-          }
-          break;
-
-        case "GeometryCollection":
-          for (; curGeom < geom.geometries.length; curGeom++) {
-            $.merge(geometries, this._flatten(geom.geometries[curGeom]));
-          }
-          break;
-
-        default:
-          geometries[0] = geom;
-          break;
-      }
-      return geometries;
-    },
-
-    length: function( geom, _ignoreGeo /* Internal Use Only */ ) {
-      var sum = 0,
-          lineStringCoordinates,
-          i = 1, dx, dy;
-
-      switch ( geom.type ) {
-        case "Point":
-          return 0;
-
-        case "LineString":
-          lineStringCoordinates = geom.coordinates;
-          break;
-
-        case "Polygon":
-          lineStringCoordinates = geom.coordinates[ 0 ];
-          break;
-      }
-
-      if ( lineStringCoordinates ) {
-        if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( lineStringCoordinates ) ) {
-          lineStringCoordinates = $.geo.proj.fromGeodetic( lineStringCoordinates );
-        }
-
-        for ( ; i < lineStringCoordinates.length; i++ ) {
-          dx = lineStringCoordinates[ i ][0] - lineStringCoordinates[ i - 1 ][0];
-          dy = lineStringCoordinates[ i ][1] - lineStringCoordinates[ i - 1 ][1];
-          sum += Math.sqrt((dx * dx) + (dy * dy));
-        }
-
-        return sum;
-      }
-
-      // return undefined;
-    },
-
-    area: function( geom, _ignoreGeo /* Internal Use Only */ ) {
-      var sum = 0,
-          polygonCoordinates,
-          i = 1, j;
-
-      switch ( geom.type ) {
-        case "Point":
-        case "LineString":
-          return 0;
-
-        case "Polygon":
-          polygonCoordinates = geom.coordinates[ 0 ];
-          break;
-      }
-
-      if ( polygonCoordinates ) {
-        if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( polygonCoordinates ) ) {
-          polygonCoordinates = $.geo.proj.fromGeodetic( polygonCoordinates );
-        }
-
-        for ( ; i <= polygonCoordinates.length; i++) {
-          j = i %  polygonCoordinates.length;
-          sum += ( polygonCoordinates[ i - 1 ][ 0 ] - polygonCoordinates[ j ][ 0 ] ) * ( polygonCoordinates[ i - 1 ][ 1 ] + polygonCoordinates[ j ][ 1 ] ) / 2;
-        }
-
-        return Math.abs( sum );
-      }
-    },
-
-    pointAlong: function( geom, percentage, _ignoreGeo /* Internal Use Only */ ) {
-      var totalLength = 0,
-          previousPercentageSum = 0,
-          percentageSum = 0,
-          remainderPercentageSum,
-          len,
-          lineStringCoordinates,
-          segmentLengths = [],
-          i = 1, dx, dy,
-          c, c0, c1,
-          wasGeodetic = false;
-
-      switch ( geom.type ) {
-        case "Point":
-          return $.extend( { }, geom );
-
-        case "LineString":
-          lineStringCoordinates = geom.coordinates;
-          break;
-
-        case "Polygon":
-          lineStringCoordinates = geom.coordinates[ 0 ];
-          break;
-      }
-
-      if ( lineStringCoordinates ) {
-        if ( percentage === 0 ) {
-          return {
-            type: "Point",
-            coordinates: [ lineStringCoordinates[ 0 ][ 0 ], lineStringCoordinates[ 0 ][ 1 ] ]
-          };
-        } else if ( percentage === 1 ) {
-          i = lineStringCoordinates.length - 1;
-          return {
-            type: "Point",
-            coordinates: [ lineStringCoordinates[ i ][ 0 ], lineStringCoordinates[ i ][ 1 ] ]
-          };
-        } else {
-          if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( lineStringCoordinates ) ) {
-            wasGeodetic = true;
-            lineStringCoordinates = $.geo.proj.fromGeodetic( lineStringCoordinates );
-          }
-
-          for ( ; i < lineStringCoordinates.length; i++ ) {
-            dx = lineStringCoordinates[ i ][ 0 ] - lineStringCoordinates[ i - 1 ][ 0 ];
-            dy = lineStringCoordinates[ i ][ 1 ] - lineStringCoordinates[ i - 1 ][ 1 ];
-            len = Math.sqrt((dx * dx) + (dy * dy));
-            segmentLengths.push( len );
-            totalLength += len;
-          }
-
-          for ( i = 0; i < segmentLengths.length && percentageSum < percentage; i++ ) {
-            previousPercentageSum = percentageSum;
-            percentageSum += ( segmentLengths[ i ] / totalLength );
-          }
-
-          remainderPercentageSum = percentage - previousPercentageSum;
-
-          c0 = lineStringCoordinates[ i - 1 ];
-          c1 = lineStringCoordinates[ i ];
-
-          c = [
-            c0[ 0 ] + ( remainderPercentageSum * ( c1[ 0 ] - c0[ 0 ] ) ),
-            c0[ 1 ] + ( remainderPercentageSum * ( c1[ 1 ] - c0[ 1 ] ) )
-          ];
-
-          return {
-            type: "Point",
-            coordinates: wasGeodetic ? $.geo.proj.toGeodetic(c) : c
-          };
-        }
-      }
-    },
-
-    //
-    // WKT functions
-    //
-
-    _WKT: (function () {
-      function pointToString(value) {
-        return "POINT " + pointToUntaggedString(value.coordinates);
-      }
-
-      function pointToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMPTY";
-        } else {
-          return "(" + coordinates.join(" ") + ")";
-        }
-      }
-
-      function lineStringToString(value) {
-        return "LINESTRING " + lineStringToUntaggedString(value.coordinates);
-      }
-
-      function lineStringToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMPTY";
-        } else {
-          var points = [];
-
-          for (var i = 0; i < coordinates.length; i++) {
-            points.push(coordinates[i].join(" "));
-          }
-
-          return "(" + points + ")";
-        }
-      }
-
-      function polygonToString(value) {
-        return "POLYGON " + polygonToUntaggedString(value.coordinates);
-      }
-
-      function polygonToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMTPY";
-        } else {
-          var lineStrings = [];
-
-          for (var i = 0; i < coordinates.length; i++) {
-            lineStrings.push(lineStringToUntaggedString(coordinates[i]));
-          }
-
-          return "(" + lineStrings + ")";
-        }
-      }
-
-      function multiPointToString(value) {
-        return "MULTIPOINT " + lineStringToUntaggedString(value.coordinates);
-      }
-
-      function multiLineStringToString(value) {
-        return "MULTILINSTRING " + polygonToUntaggedString(value.coordinates);
-      }
-
-      function multiPolygonToString(value) {
-        return "MULTIPOLYGON " + multiPolygonToUntaggedString(value.coordinates);
-      }
-
-      function multiPolygonToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMPTY";
-        } else {
-          var polygons = [];
-          for (var i = 0; i < coordinates.length; i++) {
-            polygons.push(polygonToUntaggedString(coordinates[i]));
-          }
-          return "(" + polygons + ")";
-        }
-      }
-
-      function geometryCollectionToString(value) {
-        return "GEOMETRYCOLLECTION " + geometryCollectionToUntaggedString(value.geometries);
-      }
-
-      function geometryCollectionToUntaggedString(geometries) {
-        if (!(geometries && geometries.length)) {
-          return "EMPTY";
-        } else {
-          var geometryText = [];
-          for (var i = 0; i < geometries.length; i++) {
-            geometryText.push(stringify(geometries[i]));
-          }
-          return "(" + geometries + ")";
-        }
-      }
-
-      function stringify(value) {
-        if (!(value && value.type)) {
-          return "";
-        } else {
-          switch (value.type) {
-            case "Point":
-              return pointToString(value);
-
-            case "LineString":
-              return lineStringToString(value);
-
-            case "Polygon":
-              return polygonToString(value);
-
-            case "MultiPoint":
-              return multiPointToString(value);
-
-            case "MultiLineString":
-              return multiLineStringToString(value);
-
-            case "MultiPolygon":
-              return multiPolygonToString(value);
-
-            case "GeometryCollection":
-              return geometryCollectionToString(value);
-
-            default:
-              return "";
-          }
-        }
-      }
-
-      function pointParseUntagged(wkt) {
-        var pointString = wkt.match( /\(\s*([\d\.\-]+)\s+([\d\.\-]+)\s*\)/ );
-        return pointString && pointString.length > 2 ? {
-          type: "Point",
-          coordinates: [
-            parseFloat(pointString[1]),
-            parseFloat(pointString[2])
-          ]
-        } : null;
-      }
-
-      function lineStringParseUntagged(wkt) {
-        var lineString = wkt.match( /\s*\((.*)\)/ ),
-            coords = [],
-            pointStrings,
-            pointParts,
-            i = 0;
-
-        if ( lineString && lineString.length > 1 ) {
-          pointStrings = lineString[ 1 ].match( /[\d\.\-]+\s+[\d\.\-]+/g );
-
-          for ( ; i < pointStrings.length; i++ ) {
-            pointParts = pointStrings[ i ].match( /\s*([\d\.\-]+)\s+([\d\.\-]+)\s*/ );
-            coords[ i ] = [ parseFloat( pointParts[ 1 ] ), parseFloat( pointParts[ 2 ] ) ];
-          }
-
-          return {
-            type: "LineString",
-            coordinates: coords
-          };
-        } else {
-          return null;
-        }
-      }
-
-      function polygonParseUntagged(wkt) {
-        var polygon = wkt.match( /\s*\(\s*\((.*)\)\s*\)/ ),
-            coords = [],
-            pointStrings,
-            pointParts,
-            i = 0;
-
-        if ( polygon && polygon.length > 1 ) {
-          pointStrings = polygon[ 1 ].match( /[\d\.\-]+\s+[\d\.\-]+/g );
-
-          for ( ; i < pointStrings.length; i++ ) {
-            pointParts = pointStrings[ i ].match( /\s*([\d\.\-]+)\s+([\d\.\-]+)\s*/ );
-            coords[ i ] = [ parseFloat( pointParts[ 1 ] ), parseFloat( pointParts[ 2 ] ) ];
-          }
-
-          return {
-            type: "Polygon",
-            coordinates: [ coords ]
-          };
-        } else {
-          return null;
-        }
-      }
-
-      function multiPointParseUntagged(wkt) {
-        var multiSomething;
-
-        if ( wkt.indexOf( "((" ) === -1 ) {
-          multiSomething = lineStringParseUntagged( wkt );
-        } else {
-          multiSomething = multiLineStringParseUntagged( wkt );
-          multiSomething.coordinates = $.geo._allCoordinates( multiSomething );
-        }
-
-        multiSomething.type = "MultiPoint";
-
-        return multiSomething;
-      }
-
-      function multiLineStringParseUntagged(wkt) {
-        var lineStringsWkt = wkt.substr( 1, wkt.length - 2 ),
-            lineStrings = lineStringsWkt.split( ")),((" ),
-            i = 0,
-            multiLineString = {
-              type: "MultiLineString",
-              coordinates: [ ]
-            };
-
-        for ( ; i < lineStrings.length; i++ ) {
-          multiLineString.coordinates.push( lineStringParseUntagged( lineStrings[ i ] ).coordinates );
-        }
-
-        return multiLineString;
-      }
-
-      function multiPolygonParseUntagged(wkt) {
-        var polygonsWkt = wkt.substr( 1, wkt.length - 2 ),
-            polygons = polygonsWkt.split( ")),((" ),
-            i = 0,
-            multiPolygon = {
-              type: "MultiPolygon",
-              coordinates: [ ]
-            };
-
-        for ( ; i < polygons.length; i++ ) {
-          multiPolygon.coordinates.push( polygonParseUntagged( polygons[ i ] ).coordinates );
-        }
-
-        return multiPolygon;
-      }
-
-      function geometryCollectionParseUntagged( wkt ) {
-        var geometriesWkt = wkt.substr( 1, wkt.length - 2 ),
-            geometries = geometriesWkt.match( /\),[a-zA-Z]/g ),
-            geometryCollection = {
-              type: "GeometryCollection",
-              geometries: [ ]
-            },
-            curGeom,
-            i = 0, curStart = 0, curLen;
-
-        if ( geometries && geometries.length > 0 ) {
-          for ( ; i < geometries.length; i++ ) {
-            curLen = geometriesWkt.indexOf( geometries[ i ], curStart ) - curStart + 1;
-            curGeom = parse( geometriesWkt.substr( curStart, curLen ) );
-            if ( curGeom ) {
-              geometryCollection.geometries.push( curGeom );
-            }
-            curStart += curLen + 1;
-          }
-
-          // one more
-          curGeom = parse( geometriesWkt.substr( curStart ) );
-          if ( curGeom ) {
-            geometryCollection.geometries.push( curGeom );
-          }
-
-          return geometryCollection;
-        } else {
-          return null;
-        }
-      }
-
-      function parse(wkt) {
-        wkt = $.trim(wkt);
-
-        var typeIndex = wkt.indexOf( "(" ),
-            untagged = wkt.substr( typeIndex  );
-
-        switch ($.trim(wkt.substr(0, typeIndex)).toUpperCase()) {
-          case "POINT":
-            return pointParseUntagged( untagged );
-
-          case "LINESTRING":
-            return lineStringParseUntagged( untagged );
-
-          case "POLYGON":
-            return polygonParseUntagged( untagged );
-
-          case "MULTIPOINT":
-            return multiPointParseUntagged( untagged );
-
-          case "MULTILINESTRING":
-            return multiLineStringParseUntagged( untagged );
-
-          case "MULTIPOLYGON":
-            return multiPolygonParseUntagged( untagged );
-
-          case "GEOMETRYCOLLECTION":
-            return geometryCollectionParseUntagged( untagged );
-
-          default:
-            return null;
-        }
-      }
-
-      return {
-        stringify: stringify,
-
-        parse: parse
-      };
-    }()),
-
-    //
-    // projection functions
-    //
-
-    proj: (function () {
-      var halfPi = 1.5707963267948966192,
-          quarterPi = 0.7853981633974483096,
-          radiansPerDegree = 0.0174532925199432958,
-          degreesPerRadian = 57.295779513082320877,
-          semiMajorAxis = 6378137;
-
-      return {
-        fromGeodeticPos: function (coordinate) {
-          return [
-            semiMajorAxis * coordinate[ 0 ] * radiansPerDegree,
-            semiMajorAxis * Math.log(Math.tan(quarterPi + coordinate[ 1 ] * radiansPerDegree / 2))
-          ];
-        },
-
-        fromGeodetic: function ( coordinates ) {
-          if ( ! $.geo._isGeodetic( coordinates ) ) {
-            return coordinates;
-          }
-
-          var isMultiPointOrLineString = $.isArray(coordinates[ 0 ]),
-              fromGeodeticPos = this.fromGeodeticPos;
-
-          if (!isMultiPointOrLineString && coordinates.length == 4) {
-            // bbox
-            var min = fromGeodeticPos([ coordinates[ 0 ], coordinates[ 1 ] ]),
-                max = fromGeodeticPos([ coordinates[ 2 ], coordinates[ 3 ] ]);
-            return [ min[ 0 ], min[ 1 ], max[ 0 ], max[ 1 ] ];
-          } else {
-            // geometry
-            var isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray(coordinates[ 0 ][ 0 ]),
-                isMultiPolygon = isMultiLineStringOrPolygon && $.isArray(coordinates[ 0 ][ 0 ][ 0 ]),
-                result = [ ],
-                i, j, k;
-
-            if (!isMultiPolygon) {
-              if (!isMultiLineStringOrPolygon) {
-                if (!isMultiPointOrLineString) {
-                  coordinates = [ coordinates ];
-                }
-                coordinates = [ coordinates ];
-              }
-              coordinates = [ coordinates ];
-            }
-
-            for ( i = 0; i < coordinates.length; i++ ) {
-              result[ i ] = [ ];
-              for ( j = 0; j < coordinates[ i ].length; j++ ) {
-                result[ i ][ j ] = [ ];
-                for ( k = 0; k < coordinates[ i ][ j ].length; k++ ) {
-                  result[ i ][ j ][ k ] = fromGeodeticPos(coordinates[ i ][ j ][ k ]);
-                }
-              }
-            }
-
-            return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-          }
-        },
-
-        toGeodeticPos: function (coordinate) {
-          return [
-            (coordinate[ 0 ] / semiMajorAxis) * degreesPerRadian,
-            (halfPi - 2 * Math.atan(1 / Math.exp(coordinate[ 1 ] / semiMajorAxis))) * degreesPerRadian
-          ];
-        },
-
-        toGeodetic: function (coordinates) {
-          if ( $.geo._isGeodetic( coordinates ) ) {
-            return coordinates;
-          }
-
-          var isMultiPointOrLineString = $.isArray(coordinates[ 0 ]),
-              toGeodeticPos = this.toGeodeticPos;
-
-          if (!isMultiPointOrLineString && coordinates.length == 4) {
-            // bbox
-            var min = toGeodeticPos([ coordinates[ 0 ], coordinates[ 1 ] ]),
-                max = toGeodeticPos([ coordinates[ 2 ], coordinates[ 3 ] ]);
-            return [ min[ 0 ], min[ 1 ], max[ 0 ], max[ 1 ] ];
-          } else {
-            // geometry
-            var isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray(coordinates[ 0 ][ 0 ]),
-                isMultiPolygon = isMultiLineStringOrPolygon && $.isArray(coordinates[ 0 ][ 0 ][ 0 ]),
-                result = [ ],
-                i, j, k;
-
-            if (!isMultiPolygon) {
-              if (!isMultiLineStringOrPolygon) {
-                if (!isMultiPointOrLineString) {
-                  coordinates = [ coordinates ];
-                }
-                coordinates = [ coordinates ];
-              }
-              coordinates = [ coordinates ];
-            }
-
-            for ( i = 0; i < coordinates.length; i++ ) {
-              result[ i ] = [ ];
-              for ( j = 0; j < coordinates[ i ].length; j++ ) {
-                result[ i ][ j ] = [ ];
-                for ( k = 0; k < coordinates[ i ][ j ].length; k++ ) {
-                  result[ i ][ j ][ k ] = toGeodeticPos(coordinates[ i ][ j ][ k ]);
-                }
-              }
-            }
-
-            return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-          }
-        }
-      };
-    }()),
-
-    //
-    // service types (defined in other files)
-    //
-
-    _serviceTypes: {}
-  };
-}(jQuery, this));
-
-(function ($, undefined) {
-  var _ieVersion = ( function () {
-    var v = 5, div = document.createElement("div"), a = div.all || [];
-    do {
-      div.innerHTML = "<!--[if gt IE " + (++v) + "]><br><![endif]-->";
-    } while ( a[0] );
-    return v > 6 ? v : !v;
-  }() );
-
-  $.widget("geo.geographics", {
-    _$elem: undefined,
-    _options: {},
-    _trueCanvas: true,
-
-    _width: 0,
-    _height: 0,
-
-    _$canvas: undefined,
-    _context: undefined,
-
-    _blitcanvas: undefined,
-    _blitcontext: undefined,
-
-    _$labelsContainer: undefined,
-
-    options: {
-      style: {
-        borderRadius: "8px",
-        color: "#7f0000",
-        //fill: undefined,
-        fillOpacity: 0.2,
-        height: "8px",
-        opacity: 1,
-        //stroke: undefined,
-        strokeOpacity: 1,
-        strokeWidth: "2px",
-        visibility: "visible",
-        width: "8px"
-      }
-    },
-
-    _create: function () {
-      this._$elem = this.element;
-      this._options = this.options;
-
-      this._$elem.css({ display: "inline-block", overflow: "hidden", textAlign: "left" });
-
-      if (this._$elem.css("position") == "static") {
-        this._$elem.css("position", "relative");
-      }
-
-      this._$elem.addClass( "geo-graphics" );
-
-      this._width = this._$elem.width();
-      this._height = this._$elem.height();
-
-      if (!(this._width && this._height)) {
-        this._width = parseInt(this._$elem.css("width"), 10);
-        this._height = parseInt(this._$elem.css("height"), 10);
-      }
-
-      var posCss = 'position:absolute;left:0;top:0;margin:0;padding:0;',
-          sizeCss = 'width:' + this._width + 'px;height:' + this._height + 'px;',
-          sizeAttr = 'width="' + this._width + '" height="' + this._height + '"';
-
-      if (document.createElement('canvas').getContext) {
-        this._$elem.append('<canvas ' + sizeAttr + ' style="-webkit-transform:translateZ(0);' + posCss + '"></canvas>');
-        this._$canvas = this._$elem.children(':last');
-        this._context = this._$canvas[0].getContext("2d");
-
-        this._blitcanvas = document.createElement( "canvas" );
-        this._blitcanvas.width = this._width;
-        this._blitcanvas.height = this._height;
-        this._blitcontext = this._blitcanvas.getContext("2d");
-      } else if (_ieVersion <= 8) {
-        this._trueCanvas = false;
-        this._$elem.append( '<div ' + sizeAttr + ' style="' + posCss + sizeCss + '"></div>');
-        this._$canvas = this._$elem.children(':last');
-
-        G_vmlCanvasManager.initElement(this._$canvas[0]);
-        this._context = this._$canvas[0].getContext("2d");
-        this._$canvas.children().css({ backgroundColor: "transparent", width: this._width, height: this._height });
-      }
-
-      this._$elem.append('<div class="geo-labels-container" style="-webkit-transform:translateZ(0);' + posCss + sizeCss + '"></div>');
-      this._$labelsContainer = this._$elem.children(':last');
-    },
-
-    _setOption: function (key, value) {
-      if (key == "style") {
-        value = $.extend({}, this._options.style, value);
-      }
-      $.Widget.prototype._setOption.apply(this, arguments);
-    },
-
-    destroy: function () {
-      $.Widget.prototype.destroy.apply(this, arguments);
-      this._$elem.html("");
-      this._$elem.removeClass( "geo-graphics" );
-    },
-
-    clear: function () {
-      this._context.clearRect(0, 0, this._width, this._height);
-      this._$labelsContainer.html("");
-    },
-
-    drawArc: function (coordinates, startAngle, sweepAngle, style) {
-      style = this._getGraphicStyle(style);
-
-      if (style.visibility != "hidden" && style.opacity > 0 && style.widthValue > 0 && style.heightValue > 0) {
-        var r = Math.min(style.widthValue, style.heightValue) / 2;
-
-        startAngle = (startAngle * Math.PI / 180);
-        sweepAngle = (sweepAngle * Math.PI / 180);
-
-        this._context.save();
-        this._context.translate(coordinates[0], coordinates[1]);
-        if (style.widthValue > style.heightValue) {
-          this._context.scale(style.widthValue / style.heightValue, 1);
-        } else {
-          this._context.scale(1, style.heightValue / style.widthValue);
-        }
-
-        this._context.beginPath();
-        this._context.arc(0, 0, r, startAngle, sweepAngle, false);
-
-        if (this._trueCanvas) {
-          this._context.restore();
-        }
-
-        if (style.doFill) {
-          this._context.fillStyle = style.fill;
-          this._context.globalAlpha = style.opacity * style.fillOpacity;
-          this._context.fill();
-        }
-
-        if (style.doStroke) {
-          this._context.lineJoin = "round";
-          this._context.lineWidth = style.strokeWidthValue;
-          this._context.strokeStyle = style.stroke;
-
-          this._context.globalAlpha = style.opacity * style.strokeOpacity;
-          this._context.stroke();
-        }
-
-        if (!this._trueCanvas) {
-          this._context.restore();
-        }
-      }
-    },
-
-    drawPoint: function (coordinates, style) {
-      style = this._getGraphicStyle(style);
-      if (style.widthValue == style.heightValue && style.heightValue == style.borderRadiusValue) {
-        this.drawArc(coordinates, 0, 360, style);
-      } else if (style.visibility != "hidden" && style.opacity > 0) {
-        style.borderRadiusValue = Math.min(Math.min(style.widthValue, style.heightValue) / 2, style.borderRadiusValue);
-        coordinates[0] -= style.widthValue / 2;
-        coordinates[1] -= style.heightValue / 2;
-        this._context.beginPath();
-        this._context.moveTo(coordinates[0] + style.borderRadiusValue, coordinates[1]);
-        this._context.lineTo(coordinates[0] + style.widthValue - style.borderRadiusValue, coordinates[1]);
-        this._context.quadraticCurveTo(coordinates[0] + style.widthValue, coordinates[1], coordinates[0] + style.widthValue, coordinates[1] + style.borderRadiusValue);
-        this._context.lineTo(coordinates[0] + style.widthValue, coordinates[1] + style.heightValue - style.borderRadiusValue);
-        this._context.quadraticCurveTo(coordinates[0] + style.widthValue, coordinates[1] + style.heightValue, coordinates[0] + style.widthValue - style.borderRadiusValue, coordinates[1] + style.heightValue);
-        this._context.lineTo(coordinates[0] + style.borderRadiusValue, coordinates[1] + style.heightValue);
-        this._context.quadraticCurveTo(coordinates[0], coordinates[1] + style.heightValue, coordinates[0], coordinates[1] + style.heightValue - style.borderRadiusValue);
-        this._context.lineTo(coordinates[0], coordinates[1] + style.borderRadiusValue);
-        this._context.quadraticCurveTo(coordinates[0], coordinates[1], coordinates[0] + style.borderRadiusValue, coordinates[1]);
-        this._context.closePath();
-
-        if (style.doFill) {
-          this._context.fillStyle = style.fill;
-          this._context.globalAlpha = style.opacity * style.fillOpacity;
-          this._context.fill();
-        }
-
-        if (style.doStroke) {
-          this._context.lineJoin = "round";
-          this._context.lineWidth = style.strokeWidthValue;
-          this._context.strokeStyle = style.stroke;
-
-          this._context.globalAlpha = style.opacity * style.strokeOpacity;
-
-          this._context.stroke();
-        }
-      }
-    },
-
-    drawLineString: function (coordinates, style) {
-      this._drawLines([coordinates], false, style);
-    },
-
-    drawPolygon: function (coordinates, style) {
-      if ( !this._trueCanvas || coordinates.length == 1 ) {
-        // either we don't have fancy rendering or there's no need for it (no holes)
-        this._drawLines( coordinates, true, style );
-      } else {
-        if ( !coordinates || !coordinates.length || coordinates[ 0 ].length < 3 ) {
-          // this is not a Polygon or it doesn't have a proper outer ring
-          return;
-        }
-
-        style = this._getGraphicStyle(style);
-
-        var pixelBbox, i, j;
-
-        if ( style.visibility != "hidden" && style.opacity > 0 ) {
-          this._blitcontext.clearRect(0, 0, this._width, this._height);
-
-          if ( style.doFill ) {
-            if ( coordinates.length > 1 ) {
-              // stencil inner rings
-              this._blitcontext.globalCompositeOperation = "source-out";
-              this._blitcontext.globalAlpha = 1;
-
-              for ( i = 1; i < coordinates.length; i++ ) {
-                this._blitcontext.beginPath();
-                this._blitcontext.moveTo( coordinates[ i ][ 0 ][ 0 ], coordinates[ i ][ 0 ][ 1 ] );
-                for ( j = 1; j < coordinates[ i ].length; j++ ) {
-                  this._blitcontext.lineTo( coordinates[ i ][ j ][ 0 ], coordinates[ i ][ j ][ 1 ] );
-                }
-                this._blitcontext.closePath();
-
-                this._blitcontext.fill( );
-              }
-            }
-          }
-
-          // path outer ring
-          this._blitcontext.beginPath();
-          this._blitcontext.moveTo( coordinates[ 0 ][ 0 ][ 0 ], coordinates[ 0 ][ 0 ][ 1 ] );
-
-          pixelBbox = [ coordinates[ 0 ][ 0 ][ 0 ] - style.strokeWidthValue, coordinates[ 0 ][ 0 ][ 1 ] - style.strokeWidthValue, coordinates[ 0 ][ 0 ][ 0 ] + style.strokeWidthValue, coordinates[ 0 ][ 0 ][ 1 ] + style.strokeWidthValue ];
-
-          for ( i = 1; i < coordinates[ 0 ].length - 1; i++ ) {
-            this._blitcontext.lineTo( coordinates[ 0 ][ i ][ 0 ], coordinates[ 0 ][ i ][ 1 ] );
-
-            pixelBbox[ 0 ] = Math.min( coordinates[ 0 ][ i ][ 0 ] - style.strokeWidthValue, pixelBbox[ 0 ] );
-            pixelBbox[ 1 ] = Math.min( coordinates[ 0 ][ i ][ 1 ] - style.strokeWidthValue, pixelBbox[ 1 ] );
-            pixelBbox[ 2 ] = Math.max( coordinates[ 0 ][ i ][ 0 ] + style.strokeWidthValue, pixelBbox[ 2 ] );
-            pixelBbox[ 3 ] = Math.max( coordinates[ 0 ][ i ][ 1 ] + style.strokeWidthValue, pixelBbox[ 3 ] );
-          }
-
-          this._blitcontext.closePath();
-
-          this._blitcontext.globalCompositeOperation = "source-out";
-          if ( style.doFill ) {
-            // fill outer ring
-            this._blitcontext.fillStyle = style.fill;
-            this._blitcontext.globalAlpha = style.opacity * style.fillOpacity;
-            this._blitcontext.fill( );
-          }
-
-          this._blitcontext.globalCompositeOperation = "source-over";
-          if ( style.doStroke ) {
-            // stroke outer ring
-            this._blitcontext.lineCap = this._blitcontext.lineJoin = "round";
-            this._blitcontext.lineWidth = style.strokeWidthValue;
-            this._blitcontext.strokeStyle = style.stroke;
-
-            this._blitcontext.globalAlpha = style.opacity * style.strokeOpacity;
-            this._blitcontext.stroke( );
-
-            if ( coordinates.length > 1 ) {
-              // stroke inner rings
-              for ( i = 1; i < coordinates.length; i++ ) {
-                this._blitcontext.beginPath();
-                this._blitcontext.moveTo( coordinates[ i ][ 0 ][ 0 ], coordinates[ i ][ 0 ][ 1 ] );
-                for ( j = 1; j < coordinates[ i ].length; j++ ) {
-                  this._blitcontext.lineTo( coordinates[ i ][ j ][ 0 ], coordinates[ i ][ j ][ 1 ] );
-                }
-                this._blitcontext.closePath();
-
-                this._blitcontext.stroke( );
-              }
-            }
-          }
-
-          // blit
-          pixelBbox[ 0 ] = Math.max( pixelBbox[ 0 ], 0 );
-          pixelBbox[ 1 ] = Math.max( pixelBbox[ 1 ], 0 );
-          pixelBbox[ 2 ] = Math.min( pixelBbox[ 2 ], this._width );
-          pixelBbox[ 3 ] = Math.min( pixelBbox[ 3 ], this._height );
-
-          this._context.drawImage(this._blitcanvas, pixelBbox[ 0 ], pixelBbox[ 1 ], pixelBbox[ 2 ] - pixelBbox[ 0 ], pixelBbox[ 3 ] - pixelBbox[ 1 ], pixelBbox[ 0 ], pixelBbox[ 1 ], pixelBbox[ 2 ] - pixelBbox[ 0 ], pixelBbox[ 3 ] - pixelBbox[ 1 ] );
-        }
-      }
-    },
-
-    drawBbox: function (bbox, style) {
-      this._drawLines([[
-        [bbox[0], bbox[1]],
-        [bbox[0], bbox[3]],
-        [bbox[2], bbox[3]],
-        [bbox[2], bbox[1]],
-        [bbox[0], bbox[1]]
-      ]], true, style);
-    },
-
-    drawLabel: function( coordinates, label ) {
-      this._$labelsContainer.append( '<div class="geo-label" style="-webkit-transform:translateZ(0);position:absolute; left:' + coordinates[ 0 ] + 'px; top:' + coordinates[ 1 ] + 'px;">' + label + '</div>');
-    },
-
-    resize: function( ) {
-      this._width = this._$elem.width();
-      this._height = this._$elem.height();
-
-      if (!(this._width && this._height)) {
-        this._width = parseInt(this._$elem.css("width"), 10);
-        this._height = parseInt(this._$elem.css("height"), 10);
-      }
-
-      if ( this._trueCanvas ) {
-        this._$canvas[0].width = this._width;
-        this._$canvas[0].height = this._height;
-      } else {
-      }
-
-      this._$labelsContainer.css( {
-        width: this._width,
-        height: this._height
-      } );
-    },
-
-    _getGraphicStyle: function (style) {
-      function safeParse(value) {
-        value = parseInt(value, 10);
-        return (+value + '') === value ? +value : value;
-      }
-
-      style = $.extend({}, this._options.style, style);
-      style.borderRadiusValue = safeParse(style.borderRadius);
-      style.fill = style.fill || style.color;
-      style.doFill = style.fill && style.fillOpacity > 0;
-      style.stroke = style.stroke || style.color;
-      style.strokeWidthValue = safeParse(style.strokeWidth);
-      style.doStroke = style.stroke && style.strokeOpacity > 0 && style.strokeWidthValue > 0;
-      style.widthValue = safeParse(style.width);
-      style.heightValue = safeParse(style.height);
-      return style;
-    },
-
-    _drawLines: function (coordinates, close, style) {
-      if (!coordinates || !coordinates.length || coordinates[0].length < 2) {
-        return;
-      }
-
-      var i, j;
-      style = this._getGraphicStyle(style);
-
-      if (style.visibility != "hidden" && style.opacity > 0) {
-        this._context.beginPath();
-
-        for (i = 0; i < coordinates.length; i++) {
-          this._context.moveTo(coordinates[i][0][0], coordinates[i][0][1]);
-          for (j = 1; j < coordinates[i].length; j++) {
-            this._context.lineTo(coordinates[i][j][0], coordinates[i][j][1]);
-          }
-        }
-
-        if (close) {
-          this._context.closePath();
-        }
-
-        if (close && style.doFill) {
-          this._context.fillStyle = style.fill;
-          this._context.globalAlpha = style.opacity * style.fillOpacity;
-          this._context.fill();
-        }
-
-        if (style.doStroke) {
-          this._context.lineCap = this._context.lineJoin = "round";
-          this._context.lineWidth = style.strokeWidthValue;
-          this._context.strokeStyle = style.stroke;
-
-          this._context.globalAlpha = style.opacity * style.strokeOpacity;
-          this._context.stroke();
-        }
-      }
-    }
-  });
-}(jQuery));
-
-
-(function ($, undefined) {
-  var _widgetIdSeed = 0,
-      _ieVersion = ( function () {
-        var v = 5, div = document.createElement("div"), a = div.all || [];
-        do {
-          div.innerHTML = "<!--[if gt IE " + (++v) + "]><br><![endif]-->";
-        } while ( a[0] );
-        return v > 6 ? v : !v;
-      }() ),
-
-      _defaultOptions = {
-        bbox: [-180, -85, 180, 85],
-        bboxMax: [-180, -85, 180, 85],
-        center: [0, 0],
-        cursors: {
-          "static": "default",
-          pan: "url(data:image/vnd.microsoft.icon;base64,AAACAAEAICACAAgACAAwAQAAFgAAACgAAAAgAAAAQAAAAAEAAQAAAAAAAAEAAAAAAAAAAAAAAgAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8AAAA/AAAAfwAAAP+AAAH/gAAB/8AAA//AAAd/wAAGf+AAAH9gAADbYAAA2yAAAZsAAAGbAAAAGAAAAAAAAA//////////////////////////////////////////////////////////////////////////////////////gH///4B///8Af//+AD///AA///wAH//4AB//8AAf//AAD//5AA///gAP//4AD//8AF///AB///5A////5///8=), move",
-          zoom: "crosshair",
-          dragBox: "crosshair",
-          dragCircle: "crosshair",
-          drawPoint: "crosshair",
-          drawLineString: "crosshair",
-          drawPolygon: "crosshair",
-          measureLength: "crosshair",
-          measureArea: "crosshair"
-        },
-        measureLabels: {
-          length: "{{:length.toFixed( 2 )}} m",
-          area: "{{:area.toFixed( 2 )}} sq m"
-        },
-        drawStyle: {},
-        shapeStyle: {},
-        mode: "pan",
-        pannable: true,
-        scroll: "default",
-        shift: "default",
-        services: [
-            {
-              "class": "osm",
-              type: "tiled",
-              src: function (view) {
-                return "http://otile" + ((view.index % 4) + 1) + ".mqcdn.com/tiles/1.0.0/osm/" + view.zoom + "/" + view.tile.column + "/" + view.tile.row + ".png";
-              },
-              attr: "Tiles Courtesy of <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png'>"
-            }
-          ],
-        tilingScheme: {
-          tileWidth: 256,
-          tileHeight: 256,
-          levels: 18,
-          basePixelSize: 156543.03392799936,
-          origin: [-20037508.342787, 20037508.342787]
-        },
-        axisLayout: "map",
-        zoom: 0,
-        zoomMin: 0,
-        zoomMax: Number.POSITIVE_INFINITY,
-        pixelSize: 0
-      };
-
-  $.widget("geo.geomap", {
-    // private widget members
-    _$elem: undefined, //< map div for maps, service div for services
-    _map: undefined, //< only defined in services
-    _created: false,
-    _createdGraphics: false,
-    _widgetId: 0,
-    _tmplLengthId: "",
-    _tmplAreaId: "",
-
-    _contentBounds: {},
-
-    _$resizeContainer: undefined, //< all elements that should match _contentBounds' size
-
-    _$eventTarget: undefined,
-    _$contentFrame: undefined,
-    _$existingChildren: undefined,
-    _$attrList: undefined,
-    _$servicesContainer: undefined,
-    _$shapesContainers: undefined, //< all shapesContainer divs (map only)
-
-    _$panContainer: undefined, //< all non-service elements that move while panning
-    _$shapesContainer: undefined, //< just "our" shapesContainer div (map & service)
-    _$drawContainer: undefined,
-    _$measureContainer: undefined,
-    _$measureLabel: undefined,
-
-    _dpi: 96,
-
-    _currentServices: [], //< internal copy
-
-    _center: undefined,
-    _pixelSize: undefined,
-    _centerMax: undefined,
-    _pixelSizeMax: undefined,
-
-    _userGeodetic: true,
-
-    _centerInteractive: undefined,
-    _pixelSizeInteractive: undefined,
-    _timeoutInteractive: null,
-    _triggerInteractive: false,
-
-    _loadCount: 0,
-
-    _wheelTimeout: null,
-    _wheelLevel: 0,
-
-    _zoomFactor: 2, //< determines what a zoom level means
-
-    _fullZoomFactor: 2, //< interactiveScale factor needed to zoom a whole level
-    _partialZoomFactor: 1.18920711500273, //< interactiveScale factor needed to zoom a fraction of a level (the fourth root of 2)
-
-    _mouseDown: undefined,
-    _inOp: undefined,
-    _toolPan: undefined,
-    _shiftDown: undefined,
-    _anchor: undefined,
-    _current: undefined,
-    _downDate: undefined,
-    _moveDate: undefined,
-    _clickDate: undefined,
-    _lastMove: undefined,
-    _lastDrag: undefined,
-
-    _windowHandler: null,
-    _resizeTimeout: null,
-
-    _panning: undefined,
-    _velocity: undefined,
-    _friction: undefined,
-
-    _supportTouch: undefined,
-    _softDblClick: undefined,
-    _isTap: undefined,
-    _isDbltap: undefined,
-
-    _isMultiTouch: undefined,
-    _multiTouchAnchor: [], //< TouchList
-    _multiTouchAnchorBbox: undefined, //< bbox
-    _multiTouchCurrentBbox: undefined, //< bbox
-
-    _drawTimeout: null, //< used in drawPoint mode so we don't send two shape events on dbltap
-    _drawPixels: [], //< an array of coordinate arrays for drawing lines & polygons, in pixel coordinates
-    _drawCoords: [],
-
-    _graphicShapes: [], //< an array of objects containing style object refs & GeoJSON object refs
-
-    _initOptions: {},
-
-    _options: {},
-
-    options: $.extend({}, _defaultOptions),
-
-    _createWidget: function (options, element) {
-      this._$elem = $(element);
-
-      if (this._$elem.is(".geo-service")) {
-        this._graphicShapes = [];
-        $.Widget.prototype._createWidget.apply(this, arguments);
-        return;
-      }
-
-      this._widgetId = _widgetIdSeed++;
-      this._tmplLengthId = "geoMeasureLength" + this._widgetId;
-      this._tmplAreaId = "geoMeasureArea" + this._widgetId;
-
-      this._$elem.addClass("geo-map").css( {
-        webkitTransform: "translateZ(0)"
-      } );
-        
-
-      this._initOptions = options || {};
-
-      this._forcePosition(this._$elem);
-
-      this._$elem.css("text-align", "left");
-
-      var size = this._findMapSize();
-      this._contentBounds = {
-        x: parseInt(this._$elem.css("padding-left"), 10),
-        y: parseInt(this._$elem.css("padding-top"), 10),
-        width: size["width"],
-        height: size["height"]
-      };
-
-      this._createChildren();
-
-      this._center = [ 0, 0 ];
-      this._centerMax = [ 0, 0 ];
-      this._centerInteractive = [ 0, 0 ];
-
-      this.options["pixelSize"] = this._pixelSize = this._pixelSizeMax = 156543.03392799936;
-
-      this._mouseDown =
-          this._inOp =
-          this._toolPan =
-          this._shiftDown =
-          this._panning =
-          this._isTap =
-          this._isDbltap = false;
-
-      this._anchor = [ 0, 0 ];
-      this._current = [ 0, 0 ];
-      this._lastMove = [ 0, 0 ];
-      this._lastDrag = [ 0, 0 ];
-      this._velocity = [ 0, 0 ];
-
-      this._friction = [0.8, 0.8];
-
-      this._downDate =
-          this._moveDate =
-          this._clickDate = 0;
-
-      this._drawPixels = [];
-      this._drawCoords =  [];
-      this._graphicShapes = [];
-
-
-      $.Widget.prototype._createWidget.apply(this, arguments);
-    },
-
-    _create: function () {
-      this._options = this.options;
-
-      if (this._$elem.is(".geo-service")) {
-        this._map = this._$elem.data( "geoMap" );
-        this._$elem.data( "geoService", this );
-        return;
-      }
-
-      this._map = this;
-
-      this._supportTouch = "ontouchend" in document;
-      this._softDblClick = this._supportTouch || _ieVersion == 7;
-
-      var geomap = this,
-          touchStartEvent = this._supportTouch ? "touchstart" : "mousedown",
-          touchStopEvent = this._supportTouch ? "touchend touchcancel" : "mouseup",
-          touchMoveEvent = this._supportTouch ? "touchmove" : "mousemove";
-
-      $(document).keydown($.proxy(this._document_keydown, this));
-
-      this._$eventTarget.dblclick($.proxy(this._eventTarget_dblclick, this));
-
-      this._$eventTarget.bind(touchStartEvent, $.proxy(this._eventTarget_touchstart, this));
-
-      var dragTarget = (this._$eventTarget[0].setCapture) ? this._$eventTarget : $(document);
-      dragTarget.bind(touchMoveEvent, $.proxy(this._dragTarget_touchmove, this));
-      dragTarget.bind(touchStopEvent, $.proxy(this._dragTarget_touchstop, this));
-
-      this._$eventTarget.mousewheel($.proxy(this._eventTarget_mousewheel, this));
-
-      this._windowHandler = function () {
-        if (geomap._resizeTimeout) {
-          clearTimeout(geomap._resizeTimeout);
-        }
-        geomap._resizeTimeout = setTimeout(function () {
-          if (geomap._created) {
-            geomap._$elem.geomap( "resize", true );
-          }
-        }, 500);
-      };
-
-      $(window).resize(this._windowHandler);
-
-      this._$drawContainer.geographics({ style: this._initOptions.drawStyle || {} });
-      this._options["drawStyle"] = this._$drawContainer.geographics("option", "style");
-
-      this._$shapesContainer.geographics( { style: this._initOptions.shapeStyle || { } } );
-      this._createdGraphics = true;
-
-      this._options["shapeStyle"] = this._$shapesContainer.geographics("option", "style");
-
-      if (this._initOptions) {
-        // always init tilingScheme right away, even if it's null
-        if ( this._initOptions.tilingScheme !== undefined ) {
-          this._setOption("tilingScheme", this._initOptions.tilingScheme || null, false);
-        }
-
-        if ( this._initOptions.services ) {
-          // jQuery UI Widget Factory merges user services with our default, we want to clobber the default
-          this._options[ "services" ] = $.merge( [ ], this._initOptions.services );
-        }
-        if (this._initOptions.bboxMax) {
-          this._setOption("bboxMax", this._initOptions.bboxMax, false);
-          this._setOption("bbox", this._initOptions.bboxMax, false);
-        }
-        if (this._initOptions.zoomMin !== undefined) {
-          this._setOption("zoomMin", this._initOptions.zoomMin, false);
-        }
-        if (this._initOptions.zoomMax !== undefined) {
-          this._setOption("zoomMax", this._initOptions.zoomMax, false);
-        }
-        if (this._initOptions.bbox) {
-          this._setOption("bbox", this._initOptions.bbox, false);
-        }
-        if (this._initOptions.center) {
-          this._setOption("center", this._initOptions.center, false);
-        }
-        if (this._initOptions.zoom !== undefined) {
-          this._setOption("zoom", this._initOptions.zoom, false);
-        }
-      }
-
-      $.templates( this._tmplLengthId, this._options[ "measureLabels" ].length );
-      $.templates( this._tmplAreaId, this._options[ "measureLabels" ].area );
-
-      this._$eventTarget.css("cursor", this._options["cursors"][this._options["mode"]]);
-
-      this._createServices();
-      this._refresh();
-
-      this._created = true;
-    },
-
-    _setOption: function (key, value, refresh) {
-      if ( key == "pixelSize" ) {
-        return;
-      }
-
-      refresh = (refresh === undefined || refresh);
-
-      if ( this._$elem.is( ".geo-map" ) ) {
-        this._panFinalize();
-      }
-
-      var center, pixelSize, bbox, zoom;
-
-      switch (key) {
-        case "bbox":
-          if ( this._created ) {
-            this._clearInteractiveTimeout( );
-          }
-
-          this._userGeodetic = $.geo.proj && $.geo._isGeodetic( value );
-          if ( this._userGeodetic ) {
-            value = $.geo.proj.fromGeodetic( value );
-          }
-
-          center = [value[0] + (value[2] - value[0]) / 2, value[1] + (value[3] - value[1]) / 2];
-          pixelSize = Math.max($.geo.width(value, true) / this._contentBounds.width, $.geo.height(value, true) / this._contentBounds.height);
-
-          // clamp to zoom
-          zoom = this._getZoom( center, pixelSize );
-
-          if ( this._options[ "tilingScheme" ] ) {
-            pixelSize = this._getPixelSize( Math.min( Math.max( zoom, this._options[ "zoomMin" ] ), this._options[ "zoomMax" ] ) );
-          } else {
-            if ( zoom < this._options[ "zoomMin" ] ) {
-              pixelSize = this._getPixelSize( this._options[ "zoomMin" ] );
-            } else if ( zoom > this._options[ "zoomMax" ] ) {
-              pixelSize = this._getPixelSize( this._options[ "zoomMax" ] );
-            }
-          }
-
-          if ( this._created ) {
-            this._setInteractiveCenterAndSize( center, pixelSize );
-            this._setInteractiveTimeout( false );
-          } else {
-            this._setCenterAndSize( center, pixelSize, false, refresh );
-          }
-
-          value = this._getBbox( center, pixelSize );
-          break;
-
-        case "bboxMax":
-          this._userGeodetic = $.geo.proj && $.geo._isGeodetic( value );
-          break;
-
-        case "center":
-          if ( this._created ) {
-            this._clearInteractiveTimeout( );
-          }
-
-          this._userGeodetic = $.geo.proj && $.geo._isGeodetic( value );
-          if ( this._userGeodetic ) {
-            value = $.geo.proj.fromGeodetic( value );
-          }
-
-          if ( this._created ) {
-            this._setInteractiveCenterAndSize( value, this._pixelSize );
-            this._setInteractiveTimeout( false );
-          } else {
-            this._setCenterAndSize( value, this._pixelSize, false, refresh );
-          }
-          break;
-
-        case "measureLabels":
-          value = $.extend( this._options[ "measureLabels" ], value );
-
-
-          $.templates( this._tmplLengthId, this._options[ "measureLabels" ].length );
-          $.templates( this._tmplAreaId, this._options[ "measureLabels" ].area );
-
-          break;
-
-        case "drawStyle":
-          if (this._$drawContainer) {
-            this._$drawContainer.geographics("option", "style", value);
-            value = this._$drawContainer.geographics("option", "style");
-          }
-          break;
-
-        case "shapeStyle":
-          if ( this._$elem.is( ".geo-service" ) && !this._createdGraphics ) {
-            this._createServiceGraphics( );
-          }
-
-          if ( this._createdGraphics ) {
-            this._$shapesContainer.geographics("option", "style", value);
-            value = this._$shapesContainer.geographics("option", "style");
-          }
-          break;
-
-        case "mode":
-          this._resetDrawing( );
-          this._$eventTarget.css("cursor", this._options["cursors"][value]);
-          break;
-
-        case "zoom":
-          if ( this._created ) {
-            this._setZoom(value, false, refresh);
-          } else {
-            value = Math.max( value, 0 );
-            this._setCenterAndSize( this._center, this._getPixelSize( value ), false, refresh );
-          }
-          break;
-      }
-
-      $.Widget.prototype._setOption.apply(this, arguments);
-
-      switch ( key ) {
-        case "bbox":
-        case "center":
-          if ( this._userGeodetic ) {
-            this._options[ "bbox" ] = $.geo.proj.toGeodetic( this._options[ "bbox" ] );
-            this._options[ "center" ] = $.geo.proj.toGeodetic( this._center );
-          }
-          break;
-
-        case "tilingScheme":
-          if ( value !== null ) {
-            this._pixelSizeMax = this._getPixelSize( 0 );
-            this._centerMax = [
-              value.origin[ 0 ] + this._pixelSizeMax * value.tileWidth / 2,
-              value.origin[ 1 ] + this._pixelSizeMax * value.tileHeight / 2
-            ];
-          }
-          break;
-
-        case "bboxMax":
-          if ( $.geo.proj && $.geo._isGeodetic( value ) ) {
-            bbox = $.geo.proj.fromGeodetic( value );
-          } else {
-            bbox = value;
-          }
-
-          this._centerMax = $.geo.center( bbox );
-          this._pixelSizeMax = Math.max( $.geo.width( bbox, true ) / this._contentBounds.width, $.geo.height( bbox, true ) / this._contentBounds.height );
-          break;
-
-        case "services":
-          this._createServices();
-          if (refresh) {
-            this._refresh();
-          }
-          break;
-
-        case "shapeStyle":
-          if ( refresh && this._createdGraphics ) {
-            this._$shapesContainer.geographics("clear");
-            this._refreshShapes( this._$shapesContainer, this._graphicShapes, this._graphicShapes, this._graphicShapes );
-          }
-          break;
-      }
-    },
-
-    destroy: function () {
-      if ( this._$elem.is(".geo-service") ) {
-        if ( this._createdGraphics ) {
-          this._$shapesContainer.geographics("destroy");
-          this._$shapesContainer = undefined;
-          this._createdGraphics = false;
-        }
-      } else {
-        clearTimeout( this._timeoutInteractive );
-        this._timeoutInteractive = null;
-
-        this._created = false;
-
-        $(window).unbind("resize", this._windowHandler);
-
-        for ( var i = 0; i < this._currentServices.length; i++ ) {
-          this._currentServices[ i ].serviceContainer.geomap("destroy");
-          $.geo["_serviceTypes"][this._currentServices[i].type].destroy(this, this._$servicesContainer, this._currentServices[i]);
-        }
-
-        this._$shapesContainer.geographics("destroy");
-        this._$shapesContainer = undefined;
-        this._createdGraphics = false;
-
-        this._$drawContainer.geographics("destroy");
-        this._$drawContainer = undefined;
-
-        this._$existingChildren.detach();
-        this._$elem.html("");
-        this._$elem.append(this._$existingChildren);
-        this._$elem.removeClass("geo-map");
-      }
-
-      $.Widget.prototype.destroy.apply(this, arguments);
-    },
-
-    toMap: function (p) {
-      p = this._toMap(p);
-      return this._userGeodetic ? $.geo.proj.toGeodetic(p) : p;
-    },
-
-    toPixel: function ( p, _center /* Internal Use Only */, _pixelSize /* Internal Use Only */ ) {
-      return this._toPixel( $.geo.proj ? $.geo.proj.fromGeodetic( p ) : p, _center, _pixelSize );
-    },
-
-    opacity: function ( value, _serviceContainer ) {
-      if ( this._$elem.is( ".geo-service" ) ) {
-        this._$elem.closest( ".geo-map" ).geomap( "opacity", value, this._$elem );
-      } else {
-        if ( value >= 0 || value <= 1 ) {
-          for ( var i = 0; i < this._currentServices.length; i++ ) {
-            var service = this._currentServices[ i ];
-            if ( !_serviceContainer || service.serviceContainer[ 0 ] == _serviceContainer[ 0 ] ) {
-              service.style.opacity = value;
-
-              // update the original service object's style property
-              service.serviceObject.style = $.extend( { }, service.serviceObject.style, service.style );
-
-              $.geo[ "_serviceTypes" ][ service.type ].opacity( this, service );
-            }
-          }
-        }
-      }
-    },
-
-    toggle: function ( value, _serviceContainer ) {
-      if ( this._$elem.is( ".geo-service" ) ) {
-        this._$elem.closest( ".geo-map" ).geomap( "toggle", value, this._$elem );
-      } else {
-
-        for ( var i = 0; i < this._currentServices.length; i++ ) {
-          var service = this._currentServices[ i ];
-
-          if ( !_serviceContainer || service.serviceContainer[ 0 ] == _serviceContainer[ 0 ] ) {
-            if ( value === undefined ) {
-              // toggle visibility
-              value = ( service.style.visibility !== "visible" );
-            }
-
-            service.style.visibility = ( value ? "visible" : "hidden" );
-
-            // update the original service object's style property
-            service.serviceObject.style = $.extend( { }, service.serviceObject.style, service.style );
-
-            service.serviceContainer.toggle( value );
-
-            if ( value ) {
-              $.geo[ "_serviceTypes" ][ service.type ].refresh( this, service );
-            }
-          }
-        }
-      }
-    },
-
-    zoom: function (numberOfLevels) {
-      if (numberOfLevels !== null) {
-        this._setZoom(this._options["zoom"] + numberOfLevels, false, true);
-      }
-    },
-
-    refresh: function ( force, _serviceContainer ) {
-      if ( this._$elem.is( ".geo-service" ) ) {
-        this._$elem.closest( ".geo-map" ).geomap( "refresh", force, this._$elem );
-      } else {
-        this._refresh( force, _serviceContainer );
-      }
-    },
-
-    resize: function ( _trigger /* Internal Use Only */ ) {
-      var size = this._findMapSize(),
-          dx = size["width"]/2 - this._contentBounds.width/2,
-          dy = size["height"]/2 - this._contentBounds.height/2,
-          i;
-
-      this._contentBounds = {
-        x: parseInt(this._$elem.css("padding-left"), 10),
-        y: parseInt(this._$elem.css("padding-top"), 10),
-        width: size["width"],
-        height: size["height"]
-      };
-
-      this._$resizeContainer.css( {
-        width: size["width"],
-        height: size["height"]
-      } );
-
-      for (i = 0; i < this._currentServices.length; i++) {
-        $.geo["_serviceTypes"][this._currentServices[i].type].resize(this, this._currentServices[i]);
-      }
-
-      this._$elem.find( ".geo-graphics" ).css( {
-        width: size["width"],
-        height: size["height"]
-      }).geographics( "resize" );
-
-      for (i = 0; i < this._drawPixels.length; i++) {
-        this._drawPixels[i][0] += dx;
-        this._drawPixels[i][1] += dy;
-      }
-
-      this._setCenterAndSize(this._center, this._pixelSize, _trigger, true);
-    },
-
-    append: function ( shape, style, label, refresh ) {
-      if ( shape && ( $.isPlainObject( shape ) || ( $.isArray( shape ) && shape.length > 0 ) ) ) {
-        if ( !this._createdGraphics ) {
-          this._createServiceGraphics( );
-        }
-
-        var shapes, arg, i, realStyle, realLabel, realRefresh;
-
-        if ( $.isArray( shape ) ) {
-          shapes = shape;
-        } else if ( shape.type == "FeatureCollection" ) {
-          shapes = shape.features;
-        } else {
-          shapes = [ shape ];
-        }
-
-        for ( i = 1; i < arguments.length; i++ ) {
-          arg = arguments[ i ];
-
-          if ( typeof arg === "object" ) {
-            realStyle = arg;
-          } else if ( typeof arg === "number" || typeof arg === "string" ) {
-            realLabel = arg;
-          } else if ( typeof arg === "boolean" ) {
-            realRefresh = arg;
-          }
-        }
-
-        for ( i = 0; i < shapes.length; i++ ) {
-          if ( shapes[ i ].type != "Point" ) {
-            var bbox = $.geo.bbox( shapes[ i ] );
-            if ( $.geo.proj && $.geo._isGeodetic( bbox ) ) {
-              bbox = $.geo.proj.fromGeodetic( bbox );
-            }
-            $.data( shapes[ i ], "geoBbox", bbox );
-          }
-
-          this._graphicShapes.push( {
-            shape: shapes[ i ],
-            style: realStyle,
-            label: realLabel
-          } );
-        }
-
-        if ( realRefresh === undefined || realRefresh ) {
-          if ( this._$elem.is( ".geo-service" ) ) {
-            this._refresh( false, this._$elem );
-          } else {
-            this._refresh( );
-          }
-        }
-      }
-    },
-
-    empty: function ( refresh ) {
-      for ( var i = 0; i < this._graphicShapes.length; i++ ) {
-        $.removeData( this._graphicShapes[ i ].shape, "geoBbox" );
-      }
-
-      this._graphicShapes = [];
-
-      if ( refresh === undefined || refresh ) {
-        if ( this._$elem.is( ".geo-service" ) ) {
-          this._refresh( false, this._$elem );
-        } else {
-          this._refresh( );
-        }
-      }
-    },
-
-    find: function ( selector, pixelTolerance ) {
-      var isPoint = $.isPlainObject( selector ),
-          searchPixel = isPoint ? this._map.toPixel( selector.coordinates ) : undefined,
-          mapTol = this._map._pixelSize * pixelTolerance,
-          result = [],
-          graphicShape,
-          geometries,
-          curGeom,
-          i = 0;
-
-      for ( ; i < this._graphicShapes.length; i++ ) {
-        graphicShape = this._graphicShapes[ i ];
-
-        if ( isPoint ) {
-          if ( graphicShape.shape.type == "Point" ) {
-            if ( $.geo.distance( graphicShape.shape, selector ) <= mapTol ) {
-              result.push( graphicShape.shape );
-            }
-          } else {
-            var bbox = $.data( graphicShape.shape, "geoBbox" ),
-                bboxPolygon = {
-                  type: "Polygon",
-                  coordinates: [ [
-                    [bbox[0], bbox[1]],
-                    [bbox[0], bbox[3]],
-                    [bbox[2], bbox[3]],
-                    [bbox[2], bbox[1]],
-                    [bbox[0], bbox[1]]
-                  ] ]
-                },
-                projectedPoint = {
-                  type: "Point",
-                  coordinates: $.geo.proj && $.geo._isGeodetic( selector.coordinates ) ? $.geo.proj.fromGeodetic( selector.coordinates ) : selector.coordinates
-                };
-
-            if ( $.geo.distance( bboxPolygon, projectedPoint, true ) <= mapTol ) {
-              geometries = $.geo._flatten( graphicShape.shape );
-              for ( curGeom = 0; curGeom < geometries.length; curGeom++ ) {
-                if ( $.geo.distance( geometries[ curGeom ], selector ) <= mapTol ) {
-                  result.push( graphicShape.shape );
-                  break;
-                }
-              }
-            }
-          }
-        } else {
-          result.push( graphicShape.shape );
-        }
-      }
-
-      if ( this._$elem.is( ".geo-map" ) ) {
-        this._$elem.find( ".geo-service" ).each( function( ) {
-          result = $.merge( result, $( this ).geomap( "find", selector, pixelTolerance ) );
-        } );
-      }
-
-      return result;
-    },
-
-    remove: function ( shape, refresh ) {
-      if ( shape && ( $.isPlainObject( shape ) || ( $.isArray( shape ) && shape.length > 0 ) ) ) {
-        var shapes = $.isArray( shape ) ? shape : [ shape ],
-            rest;
-
-        for ( var i = 0; i < this._graphicShapes.length; i++ ) {
-          if ( $.inArray( this._graphicShapes[ i ].shape, shapes ) >= 0 ) {
-            $.removeData( shape, "geoBbox" );
-            rest = this._graphicShapes.slice( i + 1 );
-            this._graphicShapes.length = i;
-            this._graphicShapes.push.apply( this._graphicShapes, rest );
-            i--;
-          }
-        }
-
-        if ( refresh === undefined || refresh ) {
-          if ( this._$elem.is( ".geo-service" ) ) {
-            this._refresh( false, this._$elem );
-          } else {
-            this._refresh( );
-          }
-        }
-      }
-    },
-
-    _getBbox: function (center, pixelSize) {
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      // calculate the internal bbox
-      var halfWidth = this._contentBounds[ "width" ] / 2 * pixelSize,
-          halfHeight = this._contentBounds[ "height" ] / 2 * pixelSize;
-      return [ center[ 0 ] - halfWidth, center[ 1 ] - halfHeight, center[ 0 ] + halfWidth, center[ 1 ] + halfHeight ];
-    },
-
-    _setBbox: function (value, trigger, refresh) {
-      var center = [value[0] + (value[2] - value[0]) / 2, value[1] + (value[3] - value[1]) / 2],
-          pixelSize = Math.max($.geo.width(value, true) / this._contentBounds.width, $.geo.height(value, true) / this._contentBounds.height),
-          zoom = this._getZoom( center, pixelSize );
-
-      // clamp to zoom
-      if ( this._options[ "tilingScheme" ] ) {
-        pixelSize = this._getPixelSize( Math.min( Math.max( zoom, this._options[ "zoomMin" ] ), this._options[ "zoomMax" ] ) );
-      } else {
-        if ( zoom < this._options[ "zoomMin" ] ) {
-          pixelSize = this._getPixelSize( this._options[ "zoomMin" ] );
-        } else if ( zoom > this._options[ "zoomMax" ] ) {
-          pixelSize = this._getPixelSize( this._options[ "zoomMax" ] );
-        }
-      }
-
-      this._setInteractiveCenterAndSize( center, pixelSize );
-      this._interactiveTransform( );
-    },
-
-    _getBboxMax: function () {
-      // calculate the internal bboxMax
-      var halfWidth = this._contentBounds["width"] / 2 * this._pixelSizeMax,
-        halfHeight = this._contentBounds["height"] / 2 * this._pixelSizeMax;
-      return [this._centerMax[0] - halfWidth, this._centerMax[1] - halfHeight, this._centerMax[0] + halfWidth, this._centerMax[1] + halfHeight];
-    },
-
-    _getCenter: function () {
-      return this._center;
-    },
-
-    _getContentBounds: function () {
-      return this._contentBounds;
-    },
-
-    _getServicesContainer: function () {
-      return this._$servicesContainer;
-    },
-
-    _getZoom: function ( center, pixelSize ) {
-      // calculate the internal zoom level, vs. public zoom property
-      // this does not take zoomMin or zoomMax into account
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      var tilingScheme = this._options["tilingScheme"];
-      if ( tilingScheme ) {
-        if ( tilingScheme.pixelSizes ) {
-          var roundedPixelSize = Math.floor(pixelSize * 1000),
-              levels = tilingScheme.pixelSizes.length,
-              i = levels - 1;
-
-          for ( ; i >= 0; i-- ) {
-            if ( Math.floor( tilingScheme.pixelSizes[ i ] * 1000 ) >= roundedPixelSize ) {
-              return i;
-            }
-          }
-
-          return 0;
-        } else {
-          return Math.round( Math.log( tilingScheme.basePixelSize / pixelSize) / Math.log( 2 ) );
-        }
-      } else {
-        var ratio = this._contentBounds["width"] / this._contentBounds["height"],
-            bbox = $.geo.reaspect( this._getBbox( center, pixelSize ), ratio, true ),
-            bboxMax = $.geo.reaspect(this._getBboxMax(), ratio, true);
-
-        return Math.round( Math.log($.geo.width(bboxMax, true) / $.geo.width(bbox, true)) / Math.log(this._zoomFactor) );
-      }
-    },
-
-    _setZoom: function ( value, trigger, refresh ) {
-      // set the map widget's zoom, taking zoomMin and zoomMax into account
-      this._clearInteractiveTimeout( );
-
-      value = Math.min( Math.max( value, this._options[ "zoomMin" ] ), this._options[ "zoomMax" ] );
-      this._setInteractiveCenterAndSize( this._center, this._getPixelSize( value ) );
-      this._interactiveTransform( );
-
-      this._setInteractiveTimeout( trigger );
-    },
-
-    _createChildren: function () {
-      this._$existingChildren = this._$elem.children();
-
-      this._forcePosition(this._$existingChildren);
-
-      this._$existingChildren.detach().css( {
-        mozUserSelect: "none"
-      } );
-
-
-      var contentSizeCss = "width:" + this._contentBounds["width"] + "px; height:" + this._contentBounds["height"] + "px; margin:0; padding:0;",
-          contentPosCss = "position:absolute; left:0; top:0;";
-
-      this._$elem.prepend('<div class="geo-event-target geo-content-frame" style="position:absolute; left:' + this._contentBounds.x + 'px; top:' + this._contentBounds.y + 'px;' + contentSizeCss + 'overflow:hidden; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none;" unselectable="on"></div>');
-      this._$eventTarget = this._$contentFrame = this._$elem.children(':first');
-
-      this._$contentFrame.append('<div class="geo-services-container" style="' + contentPosCss + contentSizeCss + '"></div>');
-      this._$servicesContainer = this._$contentFrame.children(':last');
-
-      this._$contentFrame.append('<div class="geo-shapes-container" style="' + contentPosCss + contentSizeCss + '"></div>');
-      this._$shapesContainer = this._$contentFrame.children(':last');
-
-      this._$contentFrame.append( '<ul style="position: absolute; bottom: 8px; left: 8px; list-style-type: none; max-width: 50%; padding: 0; margin: 0;"></ul>' );
-      this._$attrList = this._$contentFrame.children( ":last" );
-
-      this._$contentFrame.append('<div class="geo-draw-container" style="' + contentPosCss + contentSizeCss + '"></div>');
-      this._$drawContainer = this._$contentFrame.children(':last');
-
-      this._$contentFrame.append('<div class="geo-measure-container" style="' + contentPosCss + contentSizeCss + '"><span class="geo-measure-label" style="' + contentPosCss + '; display: none;"></span></div>');
-      this._$measureContainer = this._$contentFrame.children(':last');
-      this._$measureLabel = this._$measureContainer.children();
-
-      this._$panContainer = $( [ this._$shapesContainer[ 0 ], this._$drawContainer[ 0 ], this._$measureContainer[ 0 ] ] );
-
-      this._$resizeContainer = $( [ this._$contentFrame[ 0 ], this._$servicesContainer[ 0 ], this._$eventTarget[ 0 ], this._$measureContainer[ 0 ] ] ); 
-
-      this._$contentFrame.append(this._$existingChildren);
-
-      if ( ! $("#geo-measure-style").length ) {
-        $("head").prepend( '<style type="text/css" id="geo-measure-style">.geo-measure-label { margin: 4px 0 0 6px; font-family: sans-serif;' + ( _ieVersion ? 'letter-spacing: 2px; color: #444; filter:progid:DXImageTransform.Microsoft.DropShadow(Color=white, OffX=1, OffY=2, Positive=true);' : 'color: #000; text-shadow: #fff 1px 2px; font-weight: bold;' ) + ' }</style>' );
-      }
-    },
-
-    _createServices: function () {
-      var service, i;
-
-      for ( i = 0; i < this._currentServices.length; i++ ) {
-        this._currentServices[ i ].serviceContainer.geomap( "destroy" );
-        $.geo[ "_serviceTypes" ][ this._currentServices[ i ].type ].destroy( this, this._$servicesContainer, this._currentServices[ i ] );
-      }
-
-      this._currentServices = [ ];
-      this._$servicesContainer.html( "" );
-      this._$attrList.html( "" );
-
-      for ( i = 0; i < this._options[ "services" ].length; i++ ) {
-        service = this._currentServices[ i ] = $.extend( { }, this._options[ "services" ][ i ] );
-
-        // keep a reference to the original
-        service.serviceObject = this._options[ "services" ][ i ];
-
-        // default the service style property on our copy
-        service.style = $.extend( {
-                          visibility: "visible",
-                          opacity: 1
-                        }, service.style );
-
-        var idString = service.id ? ' id="' + service.id + '"' : "",
-            classString = 'class="geo-service ' + ( service["class"] ? service["class"] : '' ) + '"',
-            scHtml = '<div ' + idString + classString + ' style="-webkit-transform:translateZ(0);position:absolute; left:0; top:0; width:32px; height:32px; margin:0; padding:0; display:' + ( service.style.visibility === "visible" ? "block" : "none" ) + ';"></div>',
-            servicesContainer;
-
-        this._$servicesContainer.append( scHtml );
-        serviceContainer = this._$servicesContainer.children( ":last" );
-        service.serviceContainer = serviceContainer;
-        
-        $.geo[ "_serviceTypes" ][ service.type ].create( this, serviceContainer, service, i );
-
-        serviceContainer.data( "geoMap", this ).geomap();
-
-        if ( service.attr ) {
-          this._$attrList.append( '<li>' + service.attr + '</li>' );
-        }
-      }
-
-      // start with our map-level shapesContainer
-      this._$shapesContainers = this._$shapesContainer;
-
-      this._$attrList.find( "a" ).css( {
-        position: "relative",
-        zIndex: 100
-      } );
-    },
-
-    _createServiceGraphics: function( ) { 
-      // only called in the context of a service-level geomap
-      var $contentFrame = this._$elem.closest( ".geo-content-frame" );
-      this._$elem.append('<div class="geo-shapes-container" style="position:absolute; left:0; top:0; width:' + $contentFrame.css( "width" ) + '; height:' + $contentFrame.css( "height" ) + '; margin:0; padding:0;"></div>');
-      this._$shapesContainer = this._$elem.children(':last');
-
-      this._map._$shapesContainers = this._map._$shapesContainers.add( this._$shapesContainer );
-
-      this._$shapesContainer.geographics( );
-      this._createdGraphics = true;
-
-      this._options["shapeStyle"] = this._$shapesContainer.geographics("option", "style");
-    },
-
-    _refreshDrawing: function ( ) {
-      this._$drawContainer.geographics("clear");
-
-      if ( this._drawPixels.length > 0 ) {
-        var mode = this._options[ "mode" ],
-            pixels = this._drawPixels,
-            coords = this._drawCoords,
-            label,
-            labelShape,
-            labelPixel,
-            widthOver,
-            heightOver;
-
-        switch ( mode ) {
-          case "measureLength":
-            mode = "drawLineString";
-            labelShape = {
-              type: "LineString",
-              coordinates: coords
-            };
-            label = $.render[ this._tmplLengthId ]( { length: $.geo.length( labelShape, true ) } );
-            labelPixel = $.merge( [], pixels[ pixels.length - 1 ] );
-            break;
-
-          case "measureArea":
-            mode = "drawPolygon";
-
-            labelShape = {
-              type: "Polygon",
-              coordinates: [ $.merge( [ ], coords ) ]
-            };
-            labelShape.coordinates[ 0 ].push( coords[ 0 ] );
-
-            label = $.render[ this._tmplAreaId ]( { area: $.geo.area( labelShape, true ) } );
-            labelPixel = this._toPixel( $.geo.centroid( labelShape ).coordinates );
-            pixels = [ pixels ];
-            break;
-
-          case "drawPolygon":
-            pixels = [ pixels ];
-            break;
-        }
-
-        this._$drawContainer.geographics( mode, pixels );
-        
-        if ( label ) {
-          this._$measureLabel.html( label );
-
-          widthOver = this._contentBounds.width - ( this._$measureLabel.outerWidth( true ) + labelPixel[ 0 ] );
-          heightOver = this._contentBounds.height - ( this._$measureLabel.outerHeight( true ) + labelPixel[ 1 ] );
-
-          if ( widthOver < 0 ) {
-            labelPixel[ 0 ] += widthOver;
-          }
-
-          if ( heightOver < 0 ) {
-            labelPixel[ 1 ] += heightOver;
-          }
-
-          this._$measureLabel.css( {
-            left: Math.max( labelPixel[ 0 ], 0 ),
-            top: Math.max( labelPixel[ 1 ], 0 )
-          } ).show();
-        }
-      }
-    },
-
-    _resetDrawing: function () {
-      this._drawPixels = [];
-      this._drawCoords = [];
-      this._$drawContainer.geographics("clear");
-      this._$measureLabel.hide();
-    },
-
-    _refreshShapes: function (geographics, shapes, styles, labels, center, pixelSize) {
-      var i, mgi,
-          shape,
-          shapeBbox,
-          style,
-          label,
-          hasLabel,
-          labelPixel,
-          bbox = this._map._getBbox(center, pixelSize);
-
-      for (i = 0; i < shapes.length; i++) {
-        shape = shapes[i].shape || shapes[i];
-        shape = shape.geometry || shape;
-        shapeBbox = $.data(shape, "geoBbox");
-
-        if ( shapeBbox && $.geo._bboxDisjoint( bbox, shapeBbox ) ) {
-          continue;
-        }
-
-        style = $.isArray(styles) ? styles[i].style : styles;
-        label = $.isArray(labels) ? labels[i].label : labels;
-        hasLabel = ( label !== undefined );
-        labelPixel = undefined;
-
-        switch (shape.type) {
-          case "Point":
-            labelPixel = this._map.toPixel( shape.coordinates, center, pixelSize );
-            this._$shapesContainer.geographics("drawPoint", labelPixel, style);
-            break;
-          case "LineString":
-            this._$shapesContainer.geographics("drawLineString", this._map.toPixel(shape.coordinates, center, pixelSize), style);
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.pointAlong( shape, 0.5 ).coordinates, center, pixelSize );
-            }
-            break;
-          case "Polygon":
-            this._$shapesContainer.geographics("drawPolygon", this._map.toPixel(shape.coordinates, center, pixelSize), style);
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize );
-            }
-            break;
-          case "MultiPoint":
-            for (mgi = 0; mgi < shape.coordinates.length; mgi++) {
-              this._$shapesContainer.geographics("drawPoint", this._map.toPixel(shape.coordinates[mgi], center, pixelSize), style);
-            }
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize );
-            }
-            break;
-          case "MultiLineString":
-            for (mgi = 0; mgi < shape.coordinates.length; mgi++) {
-              this._$shapesContainer.geographics("drawLineString", this._map.toPixel(shape.coordinates[mgi], center, pixelSize), style);
-            }
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize );
-            }
-            break;
-          case "MultiPolygon":
-            for (mgi = 0; mgi < shape.coordinates.length; mgi++) {
-              this._$shapesContainer.geographics("drawPolygon", this._map.toPixel(shape.coordinates[mgi], center, pixelSize), style);
-            }
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize );
-            }
-            break;
-
-          case "GeometryCollection":
-            this._refreshShapes(geographics, shape.geometries, style, label, center, pixelSize);
-            break;
-        }
-
-        if ( hasLabel && labelPixel ) {
-          this._$shapesContainer.geographics( "drawLabel", labelPixel, label );
-        }
-      }
-    },
-
-    _findMapSize: function () {
-      // really, really attempt to find a size for this thing
-      // even if it's hidden (look at parents)
-      var size = { width: 0, height: 0 },
-        sizeContainer = this._$elem;
-
-      while (sizeContainer.size() && !(size["width"] > 0 && size["height"] > 0)) {
-        size = { width: sizeContainer.width(), height: sizeContainer.height() };
-        if (size["width"] <= 0 || size["height"] <= 0) {
-          size = { width: parseInt(sizeContainer.css("width"), 10), height: parseInt(sizeContainer.css("height"), 10) };
-        }
-        sizeContainer = sizeContainer.parent();
-      }
-      return size;
-    },
-
-    _forcePosition: function (elem) {
-      var cssPosition = elem.css("position");
-      if (cssPosition != "relative" && cssPosition != "absolute" && cssPosition != "fixed") {
-        elem.css("position", "relative");
-      }
-    },
-
-    _getPixelSize: function ( zoom ) {
-      var tilingScheme = this._options["tilingScheme"];
-      if (tilingScheme !== null) {
-        if (zoom === 0) {
-          return tilingScheme.pixelSizes ? tilingScheme.pixelSizes[0] : tilingScheme.basePixelSize;
-        }
-
-        zoom = Math.round(zoom);
-        zoom = Math.max(zoom, 0);
-        var levels = tilingScheme.pixelSizes ? tilingScheme.pixelSizes.length : tilingScheme.levels;
-        zoom = Math.min(zoom, levels - 1);
-
-        if ( tilingScheme.pixelSizes ) {
-          return tilingScheme.pixelSizes[zoom];
-        } else {
-          return tilingScheme.basePixelSize / Math.pow(2, zoom);
-        }
-      } else {
-        var bbox = $.geo.scaleBy( this._getBboxMax(), 1 / Math.pow( this._zoomFactor, zoom ), true );
-        return Math.max( $.geo.width( bbox, true ) / this._contentBounds.width, $.geo.height( bbox, true ) / this._contentBounds.height );
-      }
-    },
-
-    _getZoomCenterAndSize: function ( anchor, zoomDelta, full ) {
-      var zoomFactor = ( full ? this._fullZoomFactor : this._partialZoomFactor ),
-          scale = Math.pow( zoomFactor, -zoomDelta ),
-          pixelSize = this._pixelSizeInteractive * scale,
-          zoom = this._getZoom(this._centerInteractive, pixelSize);
-
-      // clamp to zoom
-      if ( full && this._options[ "tilingScheme" ] ) {
-        pixelSize = this._getPixelSize( Math.min( Math.max( zoom, this._options[ "zoomMin" ] ), this._options[ "zoomMax" ] ) );
-      } else {
-        if ( zoomDelta < 0 && zoom < this._options[ "zoomMin" ] ) {
-          pixelSize = this._pixelSizeInteractive;
-        } else if ( zoomDelta > 0 && zoom > this._options[ "zoomMax" ] ) {
-          pixelSize = this._pixelSizeInteractive;
-        }
-      }
-
-      var ratio = pixelSize / this._pixelSizeInteractive,
-          anchorMapCoord = this._toMap( anchor, this._centerInteractive, this._pixelSizeInteractive ),
-          centerDelta = [(this._centerInteractive[0] - anchorMapCoord[0]) * ratio, (this._centerInteractive[1] - anchorMapCoord[1]) * ratio],
-          scaleCenter = [anchorMapCoord[0] + centerDelta[0], anchorMapCoord[1] + centerDelta[1]];
-
-      return { pixelSize: pixelSize, center: scaleCenter };
-    },
-
-    _mouseWheelFinish: function ( refresh ) {
-      this._wheelTimeout = null;
-
-      if (this._wheelLevel !== 0) {
-        var wheelCenterAndSize = this._getZoomCenterAndSize( this._anchor, this._wheelLevel, this._options[ "tilingScheme" ] !== null );
-
-        this._wheelLevel = 0;
-      } else if ( refresh ) {
-        this._refresh();
-      }
-    },
-
-    _panFinalize: function () {
-      if (this._panning) {
-        this._velocity = [0, 0];
-
-        var dx = this._current[0] - this._anchor[0],
-            dy = this._current[1] - this._anchor[1],
-            image = this._options[ "axisLayout" ] === "image",
-            dxMap = -dx * this._pixelSize,
-            dyMap = ( image ? -1 : 1 ) * dy * this._pixelSize;
-
-        this._$eventTarget.css("cursor", this._options["cursors"][this._options["mode"]]);
-
-        this._inOp = false;
-        this._anchor = this._current;
-        this._mouseDown = this._toolPan = this._panning = false;
-      }
-    },
-
-    _panMove: function () {
-      if ( ! this._options[ "pannable" ] ) {
-        return;
-      }
-
-      var dx = this._current[0] - this._lastDrag[0],
-          dy = this._current[1] - this._lastDrag[1],
-          i = 0,
-          service,
-          translateObj;
-
-      if (this._toolPan || dx > 3 || dx < -3 || dy > 3 || dy < -3) {
-        if (!this._toolPan) {
-          this._toolPan = true;
-          this._$eventTarget.css("cursor", this._options["cursors"]["pan"]);
-        }
-
-        if (this._mouseDown) {
-          this._velocity = [dx, dy];
-        }
-
-        if (dx !== 0 || dy !== 0) {
-          this._panning = true;
-          this._lastDrag = this._current;
-
-          this._centerInteractive[ 0 ] -= ( dx * this._pixelSizeInteractive );
-          this._centerInteractive[ 1 ] += ( ( this._options[ "axisLayout" ] === "image" ? -1 : 1 ) * dy * this._pixelSizeInteractive );
-          this._setInteractiveCenterAndSize( this._centerInteractive, this._pixelSizeInteractive );
-          this._interactiveTransform( );
-        }
-      }
-    },
-
-    _clearInteractiveTimeout: function() {
-      if ( this._timeoutInteractive ) {
-        clearTimeout( this._timeoutInteractive );
-        this._timeoutInteractive = null;
-        return true;
-      } else {
-        this._centerInteractive[ 0 ] = this._center[ 0 ];
-        this._centerInteractive[ 1 ] = this._center[ 1 ];
-        this._pixelSizeInteractive = this._pixelSize;
-        return false;
-      }
-    },
-
-    _interactiveTransform: function( ) {
-      if ( this._$shapesContainers ) {
-        this._$shapesContainers.geographics("clear");
-      }
-
-      for ( var i = 0; i < this._currentServices.length; i++ ) {
-        service = this._currentServices[ i ];
-        $.geo[ "_serviceTypes" ][ service.type ].interactiveTransform( this, service, this._centerInteractive, this._pixelSizeInteractive );
-      }
-
-      if (this._drawCoords.length > 0) {
-        this._drawPixels = this._toPixel( this._drawCoords, this._centerInteractive, this._pixelSizeInteractive );
-        this._refreshDrawing();
-      }
-    },
-
-    _setInteractiveTimeout: function( trigger ) {
-      var geomap = this;
-
-      function interactiveTimeoutCallback( ) {
-        if ( geomap._isMultiTouch ) {
-          geomap._timeoutInteractive = setTimeout( interactiveTimeoutCallback, 128 );
-        } else if ( geomap._created && geomap._timeoutInteractive ) {
-          geomap._setCenterAndSize( geomap._centerInteractive, geomap._pixelSizeInteractive, geomap._triggerInteractive, true );
-          geomap._timeoutInteractive = null;
-          geomap._triggerInteractive = false;
-        }
-      }
-
-      this._timeoutInteractive = setTimeout( interactiveTimeoutCallback, 128 );
-      this._triggerInteractive |= trigger;
-    },
-
-    _refresh: function ( force, _serviceContainer ) {
-      var service,
-          geoService,
-          i = 0;
-
-      for ( ; i < this._currentServices.length; i++ ) {
-        service = this._currentServices[ i ];
-        if ( !_serviceContainer || service.serviceContainer[ 0 ] == _serviceContainer[ 0 ] ) {
-          $.geo[ "_serviceTypes" ][ service.type ].refresh( this, service, force );
-          geoService = service.serviceContainer.data( "geoService" );
-
-          if ( geoService._createdGraphics ) {
-            geoService._$shapesContainer.geographics( "clear" );
-            if ( geoService._graphicShapes.length > 0 ) {
-              geoService._refreshShapes( geoService._$shapesContainer, geoService._graphicShapes, geoService._graphicShapes, geoService._graphicShapes );
-            }
-          }
-        }
-      }
-
-      if ( this._createdGraphics ) {
-        this._$shapesContainer.geographics( "clear" );
-        if ( this._graphicShapes.length > 0 ) {
-          this._refreshShapes( this._$shapesContainer, this._graphicShapes, this._graphicShapes, this._graphicShapes );
-        }
-      }
-    },
-
-    _setInteractiveCenterAndSize: function ( center, pixelSize ) {
-      // set the temporary (interactive) center & size
-      // also, update the public-facing options
-      // this does not take zoomMin or zoomMax into account
-      this._centerInteractive[ 0 ] = center[ 0 ];
-      this._centerInteractive[ 1 ] = center[ 1 ];
-      this._pixelSizeInteractive = pixelSize;
-
-      if ( this._userGeodetic ) {
-        this._options["bbox"] = $.geo.proj.toGeodetic( this._getBbox( center, pixelSize ) );
-        this._options["center"] = $.geo.proj.toGeodetic( center );
-      } else {
-        this._options["bbox"] = this._getBbox( center, pixelSize );
-        this._options["center"][ 0 ] = center[ 0 ];
-        this._options["center"][ 1 ] = center[ 1 ];
-      }
-
-      this._options["pixelSize"] = pixelSize;
-      this._options["zoom"] = this._getZoom( center, pixelSize );
-    },
-
-    _setCenterAndSize: function (center, pixelSize, trigger, refresh) {
-      if ( ! $.isArray( center ) || center.length != 2 || typeof center[ 0 ] !== "number" || typeof center[ 1 ] !== "number" ) {
-        return;
-      }
-
-      // the final call during any extent change
-      // only called by timeoutInteractive & resize
-      // clamp to zoom
-      var zoom = this._getZoom( center, pixelSize );
-
-      if ( this._options[ "tilingScheme" ] ) {
-        this._pixelSizeInteractive = pixelSize = this._getPixelSize( Math.min( Math.max( zoom, this._options[ "zoomMin" ] ), this._options[ "zoomMax" ] ) );
-      } else {
-        if ( zoom < this._options[ "zoomMin" ] ) {
-          this._pixelSizeInteractive = pixelSize = this._getPixelSize( this._options[ "zoomMin" ] );
-        } else if ( zoom > this._options[ "zoomMax" ] ) {
-          this._pixelSizeInteractive = pixelSize = this._getPixelSize( this._options[ "zoomMax" ] );
-        }
-      }
-
-      this._center[ 0 ] = center[ 0 ];
-      this._center[ 1 ] = center[ 1 ];
-      this._options["pixelSize"] = this._pixelSize = pixelSize;
-
-      if ( this._userGeodetic ) {
-        this._options["bbox"] = $.geo.proj.toGeodetic( this._getBbox() );
-        this._options["center"] = $.geo.proj.toGeodetic( this._center );
-      } else {
-        this._options["bbox"] = this._getBbox();
-        this._options["center"] = $.merge( [ ], center );
-      }
-
-      this._options["zoom"] = zoom;
-
-      if (trigger) {
-        this._trigger("bboxchange", window.event, { bbox: $.merge( [ ], this._options["bbox"] ) });
-      }
-
-      if (refresh) {
-        this._refresh();
-        this._refreshDrawing();
-      }
-    },
-
-    _requestQueued: function ( ) {
-      if ( this._loadCount === 0 ) {
-        this._trigger( "loadstart", window.event );
-      }
-      this._loadCount++;
-    },
-
-    _requestComplete: function ( ) {
-      this._loadCount--;
-      if ( this._loadCount <= 0 ) {
-        this._loadCount = 0;
-        this._trigger( "loadend", window.event );
-      }
-    },
-
-    _toMap: function (p, center, pixelSize) {
-      // ignores $.geo.proj
-
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      var isMultiPointOrLineString = $.isArray( p[ 0 ] ),
-          isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray( p[ 0 ][ 0 ] ),
-          isMultiPolygon = isMultiLineStringOrPolygon && $.isArray( p[ 0 ][ 0 ][ 0 ] ),
-          width = this._contentBounds["width"],
-          height = this._contentBounds["height"],
-          halfWidth = width / 2 * pixelSize,
-          halfHeight = height / 2 * pixelSize,
-          bbox = [center[0] - halfWidth, center[1] - halfHeight, center[0] + halfWidth, center[1] + halfHeight],
-          xRatio = $.geo.width(bbox, true) / width,
-          yRatio = $.geo.height(bbox, true) / height,
-          yOffset,
-          image = this._options[ "axisLayout" ] === "image",
-          result = [],
-          i, j, k;
-
-      if ( !isMultiPolygon ) {
-        if ( !isMultiLineStringOrPolygon ) {
-          if ( !isMultiPointOrLineString ) {
-            p = [ p ];
-          }
-          p = [ p ];
-        }
-        p = [ p ];
-      }
-
-      for ( i = 0; i < p.length; i++ ) {
-        result[ i ] = [ ];
-        for ( j = 0; j < p[ i ].length; j++ ) {
-          result[ i ][ j ] = [ ];
-          for ( k = 0; k < p[ i ][ j ].length; k++ ) {
-            yOffset = (p[ i ][ j ][ k ][1] * yRatio);
-            result[ i ][ j ][ k ] = [
-              bbox[ 0 ] + ( p[ i ][ j ][ k ][ 0 ] * xRatio ),
-              image ? bbox[ 1 ] + yOffset : bbox[ 3 ] - yOffset
-            ];
-          }
-        }
-      }
-
-      return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-    },
-
-    _toPixel: function (p, center, pixelSize) {
-      // ignores $.geo.proj
-
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      var isMultiPointOrLineString = $.isArray( p[ 0 ] ),
-          isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray( p[ 0 ][ 0 ] ),
-          isMultiPolygon = isMultiLineStringOrPolygon && $.isArray( p[ 0 ][ 0 ][ 0 ] ),
-          width = this._contentBounds["width"],
-          height = this._contentBounds["height"],
-          halfWidth = width / 2 * pixelSize,
-          halfHeight = height / 2 * pixelSize,
-          bbox = [center[0] - halfWidth, center[1] - halfHeight, center[0] + halfWidth, center[1] + halfHeight],
-          bboxWidth = $.geo.width(bbox, true),
-          bboxHeight = $.geo.height(bbox, true),
-          image = this._options[ "axisLayout" ] === "image",
-          xRatio = width / bboxWidth,
-          yRatio = height / bboxHeight,
-          result = [ ],
-          i, j, k;
-
-      if ( !isMultiPolygon ) {
-        if ( !isMultiLineStringOrPolygon ) {
-          if ( !isMultiPointOrLineString ) {
-            p = [ p ];
-          }
-          p = [ p ];
-        }
-        p = [ p ];
-      }
-
-      for ( i = 0; i < p.length; i++ ) {
-        result[ i ] = [ ];
-        for ( j = 0; j < p[ i ].length; j++ ) {
-          result[ i ][ j ] = [ ];
-          for ( k = 0; k < p[ i ][ j ].length; k++ ) {
-            result[ i ][ j ][ k ] = [
-              Math.round( ( p[ i ][ j ][ k ][ 0 ] - bbox[ 0 ] ) * xRatio ),
-              Math.round( ( image ? p[ i ][ j ][ k ][ 1 ] - bbox[ 1 ] : bbox[ 3 ] - p[ i ][ j ][ k ][ 1 ] ) * yRatio )
-            ];
-          }
-        }
-      }
-
-      return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-    },
-
-    _document_keydown: function (e) {
-      var len = this._drawCoords.length;
-      if (len > 0 && e.which == 27) {
-        if (len <= 2) {
-          this._resetDrawing();
-          this._inOp = false;
-        } else {
-          this._drawCoords[len - 2] = $.merge( [], this._drawCoords[ len - 1 ] );
-          this._drawPixels[len - 2] = $.merge( [], this._drawPixels[ len - 1 ] );
-
-          this._drawCoords.length--;
-          this._drawPixels.length--;
-
-          this._refreshDrawing();
-        }
-      }
-    },
-
-    _eventTarget_dblclick_zoom: function(e) {
-      var doInteractiveTimeout = this._clearInteractiveTimeout( );
-
-      this._trigger("dblclick", e, { type: "Point", coordinates: this._toMap(this._current, this._centerInteractive, this._pixelSizeInteractive ) });
-
-      if (!e.isDefaultPrevented()) {
-        var centerAndSize = this._getZoomCenterAndSize(this._current, 1, true );
-
-        this._setInteractiveCenterAndSize( centerAndSize.center, centerAndSize.pixelSize );
-        this._interactiveTransform( );
-
-        doInteractiveTimeout = true;
-      }
-
-      if ( doInteractiveTimeout ) {
-        this._setInteractiveTimeout( true );
-      }
-    },
-
-    _eventTarget_dblclick: function (e) {
-      if ( this._options[ "mode" ] === "static" ) {
-        return;
-      }
-
-      if (this._drawTimeout) {
-        window.clearTimeout(this._drawTimeout);
-        this._drawTimeout = null;
-      }
-
-      var offset = $(e.currentTarget).offset();
-
-      switch (this._options["mode"]) {
-        case "drawLineString":
-        case "measureLength":
-          if ( this._drawCoords.length > 1 && ! ( this._drawCoords[0][0] == this._drawCoords[1][0] &&
-                                                  this._drawCoords[0][1] == this._drawCoords[1][1] ) ) {
-              this._drawCoords.length--;
-              this._trigger( "shape", e, {
-                type: "LineString",
-                coordinates: this._userGeodetic ? $.geo.proj.toGeodetic(this._drawCoords) : this._drawCoords
-              } );
-          } else {
-            this._eventTarget_dblclick_zoom(e);
-          }
-          this._resetDrawing();
-          break;
-
-        case "drawPolygon":
-        case "measureArea":
-          if ( this._drawCoords.length > 1 && ! ( this._drawCoords[0][0] == this._drawCoords[1][0] &&
-                                                  this._drawCoords[0][1] == this._drawCoords[1][1] ) ) {
-            var endIndex = this._drawCoords.length - 1;
-            if (endIndex > 2) {
-              this._drawCoords[endIndex] = $.merge( [], this._drawCoords[0] );
-              this._trigger( "shape", e, {
-                type: "Polygon",
-                coordinates: [ this._userGeodetic ? $.geo.proj.toGeodetic(this._drawCoords) : this._drawCoords ]
-              } );
-            }
-          } else {
-            this._eventTarget_dblclick_zoom(e);
-          }
-          this._resetDrawing();
-          break;
-
-        default:
-          this._eventTarget_dblclick_zoom(e);
-          break;
-      }
-
-      this._inOp = false;
-    },
-
-    _eventTarget_touchstart: function (e) {
-      var mode = this._options[ "mode" ],
-          shift = this._options[ "shift" ];
-
-      if ( mode === "static" ) {
-        return;
-      }
-
-      if ( !this._supportTouch && e.which != 1 ) {
-        return;
-      }
-
-      var doInteractiveTimeout = this._clearInteractiveTimeout( );
-
-      var offset = $(e.currentTarget).offset(),
-          touches = e.originalEvent.changedTouches;
-
-      if ( this._supportTouch ) {
-        this._multiTouchAnchor = $.merge( [ ], touches );
-
-        this._isMultiTouch = this._multiTouchAnchor.length > 1;
-
-        if ( this._isMultiTouch ) {
-          this._multiTouchCurrentBbox = [
-            touches[0].pageX - offset.left,
-            touches[0].pageY - offset.top,
-            touches[1].pageX - offset.left,
-            touches[1].pageY - offset.top
-          ];
-
-          this._multiTouchAnchorBbox = $.merge( [ ], this._multiTouchCurrentBbox );
-
-          this._current = $.geo.center( this._multiTouchCurrentBbox, true );
-        } else {
-          this._multiTouchCurrentBbox = [
-            touches[0].pageX - offset.left,
-            touches[0].pageY - offset.top,
-            NaN,
-            NaN
-          ];
-
-          this._current = [ touches[0].pageX - offset.left, touches[0].pageY - offset.top ];
-        }
-      } else {
-        this._current = [e.pageX - offset.left, e.pageY - offset.top];
-      }
-
-      if (this._softDblClick) {
-        var downDate = $.now();
-        if (downDate - this._downDate < 750) {
-          if (this._isTap) {
-            var dx = this._current[0] - this._anchor[0],
-                dy = this._current[1] - this._anchor[1],
-                distance = Math.sqrt((dx * dx) + (dy * dy));
-            if (distance > 8) {
-              this._isTap = false;
-            } else {
-              this._current = $.merge( [ ], this._anchor );
-            }
-          }
-
-          if (this._isDbltap) {
-            this._isDbltap = false;
-          } else {
-            this._isDbltap = this._isTap;
-          }
-        } else {
-          this._isDbltap = false;
-        }
-        this._isTap = true;
-        this._downDate = downDate;
-      }
-
-      this._mouseDown = true;
-      this._anchor = $.merge( [ ], this._current );
-
-      if (!this._inOp && e.shiftKey && shift !== "off") {
-        this._shiftDown = true;
-        this._$eventTarget.css( "cursor", this._options[ "cursors" ][ shift === "default" ? "zoom" : shift ] );
-      } else if ( !this._isMultiTouch && ( this._options[ "pannable" ] || mode === "dragBox" || mode === "dragCircle" ) ) {
-        this._inOp = true;
-
-        if ( mode !== "zoom" && mode !== "dragBox" && mode !== "dragCircle" ) {
-          this._lastDrag = this._current;
-
-          if (e.currentTarget.setCapture) {
-            e.currentTarget.setCapture();
-          }
-        }
-      }
-
-      e.preventDefault();
-
-      if ( doInteractiveTimeout ) {
-        this._setInteractiveTimeout( true );
-      }
-
-      return false;
-    },
-
-    _dragTarget_touchmove: function (e) {
-      if ( this._options[ "mode" ] === "static" ) {
-        return;
-      }
-
-      var doInteractiveTimeout = false;
-      if ( this._mouseDown ) {
-        doInteractiveTimeout = this._clearInteractiveTimeout( );
-      }
-
-      var offset = this._$eventTarget.offset(),
-          drawCoordsLen = this._drawCoords.length,
-          touches = e.originalEvent.changedTouches,
-          current,
-          service,
-          i = 0;
-
-      if ( this._supportTouch ) {
-        if ( !this._isMultiTouch && this._mouseDown && this._multiTouchAnchor.length > 0 && touches[ 0 ].identifier !== this._multiTouchAnchor[ 0 ].identifier ) {
-          // switch to multitouch
-          this._mouseDown = false;
-          this._isMultiTouch = true;
-          this._wheelLevel = 0;
-
-          this._multiTouchAnchor.push( touches[ 0 ] );
-
-
-
-
-          this._multiTouchCurrentBbox = [
-            this._multiTouchCurrentBbox[ 0 ],
-            this._multiTouchCurrentBbox[ 1 ],
-            this._multiTouchAnchor[1].pageX - offset.left,
-            this._multiTouchAnchor[1].pageY - offset.top
-          ];
-
-          this._multiTouchAnchorBbox = $.merge( [ ], this._multiTouchCurrentBbox );
-
-          this._mouseDown = true;
-          this._anchor = this._current = $.geo.center( this._multiTouchCurrentBbox, true );
-
-
-          if ( doInteractiveTimeout ) {
-            this._setInteractiveTimeout( true );
-          }
-          return false;
-        }
-
-        if ( this._isMultiTouch ) {
-
-          for ( ; i < touches.length; i++ ) {
-            if ( touches[ i ].identifier === this._multiTouchAnchor[ 0 ].identifier ) {
-              this._multiTouchCurrentBbox[ 0 ] = touches[ i ].pageX - offset.left;
-              this._multiTouchCurrentBbox[ 1 ] = touches[ i ].pageY - offset.top;
-            } else if ( touches[ i ].identifier === this._multiTouchAnchor[ 1 ].identifier ) {
-              this._multiTouchCurrentBbox[ 2 ] = touches[ i ].pageX - offset.left;
-              this._multiTouchCurrentBbox[ 3 ] = touches[ i ].pageY - offset.top;
-            }
-          }
-
-          var anchorDistance = $.geo._distancePointPoint( [ this._multiTouchAnchorBbox[ 0 ], this._multiTouchAnchorBbox[ 1 ] ], [ this._multiTouchAnchorBbox[ 2 ], this._multiTouchAnchorBbox[ 3 ] ] ),
-              currentDistance = $.geo._distancePointPoint( [ this._multiTouchCurrentBbox[ 0 ], this._multiTouchCurrentBbox[ 1 ] ], [ this._multiTouchCurrentBbox[ 2 ], this._multiTouchCurrentBbox[ 3 ] ] );
-
-          current = $.geo.center( this._multiTouchCurrentBbox, true );
-
-          var wheelLevel = ( ( currentDistance - anchorDistance ) / anchorDistance );
-
-          if ( wheelLevel > 0 ) {
-            wheelLevel *= 5;
-          } else {
-            wheelLevel *= 10;
-          }
-
-          var delta = wheelLevel - this._wheelLevel;
-
-          this._wheelLevel = wheelLevel;
-
-          var pinchCenterAndSize = this._getZoomCenterAndSize( this._anchor, delta, false );
-
-          this._setInteractiveCenterAndSize( pinchCenterAndSize.center, pinchCenterAndSize.pixelSize );
-          this._interactiveTransform( );
-
-          doInteractiveTimeout = true;
-
-          current = $.geo.center( this._multiTouchCurrentBbox, true );
-        } else {
-          current = [e.originalEvent.changedTouches[0].pageX - offset.left, e.originalEvent.changedTouches[0].pageY - offset.top];
-        }
-      } else {
-        current = [e.pageX - offset.left, e.pageY - offset.top];
-      }
-
-      if (current[0] === this._lastMove[0] && current[1] === this._lastMove[1]) {
-        if ( this._inOp ) {
-          e.preventDefault();
-          if ( doInteractiveTimeout ) {
-            this._setInteractiveTimeout( true );
-          }
-          return false;
-        }
-      }
-
-      if ( _ieVersion == 7 ) {
-        this._isDbltap = this._isTap = false;
-      }
-
-      if (this._mouseDown) {
-        this._current = current;
-        this._moveDate = $.now();
-      }
-
-      if ( this._isMultiTouch ) {
-        e.preventDefault( );
-        this._isDbltap = this._isTap = false;
-        if ( doInteractiveTimeout ) {
-          this._setInteractiveTimeout( true );
-        }
-        return false;
-      }
-
-      var shift = this._options[ "shift" ],
-          mode = this._shiftDown ? ( shift === "default" ? "zoom" : shift ) : this._options["mode"],
-          dx, dy, circleSize;
-
-      switch (mode) {
-        case "zoom":
-        case "dragBox":
-          if ( this._mouseDown ) {
-            this._$drawContainer.geographics( "clear" );
-            this._$drawContainer.geographics( "drawBbox", [
-              this._anchor[ 0 ],
-              this._anchor[ 1 ],
-              current[ 0 ],
-              current[ 1 ]
-            ] );
-          } else {
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-
-        case "dragCircle":
-          if ( this._mouseDown ) {
-            dx = current[ 0 ] - this._anchor[ 0 ];
-            dy = current[ 1 ] - this._anchor[ 1 ];
-            circleSize = Math.sqrt( ( dx * dx) + ( dy * dy ) ) * 2;
-            //circleSize = Math.max( Math.abs( current[ 0 ] - this._anchor[ 0 ] ), Math.abs( current[ 1 ] - this._anchor[ 1 ] ) ) * 2;
-
-            // not part of _refreshDrawing
-            this._$drawContainer.geographics( "clear" );
-            this._$drawContainer.geographics( "drawArc", this._anchor, 0, 360, {
-              width: circleSize,
-              height: circleSize
-            } );
-          } else {
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-
-        case "drawLineString":
-        case "drawPolygon":
-        case "measureLength":
-        case "measureArea":
-          if (this._mouseDown || this._toolPan) {
-            this._panMove();
-            doInteractiveTimeout = true;
-          } else {
-            if (drawCoordsLen > 0) {
-              this._drawCoords[drawCoordsLen - 1] = this._toMap( current, this._centerInteractive, this._pixelSizeInteractive );
-              this._drawPixels[drawCoordsLen - 1] = current;
-
-              this._refreshDrawing();
-            }
-
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-
-        default:
-          if (this._mouseDown || this._toolPan) {
-            this._panMove();
-            doInteractiveTimeout = true;
-          } else {
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-      }
-
-      this._lastMove = current;
-
-      if ( doInteractiveTimeout ) {
-        this._setInteractiveTimeout( true );
-      }
-
-      if ( this._inOp ) {
-        e.preventDefault();
-        return false;
-      }
-    },
-
-    _dragTarget_touchstop: function (e) {
-      if ( this._options[ "mode" ] === "static" ) {
-        return;
-      }
-
-      if ( !this._mouseDown ) {
-        if ( _ieVersion == 7 ) {
-          // ie7 doesn't appear to trigger dblclick on this._$eventTarget,
-          // we fake regular click here to cause soft dblclick
-          this._eventTarget_touchstart(e);
-        } else {
-          // Chrome & Firefox trigger a rogue mouseup event when doing a dblclick maximize in Windows(/Linux?)
-          // ignore it
-          return false;
-        }
-      }
-
-      var doInteractiveTimeout = this._clearInteractiveTimeout( );
-
-      var mouseWasDown = this._mouseDown,
-          wasToolPan = this._toolPan,
-          offset = this._$eventTarget.offset(),
-          shift = this._options[ "shift" ],
-          mode = this._shiftDown ? ( shift === "default" ? "zoom" : shift ) : this._options["mode"],
-          current, i, clickDate,
-          dx, dy,
-          coordBuffer,
-          triggerShape;
-
-
-      if (this._supportTouch) {
-        current = [e.originalEvent.changedTouches[0].pageX - offset.left, e.originalEvent.changedTouches[0].pageY - offset.top];
-        this._multiTouchAnchor = [];
-        this._inOp = false;
-      } else {
-        current = [e.pageX - offset.left, e.pageY - offset.top];
-      }
-
-      if (this._softDblClick) {
-        if (this._isTap) {
-          dx = current[0] - this._anchor[0];
-          dy = current[1] - this._anchor[1];
-          if (Math.sqrt((dx * dx) + (dy * dy)) <= 8) {
-            current = $.merge( [ ], this._anchor );
-          }
-        }
-      }
-
-      dx = current[0] - this._anchor[0];
-      dy = current[1] - this._anchor[1];
-
-      this._$eventTarget.css("cursor", this._options["cursors"][this._options["mode"]]);
-
-      this._shiftDown = this._mouseDown = this._toolPan = false;
-
-      if ( this._isMultiTouch ) {
-        e.preventDefault( );
-        this._isMultiTouch = false;
-
-        this._wheelLevel = 0;
-
-        if ( doInteractiveTimeout ) {
-          this._setInteractiveTimeout( true );
-        }
-        return;
-      }
-
-      if (document.releaseCapture) {
-        document.releaseCapture();
-      }
-
-      if (mouseWasDown) {
-        clickDate = $.now();
-        this._current = current;
-
-        switch ( mode ) {
-          case "zoom":
-          case "dragBox":
-            if ( dx !== 0 || dy !== 0 ) {
-              var minSize = this._pixelSize * 6,
-                  bboxCoords = this._toMap( [ [
-                      Math.min( this._anchor[ 0 ], current[ 0 ] ),
-                      Math.max( this._anchor[ 1 ], current[ 1 ] )
-                    ], [
-                      Math.max( this._anchor[ 0 ], current[ 0 ] ),
-                      Math.min( this._anchor[ 1 ], current[ 1 ] )
-                    ]
-                  ] ),
-                  bbox = [
-                    bboxCoords[0][0],
-                    bboxCoords[0][1],
-                    bboxCoords[1][0],
-                    bboxCoords[1][1]
-                  ];
-
-              if ( mode === "zoom" ) {
-                if ( ( bbox[2] - bbox[0] ) < minSize && ( bbox[3] - bbox[1] ) < minSize ) {
-                  bbox = $.geo.scaleBy( this._getBbox( $.geo.center( bbox, true ) ), 0.5, true );
-                }
-
-                this._setBbox(bbox, true, true);
-                doInteractiveTimeout = true;
-              } else {
-                triggerShape = $.geo.polygonize( bbox, true );
-                triggerShape.bbox = bbox;
-
-                if ( this._userGeodetic ) {
-                  triggerShape.coordinates = $.geo.proj.toGeodetic( triggerShape.coordinates );
-                  triggerShape.bbox = $.geo.proj.toGeodetic( triggerShape.bbox );
-                }
-                this._trigger( "shape", e, triggerShape );
-              }
-            } else {
-              if ( mode === "dragBox" ) {
-                coordBuffer = this._toMap( current );
-
-                triggerShape = {
-                  type: "Point",
-                  coordinates: [ coordBuffer[ 0 ], coordBuffer[ 1 ] ],
-                  bbox: [ coordBuffer[ 0 ], coordBuffer[ 1 ], coordBuffer[ 0 ], coordBuffer[ 1 ] ]
-                };
-
-                if ( this._userGeodetic ) {
-                  triggerShape.coordinates = $.geo.proj.toGeodetic( triggerShape.coordinates );
-                  triggerShape.bbox = $.geo.proj.toGeodetic( triggerShape.bbox );
-                }
-
-                this._trigger( "shape", e, triggerShape );
-              }
-            }
-
-            this._resetDrawing();
-            break;
-
-          case "dragCircle":
-            if ( dx !== 0 || dy !== 0 ) {
-              var image = this._options[ "axisLayout" ] === "image",
-                  d = Math.sqrt( ( dx * dx) + ( dy * dy ) ),
-                  n = 180,
-                  a;
-
-              this._drawPixels.length = n + 1;
-
-              for ( i = 0; i < n; i++ ) {
-                a = ( i * 360 / n ) * ( Math.PI / 180 );
-                this._drawPixels[ i ] = [
-                  this._anchor[ 0 ] + Math.cos( a ) * d,
-                  this._anchor[ 1 ] + Math.sin( a ) * d
-                ];
-              }
-
-              this._drawPixels[ n ] = [
-                this._drawPixels[ 0 ][ 0 ],
-                this._drawPixels[ 0 ][ 1 ]
-              ];
-
-              // using coordBuffer for bbox coords
-              coordBuffer = this._toMap( [
-                [ this._anchor[ 0 ] - d, this._anchor[ 1 ] + ( image ? -d : d ) ],
-                [ this._anchor[ 0 ] + d, this._anchor[ 1 ] + ( image ? d : -d ) ]
-              ] );
-
-              triggerShape = {
-                type: "Polygon",
-                coordinates: [ this._toMap( this._drawPixels ) ],
-                bbox: [ coordBuffer[ 0 ][ 0 ], coordBuffer[ 0 ][ 1 ], coordBuffer[ 1 ][ 0 ], coordBuffer[ 1 ][ 1 ] ]
-              };
-
-              if ( this._userGeodetic ) {
-                triggerShape.coordinates = $.geo.proj.toGeodetic( triggerShape.coordinates );
-                triggerShape.bbox = $.geo.proj.toGeodetic( triggerShape.bbox );
-              }
-
-              this._trigger( "shape", e, triggerShape );
-
-              this._resetDrawing();
-            } else {
-              coordBuffer = this._toMap( current );
-
-              triggerShape = {
-                type: "Point",
-                coordinates: [ coordBuffer[ 0 ], coordBuffer[ 1 ] ],
-                bbox: [ coordBuffer[ 0 ], coordBuffer[ 1 ], coordBuffer[ 0 ], coordBuffer[ 1 ] ]
-              };
-
-              if ( this._userGeodetic ) {
-                triggerShape.coordinates = $.geo.proj.toGeodetic( triggerShape.coordinates );
-                triggerShape.bbox = $.geo.proj.toGeodetic( triggerShape.bbox );
-              }
-
-              this._trigger( "shape", e, triggerShape );
-            }
-            break;
-
-          case "drawPoint":
-            if (this._drawTimeout) {
-              window.clearTimeout(this._drawTimeout);
-              this._drawTimeout = null;
-            }
-
-            if (wasToolPan) {
-              this._panFinalize();
-            } else {
-              if (clickDate - this._clickDate > 100) {
-                var geomap = this;
-                this._drawTimeout = setTimeout(function () {
-                  if (geomap._drawTimeout) {
-                    geomap._trigger("shape", e, { type: "Point", coordinates: geomap.toMap(current) });
-                    geomap._inOp = false;
-                    geomap._drawTimeout = null;
-                  }
-                }, 250);
-              }
-            }
-            break;
-
-          case "drawLineString":
-          case "drawPolygon":
-          case "measureLength":
-          case "measureArea":
-            if (wasToolPan) {
-              this._panFinalize();
-            } else {
-              i = (this._drawCoords.length === 0 ? 0 : this._drawCoords.length - 1);
-
-              this._drawCoords[i] = this._toMap(current);
-              this._drawPixels[i] = current;
-
-              if (i < 2 || !(this._drawCoords[i][0] == this._drawCoords[i-1][0] &&
-                             this._drawCoords[i][1] == this._drawCoords[i-1][1])) {
-                this._drawCoords[i + 1] = this._toMap( current, this._centerInteractive, this._pixelSizeInteractive );
-                this._drawPixels[i + 1] = current;
-              }
-
-              this._refreshDrawing();
-            }
-            break;
-
-          default:
-            if (wasToolPan) {
-              this._panFinalize();
-            } else {
-              if (clickDate - this._clickDate > 100) {
-                this._trigger("click", e, { type: "Point", coordinates: this.toMap(current) });
-                this._inOp = false;
-              }
-            }
-            break;
-        }
-
-        this._clickDate = clickDate;
-
-        if (this._softDblClick && this._isDbltap) {
-          this._isDbltap = this._isTap = false;
-          if ( doInteractiveTimeout ) {
-            this._setInteractiveTimeout( true );
-          }
-          this._$eventTarget.trigger("dblclick", e);
-          return false;
-        }
-      }
-
-      if ( doInteractiveTimeout ) {
-        this._setInteractiveTimeout( true );
-      }
-
-      if ( this._inOp ) {
-        e.preventDefault();
-        return false;
-      }
-    },
-
-    _eventTarget_mousewheel: function (e, delta) {
-      if ( this._options[ "mode" ] === "static" || this._options[ "scroll" ] === "off" ) {
-        return;
-      }
-
-      e.preventDefault();
-
-      if ( this._mouseDown ) {
-        return false;
-      }
-
-      if (delta !== 0) {
-        this._clearInteractiveTimeout( );
-
-        if ( delta > 0 ) {
-          delta = Math.ceil( delta );
-        } else { 
-          delta = Math.floor( delta );
-        }
-
-        var offset = $(e.currentTarget).offset();
-        this._anchor = [e.pageX - offset.left, e.pageY - offset.top];
-
-        var wheelCenterAndSize = this._getZoomCenterAndSize( this._anchor, delta, this._options[ "tilingScheme" ] !== null ),
-            service,
-            i = 0;
-
-        this._setInteractiveCenterAndSize( wheelCenterAndSize.center, wheelCenterAndSize.pixelSize );
-        this._interactiveTransform( );
-
-        this._setInteractiveTimeout( true );
-      }
-
-      return false;
-    }
-  }
-  );
-}(jQuery));
-
-
-(function ($, undefined) {
-  $.geo._serviceTypes.tiled = (function () {
-    return {
-      create: function (map, serviceContainer, service, index) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( !serviceState ) {
-          serviceState = {
-            loadCount: 0,
-            reloadTiles: false
-          };
-
-          var scHtml = '<div data-geo-service="tiled" style="-webkit-transform:translateZ(0); position:absolute; left:0; top:0; width:8px; height:8px; margin:0; padding:0;"></div>';
-
-          serviceContainer.append(scHtml);
-
-          serviceState.serviceContainer = serviceContainer.children( ":last" );
-
-          $.data(service, "geoServiceState", serviceState);
-        }
-
-        return serviceState.serviceContainer;
-      },
-
-      destroy: function (map, serviceContainer, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        serviceState.serviceContainer.remove();
-
-        $.removeData(service, "geoServiceState");
-      },
-
-      interactiveTransform: function ( map, service, center, pixelSize ) {
-        //console.log( "tiled.interactiveTransform( " + center.join( ", " ) + ", " + pixelSize + ")" );
-        var serviceState = $.data( service, "geoServiceState" ),
-            tilingScheme = map.options[ "tilingScheme" ];
-
-        if ( serviceState ) {
-          this._cancelUnloaded( map, service );
-
-          serviceState.serviceContainer.children( ).each( function ( i ) {
-            var $scaleContainer = $(this),
-                scalePixelSize = $scaleContainer.data("pixelSize"),
-                scaleRatio = scalePixelSize / pixelSize;
-
-            if ( scalePixelSize > 0 ) {
-              scaleRatio = Math.round(scaleRatio * 1000) / 1000;
-
-              var oldMapCoord = $scaleContainer.data("scaleOrigin"),
-                  newPixelPoint = map._toPixel(oldMapCoord, center, pixelSize);
-
-              $scaleContainer.css( {
-                left: Math.round(newPixelPoint[0]) + "px",
-                top: Math.round(newPixelPoint[1]) + "px",
-                width: tilingScheme.tileWidth * scaleRatio,
-                height: tilingScheme.tileHeight * scaleRatio
-              } );
-
-              /*
-              if ( $("body")[0].filters !== undefined ) {
-                $scaleContainer.children().each( function ( i ) {
-                  $( this ).css( "filter", "progid:DXImageTransform.Microsoft.Matrix(FilterType=bilinear,M11=" + scaleRatio + ",M22=" + scaleRatio + ",sizingmethod='auto expand')" );
-                } );
-              }
-              */
-            }
-          });
-        }
-      },
-
-      refresh: function (map, service, force) {
-        //console.log( "tiled.refresh( " + map._center.join( ", " ) + ", " + map._pixelSize + ")" );
-        var serviceState = $.data( service, "geoServiceState" );
-
-        this._cancelUnloaded(map, service);
-
-        if ( serviceState && force ) {
-          // if hidden atm, we want to make sure we reload this service after it becomes visible
-          serviceState.reloadTiles = true;
-        }
-
-        if ( serviceState && service && service.style.visibility === "visible" && !( serviceState.serviceContainer.is( ":hidden" ) ) ) {
-          var bbox = map._getBbox(),
-              pixelSize = map._pixelSize,
-
-              serviceObj = this,
-              $serviceContainer = serviceState.serviceContainer,
-
-              contentBounds = map._getContentBounds(),
-              mapWidth = contentBounds["width"],
-              mapHeight = contentBounds["height"],
-
-              image = map.options[ "axisLayout" ] === "image",
-              ySign = image ? +1 : -1,
-
-              tilingScheme = map.options["tilingScheme"],
-              tileWidth = tilingScheme.tileWidth,
-              tileHeight = tilingScheme.tileHeight,
-
-              tileX = Math.floor((bbox[0] - tilingScheme.origin[0]) / (pixelSize * tileWidth)),
-              tileY = Math.max( Math.floor( ( image ? bbox[1] - tilingScheme.origin[1] : tilingScheme.origin[1] - bbox[ 3 ] ) / (pixelSize * tileHeight) ), 0 ),
-              tileX2 = Math.ceil((bbox[2] - tilingScheme.origin[0]) / (pixelSize * tileWidth)),
-              tileY2 = Math.ceil( ( image ? bbox[3] - tilingScheme.origin[1] : tilingScheme.origin[1] - bbox[ 1 ] ) / (pixelSize * tileHeight) ),
-
-              bboxMax = map._getBboxMax(),
-              pixelSizeAtZero = map._getPixelSize(0),
-              ratio = pixelSizeAtZero / pixelSize,
-              fullXAtScale = Math.floor((bboxMax[0] - tilingScheme.origin[0]) / (pixelSizeAtZero * tileWidth)) * ratio,
-              fullYAtScale = Math.floor((tilingScheme.origin[1] + ySign * bboxMax[3]) / (pixelSizeAtZero * tileHeight)) * ratio,
-
-              fullXMinX = tilingScheme.origin[0] + (fullXAtScale * tileWidth) * pixelSize,
-              fullYMinOrMaxY = tilingScheme.origin[1] + ySign * (fullYAtScale * tileHeight) * pixelSize,
-
-              serviceLeft = Math.round((fullXMinX - bbox[0]) / pixelSize),
-              serviceTop = Math.round( ( image ? fullYMinOrMaxY - bbox[1] : bbox[3] - fullYMinOrMaxY ) / pixelSize),
-
-              scaleContainers = $serviceContainer.children().show(),
-              scaleContainer = scaleContainers.filter("[data-pixel-size='" + pixelSize + "']").appendTo($serviceContainer),
-
-              opacity = service.style.opacity,
-
-              x, y,
-
-              loadImageDeferredDone = function( url ) {
-                // when a Deferred call is done, add the image to the map
-                // a reference to the correct img element is on the Deferred object itself
-                serviceObj._loadImage( $.data( this, "img" ), url, pixelSize, map, serviceState, opacity );
-              },
-
-              loadImageDeferredFail = function( ) {
-                $.data( this, "img" ).remove( );
-                serviceState.loadCount--;
-                map._requestComplete();
-              };
-
-          if (serviceState.reloadTiles) {
-            scaleContainers.find("img").attr("data-dirty", "true");
-          }
-
-          if (!scaleContainer.size()) {
-            $serviceContainer.append("<div style='-webkit-transform:translateZ(0);position:absolute; left:" + serviceLeft % tileWidth + "px; top:" + serviceTop % tileHeight + "px; width:" + tileWidth + "px; height:" + tileHeight + "px; margin:0; padding:0;' data-pixel-size='" + pixelSize + "'></div>");
-            scaleContainer = $serviceContainer.children(":last").data("scaleOrigin", map._toMap( [ (serviceLeft % tileWidth), (serviceTop % tileHeight) ] ) );
-          } else {
-            scaleContainer.css({
-              left: (serviceLeft % tileWidth) + "px",
-              top: (serviceTop % tileHeight) + "px"
-            }).data("scaleOrigin", map._toMap( [ (serviceLeft % tileWidth), (serviceTop % tileHeight) ] ) );
-
-            scaleContainer.children().each(function (i) {
-              var 
-              $img = $(this),
-              tile = $img.attr("data-tile").split(",");
-
-              $img.css({
-                left: Math.round(((parseInt(tile[0], 10) - fullXAtScale) * 100) + (serviceLeft - (serviceLeft % tileWidth)) / tileWidth * 100) + "%",
-                top: Math.round(((parseInt(tile[1], 10) - fullYAtScale) * 100) + (serviceTop - (serviceTop % tileHeight)) / tileHeight * 100) + "%"
-              });
-
-              if (opacity < 1) {
-                $img.fadeTo(0, opacity);
-              }
-            });
-          }
-
-          for (x = tileX; x < tileX2; x++) {
-            for (y = tileY; y < tileY2; y++) {
-              var tileStr = "" + x + "," + y,
-                  $img = scaleContainer.children("[data-tile='" + tileStr + "']").removeAttr("data-dirty");
-
-              if ($img.size() === 0 || serviceState.reloadTiles) {
-                var bottomLeft = [
-                      tilingScheme.origin[0] + (x * tileWidth) * pixelSize,
-                      tilingScheme.origin[1] + ySign * (y * tileHeight) * pixelSize
-                    ],
-
-                    topRight = [
-                      tilingScheme.origin[0] + ((x + 1) * tileWidth - 1) * pixelSize,
-                      tilingScheme.origin[1] + ySign * ((y + 1) * tileHeight - 1) * pixelSize
-                    ],
-
-                    tileBbox = [bottomLeft[0], bottomLeft[1], topRight[0], topRight[1]],
-
-                    urlProp = ( service.hasOwnProperty( "src" ) ? "src" : "getUrl" ),
-                    urlArgs = {
-                      bbox: tileBbox,
-                      width: tileWidth,
-                      height: tileHeight,
-                      zoom: map._getZoom(),
-                      tile: {
-                        row: y,
-                        column: x
-                      },
-                      index: Math.abs(y + x)
-                    },
-                    isFunc = $.isFunction( service[ urlProp ] ),
-                    imageUrl;
-
-                if ( isFunc ) {
-                  imageUrl = service[ urlProp ]( urlArgs );
-                } else {
-                  $.templates( "geoSrc", service[ urlProp ] );
-                  imageUrl = $.render[ "geoSrc" ]( urlArgs );
-                }
-
-                serviceState.loadCount++;
-                map._requestQueued();
-
-                if (serviceState.reloadTiles && $img.size() > 0) {
-                  $img.attr("src", imageUrl);
-                } else {
-                  var imgMarkup = "<img style='-webkit-transform:translateZ(0);position:absolute; " +
-                    "left:" + (((x - fullXAtScale) * 100) + (serviceLeft - (serviceLeft % tileWidth)) / tileWidth * 100) + "%; " +
-                    "top:" + (((y - fullYAtScale) * 100) + (serviceTop - (serviceTop % tileHeight)) / tileHeight * 100) + "%; ";
-
-                  imgMarkup += "width: 100%; height: 100%;";
-
-                  // #newpanzoom
-                  /*
-                  if ($("body")[0].filters === undefined) {
-                    imgMarkup += "width: 100%; height: 100%;";
-                  }
-                  */
-
-                  imgMarkup += "margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;' unselectable='on' data-tile='" + tileStr + "' />";
-
-                  scaleContainer.append(imgMarkup);
-                  $img = scaleContainer.children(":last");
-                }
-
-                if ( typeof imageUrl === "string" ) {
-                  serviceObj._loadImage( $img, imageUrl, pixelSize, map, serviceState, opacity );
-                } else if ( imageUrl ) {
-                  // assume Deferred
-                  $.data( imageUrl, "img", $img );
-                  imageUrl.done( loadImageDeferredDone ).fail( loadImageDeferredFail );
-                } else {
-                  $img.remove( );
-                }
-              }
-            }
-          }
-
-          scaleContainers.find("[data-dirty]").remove();
-          serviceState.reloadTiles = false;
-        }
-      },
-
-      resize: function (map, service) {
-      },
-
-      opacity: function ( map, service ) {
-        var serviceState = $.data( service, "geoServiceState" );
-        serviceState.serviceContainer.find( "img" ).stop( true ).fadeTo( "fast", service.style.opacity );
-      },
-
-      toggle: function ( map, service ) {
-        var serviceState = $.data( service, "geoServiceState" );
-        serviceState.serviceContainer.css( "display", service.style.visibility === "visible" ? "block" : "none" );
-      },
-
-      _cancelUnloaded: function (map, service) {
-        var serviceState = $.data( service, "geoServiceState" );
-
-        if (serviceState && serviceState.loadCount > 0) {
-          serviceState.serviceContainer.find("img:hidden").remove();
-          while (serviceState.loadCount > 0) {
-            serviceState.loadCount--;
-            map._requestComplete();
-          }
-        }
-      },
-
-      _loadImage: function ( $img, url, pixelSize, map, serviceState, opacity ) {
-        var serviceContainer = serviceState.serviceContainer;
-
-        $img.load(function (e) {
-          if (opacity < 1) {
-            $(e.target).fadeTo(0, opacity);
-          } else {
-            $(e.target).show();
-          }
-
-          serviceState.loadCount--;
-          map._requestComplete();
-
-          if (serviceState.loadCount <= 0) {
-            serviceContainer.children(":not([data-pixel-size='" + pixelSize + "'])").remove();
-            serviceState.loadCount = 0;
-          }
-        }).error(function (e) {
-          $(e.target).remove();
-          serviceState.loadCount--;
-          map._requestComplete();
-
-          if (serviceState.loadCount <= 0) {
-            serviceContainer.children(":not([data-pixel-size='" + pixelSize + "'])").remove();
-            serviceState.loadCount = 0;
-          }
-        }).attr("src", url);
-      }
-    };
-  }());
-}(jQuery));
-
-(function ($, undefined) {
-  $.geo._serviceTypes.shingled = (function () {
-    return {
-      create: function (map, serviceContainer, service, index) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( !serviceState ) {
-          serviceState = {
-            loadCount: 0
-          };
-
-          var scHtml = '<div data-geo-service="shingled" style="-webkit-transform:translateZ(0);position:absolute; left:0; top:0; width:16px; height:16px; margin:0; padding:0;"></div>';
-
-          serviceContainer.append(scHtml);
-
-          serviceState.serviceContainer = serviceContainer.children(":last");
-          $.data(service, "geoServiceState", serviceState);
-        }
-
-        return serviceState.serviceContainer;
-      },
-
-      destroy: function (map, serviceContainer, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        serviceState.serviceContainer.remove();
-
-        $.removeData(service, "geoServiceState");
-      },
-
-      interactiveTransform: function ( map, service, center, pixelSize ) {
-        var serviceState = $.data( service, "geoServiceState" ),
-
-            contentBounds = map._getContentBounds(),
-            mapWidth = contentBounds[ "width" ],
-            mapHeight = contentBounds[ "height" ],
-
-            halfWidth = mapWidth / 2,
-            halfHeight = mapHeight / 2,
-
-            bbox = [ center[ 0 ] - halfWidth, center[ 1 ] - halfHeight, center[ 0 ] + halfWidth, center[ 1 ] + halfHeight ];
-
-        if ( serviceState ) {
-          this._cancelUnloaded( map, service );
-
-          serviceState.serviceContainer.children( ).each( function ( i ) {
-            var $scaleContainer = $(this),
-                scalePixelSize = $scaleContainer.data( "pixelSize" ),
-                scaleRatio = scalePixelSize / pixelSize;
-                
-            if ( scalePixelSize > 0 ) {
-              scaleRatio = Math.round(scaleRatio * 1000) / 1000;
-
-              var oldMapOrigin = $scaleContainer.data( "origin" ),
-                  newPixelPoint = map._toPixel( oldMapOrigin, center, pixelSize );
-
-              $scaleContainer.css( {
-                left: Math.round( newPixelPoint[ 0 ] ),
-                top: Math.round( newPixelPoint[ 1 ] ),
-                width: mapWidth * scaleRatio,
-                height: mapHeight * scaleRatio
-              } );
-              
-              
-              // #newpanzoom
-              /*
-             .children("img").each(function (i) {
-                var $img = $(this),
-                    imgCenter = $img.data("center"),
-                    x = (Math.round((imgCenter[0] - center[0]) / scalePixelSize) - halfWidth) * scaleRatio,
-                    y = (Math.round((center[1] - imgCenter[1]) / scalePixelSize) - halfHeight) * scaleRatio;
-
-                $img.css({ left: x + "px", top: y + "px" });
-              });
-              */
-            }
-          });
-        }
-      },
-
-      refresh: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        this._cancelUnloaded(map, service);
-
-        if ( serviceState && service && service.style.visibility === "visible" && !( serviceState.serviceContainer.is( ":hidden" ) ) ) {
-
-          var bbox = map._getBbox(),
-              pixelSize = map._pixelSize,
-
-              serviceObj = this,
-              serviceContainer = serviceState.serviceContainer,
-
-              contentBounds = map._getContentBounds(),
-              mapWidth = contentBounds["width"],
-              mapHeight = contentBounds["height"],
-
-              scaleContainer = serviceContainer.children('[data-pixel-size="' + pixelSize + '"]'),
-
-              opacity = service.style.opacity,
-
-              $img;
-
-          if (opacity < 1) {
-            serviceContainer.find("img").attr("data-keep-alive", "0");
-          }
-
-          if ( !scaleContainer.size() ) {
-            serviceContainer.append('<div style="-webkit-transform:translateZ(0);position:absolute; left:0px; top: 0px; width:' + mapWidth + 'px; height:' + mapHeight + 'px; margin:0; padding:0;" data-pixel-size="' + pixelSize + '" data-origin="[' + map._toMap( [ 0, 0 ] ) + ']"></div>');
-            scaleContainer = serviceContainer.children(":last");
-          }
-
-          var urlProp = ( service.hasOwnProperty("src") ? "src" : "getUrl" ),
-              urlArgs = {
-                bbox: bbox,
-                width: mapWidth,
-                height: mapHeight,
-                zoom: map._getZoom(),
-                tile: null,
-                index: 0
-              },
-              isFunc = $.isFunction( service[ urlProp ] ),
-              imageUrl,
-              imagePos = scaleContainer.position( );
-
-          imagePos.left = - ( imagePos.left );
-          imagePos.top = - ( imagePos.top );
-
-          if ( isFunc ) {
-            imageUrl = service[ urlProp ]( urlArgs );
-          } else {
-            $.templates( "geoSrc", service[ urlProp ] );
-            imageUrl = $.render[ "geoSrc" ]( urlArgs );
-          }
-
-          serviceState.loadCount++;
-          map._requestQueued();
-
-          scaleContainer.append('<img style="-webkit-transform:translateZ(0);position:absolute; left:' + ( imagePos.left / scaleContainer.width( ) * 100 ) + '%; top:' + ( imagePos.top / scaleContainer.height( ) * 100 ) + '%; width:100%; height:100%; margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;" unselectable="on" />');
-          $img = scaleContainer.children(":last").data("center", map._center);
-
-          if ( typeof imageUrl === "string" ) {
-            serviceObj._loadImage( $img, imageUrl, pixelSize, map, serviceState, opacity );
-          } else {
-            // assume Deferred
-            imageUrl.done( function( url ) {
-              serviceObj._loadImage( $img, url, pixelSize, map, serviceState, opacity );
-            } ).fail( function( ) {
-              $img.remove( );
-              serviceState.loadCount--;
-              map._requestComplete();
-            } );
-          }
-
-        }
-      },
-
-      resize: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( serviceState && service && service.style.visibility === "visible" ) {
-          this._cancelUnloaded(map, service);
-
-          var serviceContainer = serviceState.serviceContainer,
-
-              contentBounds = map._getContentBounds(),
-              mapWidth = contentBounds["width"],
-              mapHeight = contentBounds["height"],
-
-              scaleContainers = serviceContainer.children();
-
-          scaleContainers.attr("data-pixel-size", "0");
-
-          scaleContainers.each( function ( i ) {
-            var $scaleContainer = $(this),
-                position = $scaleContainer.position( );
-
-            var oldMapOrigin = $scaleContainer.data( "origin" ),
-                newPixelPoint = map._toPixel( oldMapOrigin );
-
-            $scaleContainer.css( {
-              left: position.left + ( mapWidth - $scaleContainer.width( ) ) / 2,
-              top: position.top + ( mapHeight - $scaleContainer.height( ) ) / 2
-            } );
-
-          } );
-            
-
-          /*
-          scaleContainer.css({
-            left: halfWidth + 'px',
-            top: halfHeight + 'px'
-          });
-          */
-        }
-      },
-
-      opacity: function ( map, service ) {
-        var serviceState = $.data( service, "geoServiceState" );
-        serviceState.serviceContainer.find( "img" ).stop( true ).fadeTo( "fast", service.style.opacity );
-      },
-
-      toggle: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-        serviceState.serviceContainer.css("display", service.style.visibility === "visible" ? "block" : "none");
-      },
-
-      _cancelUnloaded: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if (serviceState && serviceState.loadCount > 0) {
-          serviceState.serviceContainer.find("img:hidden").remove();
-          while (serviceState.loadCount > 0) {
-            serviceState.loadCount--;
-            map._requestComplete();
-          }
-        }
-      },
-
-      _loadImage: function ( $img, url, pixelSize, map, serviceState, opacity ) {
-        var serviceContainer = serviceState.serviceContainer;
-
-        $img.load(function (e) {
-          if (opacity < 1) {
-            $(e.target).fadeTo(0, opacity);
-          } else {
-            $(e.target).show();
-          }
-
-          serviceState.loadCount--;
-          map._requestComplete();
-
-          if (serviceState.loadCount <= 0) {
-            // #newpanzoom
-            serviceContainer.children(':not([data-pixel-size="' + pixelSize + '"])').remove();
-
-            serviceContainer.find( "img[data-keep-alive]" ).remove( );
-
-            serviceState.loadCount = 0;
-          }
-        }).error(function (e) {
-          $(e.target).remove();
-          serviceState.loadCount--;
-          map._requestComplete();
-
-          if (serviceState.loadCount <= 0) {
-            serviceContainer.children(":not([data-pixel-size='" + pixelSize + "'])").remove();
-            serviceState.loadCount = 0;
-          }
-        }).attr("src", url);
-      }
-    };
-  }());
-}(jQuery));
diff --git a/libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0b1.min.js b/libs/js/jquery-geo-1.0b2/docs/jquery.geo-1.0b1.min.js
deleted file mode 100755 (executable)
index c3c1f38..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! jQuery Geo - v1.0b1.0.1 - 2012-08-01
- * http://jquerygeo.com
- * Copyright (c) 2012 Ryan Westphal/Applied Geographics, Inc.; Licensed MIT, GPL */
-document.createElement("canvas").getContext||function(){function j(){return this.context_||(this.context_=new I(this))}function l(a,b,c){var d=k.call(arguments,2);return function(){return a.apply(b,d.concat(k.call(arguments)))}}function m(a){return String(a).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}function n(a,b,c){a.namespaces[b]||a.namespaces.add(b,c,"#default#VML")}function o(a){n(a,"g_vml_","urn:schemas-microsoft-com:vml"),n(a,"g_o_","urn:schemas-microsoft-com:office:office");if(!a.styleSheets.ex_canvas_){var b=a.createStyleSheet();b.owningElement.id="ex_canvas_",b.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function q(a){var b=a.srcElement;switch(a.propertyName){case"width":b.getContext().clearRect(),b.style.width=b.attributes.width.nodeValue+"px",b.firstChild.style.width=b.clientWidth+"px";break;case"height":b.getContext().clearRect(),b.style.height=b.attributes.height.nodeValue+"px",b.firstChild.style.height=b.clientHeight+"px"}}function r(a){var b=a.srcElement;b.firstChild&&(b.firstChild.style.width=b.clientWidth+"px",b.firstChild.style.height=b.clientHeight+"px")}function v(){return[[1,0,0],[0,1,0],[0,0,1]]}function w(a,b){var c=v();for(var d=0;d<3;d++)for(var e=0;e<3;e++){var f=0;for(var g=0;g<3;g++)f+=a[d][g]*b[g][e];c[d][e]=f}return c}function x(a,b){b.fillStyle=a.fillStyle,b.lineCap=a.lineCap,b.lineJoin=a.lineJoin,b.lineWidth=a.lineWidth,b.miterLimit=a.miterLimit,b.shadowBlur=a.shadowBlur,b.shadowColor=a.shadowColor,b.shadowOffsetX=a.shadowOffsetX,b.shadowOffsetY=a.shadowOffsetY,b.strokeStyle=a.strokeStyle,b.globalAlpha=a.globalAlpha,b.font=a.font,b.textAlign=a.textAlign,b.textBaseline=a.textBaseline,b.arcScaleX_=a.arcScaleX_,b.arcScaleY_=a.arcScaleY_,b.lineScale_=a.lineScale_}function y(a){var b=a.indexOf("(",3),c=a.indexOf(")",b+1),d=a.substring(b+1,c).split(",");if(d.length!=4||a.charAt(3)!="a")d[3]=1;return d}function z(a){return parseFloat(a)/100}function A(a,b,c){return Math.min(c,Math.max(b,a))}function B(a){var b,c,d,e,f,g;e=parseFloat(a[0])/360%360,e<0&&e++,f=A(z(a[1]),0,1),g=A(z(a[2]),0,1);if(f==0)b=c=d=g;else{var h=g<.5?g*(1+f):g+f-g*f,i=2*g-h;b=C(i,h,e+1/3),c=C(i,h,e),d=C(i,h,e-1/3)}return"#"+s[Math.floor(b*255)]+s[Math.floor(c*255)]+s[Math.floor(d*255)]}function C(a,b,c){return c<0&&c++,c>1&&c--,6*c<1?a+(b-a)*6*c:2*c<1?b:3*c<2?a+(b-a)*(2/3-c)*6:a}function E(a){if(a in D)return D[a];var b,c=1;a=String(a);if(a.charAt(0)=="#")b=a;else if(/^rgb/.test(a)){var d=y(a),b="#",e;for(var f=0;f<3;f++)d[f].indexOf("%")!=-1?e=Math.floor(z(d[f])*255):e=+d[f],b+=s[A(e,0,255)];c=+d[3]}else if(/^hsl/.test(a)){var d=y(a);b=B(d),c=d[3]}else b=a;return D[a]={color:b,alpha:c}}function H(a){return G[a]||"square"}function I(a){this.m_=v(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=g*1,this.globalAlpha=1,this.canvas=a;var b="width:"+a.clientWidth+"px;height:"+a.clientHeight+"px;overflow:hidden;position:absolute",c=a.ownerDocument.createElement("div");c.style.cssText=b,a.appendChild(c);var d=c.cloneNode(!1);d.style.backgroundColor="red",d.style.filter="alpha(opacity=0)",a.appendChild(d),this.element_=c,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function K(a,b,c,d){a.currentPath_.push({type:"bezierCurveTo",cp1x:b.x,cp1y:b.y,cp2x:c.x,cp2y:c.y,x:d.x,y:d.y}),a.currentX_=d.x,a.currentY_=d.y}function L(a,b){var c=E(a.strokeStyle),d=c.color,e=c.alpha*a.globalAlpha,f=a.lineScale_*a.lineWidth;f<1&&(e*=f),b.push("<g_vml_:stroke",' opacity="',e,'"',' joinstyle="',a.lineJoin,'"',' miterlimit="',a.miterLimit,'"',' endcap="',H(a.lineCap),'"',' weight="',f,'px"',' color="',d,'" />')}function M(a,b,c,d){var e=a.fillStyle,f=a.arcScaleX_,g=a.arcScaleY_,h=d.x-c.x,i=d.y-c.y,j=E(a.fillStyle),k=j.color,l=j.alpha*a.globalAlpha;b.push('<g_vml_:fill color="',k,'" opacity="',l,'" />')}function N(a,b,c){var d=a.m_;return{x:g*(b*d[0][0]+c*d[1][0]+d[2][0])-h,y:g*(b*d[0][1]+c*d[1][1]+d[2][1])-h}}function O(a){return isFinite(a[0][0])&&isFinite(a[0][1])&&isFinite(a[1][0])&&isFinite(a[1][1])&&isFinite(a[2][0])&&isFinite(a[2][1])}function P(a,b,c){if(!O(b))return;a.m_=b;if(c){var d=b[0][0]*b[1][1]-b[0][1]*b[1][0];a.lineScale_=f(e(d))}}function Q(a){throw new R(a)}function R(a){this.code=this[a],this.message=a+": DOM Exception "+this.code}var a=Math,b=a.round,c=a.sin,d=a.cos,e=a.abs,f=a.sqrt,g=10,h=g/2,i=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],k=Array.prototype.slice;o(document);var p={init:function(a){var b=a||document;b.createElement("canvas"),b.attachEvent("onreadystatechange",l(this.init_,this,b))},init_:function(a){var b=a.getElementsByTagName("canvas");for(var c=0;c<b.length;c++)this.initElement(b[c])},initElement:function(a){if(!a.getContext){a.getContext=j,o(a.ownerDocument),a.innerHTML="",a.attachEvent("onpropertychange",q),a.attachEvent("onresize",r);var b=a.attributes;b.width&&b.width.specified?a.style.width=b.width.nodeValue+"px":a.width=a.clientWidth,b.height&&b.height.specified?a.style.height=b.height.nodeValue+"px":a.height=a.clientHeight}return a}};p.init();var s=[];for(var t=0;t<16;t++)for(var u=0;u<16;u++)s[t*16+u]=t.toString(16)+u.toString(16);var D={},F={style:"normal",variant:"normal",weight:"normal",size:10,family:"sans-serif"},G={butt:"flat",round:"round"},J=I.prototype;J.clearRect=function(){this.textMeasureEl_&&(this.textMeasureEl_.removeNode(!0),this.textMeasureEl_=null),this.element_.innerHTML=""},J.beginPath=function(){this.currentPath_=[]},J.moveTo=function(a,b){var c=N(this,a,b);this.currentPath_.push({type:"moveTo",x:c.x,y:c.y}),this.currentX_=c.x,this.currentY_=c.y},J.lineTo=function(a,b){var c=N(this,a,b);this.currentPath_.push({type:"lineTo",x:c.x,y:c.y}),this.currentX_=c.x,this.currentY_=c.y},J.bezierCurveTo=function(a,b,c,d,e,f){var g=N(this,e,f),h=N(this,a,b),i=N(this,c,d);K(this,h,i,g)},J.quadraticCurveTo=function(a,b,c,d){var e=N(this,a,b),f=N(this,c,d),g={x:this.currentX_+2/3*(e.x-this.currentX_),y:this.currentY_+2/3*(e.y-this.currentY_)},h={x:g.x+(f.x-this.currentX_)/3,y:g.y+(f.y-this.currentY_)/3};K(this,g,h,f)},J.arc=function(a,b,e,f,i,j){e*=g;var k=j?"at":"wa",l=a+d(f)*e-h,m=b+c(f)*e-h,n=a+d(i)*e-h,o=b+c(i)*e-h;l==n&&!j&&(l+=.125);var p=N(this,a,b),q=N(this,l,m),r=N(this,n,o);this.currentPath_.push({type:k,x:p.x,y:p.y,radius:e,xStart:q.x,yStart:q.y,xEnd:r.x,yEnd:r.y})},J.stroke=function(a){var c=[],d=!1,e=10,f=10;c.push("<g_vml_:shape",' filled="',!!a,'"',' style="position:absolute;width:',e,"px;height:",f,'px;"',' coordorigin="0,0"',' coordsize="',g*e,",",g*f,'"',' stroked="',!a,'"',' path="');var h=!1,i={x:null,y:null},j={x:null,y:null};for(var k=0;k<this.currentPath_.length;k++){var l=this.currentPath_[k],m;switch(l.type){case"moveTo":m=l,c.push(" m ",b(l.x),",",b(l.y));break;case"lineTo":c.push(" l ",b(l.x),",",b(l.y));break;case"close":c.push(" x "),l=null;break;case"bezierCurveTo":c.push(" c ",b(l.cp1x),",",b(l.cp1y),",",b(l.cp2x),",",b(l.cp2y),",",b(l.x),",",b(l.y));break;case"at":case"wa":c.push(" ",l.type," ",b(l.x-this.arcScaleX_*l.radius),",",b(l.y-this.arcScaleY_*l.radius)," ",b(l.x+this.arcScaleX_*l.radius),",",b(l.y+this.arcScaleY_*l.radius)," ",b(l.xStart),",",b(l.yStart)," ",b(l.xEnd),",",b(l.yEnd))}if(l){if(i.x==null||l.x<i.x)i.x=l.x;if(j.x==null||l.x>j.x)j.x=l.x;if(i.y==null||l.y<i.y)i.y=l.y;if(j.y==null||l.y>j.y)j.y=l.y}}c.push(' ">'),a?M(this,c,i,j):L(this,c),c.push("</g_vml_:shape>"),this.element_.insertAdjacentHTML("beforeEnd",c.join(""))},J.fill=function(){this.stroke(!0)},J.closePath=function(){this.currentPath_.push({type:"close"})},J.save=function(){var a={};x(this,a),this.aStack_.push(a),this.mStack_.push(this.m_),this.m_=w(v(),this.m_)},J.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},J.translate=function(a,b){var c=[[1,0,0],[0,1,0],[a,b,1]];P(this,w(c,this.m_),!1)},J.scale=function(a,b){this.arcScaleX_*=a,this.arcScaleY_*=b;var c=[[a,0,0],[0,b,0],[0,0,1]];P(this,w(c,this.m_),!0)};var S=R.prototype=new Error;S.INDEX_SIZE_ERR=1,S.DOMSTRING_SIZE_ERR=2,S.HIERARCHY_REQUEST_ERR=3,S.WRONG_DOCUMENT_ERR=4,S.INVALID_CHARACTER_ERR=5,S.NO_DATA_ALLOWED_ERR=6,S.NO_MODIFICATION_ALLOWED_ERR=7,S.NOT_FOUND_ERR=8,S.NOT_SUPPORTED_ERR=9,S.INUSE_ATTRIBUTE_ERR=10,S.INVALID_STATE_ERR=11,S.SYNTAX_ERR=12,S.INVALID_MODIFICATION_ERR=13,S.NAMESPACE_ERR=14,S.INVALID_ACCESS_ERR=15,S.VALIDATION_ERR=16,S.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=p,CanvasRenderingContext2D=I,DOMException=R}(),this.jsviews||this.jQuery&&jQuery.views||function(a,b){function A(a,b){var c="\\"+a.charAt(0),d="\\"+a.charAt(1),g="\\"+b.charAt(0),h="\\"+b.charAt(1);return z.rTag=e=d+"(?:(?:(\\w+(?=[\\/\\s"+g+"]))|(?:(\\w+)?(:)|(>)|(\\*)))"+"\\s*((?:[^"+g+"]|"+g+"(?!"+h+"))*?)"+"(\\/)?|(?:\\/(\\w+)))"+g,e=new RegExp(c+e+h,"g"),f=new RegExp("<.*>|"+a+".*"+b),this}function B(a){var c=this,d=c.tmpl.helpers||{};return a=(c.ctx[a]!==b?c.ctx:d[a]!==b?d:I[a]!==b?I:{})[a],typeof a!="function"?a:function(){return a.apply(c,arguments)}}function C(a,b,c){var d=b.tmpl.converters;return a=d&&d[a]||J[a],a?a.call(b,c):c}function D(a,c,d,e,f){f.props=f.props||{};var h,i=f.props.tmpl,k=c.tmpl.tags,l=c.tmpl.templates,m=arguments,n=k&&k[a]||H[a];return n?(e=e&&c.tmpl.tmpls[e-1],i=i||e||b,f.tmpl=""+i===i?l&&l[i]||G[i]||G(i):i,f.isTag=j,f.converter=d,f.view=c,f.renderContent=K,c.ctx&&g(f.ctx,c.ctx),h=n.apply(f,m.length>5?x.call(m,5):[]),h||(h==b?"":h.toString())):""}function E(a,c,e,f,g,h){var i=e.views,j={tmpl:g,path:c,parent:e,data:f,ctx:a,views:d.isArray(f)?[]:{},hlp:B};return d.isArray(i)?i.splice(j.index=h!==b?h:i.length,0,j):i[j.index="_"+r++]=j,j}function F(a,c,d,e,f){var g,i;if(d&&typeof d=="object"&&!d.nodeType){for(g in d)c(g,d[g]);return a}if(!d||e===b)f&&(e=f(b,e||d));else if(""+d===d)if(e===null)delete c[d];else if(e=f?f(d,e):e)c[d]=e;return(i=h.onStoreItem)&&i(c,d,e,f),e}function G(a,b){return F(this,G,a,b,O)}function H(a,b){return F(this,H,a,b)}function I(a,b){return F(this,I,a,b)}function J(a,b){return F(this,J,a,b)}function K(a,c,e,f,k){var l,m,n,o,p,q,r,s,t,u,v={},w=k===j,x=this,y="";x.isTag?(t=x.tmpl,c=c||x.ctx,e=e||x.view,f=f||x.path,k=k||x.index,v=x.props):t=x.jquery&&x[0]||x,e=e||z.topView,s=e.ctx,u=t.layout,a===e&&(a=e.data,u=j),c=c&&c===s?s:s?(s=g({},s),c)?g(s,c):s:c||{},v.link===i&&(c.link=i),t.fn||(t=G[t]||G(t)),p=c.link&&h.onRenderItem,q=c.link&&h.onRenderItems;if(t){if(d.isArray(a)&&!u){o=w?e:k!==b&&e||E(c,f,e,a,t,k);for(l=0,m=a.length;l<m;l++)n=a[l],r=t.fn(n,E(c,f,o,n,t,(k||0)+l),z),y+=p?p(r,v):r}else o=w?e:E(c,f,e,a,t,k),y+=a||u?t.fn(a,o,z):"";return e.topKey=o.index,q?q(y,f,o.index,t,v):y}return""}function L(){throw"Syntax error"}function M(a,b,c){function I(b){b-=D,b&&F.push(a.substr(D,b).replace(n,"\\n"))}function J(b,e,f,g,h,i,k,l,m,n){h&&(g=":",f="html");var p="",r="",s=!l&&!g;e=e||g,I(n),D=n+b.length,i?z&&F.push(["*",k.replace(o,"$1")]):e?(e==="else"&&(G[5]=a.substring(G[5],n),G=E.pop(),F=G[3],s=j),k=k?N(k,c).replace(q,function(a,b,c){return b?r+=c+",":p+=c+",",""}):"",p=p.slice(0,-1),k=k.slice(0,-1),d=[e,f||"",k,s&&[],"{"+(p?"props:{"+p+"},":"")+"path:'"+k+"'"+(r?",ctx:{"+r.slice(0,-1)+"}":"")+"}"],s&&(E.push(G),G=d,G[5]=D),F.push(d)):m&&(G[5]=a.substring(G[5],n),G=E.pop());if(!G)throw"Expected block tag";F=G[3]}var d,f,g,h,i,k,l,m,r,s,t,u,w,x,y,z,A=b?{allowCode:z=b.allowCode,debug:b.debug}:{},B=b&&b.tmpls,C=[],D=0,E=[],F=C,G=[,,,C],H=0;a=a.replace(p,"\\$1"),a.replace(e,J),I(a.length),h=C.length,i=h?"":'"";';for(g=0;g<h;g++)f=C[g],f[0]==="*"?i=i.slice(0,g?-1:-3)+";"+f[1]+(g+1<h?"ret+=":""):""+f===f?i+='"'+f+'"+':(t=f[0],u=f[1],w=f[2],F=f[3],x=f[4],a=f[5],F&&(y=P(a,A,b,H++),M(a,y),B.push(y)),s=s||x.indexOf("view")>-1,i+=(t===":"?u==="html"?(l=j,"e("+w):u?(r=j,'c("'+u+'",view,'+w):(m=j,"((v="+w+')!=u?v:""'):(k=j,'t("'+t+'",view,"'+(u||"")+'",'+(F?B.length:'""')+","+x+(w?",":"")+w))+")+");return i=new Function("data, view, j, b, u",v+(m?"v,":"")+(k?"t=j.tag,":"")+(r?"c=j.convert,":"")+(l?"e=j.converters.html,":"")+"ret; try{\n\n"+(A.debug?"debugger;":"")+(z?"ret=":"return ")+i.slice(0,-1)+";\n\n"+(z?"return ret;":"")+"}catch(e){return j.err(e);}"),b&&(b.fn=i,b.useVw=r||s||k),i}function N(a,b){function h(a,h,k,m,n,o,p,q,r,s,t,u,v,w,x,y){function z(a,c,d,e,f,g,h){if(c){var i=(d?'view.hlp("'+d+'")':e?"view":"data")+(h?(f?"."+f:d?"":e?"":"."+c)+(g||""):(h=d?"":e?f||"":c,""));return b&&r!=="("&&(i="b("+i+',"'+h+'")'),i+(h?"."+h:"")}return a}n=n||"",k=k||h||t,m=m||q,r=r||x||"",n=n||"";if(o)L();else return g?(g=!u,g?a:'"'):f?(f=!v,f?a:'"'):(k?(e++,k):"")+(y?e?"":c?(c=i,"\b"):",":p?(e&&L(),c=j,"\b"+m+":"):m?m.replace(l,z)+(r?(d[++e]=j,r):n):n?a:w?(d[e--]=i,w)+(r?(d[++e]=j,r):""):s?(d[e]||L(),","):h?"":(g=u,f=v,'"'))}var c,d={},e=0,f=i,g=i;return a=(a+" ").replace(m,h),a}function O(a,c,d,e){function n(b){if(""+b===b||b.nodeType>0)return i=b.nodeType>0?b:!f.test(b)&&k&&k(b)[0],i&&i.type&&(b=G[i.getAttribute(u)],b||(a=a||"_"+s++,i.setAttribute(u,a),b=O(a,i.innerHTML,d,e),G[a]=b)),b}var h,i,j,l,m;h=n(c),e=e||(c.markup?c:{}),e.name=a,l=e.templates,!h&&c.markup&&(h=n(c.markup))&&h.fn&&(h.debug!==c.debug||h.allowCode!==c.allowCode)&&(h=h.markup);if(h!==b){a&&!d&&(y[a]=function(){return c.render.apply(c,arguments)}),h.fn||c.fn?h.fn&&(a&&a!==h.name?c=g(g({},h),e):c=h):(c=P(h,e,d,0),M(h,c));for(j in l)m=l[j],m.name!==j&&(l[j]=O(j,m,c));return c}}function P(a,b,c,d){function e(a){c[a]&&(f[a]=g(g({},c[a]),b[a]))}b=b||{};var f={markup:a,tmpls:[],links:[],render:K};return c&&(c.templates&&(f.templates=g(g({},c.templates),b.templates)),f.parent=c,f.name=c.name+"["+d+"]",f.index=d),g(f,b),c&&(e("templates"),e("tags"),e("helpers"),e("converters")),f}function Q(a){return t[a]||(t[a]="&#"+a.charCodeAt(0)+";")}var c="v1.0pre",d,e,f,g,h={},i=!1,j=!0,k=a.jQuery,l=/^(?:null|true|false|\d[\d.]*|([\w$]+|~([\w$]+)|#(view|([\w$]+))?)([\w$.]*?)(?:[.[]([\w$]+)\]?)?|(['"]).*\8)$/g,m=/(\()(?=|\s*\()|(?:([([])\s*)?(?:([#~]?[\w$.]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*!:?\/]|(=))\s*|([#~]?[\w$.]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*([)\]])([([]?))|(\s+)/g,n=/\r?\n/g,o=/\\(['"])/g,p=/\\?(['"])/g,q=/\x08(~)?([^\x08]+)\x08/g,r=0,s=0,t={"&":"&amp;","<":"&lt;",">":"&gt;"},u="data-jsv-tmpl",v="var j=j||"+(k?"jQuery.":"js")+"views,",w=/[\x00"&'<>]/g,x=Array.prototype.slice,y={},z={jsviews:c,sub:h,debugMode:j,err:function(a){return z.debugMode?"<br/><b>Error:</b> <em> "+(a.message||a)+". </em>":'""'},tmplFn:M,render:y,templates:G,tags:H,helpers:I,converters:J,View:E,convert:C,delimiters:A,tag:D};k?(d=k,d.templates=G,d.render=y,d.views=z,d.fn.render=K):(d=a.jsviews=z,d.extend=function(a,b){var c;a=a||{};for(c in b)a[c]=b[c];return a},d.isArray=Array&&Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"}),g=d.extend,z.topView={views:{},tmpl:{},hlp:B,ctx:z.helpers},H({"if":function(){var a=this,c=a.view;return c.onElse=function(a,d){var e=0,f=d.length;while(f&&!d[e++])if(e===f)return"";return c.onElse=b,a.path="",a.renderContent(c)},c.onElse(this,arguments)},"else":function(){var a=this.view;return a.onElse?a.onElse(this,arguments):""},"for":function(){var a,b=this,c="",d=arguments,e=d.length;b.props.layout&&(b.tmpl.layout=j);for(a=0;a<e;a++)c+=b.renderContent(d[a]);return c},"=":function(a){return a},"*":function(a){return a}}),J({html:function(a){return a!=b?String(a).replace(w,Q):""}}),A("{{","}}")}(this),function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}(jQuery),$.widget||function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){return c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}}),d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;return e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e,f&&e.charAt(0)==="_"?h:(f?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b)return h=f,!1}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))}),h)}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0)return a.extend({},this.options);if(typeof c=="string"){if(d===b)return this.options[c];e={},e[c]=d}return this._setOptions(e),this},_setOptions:function(b){var c=this;return a.each(b,function(a,b){c._setOption(a,b)}),this},_setOption:function(a,b){return this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e in f)e in c||(c[e]=f[e]);return this.element.trigger(c,d),!(a.isFunction(g)&&g.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}}(jQuery),function(a,b,c){var d=Number.POSITIVE_INFINITY,e=Number.NEGATIVE_INFINITY;a.geo={_allCoordinates:function(b){var c=this._flatten(b),d=0,e=[];for(;d<c.length;d++){var f=c[d].coordinates,g=f&&a.isArray(f[0]),h=g&&a.isArray(f[0][0]),i=h&&a.isArray(f[0][0][0]),j,k,l;i||(h||(g||(f=[f]),f=[f]),f=[f]);for(j=0;j<f.length;j++)for(k=0;k<f[j].length;k++)for(l=0;l<f[j][k].length;l++)e.push(f[j][k][l])}return e},_isGeodetic:function(b){while(a.isArray(b)){if(b.length>1&&!a.isArray(b[0]))return b[0]>=-180&&b[0]<=180&&b[1]>=-85&&b[1]<=85;b=b[0]}return!1},center:function(b,c){var d=!1;!c&&a.geo.proj&&this._isGeodetic(b)&&(d=!0,b=a.geo.proj.fromGeodetic(b));var e=[(b[0]+b[2])/2,(b[1]+b[3])/2];return d?a.geo.proj.toGeodetic(e):e},expandBy:function(b,c,d,e){var f=!1;return!e&&a.geo.proj&&this._isGeodetic(b)&&(f=!0,b=a.geo.proj.fromGeodetic(b)),b=[b[0]-c,b[1]-d,b[2]+c,b[3]+d],f?a.geo.proj.toGeodetic(b):b},height:function(b,c){return!c&&a.geo.proj&&this._isGeodetic(b)&&(b=a.geo.proj.fromGeodetic(b)),b[3]-b[1]},_in:function(a,b){return a[0]<=b[0]&&a[1]<=b[1]&&a[2]>=b[2]&&a[3]>=b[3]},_bboxDisjoint:function(a,b){return b[0]>a[2]||b[2]<a[0]||b[1]>a[3]||b[3]<a[1]},include:function(b,c,f){if(!c||!a.isArray(c))return b;var g=!1;return!f&&a.geo.proj&&this._isGeodetic(b||c)&&(g=!0),b?g&&(b=a.geo.proj.fromGeodetic(b)):b=[d,d,e,e],c.length===2&&(c=[c[0],c[1],c[0],c[1]]),c=a.geo.proj.fromGeodetic(c),b[0]=Math.min(c[0],b[0]),b[1]=Math.min(c[1],b[1]),b[2]=Math.max(c[2],b[2]),b[3]=Math.max(c[3],b[3]),g?a.geo.proj.toGeodetic(b):b},polygonize:function(b,c){var d=!1;!c&&a.geo.proj&&this._isGeodetic(b)&&(d=!0,b=a.geo.proj.fromGeodetic(b));var e={type:"Polygon",coordinates:[[[b[0],b[1]],[b[0],b[3]],[b[2],b[3]],[b[2],b[1]],[b[0],b[1]]]]};return d&&(e.coordinates=a.geo.proj.toGeodetic(e.coordinates)),e},reaspect:function(b,c,d){var e=!1;!d&&a.geo.proj&&this._isGeodetic(b)&&(e=!0,b=a.geo.proj.fromGeodetic(b));var f=this.width(b,!0),g=this.height(b,!0),h=this.center(b,!0),i,j;return f!==0&&g!==0&&c>0&&(f/g>c?(i=f/2,j=i/c):(j=g/2,i=j*c),b=[h[0]-i,h[1]-j,h[0]+i,h[1]+j]),e?a.geo.proj.toGeodetic(b):b},recenter:function(b,c,d){var e=!1;!d&&a.geo.proj&&(this._isGeodetic(b)&&(e=!0,b=a.geo.proj.fromGeodetic(b)),this._isGeodetic(c)&&(c=a.geo.proj.fromGeodetic(c)));var f=(b[2]-b[0])/2,g=(b[3]-b[1])/2;return b=[c[0]-f,c[1]-g,c[0]+f,c[1]+g],e?a.geo.proj.toGeodetic(b):b},scaleBy:function(b,c,d){var e=!1;!d&&a.geo.proj&&this._isGeodetic(b)&&(e=!0,b=a.geo.proj.fromGeodetic(b));var f=this.center(b,!0),g=(b[2]-b[0])*c/2,h=(b[3]-b[1])*c/2;return b=[f[0]-g,f[1]-h,f[0]+g,f[1]+h],e?a.geo.proj.toGeodetic(b):b},width:function(b,c){return!c&&a.geo.proj&&this._isGeodetic(b)&&(b=a.geo.proj.fromGeodetic(b)),b[2]-b[0]},bbox:function(b,f){var g,h=!1;if(!b)return c;if(b.bbox)g=!f&&a.geo.proj&&this._isGeodetic(b.bbox)?a.geo.proj.fromGeodetic(b.bbox):b.bbox;else{g=[d,d,e,e];var i=this._allCoordinates(b),j=0;if(i.length===0)return c;!f&&a.geo.proj&&this._isGeodetic(i)&&(h=!0,i=a.geo.proj.fromGeodetic(i));for(;j<i.length;j++)g[0]=Math.min(i[j][0],g[0]),g[1]=Math.min(i[j][1],g[1]),g[2]=Math.max(i[j][0],g[2]),g[3]=Math.max(i[j][1],g[3])}return h?a.geo.proj.toGeodetic(g):g},centroid:function(b,f){switch(b.type){case"Point":return a.extend({},b);case"LineString":case"Polygon":var g=0,h=[0,0],i=a.merge([],b.type=="Polygon"?b.coordinates[0]:b.coordinates),j=1,k,l,m=[d,d,e,e],n=!1;!f&&a.geo.proj&&this._isGeodetic(i)&&(n=!0,i=a.geo.proj.fromGeodetic(i));for(;j<=i.length;j++)k=j%i.length,m[0]=Math.min(i[k][0],m[0]),m[1]=Math.min(i[k][1],m[1]),m[2]=Math.max(i[k][0],m[2]),m[3]=Math.max(i[k][1],m[3]),l=i[j-1][0]*i[k][1]-i[k][0]*i[j-1][1],g+=l,h[0]+=(i[j-1][0]+i[k][0])*l,h[1]+=(i[j-1][1]+i[k][1])*l;if(g===0)return i.length>0?(h[0]=Math.min(Math.max(i[0][0],m[0]),m[2]),h[1]=Math.min(Math.max(i[0][1],m[1]),m[3]),{type:"Point",coordinates:n?a.geo.proj.toGeodetic(h):h}):c;return g*=3,h[0]=Math.min(Math.max(h[0]/g,m[0]),m[2]),h[1]=Math.min(Math.max(h[1]/g,m[1]),m[3]),{type:"Point",coordinates:n?a.geo.proj.toGeodetic(h):h}}return c},contains:function(a,b){if(a.type!="Polygon")return!1;switch(b.type){case"Point":return this._containsPolygonPoint(a.coordinates,b.coordinates);case"LineString":return this._containsPolygonLineString(a.coordinates,b.coordinates);case"Polygon":return this._containsPolygonLineString(a.coordinates,b.coordinates[0]);default:return!1}},_containsPolygonPoint:function(a,b){if(a.length===0||a[0].length<4)return!1;var c=0,d=a[0][0],e=1,f,g;for(;e<a[0].length;e++){f=a[0][e];if(d[1]<=b[1]&&b[1]<f[1]||f[1]<=b[1]&&b[1]<d[1]&&(b[0]<d[0]||b[0]<f[0]))g=d[0]+(f[0]-d[0])*(b[1]-d[1])/(f[1]-d[1]),g>b[0]&&c++;d=f}return c%2==1},_containsPolygonLineString:function(a,b){for(var c=0;c<b.length;c++)if(!this._containsPolygonPoint(a,b[c]))return!1;return!0},distance:function(b,d,e){var f=!e&&a.geo.proj&&this._isGeodetic(b.coordinates)?a.geo.proj.fromGeodetic(b.coordinates):b.coordinates,g=!e&&a.geo.proj&&this._isGeodetic(d.coordinates)?a.geo.proj.fromGeodetic(d.coordinates):d.coordinates;switch(b.type){case"Point":switch(d.type){case"Point":return this._distancePointPoint(g,f);case"LineString":return this._distanceLineStringPoint(g,f);case"Polygon":return this._containsPolygonPoint(g,f)?0:this._distanceLineStringPoint(g[0],f);default:return c}break;case"LineString":switch(d.type){case"Point":return this._distanceLineStringPoint(f,g);case"LineString":return this._distanceLineStringLineString(f,g);case"Polygon":return this._containsPolygonLineString(g,f)?0:this._distanceLineStringLineString(g[0],f);default:return c}break;case"Polygon":switch(d.type){case"Point":return this._containsPolygonPoint(f,g)?0:this._distanceLineStringPoint(f[0],g);case"LineString":return this._containsPolygonLineString(f,g)?0:this._distanceLineStringLineString(f[0],g);case"Polygon":return this._containsPolygonLineString(f,g[0])?0:this._distanceLineStringLineString(f[0],g[0]);default:return c}}},_distancePointPoint:function(a,b){var c=b[0]-a[0],d=b[1]-a[1];return Math.sqrt(c*c+d*d)},_distanceLineStringPoint:function(a,b){var c=d;if(a.length>0){var e=a[0],f=b[0]-e[0],g=b[1]-e[1];if(a.length==1)return Math.sqrt(f*f+g*g);for(var h=1;h<a.length;h++){var i=a[h],j=i[0]-e[0],k=i[1]-e[1],l=b[0]-i[0],m=b[1]-i[1],n=this._distanceSegmentPoint(j,k,f,g,l,m);if(n===0)return 0;n<c&&(c=n),e=i,f=l,g=m}}return Math.sqrt(c)},_distanceSegmentPoint:function(a,b,c,d,e,f){var g=a*c+b*d;if(g<=0)return c*c+d*d;var h=a*a+b*b;return g>=h?e*e+f*f:c*c+d*d-g*g/h},_distanceLineStringLineString:function(a,b){var c=d;for(var e=0;e<b.length;e++)c=Math.min(c,this._distanceLineStringPoint(a,b[e]));return c},_buffer:function(b,d,e){var f=!1,g=b.coordinates;!e&&a.geo.proj&&this._isGeodetic(b.coordinates)&&(f=!0,g=a.geo.proj.fromGeodetic(b.coordinates));if(b.type==="Point"){var h=[],i=180,j=0,k;for(;j<=i;j++)k=j*360/i*(Math.PI/180),h.push([g[0]+Math.cos(k)*d,g[1]+Math.sin(k)*d]);return{type:"Polygon",coordinates:[f?a.geo.proj.toGeodetic(h):h]}}return c},_flatten:function(b){var c=[],d=0;switch(b.type){case"Feature":a.merge(c,this._flatten(b.geometry));break;case"FeatureCollection":for(;d<b.features.length;d++)a.merge(c,this._flatten(b.features[d].geometry));break;case"GeometryCollection":for(;d<b.geometries.length;d++)a.merge(c,this._flatten(b.geometries[d]));break;default:c[0]=b}return c},length:function(b,c){var d=0,e,f=1,g,h;switch(b.type){case"Point":return 0;case"LineString":e=b.coordinates;break;case"Polygon":e=b.coordinates[0]}if(e){!c&&a.geo.proj&&this._isGeodetic(e)&&(e=a.geo.proj.fromGeodetic(e));for(;f<e.length;f++)g=e[f][0]-e[f-1][0],h=e[f][1]-e[f-1][1],d+=Math.sqrt(g*g+h*h);return d}},area:function(b,c){var d=0,e,f=1,g;switch(b.type){case"Point":case"LineString":return 0;case"Polygon":e=b.coordinates[0]}if(e){!c&&a.geo.proj&&this._isGeodetic(e)&&(e=a.geo.proj.fromGeodetic(e));for(;f<=e.length;f++)g=f%e.length,d+=(e[f-1][0]-e[g][0])*(e[f-1][1]+e[g][1])/2;return Math.abs(d)}},pointAlong:function(b,c,d){var e=0,f=0,g=0,h,i,j,k=[],l=1,m,n,o,p,q,r=!1;switch(b.type){case"Point":return a.extend({},b);case"LineString":j=b.coordinates;break;case"Polygon":j=b.coordinates[0]}if(j){if(c===0)return{type:"Point",coordinates:[j[0][0],j[0][1]]};if(c===1)return l=j.length-1,{type:"Point",coordinates:[j[l][0],j[l][1]]};!d&&a.geo.proj&&this._isGeodetic(j)&&(r=!0,j=a.geo.proj.fromGeodetic(j));for(;l<j.length;l++)m=j[l][0]-j[l-1][0],n=j[l][1]-j[l-1][1],i=Math.sqrt(m*m+n*n),k.push(i),e+=i;for(l=0;l<k.length&&g<c;l++)f=g,g+=k[l]/e;return h=c-f,p=j[l-1],q=j[l],o=[p[0]+h*(q[0]-p[0]),p[1]+h*(q[1]-p[1])],{type:"Point",coordinates:r?a.geo.proj.toGeodetic(o):o}}},_WKT:function(){function b(a){return"POINT "+c(a.coordinates)}function c(a){return!a||!a.length?"EMPTY":"("+a.join(" ")+")"}function d(a){return"LINESTRING "+e(a.coordinates)}function e(a){if(!a||!a.length)return"EMPTY";var b=[];for(var c=0;c<a.length;c++)b.push(a[c].join(" "));return"("+b+")"}function f(a){return"POLYGON "+g(a.coordinates)}function g(a){if(!a||!a.length)return"EMTPY";var b=[];for(var c=0;c<a.length;c++)b.push(e(a[c]));return"("+b+")"}function h(a){return"MULTIPOINT "+e(a.coordinates)}function i(a){return"MULTILINSTRING "+g(a.coordinates)}function j(a){return"MULTIPOLYGON "+k(a.coordinates)}function k(a){if(!a||!a.length)return"EMPTY";var b=[];for(var c=0;c<a.length;c++)b.push(g(a[c]));return"("+b+")"}function l(a){return"GEOMETRYCOLLECTION "+m(a.geometries)}function m(a){if(!a||!a.length)return"EMPTY";var b=[];for(var c=0;c<a.length;c++)b.push(n(a[c]));return"("+a+")"}function n(a){if(!a||!a.type)return"";switch(a.type){case"Point":return b(a);case"LineString":return d(a);case"Polygon":return f(a);case"MultiPoint":return h(a);case"MultiLineString":return i(a);case"MultiPolygon":return j(a);case"GeometryCollection":return l(a);default:return""}}function o(a){var b=a.match(/\(\s*([\d\.\-]+)\s+([\d\.\-]+)\s*\)/);return b&&b.length>2?{type:"Point",coordinates:[parseFloat(b[1]),parseFloat(b[2])]}:null}function p(a){var b=a.match(/\s*\((.*)\)/),c=[],d,e,f=0;if(b&&b.length>1){d=b[1].match(/[\d\.\-]+\s+[\d\.\-]+/g);for(;f<d.length;f++)e=d[f].match(/\s*([\d\.\-]+)\s+([\d\.\-]+)\s*/),c[f]=[parseFloat(e[1]),parseFloat(e[2])];return{type:"LineString",coordinates:c}}return null}function q(a){var b=a.match(/\s*\(\s*\((.*)\)\s*\)/),c=[],d,e,f=0;if(b&&b.length>1){d=b[1].match(/[\d\.\-]+\s+[\d\.\-]+/g);for(;f<d.length;f++)e=d[f].match(/\s*([\d\.\-]+)\s+([\d\.\-]+)\s*/),c[f]=[parseFloat(e[1]),parseFloat(e[2])];return{type:"Polygon",coordinates:[c]}}return null}function r(b){var c;return b.indexOf("((")===-1?c=p(b):(c=s(b),c.coordinates=a.geo._allCoordinates(c)),c.type="MultiPoint",c}function s(a){var b=a.substr(1,a.length-2),c=b.split(")),(("),d=0,e={type:"MultiLineString",coordinates:[]};for(;d<c.length;d++)e.coordinates.push(p(c[d]).coordinates);return e}function t(a){var b=a.substr(1,a.length-2),c=b.split(")),(("),d=0,e={type:"MultiPolygon",coordinates:[]};for(;d<c.length;d++)e.coordinates.push(q(c[d]).coordinates);return e}function u(a){var b=a.substr(1,a.length-2),c=b.match(/\),[a-zA-Z]/g),d={type:"GeometryCollection",geometries:[]},e,f=0,g=0,h;if(c&&c.length>0){for(;f<c.length;f++)h=b.indexOf(c[f],g)-g+1,e=v(b.substr(g,h)),e&&d.geometries.push(e),g+=h+1;return e=v(b.substr(g)),e&&d.geometries.push(e),d}return null}function v(b){b=a.trim(b);var c=b.indexOf("("),d=b.substr(c);switch(a.trim(b.substr(0,c)).toUpperCase()){case"POINT":return o(d);case"LINESTRING":return p(d);case"POLYGON":return q(d);case"MULTIPOINT":return r(d);case"MULTILINESTRING":return s(d);case"MULTIPOLYGON":return t(d);case"GEOMETRYCOLLECTION":return u(d);default:return null}}return{stringify:n,parse:v}}(),proj:function(){var b=1.5707963267948966,c=.7853981633974483,d=.017453292519943295,e=57.29577951308232,f=6378137;return{fromGeodeticPos:function(a){return[f*a[0]*d,f*Math.log(Math.tan(c+a[1]*d/2))]},fromGeodetic:function(b){if(!a.geo._isGeodetic(b))return b;var c=a.isArray(b[0]),d=this.fromGeodeticPos;if(!c&&b.length==4){var e=d([b[0],b[1]]),f=d([b[2],b[3]]);return[e[0],e[1],f[0],f[1]]}var g=c&&a.isArray(b[0][0]),h=g&&a.isArray(b[0][0][0]),i=[],j,k,l;h||(g||(c||(b=[b]),b=[b]),b=[b]);for(j=0;j<b.length;j++){i[j]=[];for(k=0;k<b[j].length;k++){i[j][k]=[];for(l=0;l<b[j][k].length;l++)i[j][k][l]=d(b[j][k][l])}}return h?i:g?i[0]:c?i[0][0]:i[0][0][0]},toGeodeticPos:function(a){return[a[0]/f*e,(b-2*Math.atan(1/Math.exp(a[1]/f)))*e]},toGeodetic:function(b){if(a.geo._isGeodetic(b))return b;var c=a.isArray(b[0]),d=this.toGeodeticPos;if(!c&&b.length==4){var e=d([b[0],b[1]]),f=d([b[2],b[3]]);return[e[0],e[1],f[0],f[1]]}var g=c&&a.isArray(b[0][0]),h=g&&a.isArray(b[0][0][0]),i=[],j,k,l;h||(g||(c||(b=[b]),b=[b]),b=[b]);for(j=0;j<b.length;j++){i[j]=[];for(k=0;k<b[j].length;k++){i[j][k]=[];for(l=0;l<b[j][k].length;l++)i[j][k][l]=d(b[j][k][l])}}return h?i:g?i[0]:c?i[0][0]:i[0][0][0]}}}(),_serviceTypes:{}}}(jQuery,this),function(a,b){var c=function(){var a=5,b=document.createElement("div"),c=b.all||[];do b.innerHTML="<!--[if gt IE "+ ++a+"]><br><![endif]-->";while(c[0]);return a>6?a:!a}();a.widget("geo.geographics",{_$elem:b,_options:{},_trueCanvas:!0,_width:0,_height:0,_$canvas:b,_context:b,_blitcanvas:b,_blitcontext:b,_$labelsContainer:b,options:{style:{borderRadius:"8px",color:"#7f0000",fillOpacity:.2,height:"8px",opacity:1,strokeOpacity:1,strokeWidth:"2px",visibility:"visible",width:"8px"}},_create:function(){this._$elem=this.element,this._options=this.options,this._$elem.css({display:"inline-block",overflow:"hidden",textAlign:"left"}),this._$elem.css("position")=="static"&&this._$elem.css("position","relative"),this._$elem.addClass("geo-graphics"),this._width=this._$elem.width(),this._height=this._$elem.height();if(!this._width||!this._height)this._width=parseInt(this._$elem.css("width"),10),this._height=parseInt(this._$elem.css("height"),10);var a="position:absolute;left:0;top:0;margin:0;padding:0;",b="width:"+this._width+"px;height:"+this._height+"px;",d='width="'+this._width+'" height="'+this._height+'"';document.createElement("canvas").getContext?(this._$elem.append("<canvas "+d+' style="-webkit-transform:translateZ(0);'+a+'"></canvas>'),this._$canvas=this._$elem.children(":last"),this._context=this._$canvas[0].getContext("2d"),this._blitcanvas=document.createElement("canvas"),this._blitcanvas.width=this._width,this._blitcanvas.height=this._height,this._blitcontext=this._blitcanvas.getContext("2d")):c<=8&&(this._trueCanvas=!1,this._$elem.append("<div "+d+' style="'+a+b+'"></div>'),this._$canvas=this._$elem.children(":last"),G_vmlCanvasManager.initElement(this._$canvas[0]),this._context=this._$canvas[0].getContext("2d"),this._$canvas.children().css({backgroundColor:"transparent",width:this._width,height:this._height})),this._$elem.append('<div class="geo-labels-container" style="-webkit-transform:translateZ(0);'+a+b+'"></div>'),this._$labelsContainer=this._$elem.children(":last")},_setOption:function(b,c){b=="style"&&(c=a.extend({},this._options.style,c)),a.Widget.prototype._setOption.apply(this,arguments)},destroy:function(){a.Widget.prototype.destroy.apply(this,arguments),this._$elem.html(""),this._$elem.removeClass("geo-graphics")},clear:function(){this._context.clearRect(0,0,this._width,this._height),this._$labelsContainer.html("")},drawArc:function(a,b,c,d){d=this._getGraphicStyle(d);if(d.visibility!="hidden"&&d.opacity>0&&d.widthValue>0&&d.heightValue>0){var e=Math.min(d.widthValue,d.heightValue)/2;b=b*Math.PI/180,c=c*Math.PI/180,this._context.save(),this._context.translate(a[0],a[1]),d.widthValue>d.heightValue?this._context.scale(d.widthValue/d.heightValue,1):this._context.scale(1,d.heightValue/d.widthValue),this._context.beginPath(),this._context.arc(0,0,e,b,c,!1),this._trueCanvas&&this._context.restore(),d.doFill&&(this._context.fillStyle=d.fill,this._context.globalAlpha=d.opacity*d.fillOpacity,this._context.fill()),d.doStroke&&(this._context.lineJoin="round",this._context.lineWidth=d.strokeWidthValue,this._context.strokeStyle=d.stroke,this._context.globalAlpha=d.opacity*d.strokeOpacity,this._context.stroke()),this._trueCanvas||this._context.restore()}},drawPoint:function(a,b){b=this._getGraphicStyle(b),b.widthValue==b.heightValue&&b.heightValue==b.borderRadiusValue?this.drawArc(a,0,360,b):b.visibility!="hidden"&&b.opacity>0&&(b.borderRadiusValue=Math.min(Math.min(b.widthValue,b.heightValue)/2,b.borderRadiusValue),a[0]-=b.widthValue/2,a[1]-=b.heightValue/2,this._context.beginPath(),this._context.moveTo(a[0]+b.borderRadiusValue,a[1]),this._context.lineTo(a[0]+b.widthValue-b.borderRadiusValue,a[1]),this._context.quadraticCurveTo(a[0]+b.widthValue,a[1],a[0]+b.widthValue,a[1]+b.borderRadiusValue),this._context.lineTo(a[0]+b.widthValue,a[1]+b.heightValue-b.borderRadiusValue),this._context.quadraticCurveTo(a[0]+b.widthValue,a[1]+b.heightValue,a[0]+b.widthValue-b.borderRadiusValue,a[1]+b.heightValue),this._context.lineTo(a[0]+b.borderRadiusValue,a[1]+b.heightValue),this._context.quadraticCurveTo(a[0],a[1]+b.heightValue,a[0],a[1]+b.heightValue-b.borderRadiusValue),this._context.lineTo(a[0],a[1]+b.borderRadiusValue),this._context.quadraticCurveTo(a[0],a[1],a[0]+b.borderRadiusValue,a[1]),this._context.closePath(),b.doFill&&(this._context.fillStyle=b.fill,this._context.globalAlpha=b.opacity*b.fillOpacity,this._context.fill()),b.doStroke&&(this._context.lineJoin="round",this._context.lineWidth=b.strokeWidthValue,this._context.strokeStyle=b.stroke,this._context.globalAlpha=b.opacity*b.strokeOpacity,this._context.stroke()))},drawLineString:function(a,b){this._drawLines([a],!1,b)},drawPolygon:function(a,b){if(!this._trueCanvas||a.length==1)this._drawLines(a,!0,b);else{if(!a||!a.length||a[0].length<3)return;b=this._getGraphicStyle(b);var c,d,e;if(b.visibility!="hidden"&&b.opacity>0){this._blitcontext.clearRect(0,0,this._width,this._height);if(b.doFill&&a.length>1){this._blitcontext.globalCompositeOperation="source-out",this._blitcontext.globalAlpha=1;for(d=1;d<a.length;d++){this._blitcontext.beginPath(),this._blitcontext.moveTo(a[d][0][0],a[d][0][1]);for(e=1;e<a[d].length;e++)this._blitcontext.lineTo(a[d][e][0],a[d][e][1]);this._blitcontext.closePath(),this._blitcontext.fill()}}this._blitcontext.beginPath(),this._blitcontext.moveTo(a[0][0][0],a[0][0][1]),c=[a[0][0][0]-b.strokeWidthValue,a[0][0][1]-b.strokeWidthValue,a[0][0][0]+b.strokeWidthValue,a[0][0][1]+b.strokeWidthValue];for(d=1;d<a[0].length-1;d++)this._blitcontext.lineTo(a[0][d][0],a[0][d][1]),c[0]=Math.min(a[0][d][0]-b.strokeWidthValue,c[0]),c[1]=Math.min(a[0][d][1]-b.strokeWidthValue,c[1]),c[2]=Math.max(a[0][d][0]+b.strokeWidthValue,c[2]),c[3]=Math.max(a[0][d][1]+b.strokeWidthValue,c[3]);this._blitcontext.closePath(),this._blitcontext.globalCompositeOperation="source-out",b.doFill&&(this._blitcontext.fillStyle=b.fill,this._blitcontext.globalAlpha=b.opacity*b.fillOpacity,this._blitcontext.fill()),this._blitcontext.globalCompositeOperation="source-over";if(b.doStroke){this._blitcontext.lineCap=this._blitcontext.lineJoin="round",this._blitcontext.lineWidth=b.strokeWidthValue,this._blitcontext.strokeStyle=b.stroke,this._blitcontext.globalAlpha=b.opacity*b.strokeOpacity,this._blitcontext.stroke();if(a.length>1)for(d=1;d<a.length;d++){this._blitcontext.beginPath(),this._blitcontext.moveTo(a[d][0][0],a[d][0][1]);for(e=1;e<a[d].length;e++)this._blitcontext.lineTo(a[d][e][0],a[d][e][1]);this._blitcontext.closePath(),this._blitcontext.stroke()}}c[0]=Math.max(c[0],0),c[1]=Math.max(c[1],0),c[2]=Math.min(c[2],this._width),c[3]=Math.min(c[3],this._height),this._context.drawImage(this._blitcanvas,c[0],c[1],c[2]-c[0],c[3]-c[1],c[0],c[1],c[2]-c[0],c[3]-c[1])}}},drawBbox:function(a,b){this._drawLines([[[a[0],a[1]],[a[0],a[3]],[a[2],a[3]],[a[2],a[1]],[a[0],a[1]]]],!0,b)},drawLabel:function(a,b){this._$labelsContainer.append('<div class="geo-label" style="-webkit-transform:translateZ(0);position:absolute; left:'+a[0]+"px; top:"+a[1]+'px;">'+b+"</div>")},resize:function(){this._width=this._$elem.width(),this._height=this._$elem.height();if(!this._width||!this._height)this._width=parseInt(this._$elem.css("width"),10),this._height=parseInt(this._$elem.css("height"),10);this._trueCanvas&&(this._$canvas[0].width=this._width,this._$canvas[0].height=this._height),this._$labelsContainer.css({width:this._width,height:this._height})},_getGraphicStyle:function(b){function c(a){return a=parseInt(a,10),+a+""===a?+a:a}return b=a.extend({},this._options.style,b),b.borderRadiusValue=c(b.borderRadius),b.fill=b.fill||b.color,b.doFill=b.fill&&b.fillOpacity>0,b.stroke=b.stroke||b.color,b.strokeWidthValue=c(b.strokeWidth),b.doStroke=b.stroke&&b.strokeOpacity>0&&b.strokeWidthValue>0,b.widthValue=c(b.width),b.heightValue=c(b.height),b},_drawLines:function(a,b,c){if(!a||!a.length||a[0].length<2)return;var d,e;c=this._getGraphicStyle(c);if(c.visibility!="hidden"&&c.opacity>0){this._context.beginPath();for(d=0;d<a.length;d++){this._context.moveTo(a[d][0][0],a[d][0][1]);for(e=1;e<a[d].length;e++)this._context.lineTo(a[d][e][0],a[d][e][1])}b&&this._context.closePath(),b&&c.doFill&&(this._context.fillStyle=c.fill,this._context.globalAlpha=c.opacity*c.fillOpacity,this._context.fill()),c.doStroke&&(this._context.lineCap=this._context.lineJoin="round",this._context.lineWidth=c.strokeWidthValue,this._context.strokeStyle=c.stroke,this._context.globalAlpha=c.opacity*c.strokeOpacity,this._context.stroke())}}})}(jQuery),function(a,b){var c=0,d=function(){var a=5,b=document.createElement("div"),c=b.all||[];do b.innerHTML="<!--[if gt IE "+ ++a+"]><br><![endif]-->";while(c[0]);return a>6?a:!a}(),e={bbox:[-180,-85,180,85],bboxMax:[-180,-85,180,85],center:[0,0],cursors:{"static":"default",pan:"url(data:image/vnd.microsoft.icon;base64,AAACAAEAICACAAgACAAwAQAAFgAAACgAAAAgAAAAQAAAAAEAAQAAAAAAAAEAAAAAAAAAAAAAAgAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8AAAA/AAAAfwAAAP+AAAH/gAAB/8AAA//AAAd/wAAGf+AAAH9gAADbYAAA2yAAAZsAAAGbAAAAGAAAAAAAAA//////////////////////////////////////////////////////////////////////////////////////gH///4B///8Af//+AD///AA///wAH//4AB//8AAf//AAD//5AA///gAP//4AD//8AF///AB///5A////5///8=), move",zoom:"crosshair",dragBox:"crosshair",dragCircle:"crosshair",drawPoint:"crosshair",drawLineString:"crosshair",drawPolygon:"crosshair",measureLength:"crosshair",measureArea:"crosshair"},measureLabels:{length:"{{:length.toFixed( 2 )}} m",area:"{{:area.toFixed( 2 )}} sq m"},drawStyle:{},shapeStyle:{},mode:"pan",pannable:!0,scroll:"default",shift:"default",services:[{"class":"osm",type:"tiled",src:function(a){return"http://otile"+(a.index%4+1)+".mqcdn.com/tiles/1.0.0/osm/"+a.zoom+"/"+a.tile.column+"/"+a.tile.row+".png"},attr:"Tiles Courtesy of <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png'>"}],tilingScheme:{tileWidth:256,tileHeight:256,levels:18,basePixelSize:156543.03392799935,origin:[-20037508.342787,20037508.342787]},axisLayout:"map",zoom:0,zoomMin:0,zoomMax:Number.POSITIVE_INFINITY,pixelSize:0};a.widget("geo.geomap",{_$elem:b,_map:b,_created:!1,_createdGraphics:!1,_widgetId:0,_tmplLengthId:"",_tmplAreaId:"",_contentBounds:{},_$resizeContainer:b,_$eventTarget:b,_$contentFrame:b,_$existingChildren:b,_$attrList:b,_$servicesContainer:b,_$shapesContainers:b,_$panContainer:b,_$shapesContainer:b,_$drawContainer:b,_$measureContainer:b,_$measureLabel:b,_dpi:96,_currentServices:[],_center:b,_pixelSize:b,_centerMax:b,_pixelSizeMax:b,_userGeodetic:!0,_centerInteractive:b,_pixelSizeInteractive:b,_timeoutInteractive:null,_triggerInteractive:!1,_loadCount:0,_wheelTimeout:null,_wheelLevel:0,_zoomFactor:2,_fullZoomFactor:2,_partialZoomFactor:1.18920711500273,_mouseDown:b,_inOp:b,_toolPan:b,_shiftDown:b,_anchor:b,_current:b,_downDate:b,_moveDate:b,_clickDate:b,_lastMove:b,_lastDrag:b,_windowHandler:null,_resizeTimeout:null,_panning:b,_velocity:b,_friction:b,_supportTouch:b,_softDblClick:b,_isTap:b,_isDbltap:b,_isMultiTouch:b,_multiTouchAnchor:[],_multiTouchAnchorBbox:b,_multiTouchCurrentBbox:b,_drawTimeout:null,_drawPixels:[],_drawCoords:[],_graphicShapes:[],_initOptions:{},_options:{},options:a.extend({},e),_createWidget:function(b,d){this._$elem=a(d);if(this._$elem.is(".geo-service")){this._graphicShapes=[],a.Widget.prototype._createWidget.apply(this,arguments);return}this._widgetId=c++,this._tmplLengthId="geoMeasureLength"+this._widgetId,this._tmplAreaId="geoMeasureArea"+this._widgetId,this._$elem.addClass("geo-map").css({webkitTransform:"translateZ(0)"}),this._initOptions=b||{},this._forcePosition(this._$elem),this._$elem.css("text-align","left");var e=this._findMapSize();this._contentBounds={x:parseInt(this._$elem.css("padding-left"),10),y:parseInt(this._$elem.css("padding-top"),10),width:e.width,height:e.height},this._createChildren(),this._center=[0,0],this._centerMax=[0,0],this._centerInteractive=[0,0],this.options.pixelSize=this._pixelSize=this._pixelSizeMax=156543.03392799935,this._mouseDown=this._inOp=this._toolPan=this._shiftDown=this._panning=this._isTap=this._isDbltap=!1,this._anchor=[0,0],this._current=[0,0],this._lastMove=[0,0],this._lastDrag=[0,0],this._velocity=[0,0],this._friction=[.8,.8],this._downDate=this._moveDate=this._clickDate=0,this._drawPixels=[],this._drawCoords=[],this._graphicShapes=[],a.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this._options=this.options;if(this._$elem.is(".geo-service")){this._map=this._$elem.data("geoMap"),this._$elem.data("geoService",this);return}this._map=this,this._supportTouch="ontouchend"in document,this._softDblClick=this._supportTouch||d==7;var c=this,e=this._supportTouch?"touchstart":"mousedown",f=this._supportTouch?"touchend touchcancel":"mouseup",g=this._supportTouch?"touchmove":"mousemove";a(document).keydown(a.proxy(this._document_keydown,this)),this._$eventTarget.dblclick(a.proxy(this._eventTarget_dblclick,this)),this._$eventTarget.bind(e,a.proxy(this._eventTarget_touchstart,this));var h=this._$eventTarget[0].setCapture?this._$eventTarget:a(document);h.bind(g,a.proxy(this._dragTarget_touchmove,this)),h.bind(f,a.proxy(this._dragTarget_touchstop,this)),this._$eventTarget.mousewheel(a.proxy(this._eventTarget_mousewheel,this)),this._windowHandler=function(){c._resizeTimeout&&clearTimeout(c._resizeTimeout),c._resizeTimeout=setTimeout(function(){c._created&&c._$elem.geomap("resize",!0)},500)},a(window).resize(this._windowHandler),this._$drawContainer.geographics({style:this._initOptions.drawStyle||{}}),this._options.drawStyle=this._$drawContainer.geographics("option","style"),this._$shapesContainer.geographics({style:this._initOptions.shapeStyle||{}}),this._createdGraphics=!0,this._options.shapeStyle=this._$shapesContainer.geographics("option","style"),this._initOptions&&(this._initOptions.tilingScheme!==b&&this._setOption("tilingScheme",this._initOptions.tilingScheme||null,!1),this._initOptions.services&&(this._options.services=a.merge([],this._initOptions.services)),this._initOptions.bboxMax&&(this._setOption("bboxMax",this._initOptions.bboxMax,!1),this._setOption("bbox",this._initOptions.bboxMax,!1)),this._initOptions.zoomMin!==b&&this._setOption("zoomMin",this._initOptions.zoomMin,!1),this._initOptions.zoomMax!==b&&this._setOption("zoomMax",this._initOptions.zoomMax,!1),this._initOptions.bbox&&this._setOption("bbox",this._initOptions.bbox,!1),this._initOptions.center&&this._setOption("center",this._initOptions.center,!1),this._initOptions.zoom!==b&&this._setOption("zoom",this._initOptions.zoom,!1)),a.templates(this._tmplLengthId,this._options.measureLabels.length),a.templates(this._tmplAreaId,this._options.measureLabels.area),this._$eventTarget.css("cursor",this._options.cursors[this._options.mode]),this._createServices(),this._refresh(),this._created=!0},_setOption:function(c,d,e){if(c=="pixelSize")return;e=e===b||e,this._$elem.is(".geo-map")&&this._panFinalize();var f,g,h,i;switch(c){case"bbox":this._created&&this._clearInteractiveTimeout(),this._userGeodetic=a.geo.proj&&a.geo._isGeodetic(d),this._userGeodetic&&(d=a.geo.proj.fromGeodetic(d)),f=[d[0]+(d[2]-d[0])/2,d[1]+(d[3]-d[1])/2],g=Math.max(a.geo.width(d,!0)/this._contentBounds.width,a.geo.height(d,!0)/this._contentBounds.height),i=this._getZoom(f,g),this._options.tilingScheme?g=this._getPixelSize(Math.min(Math.max(i,this._options.zoomMin),this._options.zoomMax)):i<this._options.zoomMin?g=this._getPixelSize(this._options.zoomMin):i>this._options.zoomMax&&(g=this._getPixelSize(this._options.zoomMax)),this._created?(this._setInteractiveCenterAndSize(f,g),this._setInteractiveTimeout(!1)):this._setCenterAndSize(f,g,!1,e),d=this._getBbox(f,g);break;case"bboxMax":this._userGeodetic=a.geo.proj&&a.geo._isGeodetic(d);break;case"center":this._created&&this._clearInteractiveTimeout(),this._userGeodetic=a.geo.proj&&a.geo._isGeodetic(d),this._userGeodetic&&(d=a.geo.proj.fromGeodetic(d)),this._created?(this._setInteractiveCenterAndSize(d,this._pixelSize),this._setInteractiveTimeout(!1)):this._setCenterAndSize(d,this._pixelSize,!1,e);break;case"measureLabels":d=a.extend(this._options.measureLabels,d),a.templates(this._tmplLengthId,this._options.measureLabels.length),a.templates(this._tmplAreaId,this._options.measureLabels.area);break;case"drawStyle":this._$drawContainer&&(this._$drawContainer.geographics("option","style",d),d=this._$drawContainer.geographics("option","style"));break;case"shapeStyle":this._$elem.is(".geo-service")&&!this._createdGraphics&&this._createServiceGraphics(),this._createdGraphics&&(this._$shapesContainer.geographics("option","style",d),d=this._$shapesContainer.geographics("option","style"));break;case"mode":this._resetDrawing(),this._$eventTarget.css("cursor",this._options.cursors[d]);break;case"zoom":this._created?this._setZoom(d,!1,e):(d=Math.max(d,0),this._setCenterAndSize(this._center,this._getPixelSize(d),!1,e))}a.Widget.prototype._setOption.apply(this,arguments);switch(c){case"bbox":case"center":this._userGeodetic&&(this._options.bbox=a.geo.proj.toGeodetic(this._options.bbox),this._options.center=a.geo.proj.toGeodetic(this._center));break;case"tilingScheme":d!==null&&(this._pixelSizeMax=this._getPixelSize(0),this._centerMax=[d.origin[0]+this._pixelSizeMax*d.tileWidth/2,d.origin[1]+this._pixelSizeMax*d.tileHeight/2]);break;case"bboxMax":a.geo.proj&&a.geo._isGeodetic(d)?h=a.geo.proj.fromGeodetic(d):h=d,this._centerMax=a.geo.center(h),this._pixelSizeMax=Math.max(a.geo.width(h,!0)/this._contentBounds.width,a.geo.height(h,!0)/this._contentBounds.height);break;case"services":this._createServices(),e&&this._refresh();break;case"shapeStyle":e&&this._createdGraphics&&(this._$shapesContainer.geographics("clear"),this._refreshShapes(this._$shapesContainer,this._graphicShapes,this._graphicShapes,this._graphicShapes))}},destroy:function(){if(this._$elem.is(".geo-service"))this._createdGraphics&&(this._$shapesContainer.geographics("destroy"),this._$shapesContainer=b,this._createdGraphics=!1);else{clearTimeout(this._timeoutInteractive),this._timeoutInteractive=null,this._created=!1,a(window).unbind("resize",this._windowHandler);for(var c=0;c<this._currentServices.length;c++)this._currentServices[c].serviceContainer.geomap("destroy"),a.geo._serviceTypes[this._currentServices[c].type].destroy(this,this._$servicesContainer,this._currentServices[c]);this._$shapesContainer.geographics("destroy"),this._$shapesContainer=b,this._createdGraphics=!1,this._$drawContainer.geographics("destroy"),this._$drawContainer=b,this._$existingChildren.detach(),this._$elem.html(""),this._$elem.append(this._$existingChildren),this._$elem.removeClass("geo-map")}a.Widget.prototype.destroy.apply(this,arguments)},toMap:function(b){return b=this._toMap(b),this._userGeodetic?a.geo.proj.toGeodetic(b):b},toPixel:function(b,c,d){return this._toPixel(a.geo.proj?a.geo.proj.fromGeodetic(b):b,c,d)},opacity:function(b,c){if(this._$elem.is(".geo-service"))this._$elem.closest(".geo-map").geomap("opacity",b,this._$elem);else if(b>=0||b<=1)for(var d=0;d<this._currentServices.length;d++){var e=this._currentServices[d];if(!c||e.serviceContainer[0]==c[0])e.style.opacity=b,e.serviceObject.style=a.extend({},e.serviceObject.style,e.style),a.geo._serviceTypes[e.type].opacity(this,e)}},toggle:function(c,d){if(this._$elem.is(".geo-service"))this._$elem.closest(".geo-map").geomap("toggle",c,this._$elem);else for(var e=0;e<this._currentServices.length;e++){var f=this._currentServices[e];if(!d||f.serviceContainer[0]==d[0])c===b&&(c=f.style.visibility!=="visible"),f.style.visibility=c?"visible":"hidden",f.serviceObject.style=a.extend({},f.serviceObject.style,f.style),f.serviceContainer.toggle(c),c&&a.geo._serviceTypes[f.type].refresh(this,f)}},zoom:function(a){a!==null&&this._setZoom(this._options.zoom+a,!1,!0)},refresh:function(a,b){this._$elem.is(".geo-service")?this._$elem.closest(".geo-map").geomap("refresh",a,this._$elem):this._refresh(a,b)},resize:function(b){var c=this._findMapSize(),d=c.width/2-this._contentBounds.width/2,e=c.height/2-this._contentBounds.height/2,f;this._contentBounds={x:parseInt(this._$elem.css("padding-left"),10),y:parseInt(this._$elem.css("padding-top"),10),width:c.width,height:c.height},this._$resizeContainer.css({width:c.width,height:c.height});for(f=0;f<this._currentServices.length;f++)a.geo._serviceTypes[this._currentServices[f].type].resize(this,this._currentServices[f]);this._$elem.find(".geo-graphics").css({width:c.width,height:c.height}).geographics("resize");for(f=0;f<this._drawPixels.length;f++)this._drawPixels[f][0]+=d,this._drawPixels[f][1]+=e;this._setCenterAndSize(this._center,this._pixelSize,b,!0)},append:function(c,d,e,f){if(c&&(a.isPlainObject(c)||a.isArray(c)&&c.length>0)){this._createdGraphics||this._createServiceGraphics();var g,h,i,j,k,l;a.isArray(c)?g=c:c.type=="FeatureCollection"?g=c.features:g=[c];for(i=1;i<arguments.length;i++)h=arguments[i],typeof h=="object"?j=h:typeof h=="number"||typeof h=="string"?k=h:typeof h=="boolean"&&(l=h);for(i=0;i<g.length;i++){if(g[i].type!="Point"){var m=a.geo.bbox(g[i]);a.geo.proj&&a.geo._isGeodetic(m)&&(m=a.geo.proj.fromGeodetic(m)),a.data(g[i],"geoBbox",m)}this._graphicShapes.push({shape:g[i],style:j,label:k})}if(l===b||l)this._$elem.is(".geo-service")?this._refresh(!1,this._$elem):this._refresh()}},empty:function(c){for(var d=0;d<this._graphicShapes.length;d++)a.removeData(this._graphicShapes[d].shape,"geoBbox");this._graphicShapes=[];if(c===b||c)this._$elem.is(".geo-service")?this._refresh(!1,this._$elem):this._refresh()},find:function(c,d){var e=a.isPlainObject(c),f=e?this._map.toPixel(c.coordinates):b,g=this._map._pixelSize*d,h=[],i,j,k,l=0;for(;l<this._graphicShapes.length;l++){i=this._graphicShapes[l];if(e)if(i.shape.type=="Point")a.geo.distance(i.shape,c)<=g&&h.push(i.shape);else{var m=a.data(i.shape,"geoBbox"),n={type:"Polygon",coordinates:[[[m[0],m[1]],[m[0],m[3]],[m[2],m[3]],[m[2],m[1]],[m[0],m[1]]]]},o={type:"Point",coordinates:a.geo.proj&&a.geo._isGeodetic(c.coordinates)?a.geo.proj.fromGeodetic(c.coordinates):c.coordinates};if(a.geo.distance(n,o,!0)<=g){j=a.geo._flatten(i.shape);for(k=0;k<j.length;k++)if(a.geo.distance(j[k],c)<=g){h.push(i.shape);break}}}else h.push(i.shape)}return this._$elem.is(".geo-map")&&this._$elem.find(".geo-service").each(function(){h=a.merge(h,a(this).geomap("find",c,d))}),h},remove:function(c,d){if(c&&(a.isPlainObject(c)||a.isArray(c)&&c.length>0)){var e=a.isArray(c)?c:[c],f;for(var g=0;g<this._graphicShapes.length;g++)a.inArray(this._graphicShapes[g].shape,e)>=0&&(a.removeData(c,"geoBbox"),f=this._graphicShapes.slice(g+1),this._graphicShapes.length=g,this._graphicShapes.push.apply(this._graphicShapes,f),g--);if(d===b||d)this._$elem.is(".geo-service")?this._refresh(!1,this._$elem):this._refresh()}},_getBbox:function(a,b){a=a||this._center,b=b||this._pixelSize;var c=this._contentBounds.width/2*b,d=this._contentBounds.height/2*b;return[a[0]-c,a[1]-d,a[0]+c,a[1]+d]},_setBbox:function(b,c,d){var e=[b[0]+(b[2]-b[0])/2,b[1]+(b[3]-b[1])/2],f=Math.max(a.geo.width(b,!0)/this._contentBounds.width,a.geo.height(b,!0)/this._contentBounds.height),g=this._getZoom(e,f);this._options.tilingScheme?f=this._getPixelSize(Math.min(Math.max(g,this._options.zoomMin),this._options.zoomMax)):g<this._options.zoomMin?f=this._getPixelSize(this._options.zoomMin):g>this._options.zoomMax&&(f=this._getPixelSize(this._options.zoomMax)),this._setInteractiveCenterAndSize(e,f),this._interactiveTransform()},_getBboxMax:function(){var a=this._contentBounds.width/2*this._pixelSizeMax,b=this._contentBounds.height/2*this._pixelSizeMax;return[this._centerMax[0]-a,this._centerMax[1]-b,this._centerMax[0]+a,this._centerMax[1]+b]},_getCenter:function(){return this._center},_getContentBounds:function(){return this._contentBounds},_getServicesContainer:function(){return this._$servicesContainer},_getZoom:function(b,c){b=b||this._center,c=c||this._pixelSize;var d=this._options.tilingScheme;if(d){if(d.pixelSizes){var e=Math.floor(c*1e3),f=d.pixelSizes.length,g=f-1;for(;g>=0;g--)if(Math.floor(d.pixelSizes[g]*1e3)>=e)return g;return 0}return Math.round(Math.log(d.basePixelSize/c)/Math.log(2))}var h=this._contentBounds.width/this._contentBounds.height,i=a.geo.reaspect(this._getBbox(b,c),h,!0),j=a.geo.reaspect(this._getBboxMax(),h,!0);return Math.round(Math.log(a.geo.width(j,!0)/a.geo.width(i,!0))/Math.log(this._zoomFactor))},_setZoom:function(a,b,c){this._clearInteractiveTimeout(),a=Math.min(Math.max(a,this._options.zoomMin),this._options.zoomMax),this._setInteractiveCenterAndSize(this._center,this._getPixelSize(a)),this._interactiveTransform(),this._setInteractiveTimeout(b)},_createChildren:function(){this._$existingChildren=this._$elem.children(),this._forcePosition(this._$existingChildren),this._$existingChildren.detach().css({mozUserSelect:"none"});var b="width:"+this._contentBounds.width+"px; height:"+this._contentBounds.height+"px; margin:0; padding:0;",c="position:absolute; left:0; top:0;";this._$elem.prepend('<div class="geo-event-target geo-content-frame" style="position:absolute; left:'+this._contentBounds.x+"px; top:"+this._contentBounds.y+"px;"+b+'overflow:hidden; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none;" unselectable="on"></div>'),this._$eventTarget=this._$contentFrame=this._$elem.children(":first"),this._$contentFrame.append('<div class="geo-services-container" style="'+c+b+'"></div>'),this._$servicesContainer=this._$contentFrame.children(":last"),this._$contentFrame.append('<div class="geo-shapes-container" style="'+c+b+'"></div>'),this._$shapesContainer=this._$contentFrame.children(":last"),this._$contentFrame.append('<ul style="position: absolute; bottom: 8px; left: 8px; list-style-type: none; max-width: 50%; padding: 0; margin: 0;"></ul>'),this._$attrList=this._$contentFrame.children(":last"),this._$contentFrame.append('<div class="geo-draw-container" style="'+c+b+'"></div>'),this._$drawContainer=this._$contentFrame.children(":last"),this._$contentFrame.append('<div class="geo-measure-container" style="'+c+b+'"><span class="geo-measure-label" style="'+c+'; display: none;"></span></div>'),this._$measureContainer=this._$contentFrame.children(":last"),this._$measureLabel=this._$measureContainer.children(),this._$panContainer=a([this._$shapesContainer[0],this._$drawContainer[0],this._$measureContainer[0]]),this._$resizeContainer=a([this._$contentFrame[0],this._$servicesContainer[0],this._$eventTarget[0],this._$measureContainer[0]]),this._$contentFrame.append(this._$existingChildren),a("#geo-measure-style").length||a("head").prepend('<style type="text/css" id="geo-measure-style">.geo-measure-label { margin: 4px 0 0 6px; font-family: sans-serif;'+(d?"letter-spacing: 2px; color: #444; filter:progid:DXImageTransform.Microsoft.DropShadow(Color=white, OffX=1, OffY=2, Positive=true);":"color: #000; text-shadow: #fff 1px 2px; font-weight: bold;")+" }</style>")},_createServices:function(){var b,c;for(c=0;c<this._currentServices.length;c++)this._currentServices[c].serviceContainer.geomap("destroy"),a.geo._serviceTypes[this._currentServices[c].type].destroy(this,this._$servicesContainer,this._currentServices[c]);this._currentServices=[],this._$servicesContainer.html(""),this._$attrList.html("");for(c=0;c<this._options.services.length;c++){b=this._currentServices[c]=a.extend({},this._options.services[c]),b.serviceObject=this._options.services[c],b.style=a.extend({visibility:"visible",opacity:1},b.style);var d=b.id?' id="'+b.id+'"':"",e='class="geo-service '+(b["class"]?b["class"]:"")+'"',f="<div "+d+e+' style="-webkit-transform:translateZ(0);position:absolute; left:0; top:0; width:32px; height:32px; margin:0; padding:0; display:'+(b.style.visibility==="visible"?"block":"none")+';"></div>',g;this._$servicesContainer.append(f),serviceContainer=this._$servicesContainer.children(":last"),b.serviceContainer=serviceContainer,a.geo._serviceTypes[b.type].create(this,serviceContainer,b,c),serviceContainer.data("geoMap",this).geomap(),b.attr&&this._$attrList.append("<li>"+b.attr+"</li>")}this._$shapesContainers=this._$shapesContainer,this._$attrList.find("a").css({position:"relative",zIndex:100})},_createServiceGraphics:function(){var a=this._$elem.closest(".geo-content-frame");this._$elem.append('<div class="geo-shapes-container" style="position:absolute; left:0; top:0; width:'+a.css("width")+"; height:"+a.css("height")+'; margin:0; padding:0;"></div>'),this._$shapesContainer=this._$elem.children(":last"),this._map._$shapesContainers=this._map._$shapesContainers.add(this._$shapesContainer),this._$shapesContainer.geographics(),this._createdGraphics=!0,this._options.shapeStyle=this._$shapesContainer.geographics("option","style")},_refreshDrawing:function(){this._$drawContainer.geographics("clear");if(this._drawPixels.length>0){var b=this._options.mode,c=this._drawPixels,d=this._drawCoords,e,f,g,h,i;switch(b){case"measureLength":b="drawLineString",f={type:"LineString",coordinates:d},e=a.render[this._tmplLengthId]({length:a.geo.length(f,!0)}),g=a.merge([],c[c.length-1]);break;case"measureArea":b="drawPolygon",f={type:"Polygon",coordinates:[a.merge([],d)]},f.coordinates[0].push(d[0]),e=a.render[this._tmplAreaId]({area:a.geo.area(f,!0)}),g=this._toPixel(a.geo.centroid(f).coordinates),c=[c];break;case"drawPolygon":c=[c]}this._$drawContainer.geographics(b,c),e&&(this._$measureLabel.html(e),h=this._contentBounds.width-(this._$measureLabel.outerWidth(!0)+g[0]),i=this._contentBounds.height-(this._$measureLabel.outerHeight(!0)+g[1]),h<0&&(g[0]+=h),i<0&&(g[1]+=i),this._$measureLabel.css({left:Math.max(g[0],0),top:Math.max(g[1],0)}).show())}},_resetDrawing:function(){this._drawPixels=[],this._drawCoords=[],this._$drawContainer.geographics("clear"),this._$measureLabel.hide()},_refreshShapes:function(c,d,e,f,g,h){var i,j,k,l,m,n,o,p,q=this._map._getBbox(g,h);for(i=0;i<d.length;i++){k=d[i].shape||d[i],k=k.geometry||k,l=a.data(k,"geoBbox");if(l&&a.geo._bboxDisjoint(q,l))continue;m=a.isArray(e)?e[i].style:e,n=a.isArray(f)?f[i].label:f,o=n!==b,p=b;switch(k.type){case"Point":p=this._map.toPixel(k.coordinates,g,h),this._$shapesContainer.geographics("drawPoint",p,m);break;case"LineString":this._$shapesContainer.geographics("drawLineString",this._map.toPixel(k.coordinates,g,h),m),o&&(p=this._map.toPixel(a.geo.pointAlong(k,.5).coordinates,g,h));break;case"Polygon":this._$shapesContainer.geographics("drawPolygon",this._map.toPixel(k.coordinates,g,h),m),o&&(p=this._map.toPixel(a.geo.centroid(k).coordinates,g,h));break;case"MultiPoint":for(j=0;j<k.coordinates.length;j++)this._$shapesContainer.geographics("drawPoint",this._map.toPixel(k.coordinates[j],g,h),m);o&&(p=this._map.toPixel(a.geo.centroid(k).coordinates,g,h));break;case"MultiLineString":for(j=0;j<k.coordinates.length;j++)this._$shapesContainer.geographics("drawLineString",this._map.toPixel(k.coordinates[j],g,h),m);o&&(p=this._map.toPixel(a.geo.centroid(k).coordinates,g,h));break;case"MultiPolygon":for(j=0;j<k.coordinates.length;j++)this._$shapesContainer.geographics("drawPolygon",this._map.toPixel(k.coordinates[j],g,h),m);o&&(p=this._map.toPixel(a.geo.centroid(k).coordinates,g,h));break;case"GeometryCollection":this._refreshShapes(c,k.geometries,m,n,g,h)}o&&p&&this._$shapesContainer.geographics("drawLabel",p,n)}},_findMapSize:function(){var a={width:0,height:0},b=this._$elem;while(b.size()&&!(a.width>0&&a.height>0)){a={width:b.width(),height:b.height()};if(a.width<=0||a.height<=0)a={width:parseInt(b.css("width"),10),height:parseInt(b.css("height"),10)};b=b.parent()}return a},_forcePosition:function(a){var b=a.css("position");b!="relative"&&b!="absolute"&&b!="fixed"&&a.css("position","relative")},_getPixelSize:function(b){var c=this._options.tilingScheme;if(c!==null){if(b===0)return c.pixelSizes?c.pixelSizes[0]:c.basePixelSize;b=Math.round(b),b=Math.max(b,0);var d=c.pixelSizes?c.pixelSizes.length:c.levels;return b=Math.min(b,d-1),c.pixelSizes?c.pixelSizes[b]:c.basePixelSize/Math.pow(2,b)}var e=a.geo.scaleBy(this._getBboxMax(),1/Math.pow(this._zoomFactor,b),!0);return Math.max(a.geo.width(e,!0)/this._contentBounds.width,a.geo.height(e,!0)/this._contentBounds.height)},_getZoomCenterAndSize:function(a,b,c){var d=c?this._fullZoomFactor:this._partialZoomFactor,e=Math.pow(d,-b),f=this._pixelSizeInteractive*e,g=this._getZoom(this._centerInteractive,f);c&&this._options.tilingScheme?f=this._getPixelSize(Math.min(Math.max(g,this._options.zoomMin),this._options.zoomMax)):b<0&&g<this._options.zoomMin?f=this._pixelSizeInteractive:b>0&&g>this._options.zoomMax&&(f=this._pixelSizeInteractive);var h=f/this._pixelSizeInteractive,i=this._toMap(a,this._centerInteractive,this._pixelSizeInteractive),j=[(this._centerInteractive[0]-i[0])*h,(this._centerInteractive[1]-i[1])*h],k=[i[0]+j[0],i[1]+j[1]];return{pixelSize:f,center:k}},_mouseWheelFinish:function(a){this._wheelTimeout=null;if(this._wheelLevel!==0){var b=this._getZoomCenterAndSize(this._anchor,this._wheelLevel,this._options.tilingScheme!==null);this._wheelLevel=0}else a&&this._refresh()},_panFinalize:function(){if(this._panning){this._velocity=[0,0];var a=this._current[0]-this._anchor[0],b=this._current[1]-this._anchor[1],c=this._options.axisLayout==="image",d=-a*this._pixelSize,e=(c?-1:1)*b*this._pixelSize;this._$eventTarget.css("cursor",this._options.cursors[this._options.mode]),this._inOp=!1,this._anchor=this._current,this._mouseDown=this._toolPan=this._panning=!1}},_panMove:function(){if(!this._options.pannable)return;var a=this._current[0]-this._lastDrag[0],b=this._current[1]-this._lastDrag[1],c=0,d,e;if(this._toolPan||a>3||a<-3||b>3||b<-3){this._toolPan||(this._toolPan=!0,this._$eventTarget.css("cursor",this._options.cursors.pan)),this._mouseDown&&(this._velocity=[a,b]);if(a!==0||b!==0)this._panning=!0,this._lastDrag=this._current,this._centerInteractive[0]-=a*this._pixelSizeInteractive,this._centerInteractive[1]+=(this._options.axisLayout==="image"?-1:1)*b*this._pixelSizeInteractive,this._setInteractiveCenterAndSize(this._centerInteractive,this._pixelSizeInteractive),this._interactiveTransform()}},_clearInteractiveTimeout:function(){return this._timeoutInteractive?(clearTimeout(this._timeoutInteractive),this._timeoutInteractive=null,!0):(this._centerInteractive[0]=this._center[0],this._centerInteractive[1]=this._center[1],this._pixelSizeInteractive=this._pixelSize,!1)},_interactiveTransform:function(){this._$shapesContainers&&this._$shapesContainers.geographics("clear");for(var b=0;b<this._currentServices.length;b++)service=this._currentServices[b],a.geo._serviceTypes[service.type].interactiveTransform(this,service,this._centerInteractive,this._pixelSizeInteractive);this._drawCoords.length>0&&(this._drawPixels=this._toPixel(this._drawCoords,this._centerInteractive,this._pixelSizeInteractive),this._refreshDrawing())},_setInteractiveTimeout:function(a){function c(){b._isMultiTouch?b._timeoutInteractive=setTimeout(c,128):b._created&&b._timeoutInteractive&&(b._setCenterAndSize(b._centerInteractive,b._pixelSizeInteractive,b._triggerInteractive,!0),b._timeoutInteractive=null,b._triggerInteractive=!1)}var b=this;this._timeoutInteractive=setTimeout(c,128),this._triggerInteractive|=a},_refresh:function(b,c){var d,e,f=0;for(;f<this._currentServices.length;f++){d=this._currentServices[f];if(!c||d.serviceContainer[0]==c[0])a.geo._serviceTypes[d.type].refresh(this,d,b),e=d.serviceContainer.data("geoService"),e._createdGraphics&&(e._$shapesContainer.geographics("clear"),e._graphicShapes.length>0&&e._refreshShapes(e._$shapesContainer,e._graphicShapes,e._graphicShapes,e._graphicShapes))}this._createdGraphics&&(this._$shapesContainer.geographics("clear"),this._graphicShapes.length>0&&this._refreshShapes(this._$shapesContainer,this._graphicShapes,this._graphicShapes,this._graphicShapes))},_setInteractiveCenterAndSize:function(b,c){this._centerInteractive[0]=b[0],this._centerInteractive[1]=b[1],this._pixelSizeInteractive=c,this._userGeodetic?(this._options.bbox=a.geo.proj.toGeodetic(this._getBbox(b,c)),this._options.center=a.geo.proj.toGeodetic(b)):(this._options.bbox=this._getBbox(b,c),this._options.center[0]=b[0],this._options.center[1]=b[1]),this._options.pixelSize=c,this._options.zoom=this._getZoom(b,c)},_setCenterAndSize:function(b,c,d,e){if(!a.isArray(b)||b.length!=2||typeof b[0]!="number"||typeof b[1]!="number")return;var f=this._getZoom(b,c);this._options.tilingScheme?this._pixelSizeInteractive=c=this._getPixelSize(Math.min(Math.max(f,this._options.zoomMin),this._options.zoomMax)):f<this._options.zoomMin?this._pixelSizeInteractive=c=this._getPixelSize(this._options.zoomMin):f>this._options.zoomMax&&(this._pixelSizeInteractive=c=this._getPixelSize(this._options.zoomMax)),this._center[0]=b[0],this._center[1]=b[1],this._options.pixelSize=this._pixelSize=c,this._userGeodetic?(this._options.bbox=a.geo.proj.toGeodetic(this._getBbox()),this._options.center=a.geo.proj.toGeodetic(this._center)):(this._options.bbox=this._getBbox(),this._options.center=a.merge([],b)),this._options.zoom=f,d&&this._trigger("bboxchange",window.event,{bbox:a.merge([],this._options.bbox)}),e&&(this._refresh(),this._refreshDrawing())},_requestQueued:function(){this._loadCount===0&&this._trigger("loadstart",window.event),this._loadCount++},_requestComplete:function(){this._loadCount--,this._loadCount<=0&&(this._loadCount=0,this._trigger("loadend",window.event))},_toMap:function(b,c,d){c=c||this._center,d=d||this._pixelSize;var e=a.isArray(b[0]),f=e&&a.isArray(b[0][0]),g=f&&a.isArray(b[0][0][0]),h=this._contentBounds.width,i=this._contentBounds.height,j=h/2*d,k=i/2*d,l=[c[0]-j,c[1]-k,c[0]+j,c[1]+k],m=a.geo.width(l,!0)/h,n=a.geo.height(l,!0)/i,o,p=this._options.axisLayout==="image",q=[],r,s,t;g||(f||(e||(b=[b]),b=[b]),b=[b]);for(r=0;r<b.length;r++){q[r]=[];for(s=0;s<b[r].length;s++){q[r][s]=[];for(t=0;t<b[r][s].length;t++)o=b[r][s][t][1]*n,q[r][s][t]=[l[0]+b[r][s][t][0]*m,p?l[1]+o:l[3]-o]}}return g?q:f?q[0]:e?q[0][0]:q[0][0][0]},_toPixel:function(b,c,d){c=c||this._center,d=d||this._pixelSize;var e=a.isArray(b[0]),f=e&&a.isArray(b[0][0]),g=f&&a.isArray(b[0][0][0]),h=this._contentBounds.width,i=this._contentBounds.height,j=h/2*d,k=i/2*d,l=[c[0]-j,c[1]-k,c[0]+j,c[1]+k],m=a.geo.width(l,!0),n=a.geo.height(l,!0),o=this._options.axisLayout==="image",p=h/m,q=i/n,r=[],s,t,u;g||(f||(e||(b=[b]),b=[b]),b=[b]);for(s=0;s<b.length;s++){r[s]=[];for(t=0;t<b[s].length;t++){r[s][t]=[];for(u=0;u<b[s][t].length;u++)r[s][t][u]=[Math.round((b[s][t][u][0]-l[0])*p),Math.round((o?b[s][t][u][1]-l[1]:l[3]-b[s][t][u][1])*q)]}}return g?r:f?r[0]:e?r[0][0]:r[0][0][0]},_document_keydown:function(b){var c=this._drawCoords.length;c>0&&b.which==27&&(c<=2?(this._resetDrawing(),this._inOp=!1):(this._drawCoords[c-2]=a.merge([],this._drawCoords[c-1]),this._drawPixels[c-2]=a.merge([],this._drawPixels[c-1]),this._drawCoords.length--,this._drawPixels.length--,this._refreshDrawing()))},_eventTarget_dblclick_zoom:function(a){var b=this._clearInteractiveTimeout();this._trigger("dblclick",a,{type:"Point",coordinates:this._toMap(this._current,this._centerInteractive,this._pixelSizeInteractive)});if(!a.isDefaultPrevented()){var c=this._getZoomCenterAndSize(this._current,1,!0);this._setInteractiveCenterAndSize(c.center,c.pixelSize),this._interactiveTransform(),b=!0}b&&this._setInteractiveTimeout(!0)},_eventTarget_dblclick:function(b){if(this._options.mode==="static")return;this._drawTimeout&&(window.clearTimeout(this._drawTimeout),this._drawTimeout=null);var c=a(b.currentTarget).offset();switch(this._options.mode){case"drawLineString":case"measureLength":this._drawCoords.length>1&&(this._drawCoords[0][0]!=this._drawCoords[1][0]||this._drawCoords[0][1]!=this._drawCoords[1][1])?(this._drawCoords.length--,this._trigger("shape",b,{type:"LineString",coordinates:this._userGeodetic?a.geo.proj.toGeodetic(this._drawCoords):this._drawCoords})):this._eventTarget_dblclick_zoom(b),this._resetDrawing();break;case"drawPolygon":case"measureArea":if(this._drawCoords.length>1&&(this._drawCoords[0][0]!=this._drawCoords[1][0]||this._drawCoords[0][1]!=this._drawCoords[1][1])){var d=this._drawCoords.length-1;d>2&&(this._drawCoords[d]=a.merge([],this._drawCoords[0]),this._trigger("shape",b,{type:"Polygon",coordinates:[this._userGeodetic?a.geo.proj.toGeodetic(this._drawCoords):this._drawCoords]}))}else this._eventTarget_dblclick_zoom(b);this._resetDrawing();break;default:this._eventTarget_dblclick_zoom(b)}this._inOp=!1},_eventTarget_touchstart:function(b){var c=this._options.mode,d=this._options.shift;if(c==="static")return;if(!this._supportTouch&&b.which!=1)return;var e=this._clearInteractiveTimeout(),f=a(b.currentTarget).offset(),g=b.originalEvent.changedTouches;this._supportTouch?(this._multiTouchAnchor=a.merge([],g),this._isMultiTouch=this._multiTouchAnchor.length>1,this._isMultiTouch?(this._multiTouchCurrentBbox=[g[0].pageX-f.left,g[0].pageY-f.top,g[1].pageX-f.left,g[1].pageY-f.top],this._multiTouchAnchorBbox=a.merge([],this._multiTouchCurrentBbox),this._current=a.geo.center(this._multiTouchCurrentBbox,!0)):(this._multiTouchCurrentBbox=[g[0].pageX-f.left,g[0].pageY-f.top,NaN,NaN],this._current=[g[0].pageX-f.left,g[0].pageY-f.top])):this._current=[b.pageX-f.left,b.pageY-f.top];if(this._softDblClick){var h=a.now();if(h-this._downDate<750){if(this._isTap){var i=this._current[0]-this._anchor[0],j=this._current[1]-this._anchor[1],k=Math.sqrt(i*i+j*j);k>8?this._isTap=!1:this._current=a.merge([],this._anchor)}this._isDbltap?this._isDbltap=!1:this._isDbltap=this._isTap}else this._isDbltap=!1;this._isTap=!0,this._downDate=h}return this._mouseDown=!0,this._anchor=a.merge([],this._current),!this._inOp&&b.shiftKey&&d!=="off"?(this._shiftDown=!0,this._$eventTarget.css("cursor",this._options.cursors[d==="default"?"zoom":d])):!this._isMultiTouch&&(this._options.pannable||c==="dragBox"||c==="dragCircle")&&(this._inOp=!0,c!=="zoom"&&c!=="dragBox"&&c!=="dragCircle"&&(this._lastDrag=this._current,b.currentTarget.setCapture&&b.currentTarget.setCapture())),b.preventDefault(),e&&this._setInteractiveTimeout(!0),!1},_dragTarget_touchmove:function(b){if(this._options.mode==="static")return;var c=!1;this._mouseDown&&(c=this._clearInteractiveTimeout());var e=this._$eventTarget.offset(),f=this._drawCoords.length,g=b.originalEvent.changedTouches,h,i,j=0;if(this._supportTouch){if(!this._isMultiTouch&&this._mouseDown&&this._multiTouchAnchor.length>0&&g[0].identifier!==this._multiTouchAnchor[0].identifier)return this._mouseDown=!1,this._isMultiTouch=!0,this._wheelLevel=0,this._multiTouchAnchor.push(g[0]),this._multiTouchCurrentBbox=[this._multiTouchCurrentBbox[0],this._multiTouchCurrentBbox[1],this._multiTouchAnchor[1].pageX-e.left,this._multiTouchAnchor[1].pageY-e.top],this._multiTouchAnchorBbox=a.merge([],this._multiTouchCurrentBbox),this._mouseDown=!0,this._anchor=this._current=a.geo.center(this._multiTouchCurrentBbox,!0),c&&this._setInteractiveTimeout(!0),!1;if(this._isMultiTouch){for(;j<g.length;j++)g[j].identifier===this._multiTouchAnchor[0].identifier?(this._multiTouchCurrentBbox[0]=g[j].pageX-e.left,this._multiTouchCurrentBbox[1]=g[j].pageY-e.top):g[j].identifier===this._multiTouchAnchor[1].identifier&&(this._multiTouchCurrentBbox[2]=g[j].pageX-e.left,this._multiTouchCurrentBbox[3]=g[j].pageY-e.top);var k=a.geo._distancePointPoint([this._multiTouchAnchorBbox[0],this._multiTouchAnchorBbox[1]],[this._multiTouchAnchorBbox[2],this._multiTouchAnchorBbox[3]]),l=a.geo._distancePointPoint([this._multiTouchCurrentBbox[0],this._multiTouchCurrentBbox[1]],[this._multiTouchCurrentBbox[2],this._multiTouchCurrentBbox[3]]);h=a.geo.center(this._multiTouchCurrentBbox,!0);var m=(l-k)/k;m>0?m*=5:m*=10;var n=m-this._wheelLevel;this._wheelLevel=m;var o=this._getZoomCenterAndSize(this._anchor,n,!1);this._setInteractiveCenterAndSize(o.center,o.pixelSize),this._interactiveTransform(),c=!0,h=a.geo.center(this._multiTouchCurrentBbox,!0)}else h=[b.originalEvent.changedTouches[0].pageX-e.left,b.originalEvent.changedTouches[0].pageY-e.top]}else h=[b.pageX-e.left,b.pageY-e.top];if(h[0]===this._lastMove[0]&&h[1]===this._lastMove[1]&&this._inOp)return b.preventDefault(),c&&this._setInteractiveTimeout(!0),!1;d==7&&(this._isDbltap=this._isTap=!1),this._mouseDown&&(this._current=h,this._moveDate=a.now());if(this._isMultiTouch)return b.preventDefault(),this._isDbltap=this._isTap=!1,c&&this._setInteractiveTimeout(!0),!1;var p=this._options.shift,q=this._shiftDown?p==="default"?"zoom":p:this._options.mode,r,s,t;switch(q){case"zoom":case"dragBox":this._mouseDown?(this._$drawContainer.geographics("clear"),this._$drawContainer.geographics("drawBbox",[this._anchor[0],this._anchor[1],h[0],h[1]])):this._trigger("move",b,{type:"Point",coordinates:this.toMap(h)});break;case"dragCircle":this._mouseDown?(r=h[0]-this._anchor[0],s=h[1]-this._anchor[1],t=Math.sqrt(r*r+s*s)*2,this._$drawContainer.geographics("clear"),this._$drawContainer.geographics("drawArc",this._anchor,0,360,{width:t,height:t})):this._trigger("move",b,{type:"Point",coordinates:this.toMap(h)});break;case"drawLineString":case"drawPolygon":case"measureLength":case"measureArea":this._mouseDown||this._toolPan?(this._panMove(),c=!0):(f>0&&(this._drawCoords[f-1]=this._toMap(h,this._centerInteractive,this._pixelSizeInteractive),this._drawPixels[f-1]=h,this._refreshDrawing()),this._trigger("move",b,{type:"Point",coordinates:this.toMap(h)}));break;default:this._mouseDown||this._toolPan?(this._panMove(),c=!0):this._trigger("move",b,{type:"Point",coordinates:this.toMap(h)})}this._lastMove=h,c&&this._setInteractiveTimeout(!0);if(this._inOp)return b.preventDefault(),!1},_dragTarget_touchstop:function(b){if(this._options.mode==="static")return;if(!this._mouseDown)if(d==7)this._eventTarget_touchstart(b);else return!1;var c=this._clearInteractiveTimeout(),e=this._mouseDown,f=this._toolPan,g=this._$eventTarget.offset(),h=this._options.shift,i=this._shiftDown?h==="default"?"zoom":h:this._options.mode,j,k,l,m,n,o,p;this._supportTouch?(j=[b.originalEvent.changedTouches[0].pageX-g.left,b.originalEvent.changedTouches[0].pageY-g.top],this._multiTouchAnchor=[],this._inOp=!1):j=[b.pageX-g.left,b.pageY-g.top],this._softDblClick&&this._isTap&&(m=j[0]-this._anchor[0],n=j[1]-this._anchor[1],Math.sqrt(m*m+n*n)<=8&&(j=a.merge([],this._anchor))),m=j[0]-this._anchor[0],n=j[1]-this._anchor[1],this._$eventTarget.css("cursor",this._options.cursors[this._options.mode]),this._shiftDown=this._mouseDown=this._toolPan=!1;if(this._isMultiTouch){b.preventDefault(),this._isMultiTouch=!1,this._wheelLevel=0,c&&this._setInteractiveTimeout(!0);return}document.releaseCapture&&document.releaseCapture();if(e){l=a.now(),this._current=j;switch(i){case"zoom":case"dragBox":if(m!==0||n!==0){var q=this._pixelSize*6,r=this._toMap([[Math.min(this._anchor[0],j[0]),Math.max(this._anchor[1],j[1])],[Math.max(this._anchor[0],j[0]),Math.min(this._anchor[1],j[1])]]),s=[r[0][0],r[0][1],r[1][0],r[1][1]];i==="zoom"?(s[2]-s[0]<q&&s[3]-s[1]<q&&(s=a.geo.scaleBy(this._getBbox(a.geo.center(s,!0)),.5,!0)),this._setBbox(s,!0,!0),c=!0):(p=a.geo.polygonize(s,!0),p.bbox=s,this._userGeodetic&&(p.coordinates=a.geo.proj.toGeodetic(p.coordinates),p.bbox=a.geo.proj.toGeodetic(p.bbox)),this._trigger("shape",b,p))}else i==="dragBox"&&(o=this._toMap(j),p={type:"Point",coordinates:[o[0],o[1]],bbox:[o[0],o[1],o[0],o[1]]},this._userGeodetic&&(p.coordinates=a.geo.proj.toGeodetic(p.coordinates),p.bbox=a.geo.proj.toGeodetic(p.bbox)),this._trigger("shape",b,p));this._resetDrawing();break;case"dragCircle":if(m!==0||n!==0){var t=this._options.axisLayout==="image",u=Math.sqrt(m*m+n*n),v=180,w;this._drawPixels.length=v+1;for(k=0;k<v;k++)w=k*360/v*(Math.PI/180),this._drawPixels[k]=[this._anchor[0]+Math.cos(w)*u,this._anchor[1]+Math.sin(w)*u];this._drawPixels[v]=[this._drawPixels[0][0],this._drawPixels[0][1]],o=this._toMap([[this._anchor[0]-u,this._anchor[1]+(t?-u:u)],[this._anchor[0]+u,this._anchor[1]+(t?u:-u)]]),p={type:"Polygon",coordinates:[this._toMap(this._drawPixels)],bbox:[o[0][0],o[0][1],o[1][0],o[1][1]]},this._userGeodetic&&(p.coordinates=a.geo.proj.toGeodetic(p.coordinates),p.bbox=a.geo.proj.toGeodetic(p.bbox)),this._trigger("shape",b,p),this._resetDrawing()}else o=this._toMap(j),p={type:"Point",coordinates:[o[0],o[1]],bbox:[o[0],o[1],o[0],o[1]]},this._userGeodetic&&(p.coordinates=a.geo.proj.toGeodetic(p.coordinates),p.bbox=a.geo.proj.toGeodetic(p.bbox)),this._trigger("shape",b,p);break;case"drawPoint":this._drawTimeout&&(window.clearTimeout(this._drawTimeout),this._drawTimeout=null);if(f)this._panFinalize();else if(l-this._clickDate>100){var x=this;this._drawTimeout=setTimeout(function(){x._drawTimeout&&(x._trigger("shape",b,{type:"Point",coordinates:x.toMap(j)}),x._inOp=!1,x._drawTimeout=null)},250)}break;case"drawLineString":case"drawPolygon":case"measureLength":case"measureArea":if(f)this._panFinalize();else{k=this._drawCoords.length===0?0:this._drawCoords.length-1,this._drawCoords[k]=this._toMap(j),this._drawPixels[k]=j;if(k<2||this._drawCoords[k][0]!=this._drawCoords[k-1][0]||this._drawCoords[k][1]!=this._drawCoords[k-1][1])this._drawCoords[k+1]=this._toMap(j,this._centerInteractive,this._pixelSizeInteractive),this._drawPixels[k+1]=j;this._refreshDrawing()}break;default:f?this._panFinalize():l-this._clickDate>100&&(this._trigger("click",b,{type:"Point",coordinates:this.toMap(j)}),this._inOp=!1)}this._clickDate=l;if(this._softDblClick&&this._isDbltap)return this._isDbltap=this._isTap=!1,c&&this._setInteractiveTimeout(!0),this._$eventTarget.trigger("dblclick",b),!1}c&&this._setInteractiveTimeout(!0);if(this._inOp)return b.preventDefault(),!1},_eventTarget_mousewheel:function(b,c){if(this._options.mode==="static"||this._options.scroll==="off")return;b.preventDefault();if(this._mouseDown)return!1;if(c!==0){this._clearInteractiveTimeout(),c>0?c=Math.ceil(c):c=Math.floor(c);var d=a(b.currentTarget).offset();this._anchor=[b.pageX-d.left,b.pageY-d.top];var e=this._getZoomCenterAndSize(this._anchor,c,this._options.tilingScheme!==null),f,g=0;this._setInteractiveCenterAndSize(e.center,e.pixelSize),this._interactiveTransform(),this._setInteractiveTimeout(!0)}return!1}})}(jQuery),function(a,b){a.geo._serviceTypes.tiled=function(){return{create:function(b,c,d,e){var f=a.data(d,"geoServiceState");if(!f){f={loadCount:0,reloadTiles:!1};var g='<div data-geo-service="tiled" style="-webkit-transform:translateZ(0); position:absolute; left:0; top:0; width:8px; height:8px; margin:0; padding:0;"></div>';c.append(g),f.serviceContainer=c.children(":last"),a.data(d,"geoServiceState",f)}return f.serviceContainer},destroy:function(b,c,d){var e=a.data(d,"geoServiceState");e.serviceContainer.remove(),a.removeData(d,"geoServiceState")},interactiveTransform:function(b,c,d,e){var f=a.data(c,"geoServiceState"),g=b.options.tilingScheme;f&&(this._cancelUnloaded(b,c),f.serviceContainer.children().each(function(c){var f=a(this),h=f.data("pixelSize"),i=h/e;if(h>0){i=Math.round(i*1e3)/1e3;var j=f.data("scaleOrigin"),k=b._toPixel(j,d,e);f.css({left:Math.round(k[0])+"px",top:Math.round(k[1])+"px",width:g.tileWidth*i,height:g.tileHeight*i})}}))},refresh:function(b,c,d){var e=a.data(c,"geoServiceState");this._cancelUnloaded(b,c),e&&d&&(e.reloadTiles=!0);if(e&&c&&c.style.visibility==="visible"&&!e.serviceContainer.is(":hidden")){var f=b._getBbox(),g=b._pixelSize,h=this,i=e.serviceContainer,j=b._getContentBounds(),k=j.width,l=j.height,m=b.options.axisLayout==="image",n=m?1:-1,o=b.options.tilingScheme,p=o.tileWidth,q=o.tileHeight,r=Math.floor((f[0]-o.origin[0])/(g*p)),s=Math.max(Math.floor((m?f[1]-o.origin[1]:o.origin[1]-f[3])/(g*q)),0),t=Math.ceil((f[2]-o.origin[0])/(g*p)),u=Math.ceil((m?f[3]-o.origin[1]:o.origin[1]-f[1])/(g*q)),v=b._getBboxMax(),w=b._getPixelSize(0),x=w/g,y=Math.floor((v[0]-o.origin[0])/(w*p))*x,z=Math.floor((o.origin[1]+n*v[3])/(w*q))*x,A=o.origin[0]+y*p*g,B=o.origin[1]+n*z*q*g,C=Math.round((A-f[0])/g),D=Math.round((m?B-f[1]:f[3]-B)/g),E=i.children().show(),F=E.filter("[data-pixel-size='"+g+"']").appendTo(i),G=c.style.opacity,H,I,J=function(c){h._loadImage(a.data(this,"img"),c,g,b,e,G)},K=function(){a.data(this,"img").remove(),e.loadCount--,b._requestComplete()};e.reloadTiles&&E.find("img").attr("data-dirty","true"),F.size()?(F.css({left:C%p+"px",top:D%q+"px"}).data("scaleOrigin",b._toMap([C%p,D%q])),F.children().each(function(b){var c=a(this),d=c.attr("data-tile").split(",");c.css({left:Math.round((parseInt(d[0],10)-y)*100+(C-C%p)/p*100)+"%",top:Math.round((parseInt(d[1],10)-z)*100+(D-D%q)/q*100)+"%"}),G<1&&c.fadeTo(0,G)})):(i.append("<div style='-webkit-transform:translateZ(0);position:absolute; left:"+C%p+"px; top:"+D%q+"px; width:"+p+"px; height:"+q+"px; margin:0; padding:0;' data-pixel-size='"+g+"'></div>"),F=i.children(":last").data("scaleOrigin",b._toMap([C%p,D%q])));for(H=r;H<t;H++)for(I=s;I<u;I++){var L=""+H+","+I,M=F.children("[data-tile='"+L+"']").removeAttr("data-dirty");if(M.size()===0||e.reloadTiles){var N=[o.origin[0]+H*p*g,o.origin[1]+n*I*q*g],O=[o.origin[0]+((H+1)*p-1)*g,o.origin[1]+n*((I+1)*q-1)*g],P=[N[0],N[1],O[0],O[1]],Q=c.hasOwnProperty("src")?"src":"getUrl",R={bbox:P,width:p,height:q,zoom:b._getZoom(),tile:{row:I,column:H},index:Math.abs(I+H)},S=a.isFunction(c[Q]),T;S?T=c[Q](R):(a.templates("geoSrc",c[Q]),T=a.render.geoSrc(R)),e.loadCount++,b._requestQueued();if(e.reloadTiles&&M.size()>0)M.attr("src",T);else{var U="<img style='-webkit-transform:translateZ(0);position:absolute; left:"+((H-y)*100+(C-C%p)/p*100)+"%; "+"top:"+((I-z)*100+(D-D%q)/q*100)+"%; ";U+="width: 100%; height: 100%;",U+="margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;' unselectable='on' data-tile='"+L+"' />",F.append(U),M=F.children(":last")}typeof T=="string"?h._loadImage(M,T,g,b,e,G):T?(a.data(T,"img",M),T.done(J).fail(K)):M.remove()}}E.find("[data-dirty]").remove(),e.reloadTiles=!1}},resize:function(a,b){},opacity:function(b,c){var d=a.data(c,"geoServiceState");d.serviceContainer.find("img").stop(!0).fadeTo("fast",c.style.opacity)},toggle:function(b,c){var d=a.data(c,"geoServiceState");d.serviceContainer.css("display",c.style.visibility==="visible"?"block":"none")},_cancelUnloaded:function(b,c){var d=a.data(c,"geoServiceState");if(d&&d.loadCount>0){d.serviceContainer.find("img:hidden").remove();while(d.loadCount>0)d.loadCount--,b._requestComplete()}},_loadImage:function(b,c,d,e,f,g){var h=f.serviceContainer;b.load(function(b){g<1?a(b.target).fadeTo(0,g):a(b.target).show(),f.loadCount--,e._requestComplete(),f.loadCount<=0&&(h.children(":not([data-pixel-size='"+d+"'])").remove(),f.loadCount=0)}).error(function(b){a(b.target).remove(),f.loadCount--,e._requestComplete(),f.loadCount<=0&&(h.children(":not([data-pixel-size='"+d+"'])").remove(),f.loadCount=0)}).attr("src",c)}}}()}(jQuery),function(a,b){a.geo._serviceTypes.shingled=function(){return{create:function(b,c,d,e){var f=a.data(d,"geoServiceState");if(!f){f={loadCount:0};var g='<div data-geo-service="shingled" style="-webkit-transform:translateZ(0);position:absolute; left:0; top:0; width:16px; height:16px; margin:0; padding:0;"></div>';c.append(g),f.serviceContainer=c.children(":last"),a.data(d,"geoServiceState",f)}return f.serviceContainer},destroy:function(b,c,d){var e=a.data(d,"geoServiceState");e.serviceContainer.remove(),a.removeData(d,"geoServiceState")},interactiveTransform:function(b,c,d,e){var f=a.data(c,"geoServiceState"),g=b._getContentBounds(),h=g.width,i=g.height,j=h/2,k=i/2,l=[d[0]-j,d[1]-k,d[0]+j,d[1]+k];f&&(this._cancelUnloaded(b,c),f.serviceContainer.children().each(function(c){var f=a(this),g=f.data("pixelSize"),j=g/e;if(g>0){j=Math.round(j*1e3)/1e3;var k=f.data("origin"),l=b._toPixel(k,d,e);f.css({left:Math.round(l[0]),top:Math.round(l[1]),width:h*j,height:i*j})}}))},refresh:function(b,c){var d=a.data(c,"geoServiceState");this._cancelUnloaded(b,c);if(d&&c&&c.style.visibility==="visible"&&!d.serviceContainer.is(":hidden")){var e=b._getBbox(),f=b._pixelSize,g=this,h=d.serviceContainer,i=b._getContentBounds(),j=i.width,k=i.height,l=h.children('[data-pixel-size="'+f+'"]'),m=c.style.opacity,n;m<1&&h.find("img").attr("data-keep-alive","0"),l.size()||(h.append('<div style="-webkit-transform:translateZ(0);position:absolute; left:0px; top: 0px; width:'+j+"px; height:"+k+'px; margin:0; padding:0;" data-pixel-size="'+f+'" data-origin="['+b._toMap([0,0])+']"></div>'),l=h.children(":last"));var o=c.hasOwnProperty("src")?"src":"getUrl",p={bbox:e,width:j,height:k,zoom:b._getZoom(),tile:null,index:0},q=a.isFunction(c[o]),r,s=l.position();s.left=-s.left,s.top=-s.top,q?r=c[o](p):(a.templates("geoSrc",c[o]),r=a.render.geoSrc(p)),d.loadCount++,b._requestQueued(),l.append('<img style="-webkit-transform:translateZ(0);position:absolute; left:'+s.left/l.width()*100+"%; top:"+s.top/l.height()*100+'%; width:100%; height:100%; margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;" unselectable="on" />'),n=l.children(":last").data("center",b._center),typeof r=="string"?g._loadImage(n,r,f,b,d,m):r.done(function(a){g._loadImage(n,a,f,b,d,m)}).fail(function(){n.remove(),d.loadCount--,b._requestComplete()})}},resize:function(b,c){var d=a.data(c,"geoServiceState");if(d&&c&&c.style.visibility==="visible"){this._cancelUnloaded(b,c);var e=d.serviceContainer,f=b._getContentBounds(),g=f.width,h=f.height,i=e.children();i.attr("data-pixel-size","0"),i.each(function(c){var d=a(this),e=d.position(),f=d.data("origin"),i=b._toPixel(f);d.css({left:e.left+(g-d.width())/2,top:e.top+(h-d.height())/2})})}},opacity:function(b,c){var d=a.data(c,"geoServiceState");d.serviceContainer.find("img").stop(!0).fadeTo("fast",c.style.opacity)},toggle:function(b,c){var d=a.data(c,"geoServiceState");d.serviceContainer.css("display",c.style.visibility==="visible"?"block":"none")},_cancelUnloaded:function(b,c){var d=a.data(c,"geoServiceState");if(d&&d.loadCount>0){d.serviceContainer.find("img:hidden").remove();while(d.loadCount>0)d.loadCount--,b._requestComplete()}},_loadImage:function(b,c,d,e,f,g){var h=f.serviceContainer;b.load(function(b){g<1?a(b.target).fadeTo(0,g):a(b.target).show(),f.loadCount--,e._requestComplete(),f.loadCount<=0&&(h.children(':not([data-pixel-size="'+d+'"])').remove(),h.find("img[data-keep-alive]").remove(),f.loadCount=0)}).error(function(b){a(b.target).remove(),f.loadCount--,e._requestComplete(),f.loadCount<=0&&(h.children(":not([data-pixel-size='"+d+"'])").remove(),f.loadCount=0)}).attr("src",c)}}}()}(jQuery)
\ No newline at end of file
diff --git a/libs/js/jquery-geo-1.0b2/docs/jquery.geo-test.js b/libs/js/jquery-geo-1.0b2/docs/jquery.geo-test.js
deleted file mode 100755 (executable)
index e3db452..0000000
+++ /dev/null
@@ -1,7215 +0,0 @@
-/*! jQuery Geo - vtest - 2012-11-02
- * http://jquerygeo.com
- * Copyright (c) 2012 Ryan Westphal/Applied Geographics, Inc.; Licensed MIT, GPL */
-
-// Copyright 2006 Google Inc.
-//
-// 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.
-
-
-// Known Issues:
-//
-// * Patterns only support repeat.
-// * Radial gradient are not implemented. The VML version of these look very
-//   different from the canvas one.
-// * Clipping paths are not implemented.
-// * Coordsize. The width and height attribute have higher priority than the
-//   width and height style values which isn't correct.
-// * Painting mode isn't implemented.
-// * Canvas width/height should is using content-box by default. IE in
-//   Quirks mode will draw the canvas using border-box. Either change your
-//   doctype to HTML5
-//   (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype)
-//   or use Box Sizing Behavior from WebFX
-//   (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html)
-// * Non uniform scaling does not correctly scale strokes.
-// * Optimize. There is always room for speed improvements.
-
-// Only add this code if we do not already have a canvas implementation
-if (!document.createElement('canvas').getContext) {
-
-  (function () {
-
-    // alias some functions to make (compiled) code shorter
-    var m = Math;
-    var mr = m.round;
-    var ms = m.sin;
-    var mc = m.cos;
-    var abs = m.abs;
-    var sqrt = m.sqrt;
-
-    // this is used for sub pixel precision
-    var Z = 10;
-    var Z2 = Z / 2;
-
-    var IE_VERSION = +navigator.userAgent.match(/MSIE ([\d.]+)?/)[1];
-
-    /**
-    * This funtion is assigned to the <canvas> elements as element.getContext().
-    * @this {HTMLElement}
-    * @return {CanvasRenderingContext2D_}
-    */
-    function getContext() {
-      return this.context_ ||
-        (this.context_ = new CanvasRenderingContext2D_(this));
-    }
-
-    var slice = Array.prototype.slice;
-
-    /**
-    * Binds a function to an object. The returned function will always use the
-    * passed in {@code obj} as {@code this}.
-    *
-    * Example:
-    *
-    *   g = bind(f, obj, a, b)
-    *   g(c, d) // will do f.call(obj, a, b, c, d)
-    *
-    * @param {Function} f The function to bind the object to
-    * @param {Object} obj The object that should act as this when the function
-    *     is called
-    * @param {*} var_args Rest arguments that will be used as the initial
-    *     arguments when the function is called
-    * @return {Function} A new function that has bound this
-    */
-    function bind(f, obj, var_args) {
-      var a = slice.call(arguments, 2);
-      return function () {
-        return f.apply(obj, a.concat(slice.call(arguments)));
-      };
-    }
-
-    function encodeHtmlAttribute(s) {
-      return String(s).replace(/&/g, '&amp;').replace(/"/g, '&quot;');
-    }
-
-    function addNamespace(doc, prefix, urn) {
-      if (!doc.namespaces[prefix]) {
-        doc.namespaces.add(prefix, urn, '#default#VML');
-      }
-    }
-
-    function addNamespacesAndStylesheet(doc) {
-      addNamespace(doc, 'g_vml_', 'urn:schemas-microsoft-com:vml');
-      addNamespace(doc, 'g_o_', 'urn:schemas-microsoft-com:office:office');
-
-      // Setup default CSS.  Only add one style sheet per document
-      if (!doc.styleSheets['ex_canvas_']) {
-        var ss = doc.createStyleSheet();
-        ss.owningElement.id = 'ex_canvas_';
-        ss.cssText = 'canvas{display:inline-block;overflow:hidden;' +
-        // default size is 300x150 in Gecko and Opera
-          'text-align:left;width:300px;height:150px}';
-      }
-    }
-
-    // Add namespaces and stylesheet at startup.
-    addNamespacesAndStylesheet(document);
-
-    var G_vmlCanvasManager_ = {
-      init: function (opt_doc) {
-        var doc = opt_doc || document;
-        // Create a dummy element so that IE will allow canvas elements to be
-        // recognized.
-        doc.createElement('canvas');
-        doc.attachEvent('onreadystatechange', bind(this.init_, this, doc));
-      },
-
-      init_: function (doc) {
-        // find all canvas elements
-        var els = doc.getElementsByTagName('canvas');
-        for (var i = 0; i < els.length; i++) {
-          this.initElement(els[i]);
-        }
-      },
-
-      /**
-      * Public initializes a canvas element so that it can be used as canvas
-      * element from now on. This is called automatically before the page is
-      * loaded but if you are creating elements using createElement you need to
-      * make sure this is called on the element.
-      * @param {HTMLElement} el The canvas element to initialize.
-      * @return {HTMLElement} the element that was created.
-      */
-      initElement: function (el) {
-        if (!el.getContext) {
-          el.getContext = getContext;
-
-          // Add namespaces and stylesheet to document of the element.
-          addNamespacesAndStylesheet(el.ownerDocument);
-
-          // Remove fallback content. There is no way to hide text nodes so we
-          // just remove all childNodes. We could hide all elements and remove
-          // text nodes but who really cares about the fallback content.
-          el.innerHTML = '';
-
-          // do not use inline function because that will leak memory
-          el.attachEvent('onpropertychange', onPropertyChange);
-          el.attachEvent('onresize', onResize);
-
-          var attrs = el.attributes;
-          if (attrs.width && attrs.width.specified) {
-            // TODO: use runtimeStyle and coordsize
-            // el.getContext().setWidth_(attrs.width.nodeValue);
-            el.style.width = attrs.width.nodeValue + 'px';
-          } else {
-            el.width = el.clientWidth;
-          }
-          if (attrs.height && attrs.height.specified) {
-            // TODO: use runtimeStyle and coordsize
-            // el.getContext().setHeight_(attrs.height.nodeValue);
-            el.style.height = attrs.height.nodeValue + 'px';
-          } else {
-            el.height = el.clientHeight;
-          }
-          //el.getContext().setCoordsize_()
-        }
-        return el;
-      }
-    };
-
-    function onPropertyChange(e) {
-      var el = e.srcElement;
-
-      switch (e.propertyName) {
-        case 'width':
-          el.getContext().clearRect();
-          el.style.width = el.attributes.width.nodeValue + 'px';
-          // In IE8 this does not trigger onresize.
-          el.firstChild.style.width = el.clientWidth + 'px';
-          break;
-        case 'height':
-          el.getContext().clearRect();
-          el.style.height = el.attributes.height.nodeValue + 'px';
-          el.firstChild.style.height = el.clientHeight + 'px';
-          break;
-      }
-    }
-
-    function onResize(e) {
-      var el = e.srcElement;
-      if (el.firstChild) {
-        el.firstChild.style.width = el.clientWidth + 'px';
-        el.firstChild.style.height = el.clientHeight + 'px';
-      }
-    }
-
-    G_vmlCanvasManager_.init();
-
-    // precompute "00" to "FF"
-    var decToHex = [];
-    for (var i = 0; i < 16; i++) {
-      for (var j = 0; j < 16; j++) {
-        decToHex[i * 16 + j] = i.toString(16) + j.toString(16);
-      }
-    }
-
-    function createMatrixIdentity() {
-      return [
-      [1, 0, 0],
-      [0, 1, 0],
-      [0, 0, 1]
-    ];
-    }
-
-    function matrixMultiply(m1, m2) {
-      var result = createMatrixIdentity();
-
-      for (var x = 0; x < 3; x++) {
-        for (var y = 0; y < 3; y++) {
-          var sum = 0;
-
-          for (var z = 0; z < 3; z++) {
-            sum += m1[x][z] * m2[z][y];
-          }
-
-          result[x][y] = sum;
-        }
-      }
-      return result;
-    }
-
-    function copyState(o1, o2) {
-      o2.fillStyle     = o1.fillStyle;
-      o2.lineCap       = o1.lineCap;
-      o2.lineJoin      = o1.lineJoin;
-      o2.lineWidth     = o1.lineWidth;
-      o2.miterLimit    = o1.miterLimit;
-      o2.shadowBlur    = o1.shadowBlur;
-      o2.shadowColor   = o1.shadowColor;
-      o2.shadowOffsetX = o1.shadowOffsetX;
-      o2.shadowOffsetY = o1.shadowOffsetY;
-      o2.strokeStyle   = o1.strokeStyle;
-      o2.globalAlpha   = o1.globalAlpha;
-      o2.font          = o1.font;
-      o2.textAlign     = o1.textAlign;
-      o2.textBaseline  = o1.textBaseline;
-      o2.arcScaleX_    = o1.arcScaleX_;
-      o2.arcScaleY_    = o1.arcScaleY_;
-      o2.lineScale_    = o1.lineScale_;
-    }
-
-    //  var colorData = {
-    //    aliceblue: '#F0F8FF',
-    //    antiquewhite: '#FAEBD7',
-    //    aquamarine: '#7FFFD4',
-    //    azure: '#F0FFFF',
-    //    beige: '#F5F5DC',
-    //    bisque: '#FFE4C4',
-    //    black: '#000000',
-    //    blanchedalmond: '#FFEBCD',
-    //    blueviolet: '#8A2BE2',
-    //    brown: '#A52A2A',
-    //    burlywood: '#DEB887',
-    //    cadetblue: '#5F9EA0',
-    //    chartreuse: '#7FFF00',
-    //    chocolate: '#D2691E',
-    //    coral: '#FF7F50',
-    //    cornflowerblue: '#6495ED',
-    //    cornsilk: '#FFF8DC',
-    //    crimson: '#DC143C',
-    //    cyan: '#00FFFF',
-    //    darkblue: '#00008B',
-    //    darkcyan: '#008B8B',
-    //    darkgoldenrod: '#B8860B',
-    //    darkgray: '#A9A9A9',
-    //    darkgreen: '#006400',
-    //    darkgrey: '#A9A9A9',
-    //    darkkhaki: '#BDB76B',
-    //    darkmagenta: '#8B008B',
-    //    darkolivegreen: '#556B2F',
-    //    darkorange: '#FF8C00',
-    //    darkorchid: '#9932CC',
-    //    darkred: '#8B0000',
-    //    darksalmon: '#E9967A',
-    //    darkseagreen: '#8FBC8F',
-    //    darkslateblue: '#483D8B',
-    //    darkslategray: '#2F4F4F',
-    //    darkslategrey: '#2F4F4F',
-    //    darkturquoise: '#00CED1',
-    //    darkviolet: '#9400D3',
-    //    deeppink: '#FF1493',
-    //    deepskyblue: '#00BFFF',
-    //    dimgray: '#696969',
-    //    dimgrey: '#696969',
-    //    dodgerblue: '#1E90FF',
-    //    firebrick: '#B22222',
-    //    floralwhite: '#FFFAF0',
-    //    forestgreen: '#228B22',
-    //    gainsboro: '#DCDCDC',
-    //    ghostwhite: '#F8F8FF',
-    //    gold: '#FFD700',
-    //    goldenrod: '#DAA520',
-    //    grey: '#808080',
-    //    greenyellow: '#ADFF2F',
-    //    honeydew: '#F0FFF0',
-    //    hotpink: '#FF69B4',
-    //    indianred: '#CD5C5C',
-    //    indigo: '#4B0082',
-    //    ivory: '#FFFFF0',
-    //    khaki: '#F0E68C',
-    //    lavender: '#E6E6FA',
-    //    lavenderblush: '#FFF0F5',
-    //    lawngreen: '#7CFC00',
-    //    lemonchiffon: '#FFFACD',
-    //    lightblue: '#ADD8E6',
-    //    lightcoral: '#F08080',
-    //    lightcyan: '#E0FFFF',
-    //    lightgoldenrodyellow: '#FAFAD2',
-    //    lightgreen: '#90EE90',
-    //    lightgrey: '#D3D3D3',
-    //    lightpink: '#FFB6C1',
-    //    lightsalmon: '#FFA07A',
-    //    lightseagreen: '#20B2AA',
-    //    lightskyblue: '#87CEFA',
-    //    lightslategray: '#778899',
-    //    lightslategrey: '#778899',
-    //    lightsteelblue: '#B0C4DE',
-    //    lightyellow: '#FFFFE0',
-    //    limegreen: '#32CD32',
-    //    linen: '#FAF0E6',
-    //    magenta: '#FF00FF',
-    //    mediumaquamarine: '#66CDAA',
-    //    mediumblue: '#0000CD',
-    //    mediumorchid: '#BA55D3',
-    //    mediumpurple: '#9370DB',
-    //    mediumseagreen: '#3CB371',
-    //    mediumslateblue: '#7B68EE',
-    //    mediumspringgreen: '#00FA9A',
-    //    mediumturquoise: '#48D1CC',
-    //    mediumvioletred: '#C71585',
-    //    midnightblue: '#191970',
-    //    mintcream: '#F5FFFA',
-    //    mistyrose: '#FFE4E1',
-    //    moccasin: '#FFE4B5',
-    //    navajowhite: '#FFDEAD',
-    //    oldlace: '#FDF5E6',
-    //    olivedrab: '#6B8E23',
-    //    orange: '#FFA500',
-    //    orangered: '#FF4500',
-    //    orchid: '#DA70D6',
-    //    palegoldenrod: '#EEE8AA',
-    //    palegreen: '#98FB98',
-    //    paleturquoise: '#AFEEEE',
-    //    palevioletred: '#DB7093',
-    //    papayawhip: '#FFEFD5',
-    //    peachpuff: '#FFDAB9',
-    //    peru: '#CD853F',
-    //    pink: '#FFC0CB',
-    //    plum: '#DDA0DD',
-    //    powderblue: '#B0E0E6',
-    //    rosybrown: '#BC8F8F',
-    //    royalblue: '#4169E1',
-    //    saddlebrown: '#8B4513',
-    //    salmon: '#FA8072',
-    //    sandybrown: '#F4A460',
-    //    seagreen: '#2E8B57',
-    //    seashell: '#FFF5EE',
-    //    sienna: '#A0522D',
-    //    skyblue: '#87CEEB',
-    //    slateblue: '#6A5ACD',
-    //    slategray: '#708090',
-    //    slategrey: '#708090',
-    //    snow: '#FFFAFA',
-    //    springgreen: '#00FF7F',
-    //    steelblue: '#4682B4',
-    //    tan: '#D2B48C',
-    //    thistle: '#D8BFD8',
-    //    tomato: '#FF6347',
-    //    turquoise: '#40E0D0',
-    //    violet: '#EE82EE',
-    //    wheat: '#F5DEB3',
-    //    whitesmoke: '#F5F5F5',
-    //    yellowgreen: '#9ACD32'
-    //  };
-
-
-    function getRgbHslContent(styleString) {
-      var start = styleString.indexOf('(', 3);
-      var end = styleString.indexOf(')', start + 1);
-      var parts = styleString.substring(start + 1, end).split(',');
-      // add alpha if needed
-      if (parts.length != 4 || styleString.charAt(3) != 'a') {
-        parts[3] = 1;
-      }
-      return parts;
-    }
-
-    function percent(s) {
-      return parseFloat(s) / 100;
-    }
-
-    function clamp(v, min, max) {
-      return Math.min(max, Math.max(min, v));
-    }
-
-    function hslToRgb(parts) {
-      var r, g, b, h, s, l;
-      h = parseFloat(parts[0]) / 360 % 360;
-      if (h < 0)
-        h++;
-      s = clamp(percent(parts[1]), 0, 1);
-      l = clamp(percent(parts[2]), 0, 1);
-      if (s == 0) {
-        r = g = b = l; // achromatic
-      } else {
-        var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
-        var p = 2 * l - q;
-        r = hueToRgb(p, q, h + 1 / 3);
-        g = hueToRgb(p, q, h);
-        b = hueToRgb(p, q, h - 1 / 3);
-      }
-
-      return '#' + decToHex[Math.floor(r * 255)] +
-        decToHex[Math.floor(g * 255)] +
-        decToHex[Math.floor(b * 255)];
-    }
-
-    function hueToRgb(m1, m2, h) {
-      if (h < 0)
-        h++;
-      if (h > 1)
-        h--;
-
-      if (6 * h < 1)
-        return m1 + (m2 - m1) * 6 * h;
-      else if (2 * h < 1)
-        return m2;
-      else if (3 * h < 2)
-        return m1 + (m2 - m1) * (2 / 3 - h) * 6;
-      else
-        return m1;
-    }
-
-    var processStyleCache = {};
-
-    function processStyle(styleString) {
-      if (styleString in processStyleCache) {
-        return processStyleCache[styleString];
-      }
-
-      var str, alpha = 1;
-
-      styleString = String(styleString);
-      if (styleString.charAt(0) == '#') {
-        str = styleString;
-      } else if (/^rgb/.test(styleString)) {
-        var parts = getRgbHslContent(styleString);
-        var str = '#', n;
-        for (var i = 0; i < 3; i++) {
-          if (parts[i].indexOf('%') != -1) {
-            n = Math.floor(percent(parts[i]) * 255);
-          } else {
-            n = +parts[i];
-          }
-          str += decToHex[clamp(n, 0, 255)];
-        }
-        alpha = +parts[3];
-      } else if (/^hsl/.test(styleString)) {
-        var parts = getRgbHslContent(styleString);
-        str = hslToRgb(parts);
-        alpha = parts[3];
-      } else {
-        str = /*colorData[styleString] ||*/styleString;
-      }
-      return processStyleCache[styleString] = { color: str, alpha: alpha };
-    }
-
-    var DEFAULT_STYLE = {
-      style: 'normal',
-      variant: 'normal',
-      weight: 'normal',
-      size: 10,
-      family: 'sans-serif'
-    };
-
-    // Internal text style cache
-    //  var fontStyleCache = {};
-
-    //  function processFontStyle(styleString) {
-    //    if (fontStyleCache[styleString]) {
-    //      return fontStyleCache[styleString];
-    //    }
-
-    //    var el = document.createElement('div');
-    //    var style = el.style;
-    //    try {
-    //      style.font = styleString;
-    //    } catch (ex) {
-    //      // Ignore failures to set to invalid font.
-    //    }
-
-    //    return fontStyleCache[styleString] = {
-    //      style: style.fontStyle || DEFAULT_STYLE.style,
-    //      variant: style.fontVariant || DEFAULT_STYLE.variant,
-    //      weight: style.fontWeight || DEFAULT_STYLE.weight,
-    //      size: style.fontSize || DEFAULT_STYLE.size,
-    //      family: style.fontFamily || DEFAULT_STYLE.family
-    //    };
-    //  }
-
-    //  function getComputedStyle(style, element) {
-    //    var computedStyle = {};
-
-    //    for (var p in style) {
-    //      computedStyle[p] = style[p];
-    //    }
-
-    //    // Compute the size
-    //    var canvasFontSize = parseFloat(element.currentStyle.fontSize),
-    //        fontSize = parseFloat(style.size);
-
-    //    if (typeof style.size == 'number') {
-    //      computedStyle.size = style.size;
-    //    } else if (style.size.indexOf('px') != -1) {
-    //      computedStyle.size = fontSize;
-    //    } else if (style.size.indexOf('em') != -1) {
-    //      computedStyle.size = canvasFontSize * fontSize;
-    //    } else if(style.size.indexOf('%') != -1) {
-    //      computedStyle.size = (canvasFontSize / 100) * fontSize;
-    //    } else if (style.size.indexOf('pt') != -1) {
-    //      computedStyle.size = fontSize / .75;
-    //    } else {
-    //      computedStyle.size = canvasFontSize;
-    //    }
-
-    //    // Different scaling between normal text and VML text. This was found using
-    //    // trial and error to get the same size as non VML text.
-    //    computedStyle.size *= 0.981;
-
-    //    return computedStyle;
-    //  }
-
-    //  function buildStyle(style) {
-    //    return style.style + ' ' + style.variant + ' ' + style.weight + ' ' +
-    //        style.size + 'px ' + style.family;
-    //  }
-
-    var lineCapMap = {
-      'butt': 'flat',
-      'round': 'round'
-    };
-
-    function processLineCap(lineCap) {
-      return lineCapMap[lineCap] || 'square';
-    }
-
-    /**
-    * This class implements CanvasRenderingContext2D interface as described by
-    * the WHATWG.
-    * @param {HTMLElement} canvasElement The element that the 2D context should
-    * be associated with
-    */
-    function CanvasRenderingContext2D_(canvasElement) {
-      this.m_ = createMatrixIdentity();
-
-      this.mStack_ = [];
-      this.aStack_ = [];
-      this.currentPath_ = [];
-
-      // Canvas context properties
-      this.strokeStyle = '#000';
-      this.fillStyle = '#000';
-
-      this.lineWidth = 1;
-      this.lineJoin = 'miter';
-      this.lineCap = 'butt';
-      this.miterLimit = Z * 1;
-      this.globalAlpha = 1;
-      //this.font = '10px sans-serif';
-      //this.textAlign = 'left';
-      //this.textBaseline = 'alphabetic';
-      this.canvas = canvasElement;
-
-      var cssText = 'width:' + canvasElement.clientWidth + 'px;height:' +
-        canvasElement.clientHeight + 'px;overflow:hidden;position:absolute';
-      var el = canvasElement.ownerDocument.createElement('div');
-      el.style.cssText = cssText;
-      canvasElement.appendChild(el);
-
-      var overlayEl = el.cloneNode(false);
-      // Use a non transparent background.
-      overlayEl.style.backgroundColor = 'red';
-      overlayEl.style.filter = 'alpha(opacity=0)';
-      canvasElement.appendChild(overlayEl);
-
-      this.element_ = el;
-      this.arcScaleX_ = 1;
-      this.arcScaleY_ = 1;
-      this.lineScale_ = 1;
-    }
-
-    var contextPrototype = CanvasRenderingContext2D_.prototype;
-    contextPrototype.clearRect = function () {
-      if (this.textMeasureEl_) {
-        this.textMeasureEl_.removeNode(true);
-        this.textMeasureEl_ = null;
-      }
-      this.element_.innerHTML = '';
-    };
-
-    contextPrototype.beginPath = function () {
-      // TODO: Branch current matrix so that save/restore has no effect
-      //       as per safari docs.
-      this.currentPath_ = [];
-    };
-
-    contextPrototype.moveTo = function (aX, aY) {
-      var p = getCoords(this, aX, aY);
-      this.currentPath_.push({ type: 'moveTo', x: p.x, y: p.y });
-      this.currentX_ = p.x;
-      this.currentY_ = p.y;
-    };
-
-    contextPrototype.lineTo = function (aX, aY) {
-      var p = getCoords(this, aX, aY);
-      this.currentPath_.push({ type: 'lineTo', x: p.x, y: p.y });
-
-      this.currentX_ = p.x;
-      this.currentY_ = p.y;
-    };
-
-    contextPrototype.bezierCurveTo = function(aCP1x, aCP1y,
-                                              aCP2x, aCP2y,
-                                              aX, aY) {
-      var p = getCoords(this, aX, aY);
-      var cp1 = getCoords(this, aCP1x, aCP1y);
-      var cp2 = getCoords(this, aCP2x, aCP2y);
-      bezierCurveTo(this, cp1, cp2, p);
-    };
-
-    // Helper function that takes the already fixed cordinates.
-    function bezierCurveTo(self, cp1, cp2, p) {
-      self.currentPath_.push({
-        type: 'bezierCurveTo',
-        cp1x: cp1.x,
-        cp1y: cp1.y,
-        cp2x: cp2.x,
-        cp2y: cp2.y,
-        x: p.x,
-        y: p.y
-      });
-      self.currentX_ = p.x;
-      self.currentY_ = p.y;
-    }
-
-    contextPrototype.quadraticCurveTo = function(aCPx, aCPy, aX, aY) {
-      // the following is lifted almost directly from
-      // http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes
-
-      var cp = getCoords(this, aCPx, aCPy);
-      var p = getCoords(this, aX, aY);
-
-      var cp1 = {
-        x: this.currentX_ + 2.0 / 3.0 * (cp.x - this.currentX_),
-        y: this.currentY_ + 2.0 / 3.0 * (cp.y - this.currentY_)
-      };
-      var cp2 = {
-        x: cp1.x + (p.x - this.currentX_) / 3.0,
-        y: cp1.y + (p.y - this.currentY_) / 3.0
-      };
-
-      bezierCurveTo(this, cp1, cp2, p);
-    };
-
-    contextPrototype.arc = function (aX, aY, aRadius,
-                                  aStartAngle, aEndAngle, aClockwise) {
-      aRadius *= Z;
-      var arcType = aClockwise ? 'at' : 'wa';
-
-      var xStart = aX + mc(aStartAngle) * aRadius - Z2;
-      var yStart = aY + ms(aStartAngle) * aRadius - Z2;
-
-      var xEnd = aX + mc(aEndAngle) * aRadius - Z2;
-      var yEnd = aY + ms(aEndAngle) * aRadius - Z2;
-
-      // IE won't render arches drawn counter clockwise if xStart == xEnd.
-      if (xStart == xEnd && !aClockwise) {
-        xStart += 0.125; // Offset xStart by 1/80 of a pixel. Use something
-        // that can be represented in binary
-      }
-
-      var p = getCoords(this, aX, aY);
-      var pStart = getCoords(this, xStart, yStart);
-      var pEnd = getCoords(this, xEnd, yEnd);
-
-      this.currentPath_.push({ type: arcType,
-        x: p.x,
-        y: p.y,
-        radius: aRadius,
-        xStart: pStart.x,
-        yStart: pStart.y,
-        xEnd: pEnd.x,
-        yEnd: pEnd.y
-      });
-
-    };
-
-    //  contextPrototype.rect = function(aX, aY, aWidth, aHeight) {
-    //    this.moveTo(aX, aY);
-    //    this.lineTo(aX + aWidth, aY);
-    //    this.lineTo(aX + aWidth, aY + aHeight);
-    //    this.lineTo(aX, aY + aHeight);
-    //    this.closePath();
-    //  };
-
-    //  contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) {
-    //    var oldPath = this.currentPath_;
-    //    this.beginPath();
-
-    //    this.moveTo(aX, aY);
-    //    this.lineTo(aX + aWidth, aY);
-    //    this.lineTo(aX + aWidth, aY + aHeight);
-    //    this.lineTo(aX, aY + aHeight);
-    //    this.closePath();
-    //    this.stroke();
-
-    //    this.currentPath_ = oldPath;
-    //  };
-
-    //  contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) {
-    //    var oldPath = this.currentPath_;
-    //    this.beginPath();
-
-    //    this.moveTo(aX, aY);
-    //    this.lineTo(aX + aWidth, aY);
-    //    this.lineTo(aX + aWidth, aY + aHeight);
-    //    this.lineTo(aX, aY + aHeight);
-    //    this.closePath();
-    //    this.fill();
-
-    //    this.currentPath_ = oldPath;
-    //  };
-
-    //  contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) {
-    //    var gradient = new CanvasGradient_('gradient');
-    //    gradient.x0_ = aX0;
-    //    gradient.y0_ = aY0;
-    //    gradient.x1_ = aX1;
-    //    gradient.y1_ = aY1;
-    //    return gradient;
-    //  };
-
-    //  contextPrototype.createRadialGradient = function(aX0, aY0, aR0,
-    //                                                   aX1, aY1, aR1) {
-    //    var gradient = new CanvasGradient_('gradientradial');
-    //    gradient.x0_ = aX0;
-    //    gradient.y0_ = aY0;
-    //    gradient.r0_ = aR0;
-    //    gradient.x1_ = aX1;
-    //    gradient.y1_ = aY1;
-    //    gradient.r1_ = aR1;
-    //    return gradient;
-    //  };
-
-    //  contextPrototype.drawImage = function(image, var_args) {
-    //    var dx, dy, dw, dh, sx, sy, sw, sh;
-
-    //    // to find the original width we overide the width and height
-    //    var oldRuntimeWidth = image.runtimeStyle.width;
-    //    var oldRuntimeHeight = image.runtimeStyle.height;
-    //    image.runtimeStyle.width = 'auto';
-    //    image.runtimeStyle.height = 'auto';
-
-    //    // get the original size
-    //    var w = image.width;
-    //    var h = image.height;
-
-    //    // and remove overides
-    //    image.runtimeStyle.width = oldRuntimeWidth;
-    //    image.runtimeStyle.height = oldRuntimeHeight;
-
-    //    if (arguments.length == 3) {
-    //      dx = arguments[1];
-    //      dy = arguments[2];
-    //      sx = sy = 0;
-    //      sw = dw = w;
-    //      sh = dh = h;
-    //    } else if (arguments.length == 5) {
-    //      dx = arguments[1];
-    //      dy = arguments[2];
-    //      dw = arguments[3];
-    //      dh = arguments[4];
-    //      sx = sy = 0;
-    //      sw = w;
-    //      sh = h;
-    //    } else if (arguments.length == 9) {
-    //      sx = arguments[1];
-    //      sy = arguments[2];
-    //      sw = arguments[3];
-    //      sh = arguments[4];
-    //      dx = arguments[5];
-    //      dy = arguments[6];
-    //      dw = arguments[7];
-    //      dh = arguments[8];
-    //    } else {
-    //      throw Error('Invalid number of arguments');
-    //    }
-
-    //    var d = getCoords(this, dx, dy);
-
-    //    var w2 = sw / 2;
-    //    var h2 = sh / 2;
-
-    //    var vmlStr = [];
-
-    //    var W = 10;
-    //    var H = 10;
-
-    //    // For some reason that I've now forgotten, using divs didn't work
-    //    vmlStr.push(' <g_vml_:group',
-    //                ' coordsize="', Z * W, ',', Z * H, '"',
-    //                ' coordorigin="0,0"' ,
-    //                ' style="width:', W, 'px;height:', H, 'px;position:absolute;');
-
-    //    // If filters are necessary (rotation exists), create them
-    //    // filters are bog-slow, so only create them if abbsolutely necessary
-    //    // The following check doesn't account for skews (which don't exist
-    //    // in the canvas spec (yet) anyway.
-
-    //    if (this.m_[0][0] != 1 || this.m_[0][1] ||
-    //        this.m_[1][1] != 1 || this.m_[1][0]) {
-    //      var filter = [];
-
-    //      // Note the 12/21 reversal
-    //      filter.push('M11=', this.m_[0][0], ',',
-    //                  'M12=', this.m_[1][0], ',',
-    //                  'M21=', this.m_[0][1], ',',
-    //                  'M22=', this.m_[1][1], ',',
-    //                  'Dx=', mr(d.x / Z), ',',
-    //                  'Dy=', mr(d.y / Z), '');
-
-    //      // Bounding box calculation (need to minimize displayed area so that
-    //      // filters don't waste time on unused pixels.
-    //      var max = d;
-    //      var c2 = getCoords(this, dx + dw, dy);
-    //      var c3 = getCoords(this, dx, dy + dh);
-    //      var c4 = getCoords(this, dx + dw, dy + dh);
-
-    //      max.x = m.max(max.x, c2.x, c3.x, c4.x);
-    //      max.y = m.max(max.y, c2.y, c3.y, c4.y);
-
-    //      vmlStr.push('padding:0 ', mr(max.x / Z), 'px ', mr(max.y / Z),
-    //                  'px 0;filter:progid:DXImageTransform.Microsoft.Matrix(',
-    //                  filter.join(''), ", sizingmethod='clip');");
-
-    //    } else {
-    //      vmlStr.push('top:', mr(d.y / Z), 'px;left:', mr(d.x / Z), 'px;');
-    //    }
-
-    //    vmlStr.push(' ">' ,
-    //                '<g_vml_:image src="', image.src, '"',
-    //                ' style="width:', Z * dw, 'px;',
-    //                ' height:', Z * dh, 'px"',
-    //                ' cropleft="', sx / w, '"',
-    //                ' croptop="', sy / h, '"',
-    //                ' cropright="', (w - sx - sw) / w, '"',
-    //                ' cropbottom="', (h - sy - sh) / h, '"',
-    //                ' />',
-    //                '</g_vml_:group>');
-
-    //    this.element_.insertAdjacentHTML('BeforeEnd', vmlStr.join(''));
-    //  };
-
-    contextPrototype.stroke = function (aFill) {
-      var lineStr = [];
-      var lineOpen = false;
-
-      var W = 10;
-      var H = 10;
-
-      lineStr.push('<g_vml_:shape',
-                 ' filled="', !!aFill, '"',
-                 ' style="position:absolute;width:', W, 'px;height:', H, 'px;"',
-                 ' coordorigin="0,0"',
-                 ' coordsize="', Z * W, ',', Z * H, '"',
-                 ' stroked="', !aFill, '"',
-                 ' path="');
-
-      var newSeq = false;
-      var min = { x: null, y: null };
-      var max = { x: null, y: null };
-
-      for (var i = 0; i < this.currentPath_.length; i++) {
-        var p = this.currentPath_[i];
-        var c;
-
-        switch (p.type) {
-          case 'moveTo':
-            c = p;
-            lineStr.push(' m ', mr(p.x), ',', mr(p.y));
-            break;
-          case 'lineTo':
-            lineStr.push(' l ', mr(p.x), ',', mr(p.y));
-            break;
-          case 'close':
-            lineStr.push(' x ');
-            p = null;
-            break;
-          case 'bezierCurveTo':
-            lineStr.push(' c ',
-                       mr(p.cp1x), ',', mr(p.cp1y), ',',
-                       mr(p.cp2x), ',', mr(p.cp2y), ',',
-                       mr(p.x), ',', mr(p.y));
-            break;
-          case 'at':
-          case 'wa':
-            lineStr.push(' ', p.type, ' ',
-                       mr(p.x - this.arcScaleX_ * p.radius), ',',
-                       mr(p.y - this.arcScaleY_ * p.radius), ' ',
-                       mr(p.x + this.arcScaleX_ * p.radius), ',',
-                       mr(p.y + this.arcScaleY_ * p.radius), ' ',
-                       mr(p.xStart), ',', mr(p.yStart), ' ',
-                       mr(p.xEnd), ',', mr(p.yEnd));
-            break;
-        }
-
-
-        // TODO: Following is broken for curves due to
-        //       move to proper paths.
-
-        // Figure out dimensions so we can do gradient fills
-        // properly
-        if (p) {
-          if (min.x == null || p.x < min.x) {
-            min.x = p.x;
-          }
-          if (max.x == null || p.x > max.x) {
-            max.x = p.x;
-          }
-          if (min.y == null || p.y < min.y) {
-            min.y = p.y;
-          }
-          if (max.y == null || p.y > max.y) {
-            max.y = p.y;
-          }
-        }
-      }
-      lineStr.push(' ">');
-
-      if (!aFill) {
-        appendStroke(this, lineStr);
-      } else {
-        appendFill(this, lineStr, min, max);
-      }
-
-      lineStr.push('</g_vml_:shape>');
-
-      this.element_.insertAdjacentHTML('beforeEnd', lineStr.join(''));
-    };
-
-    function appendStroke(ctx, lineStr) {
-      var a = processStyle(ctx.strokeStyle);
-      var color = a.color;
-      var opacity = a.alpha * ctx.globalAlpha;
-      var lineWidth = ctx.lineScale_ * ctx.lineWidth;
-
-      // VML cannot correctly render a line if the width is less than 1px.
-      // In that case, we dilute the color to make the line look thinner.
-      if (lineWidth < 1) {
-        opacity *= lineWidth;
-      }
-
-      lineStr.push(
-      '<g_vml_:stroke',
-      ' opacity="', opacity, '"',
-      ' joinstyle="', ctx.lineJoin, '"',
-      ' miterlimit="', ctx.miterLimit, '"',
-      ' endcap="', processLineCap(ctx.lineCap), '"',
-      ' weight="', lineWidth, 'px"',
-      ' color="', color, '" />'
-    );
-    }
-
-    function appendFill(ctx, lineStr, min, max) {
-      var fillStyle = ctx.fillStyle;
-      var arcScaleX = ctx.arcScaleX_;
-      var arcScaleY = ctx.arcScaleY_;
-      var width = max.x - min.x;
-      var height = max.y - min.y;
-      //    if (fillStyle instanceof CanvasGradient_) {
-      //      // TODO: Gradients transformed with the transformation matrix.
-      //      var angle = 0;
-      //      var focus = {x: 0, y: 0};
-
-      //      // additional offset
-      //      var shift = 0;
-      //      // scale factor for offset
-      //      var expansion = 1;
-
-      //      if (fillStyle.type_ == 'gradient') {
-      //        var x0 = fillStyle.x0_ / arcScaleX;
-      //        var y0 = fillStyle.y0_ / arcScaleY;
-      //        var x1 = fillStyle.x1_ / arcScaleX;
-      //        var y1 = fillStyle.y1_ / arcScaleY;
-      //        var p0 = getCoords(ctx, x0, y0);
-      //        var p1 = getCoords(ctx, x1, y1);
-      //        var dx = p1.x - p0.x;
-      //        var dy = p1.y - p0.y;
-      //        angle = Math.atan2(dx, dy) * 180 / Math.PI;
-
-      //        // The angle should be a non-negative number.
-      //        if (angle < 0) {
-      //          angle += 360;
-      //        }
-
-      //        // Very small angles produce an unexpected result because they are
-      //        // converted to a scientific notation string.
-      //        if (angle < 1e-6) {
-      //          angle = 0;
-      //        }
-      //      } else {
-      //        var p0 = getCoords(ctx, fillStyle.x0_, fillStyle.y0_);
-      //        focus = {
-      //          x: (p0.x - min.x) / width,
-      //          y: (p0.y - min.y) / height
-      //        };
-
-      //        width  /= arcScaleX * Z;
-      //        height /= arcScaleY * Z;
-      //        var dimension = m.max(width, height);
-      //        shift = 2 * fillStyle.r0_ / dimension;
-      //        expansion = 2 * fillStyle.r1_ / dimension - shift;
-      //      }
-
-      //      // We need to sort the color stops in ascending order by offset,
-      //      // otherwise IE won't interpret it correctly.
-      //      var stops = fillStyle.colors_;
-      //      stops.sort(function(cs1, cs2) {
-      //        return cs1.offset - cs2.offset;
-      //      });
-
-      //      var length = stops.length;
-      //      var color1 = stops[0].color;
-      //      var color2 = stops[length - 1].color;
-      //      var opacity1 = stops[0].alpha * ctx.globalAlpha;
-      //      var opacity2 = stops[length - 1].alpha * ctx.globalAlpha;
-
-      //      var colors = [];
-      //      for (var i = 0; i < length; i++) {
-      //        var stop = stops[i];
-      //        colors.push(stop.offset * expansion + shift + ' ' + stop.color);
-      //      }
-
-      //      // When colors attribute is used, the meanings of opacity and o:opacity2
-      //      // are reversed.
-      //      lineStr.push('<g_vml_:fill type="', fillStyle.type_, '"',
-      //                   ' method="none" focus="100%"',
-      //                   ' color="', color1, '"',
-      //                   ' color2="', color2, '"',
-      //                   ' colors="', colors.join(','), '"',
-      //                   ' opacity="', opacity2, '"',
-      //                   ' g_o_:opacity2="', opacity1, '"',
-      //                   ' angle="', angle, '"',
-      //                   ' focusposition="', focus.x, ',', focus.y, '" />');
-      //    } else if (fillStyle instanceof CanvasPattern_) {
-      //      if (width && height) {
-      //        var deltaLeft = -min.x;
-      //        var deltaTop = -min.y;
-      //        lineStr.push('<g_vml_:fill',
-      //                     ' position="',
-      //                     deltaLeft / width * arcScaleX * arcScaleX, ',',
-      //                     deltaTop / height * arcScaleY * arcScaleY, '"',
-      //                     ' type="tile"',
-      //                     // TODO: Figure out the correct size to fit the scale.
-      //                     //' size="', w, 'px ', h, 'px"',
-      //                     ' src="', fillStyle.src_, '" />');
-      //       }
-      //    } else {
-      var a = processStyle(ctx.fillStyle);
-      var color = a.color;
-      var opacity = a.alpha * ctx.globalAlpha;
-      lineStr.push('<g_vml_:fill color="', color, '" opacity="', opacity,
-                   '" />');
-      //     }
-    }
-
-    contextPrototype.fill = function () {
-      this.stroke(true);
-    };
-
-    contextPrototype.closePath = function () {
-      this.currentPath_.push({ type: 'close' });
-    };
-
-    function getCoords(ctx, aX, aY) {
-      var m = ctx.m_;
-      return {
-        x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2,
-        y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2
-      };
-    };
-
-    contextPrototype.save = function () {
-      var o = {};
-      copyState(this, o);
-      this.aStack_.push(o);
-      this.mStack_.push(this.m_);
-      this.m_ = matrixMultiply(createMatrixIdentity(), this.m_);
-    };
-
-    contextPrototype.restore = function () {
-      if (this.aStack_.length) {
-        copyState(this.aStack_.pop(), this);
-        this.m_ = this.mStack_.pop();
-      }
-    };
-
-    function matrixIsFinite(m) {
-      return isFinite(m[0][0]) && isFinite(m[0][1]) &&
-        isFinite(m[1][0]) && isFinite(m[1][1]) &&
-        isFinite(m[2][0]) && isFinite(m[2][1]);
-    }
-
-    function setM(ctx, m, updateLineScale) {
-      if (!matrixIsFinite(m)) {
-        return;
-      }
-      ctx.m_ = m;
-
-      if (updateLineScale) {
-        // Get the line scale.
-        // Determinant of this.m_ means how much the area is enlarged by the
-        // transformation. So its square root can be used as a scale factor
-        // for width.
-        var det = m[0][0] * m[1][1] - m[0][1] * m[1][0];
-        ctx.lineScale_ = sqrt(abs(det));
-      }
-    }
-
-    contextPrototype.translate = function (aX, aY) {
-      var m1 = [
-      [1, 0, 0],
-      [0, 1, 0],
-      [aX, aY, 1]
-    ];
-
-      setM(this, matrixMultiply(m1, this.m_), false);
-    };
-
-    //  contextPrototype.rotate = function(aRot) {
-    //    var c = mc(aRot);
-    //    var s = ms(aRot);
-
-    //    var m1 = [
-    //      [c,  s, 0],
-    //      [-s, c, 0],
-    //      [0,  0, 1]
-    //    ];
-
-    //    setM(this, matrixMultiply(m1, this.m_), false);
-    //  };
-
-    contextPrototype.scale = function (aX, aY) {
-      this.arcScaleX_ *= aX;
-      this.arcScaleY_ *= aY;
-      var m1 = [
-      [aX, 0, 0],
-      [0, aY, 0],
-      [0, 0, 1]
-    ];
-
-      setM(this, matrixMultiply(m1, this.m_), true);
-    };
-
-    //  contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) {
-    //    var m1 = [
-    //      [m11, m12, 0],
-    //      [m21, m22, 0],
-    //      [dx,  dy,  1]
-    //    ];
-
-    //    setM(this, matrixMultiply(m1, this.m_), true);
-    //  };
-
-    //  contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) {
-    //    var m = [
-    //      [m11, m12, 0],
-    //      [m21, m22, 0],
-    //      [dx,  dy,  1]
-    //    ];
-
-    //    setM(this, m, true);
-    //  };
-
-    /**
-    * The text drawing function.
-    * The maxWidth argument isn't taken in account, since no browser supports
-    * it yet.
-    */
-    //  contextPrototype.drawText_ = function(text, x, y, maxWidth, stroke) {
-    //    var m = this.m_,
-    //        delta = 1000,
-    //        left = 0,
-    //        right = delta,
-    //        offset = {x: 0, y: 0},
-    //        lineStr = [];
-
-    //    var fontStyle = getComputedStyle(processFontStyle(this.font),
-    //                                     this.element_);
-
-    //    var fontStyleString = buildStyle(fontStyle);
-
-    //    var elementStyle = this.element_.currentStyle;
-    //    var textAlign = this.textAlign.toLowerCase();
-    //    switch (textAlign) {
-    //      case 'left':
-    //      case 'center':
-    //      case 'right':
-    //        break;
-    //      case 'end':
-    //        textAlign = elementStyle.direction == 'ltr' ? 'right' : 'left';
-    //        break;
-    //      case 'start':
-    //        textAlign = elementStyle.direction == 'rtl' ? 'right' : 'left';
-    //        break;
-    //      default:
-    //        textAlign = 'left';
-    //    }
-
-    //    // 1.75 is an arbitrary number, as there is no info about the text baseline
-    //    switch (this.textBaseline) {
-    //      case 'hanging':
-    //      case 'top':
-    //        offset.y = fontStyle.size / 1.75;
-    //        break;
-    //      case 'middle':
-    //        break;
-    //      default:
-    //      case null:
-    //      case 'alphabetic':
-    //      case 'ideographic':
-    //      case 'bottom':
-    //        offset.y = -fontStyle.size / 2.25;
-    //        break;
-    //    }
-
-    //    switch(textAlign) {
-    //      case 'right':
-    //        left = delta;
-    //        right = 0.05;
-    //        break;
-    //      case 'center':
-    //        left = right = delta / 2;
-    //        break;
-    //    }
-
-    //    var d = getCoords(this, x + offset.x, y + offset.y);
-
-    //    lineStr.push('<g_vml_:line from="', -left ,' 0" to="', right ,' 0.05" ',
-    //                 ' coordsize="100 100" coordorigin="0 0"',
-    //                 ' filled="', !stroke, '" stroked="', !!stroke,
-    //                 '" style="position:absolute;width:1px;height:1px;">');
-
-    //    if (stroke) {
-    //      appendStroke(this, lineStr);
-    //    } else {
-    //      // TODO: Fix the min and max params.
-    //      appendFill(this, lineStr, {x: -left, y: 0},
-    //                 {x: right, y: fontStyle.size});
-    //    }
-
-    //    var skewM = m[0][0].toFixed(3) + ',' + m[1][0].toFixed(3) + ',' +
-    //                m[0][1].toFixed(3) + ',' + m[1][1].toFixed(3) + ',0,0';
-
-    //    var skewOffset = mr(d.x / Z) + ',' + mr(d.y / Z);
-
-    //    lineStr.push('<g_vml_:skew on="t" matrix="', skewM ,'" ',
-    //                 ' offset="', skewOffset, '" origin="', left ,' 0" />',
-    //                 '<g_vml_:path textpathok="true" />',
-    //                 '<g_vml_:textpath on="true" string="',
-    //                 encodeHtmlAttribute(text),
-    //                 '" style="v-text-align:', textAlign,
-    //                 ';font:', encodeHtmlAttribute(fontStyleString),
-    //                 '" /></g_vml_:line>');
-
-    //    this.element_.insertAdjacentHTML('beforeEnd', lineStr.join(''));
-    //  };
-
-    //  contextPrototype.fillText = function(text, x, y, maxWidth) {
-    //    this.drawText_(text, x, y, maxWidth, false);
-    //  };
-
-    //  contextPrototype.strokeText = function(text, x, y, maxWidth) {
-    //    this.drawText_(text, x, y, maxWidth, true);
-    //  };
-
-    //  contextPrototype.measureText = function(text) {
-    //    if (!this.textMeasureEl_) {
-    //      var s = '<span style="position:absolute;' +
-    //          'top:-20000px;left:0;padding:0;margin:0;border:none;' +
-    //          'white-space:pre;"></span>';
-    //      this.element_.insertAdjacentHTML('beforeEnd', s);
-    //      this.textMeasureEl_ = this.element_.lastChild;
-    //    }
-    //    var doc = this.element_.ownerDocument;
-    //    this.textMeasureEl_.innerHTML = '';
-    //    this.textMeasureEl_.style.font = this.font;
-    //    // Don't use innerHTML or innerText because they allow markup/whitespace.
-    //    this.textMeasureEl_.appendChild(doc.createTextNode(text));
-    //    return {width: this.textMeasureEl_.offsetWidth};
-    //  };
-
-    /******** STUBS ********/
-    //  contextPrototype.clip = function() {
-    //    // TODO: Implement
-    //  };
-
-    //  contextPrototype.arcTo = function() {
-    //    // TODO: Implement
-    //  };
-
-    //  contextPrototype.createPattern = function(image, repetition) {
-    //    return new CanvasPattern_(image, repetition);
-    //  };
-
-    //  // Gradient / Pattern Stubs
-    //  function CanvasGradient_(aType) {
-    //    this.type_ = aType;
-    //    this.x0_ = 0;
-    //    this.y0_ = 0;
-    //    this.r0_ = 0;
-    //    this.x1_ = 0;
-    //    this.y1_ = 0;
-    //    this.r1_ = 0;
-    //    this.colors_ = [];
-    //  }
-
-    //  CanvasGradient_.prototype.addColorStop = function(aOffset, aColor) {
-    //    aColor = processStyle(aColor);
-    //    this.colors_.push({offset: aOffset,
-    //                       color: aColor.color,
-    //                       alpha: aColor.alpha});
-    //  };
-
-    //  function CanvasPattern_(image, repetition) {
-    //    assertImageIsValid(image);
-    //    switch (repetition) {
-    //      case 'repeat':
-    //      case null:
-    //      case '':
-    //        this.repetition_ = 'repeat';
-    //        break
-    //      case 'repeat-x':
-    //      case 'repeat-y':
-    //      case 'no-repeat':
-    //        this.repetition_ = repetition;
-    //        break;
-    //      default:
-    //        throwException('SYNTAX_ERR');
-    //    }
-
-    //    this.src_ = image.src;
-    //    this.width_ = image.width;
-    //    this.height_ = image.height;
-    //  }
-
-    function throwException(s) {
-      throw new DOMException_(s);
-    }
-
-    //  function assertImageIsValid(img) {
-    //    if (!img || img.nodeType != 1 || img.tagName != 'IMG') {
-    //      throwException('TYPE_MISMATCH_ERR');
-    //    }
-    //    if (img.readyState != 'complete') {
-    //      throwException('INVALID_STATE_ERR');
-    //    }
-    //  }
-
-    function DOMException_(s) {
-      this.code = this[s];
-      this.message = s + ': DOM Exception ' + this.code;
-    }
-    var p = DOMException_.prototype = new Error;
-    p.INDEX_SIZE_ERR = 1;
-    p.DOMSTRING_SIZE_ERR = 2;
-    p.HIERARCHY_REQUEST_ERR = 3;
-    p.WRONG_DOCUMENT_ERR = 4;
-    p.INVALID_CHARACTER_ERR = 5;
-    p.NO_DATA_ALLOWED_ERR = 6;
-    p.NO_MODIFICATION_ALLOWED_ERR = 7;
-    p.NOT_FOUND_ERR = 8;
-    p.NOT_SUPPORTED_ERR = 9;
-    p.INUSE_ATTRIBUTE_ERR = 10;
-    p.INVALID_STATE_ERR = 11;
-    p.SYNTAX_ERR = 12;
-    p.INVALID_MODIFICATION_ERR = 13;
-    p.NAMESPACE_ERR = 14;
-    p.INVALID_ACCESS_ERR = 15;
-    p.VALIDATION_ERR = 16;
-    p.TYPE_MISMATCH_ERR = 17;
-
-    // set up externs
-    G_vmlCanvasManager = G_vmlCanvasManager_;
-    CanvasRenderingContext2D = CanvasRenderingContext2D_;
-    //CanvasGradient = CanvasGradient_;
-    //CanvasPattern = CanvasPattern_;
-    DOMException = DOMException_;
-  })();
-
-} // if
-
-/*! JsRender v1.0pre: http://github.com/BorisMoore/jsrender */
-/*
- * Optimized version of jQuery Templates, for rendering to string.
- * Does not require jQuery, or HTML DOM
- * Integrates with JsViews (http://github.com/BorisMoore/jsviews)
- * Copyright 2012, Boris Moore
- * Released under the MIT License.
- */
-// informal pre beta commit counter: 3
-
-this.jsviews || this.jQuery && jQuery.views || (function( window, undefined ) {
-
-//========================== Top-level vars ==========================
-
-var versionNumber = "v1.0pre",
-
-       $, rTag, rTmplString, extend,
-       sub = {},
-       FALSE = false, TRUE = true,
-       jQuery = window.jQuery,
-
-       rPath = /^(?:null|true|false|\d[\d.]*|([\w$]+|~([\w$]+)|#(view|([\w$]+))?)([\w$.]*?)(?:[.[]([\w$]+)\]?)?|(['"]).*\8)$/g,
-       //                                 nil    object   helper    view  viewProperty pathTokens   leafToken     string
-
-       rParams = /(\()(?=|\s*\()|(?:([([])\s*)?(?:([#~]?[\w$.]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*!:?\/]|(=))\s*|([#~]?[\w$.]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*([)\]])([([]?))|(\s+)/g,
-       //          lftPrn        lftPrn2                path    operator err                                                eq         path2       prn    comma   lftPrn2   apos quot        rtPrn   prn2   space
-       // (left paren? followed by (path? followed by operator) or (path followed by paren?)) or comma or apos or quot or right paren or space
-
-    rNewLine = /\r?\n/g,
-       rUnescapeQuotes = /\\(['"])/g,
-       rEscapeQuotes = /\\?(['"])/g,
-       rBuildHash = /\x08(~)?([^\x08]+)\x08/g,
-
-       autoViewKey = 0,
-       autoTmplName = 0,
-       escapeMapForHtml = {
-               "&": "&amp;",
-               "<": "&lt;",
-               ">": "&gt;"
-       },
-       tmplAttr = "data-jsv-tmpl",
-       fnDeclStr = "var j=j||" + (jQuery ? "jQuery." : "js") + "views,",
-       htmlSpecialChar = /[\x00"&'<>]/g,
-       slice = Array.prototype.slice,
-
-       render = {},
-
-       // jsviews object ($.views if jQuery is loaded)
-       jsv = {
-               jsviews: versionNumber,
-               sub: sub, // subscription, e.g. JsViews integration
-               debugMode: TRUE,
-               err: function( e ) {
-                       return jsv.debugMode ? ("<br/><b>Error:</b> <em> " + (e.message || e) + ". </em>") : '""';
-               },
-               tmplFn: tmplFn,
-               render: render,
-               templates: templates,
-               tags: tags,
-               helpers: helpers,
-               converters: converters,
-               View: View,
-               convert: convert,
-               delimiters: setDelimiters,
-               tag: renderTag
-       };
-
-//========================== Top-level functions ==========================
-
-//===================
-// jsviews.delimiters
-//===================
-
-function setDelimiters( openChars, closeChars ) {
-       // Set the tag opening and closing delimiters. Default is "{{" and "}}"
-       // openChar, closeChars: opening and closing strings, each with two characters
-       var firstOpenChar = "\\" + openChars.charAt( 0 ), // Escape the characters - since they could be regex special characters
-               secondOpenChar = "\\" + openChars.charAt( 1 ),
-               firstCloseChar = "\\" + closeChars.charAt( 0 ),
-               secondCloseChar = "\\" + closeChars.charAt( 1 );
-       // Build regex with new delimiters
-       jsv.rTag = rTag // make rTag available to JsViews (or other components) for parsing binding expressions
-               = secondOpenChar
-                       //          tag    (followed by / space or })   or  colon     or  html or code
-               + "(?:(?:(\\w+(?=[\\/\\s" + firstCloseChar + "]))|(?:(\\w+)?(:)|(>)|(\\*)))"
-               //     params
-               + "\\s*((?:[^" + firstCloseChar + "]|" + firstCloseChar + "(?!" + secondCloseChar + "))*?)"
-               //  slash or closeBlock
-               + "(\\/)?|(?:\\/(\\w+)))"
-       //  }}
-       + firstCloseChar;
-
-       // Default rTag:    tag          converter colon  html  code     params         slash   closeBlock
-       //          /{{(?:(?:(\w+(?=[\/\s\}]))|(?:(\w+)?(:)|(>)|(\*)))\s*((?:[^}]|}(?!\}))*?)(\/)?|(?:\/(\w+)))}}
-
-       //      /{{(?:(?:(\w+(?=[\/!\s\}!]))|(?:(\w+)?(:)|(>)|(\*)))((?:[^\}]|}(?!}))*?)(\/)?|(?:\/(\w+)))}}/g;
-       rTag = new RegExp( firstOpenChar + rTag + secondCloseChar, "g" );
-       rTmplString = new RegExp( "<.*>|" + openChars + ".*" + closeChars );
-       return this;
-}
-
-//=================
-// View.hlp
-//=================
-
-function getHelper( helper ) {
-       // Helper method called as view.hlp() from compiled template, for helper functions or template parameters ~foo
-       var view = this,
-       tmplHelpers = view.tmpl.helpers || {};
-       helper = (view.ctx[ helper ] !== undefined ? view.ctx : tmplHelpers[ helper ] !== undefined ? tmplHelpers : helpers[ helper ] !== undefined ? helpers : {})[ helper ];
-       return typeof helper !== "function" ? helper : function() {
-               return helper.apply(view, arguments);
-       };
-}
-
-//=================
-// jsviews.convert
-//=================
-
-function convert( converter, view, text ) {
-       var tmplConverters = view.tmpl.converters;
-       converter = tmplConverters && tmplConverters[ converter ] || converters[ converter ];
-       return converter ? converter.call( view, text ) : text;
-}
-
-//=================
-// jsviews.tag
-//=================
-
-function renderTag( tag, parentView, converter, content, tagObject ) {
-       // Called from within compiled template function, to render a nested tag
-       // Returns the rendered tag
-       tagObject.props = tagObject.props || {};
-       var ret,
-               tmpl = tagObject.props.tmpl,
-               tmplTags = parentView.tmpl.tags,
-               nestedTemplates = parentView.tmpl.templates,
-               args = arguments,
-               tagFn = tmplTags && tmplTags[ tag ] || tags[ tag ];
-
-       if ( !tagFn ) {
-               return "";
-       }
-       // Set the tmpl property to the content of the block tag, unless set as an override property on the tag
-       content = content && parentView.tmpl.tmpls[ content - 1 ];
-       tmpl = tmpl || content || undefined;
-       tagObject.tmpl =
-               "" + tmpl === tmpl // if a string
-                       ? nestedTemplates && nestedTemplates[ tmpl ] || templates[ tmpl ] || templates( tmpl )
-                       : tmpl;
-
-       tagObject.isTag = TRUE;
-       tagObject.converter = converter;
-       tagObject.view = parentView;
-       tagObject.renderContent = renderContent;
-       if ( parentView.ctx ) {
-               extend( tagObject.ctx, parentView.ctx);
-       }
-
-       ret = tagFn.apply( tagObject, args.length > 5 ? slice.call( args, 5 ) : [] );
-       return ret || ( ret == undefined ? "" : ret.toString()); // (If ret is the value 0 or false, will render to string)
-}
-
-//=================
-// View constructor
-//=================
-
-function View( context, path, parentView, data, template, index ) {
-       // Constructor for view object in view hierarchy. (Augmented by JsViews if JsViews is loaded)
-       var views = parentView.views,
-//     TODO: add this, as part of smart re-linking on existing content ($.link method), or remove completely
-//                     self = parentView.views[ index ];
-//                     if ( !self ) { ... }
-               self = {
-                       tmpl: template,
-                       path: path,
-                       parent: parentView,
-                       data: data,
-                       ctx: context,
-                       views: $.isArray( data ) ? [] : {},
-                       hlp: getHelper
-               };
-
-       if ( $.isArray( views ))  {
-               views.splice(
-                       self.index = index !== undefined
-                               ? index
-                               : views.length, 0, self
-               );
-       } else {
-               views[ self.index = "_" + autoViewKey++ ] = self;
-       }
-       return self;
-}
-
-//=================
-// Registration
-//=================
-
-function addToStore( self, store, name, item, process ) {
-       // Add item to named store such as templates, helpers, converters...
-       var key, onStore;
-       if ( name && typeof name === "object" && !name.nodeType ) {
-               // If name is a map, iterate over map and call store for key
-               for ( key in name ) {
-                       store( key, name[ key ]);
-               }
-               return self;
-       }
-       if ( !name || item === undefined ) {
-               if ( process ) {
-                       item = process( undefined, item || name );
-               }
-       } else if ( "" + name === name ) { // name must be a string
-               if ( item === null ) {
-                       // If item is null, delete this entry
-                       delete store[name];
-               } else if ( item = process ? process( name, item ) : item ) {
-                       store[ name ] = item;
-               }
-       }
-       if ( onStore = sub.onStoreItem ) {
-               // e.g. JsViews integration
-               onStore( store, name, item, process );
-       }
-       return item;
-}
-
-function templates( name, tmpl ) {
-       // Register templates
-       // Setter: Use $.view.tags( name, tagFn ) or $.view.tags({ name: tagFn, ... }) to add additional tags to the registered tags collection.
-       // Getter: Use var tagFn = $.views.tags( name ) or $.views.tags[name] or $.views.tags.name to return the function for the registered tag.
-       // Remove: Use $.view.tags( name, null ) to remove a registered tag from $.view.tags.
-
-       // When registering for {{foo a b c==d e=f}}, tagFn should be a function with the signature:
-       // function(a,b). The 'this' pointer will be a hash with properties c and e.
-       return addToStore( this, templates, name, tmpl, compile );
-}
-
-function tags( name, tagFn ) {
-       // Register template tags
-       // Setter: Use $.view.tags( name, tagFn ) or $.view.tags({ name: tagFn, ... }) to add additional tags to the registered tags collection.
-       // Getter: Use var tagFn = $.views.tags( name ) or $.views.tags[name] or $.views.tags.name to return the function for the registered tag.
-       // Remove: Use $.view.tags( name, null ) to remove a registered tag from $.view.tags.
-
-       // When registering for {{foo a b c==d e=f}}, tagFn should be a function with the signature:
-       // function(a,b). The 'this' pointer will be a hash with properties c and e.
-       return addToStore( this, tags, name, tagFn );
-}
-
-function helpers( name, helperFn ) {
-       // Register helper functions for use in templates (or in data-link expressions if JsViews is loaded)
-       // Setter: Use $.view.helpers( name, helperFn ) or $.view.helpers({ name: helperFn, ... }) to add additional helpers to the registered helpers collection.
-       // Getter: Use var helperFn = $.views.helpers( name ) or $.views.helpers[name] or $.views.helpers.name to return the function.
-       // Remove: Use $.view.helpers( name, null ) to remove a registered helper function from $.view.helpers.
-       // Within a template, access the helper using the syntax: {{... ~myHelper(...) ...}}.
-       return addToStore( this, helpers, name, helperFn );
-}
-
-function converters( name, converterFn ) {
-       // Register converter functions for use in templates (or in data-link expressions if JsViews is loaded)
-       // Setter: Use $.view.converters( name, converterFn ) or $.view.converters({ name: converterFn, ... }) to add additional converters to the registered converters collection.
-       // Getter: Use var converterFn = $.views.converters( name ) or $.views.converters[name] or $.views.converters.name to return the converter function.
-       // Remove: Use $.view.converters( name, null ) to remove a registered converter from $.view.converters.
-       // Within a template, access the converter using the syntax: {{myConverter:...}}.
-       return addToStore( this, converters, name, converterFn );
-}
-
-//=================
-// renderContent
-//=================
-
-function renderContent( data, context, parentView, path, index ) {
-       // Render template against data as a tree of subviews (nested template), or as a string (top-level template).
-       // tagName parameter for internal use only. Used for rendering templates registered as tags (which may have associated presenter objects)
-       var i, l, dataItem, newView, itemWrap, itemsWrap, itemResult, parentContext, tmpl, layout,
-               props = {},
-               swapContent = index === TRUE,
-               self = this,
-               result = "";
-
-       if ( self.isTag ) {
-               // This is a call from renderTag
-               tmpl = self.tmpl;
-               context = context || self.ctx;
-               parentView = parentView || self.view;
-               path = path || self.path;
-               index = index || self.index;
-               props = self.props;
-       } else {
-               tmpl = self.jquery && self[0] // This is a call $.fn.render
-                       || self; // This is a call from tmpl.render
-       }
-       parentView = parentView || jsv.topView;
-       parentContext = parentView.ctx;
-       layout = tmpl.layout;
-       if ( data === parentView ) {
-               // Inherit the data from the parent view.
-               // This may be the contents of an {{if}} block
-               data = parentView.data;
-               layout = TRUE;
-       }
-
-       // Set additional context on views created here, (as modified context inherited from the parent, and be inherited by child views)
-       // Note: If no jQuery, extend does not support chained copies - so limit extend() to two parameters
-       context = (context && context === parentContext)
-               ? parentContext
-               : (parentContext
-                       // if parentContext, make copy
-                       ? ((parentContext = extend( {}, parentContext ), context)
-                               // If context, merge context with copied parentContext
-                               ? extend( parentContext, context )
-                               : parentContext)
-                       // if no parentContext, use context, or default to {}
-                       : context || {});
-
-       if ( props.link === FALSE ) {
-               // Override inherited value of link by an explicit setting in props: link=false
-               // The child views of an unlinked view are also unlinked. So setting child back to true will not have any effect.
-               context.link = FALSE;
-       }
-       if ( !tmpl.fn ) {
-               tmpl = templates[ tmpl ] || templates( tmpl );
-       }
-       itemWrap = context.link && sub.onRenderItem;
-       itemsWrap = context.link && sub.onRenderItems;
-
-       if ( tmpl ) {
-               if ( $.isArray( data ) && !layout ) {
-                       // Create a view for the array, whose child views correspond to each data item.
-                       // (Note: if index and parentView are passed in along with parent view, treat as
-                       // insert -e.g. from view.addViews - so parentView is already the view item for array)
-                       newView = swapContent ? parentView : (index !== undefined && parentView) || View( context, path, parentView, data, tmpl, index );
-
-                       for ( i = 0, l = data.length; i < l; i++ ) {
-                               // Create a view for each data item.
-                               dataItem = data[ i ];
-                               itemResult = tmpl.fn( dataItem, View( context, path, newView, dataItem, tmpl, (index||0) + i ), jsv );
-                               result += itemWrap ? itemWrap( itemResult, props ) : itemResult;
-                       }
-               } else {
-                       // Create a view for singleton data object.
-                       newView = swapContent ? parentView : View( context, path, parentView, data, tmpl, index );
-                       result += (data || layout) ? tmpl.fn( data, newView, jsv ) : "";
-               }
-               parentView.topKey = newView.index;
-               return itemsWrap ? itemsWrap( result, path, newView.index, tmpl, props ) : result;
-       }
-       return ""; // No tmpl. Could throw...
-}
-
-//===========================
-// Build and compile template
-//===========================
-
-// Generate a reusable function that will serve to render a template against data
-// (Compile AST then build template function)
-
-function syntaxError() {
-       throw "Syntax error";
-}
-
-function tmplFn( markup, tmpl, bind ) {
-       // Compile markup to AST (abtract syntax tree) then build the template function code from the AST nodes
-       // Used for compiling templates, and also by JsViews to build functions for data link expressions
-       var newNode, node, i, l, code, hasTag, hasEncoder, getsValue, hasConverter, hasViewPath, tag, converter, params, hash, nestedTmpl, allowCode,
-               tmplOptions = tmpl ? {
-                       allowCode: allowCode = tmpl.allowCode,
-                       debug: tmpl.debug
-               } : {},
-               nested = tmpl && tmpl.tmpls,
-               astTop = [],
-               loc = 0,
-               stack = [],
-               content = astTop,
-               current = [,,,astTop],
-               nestedIndex = 0;
-
-       //==== nested functions ====
-       function pushPreceedingContent( shift ) {
-               shift -= loc;
-               if ( shift ) {
-                       content.push( markup.substr( loc, shift ).replace( rNewLine, "\\n" ));
-               }
-       }
-
-       function parseTag( all, tagName, converter, colon, html, code, params, slash, closeBlock, index ) {
-               //                  tag           converter colon  html  code     params         slash   closeBlock
-               //      /{{(?:(?:(\w+(?=[\/!\s\}!]))|(?:(\w+)?(:)|(?:(>)|(\*)))((?:[^\}]|}(?!}))*?)(\/)?|(?:\/(\w+)))}}/g;
-               // Build abstract syntax tree (AST): [ tagName, converter, params, content, hash, contentMarkup ]
-               if ( html ) {
-                       colon = ":";
-                       converter = "html";
-               }
-               var hash = "",
-                       passedCtx = "",
-                       block = !slash && !colon; // Block tag if not self-closing and not {{:}} or {{>}} (special case)
-
-               //==== nested helper function ====
-
-               tagName = tagName || colon;
-               pushPreceedingContent( index );
-               loc = index + all.length; // location marker - parsed up to here
-               if ( code ) {
-                       if ( allowCode ) {
-                               content.push([ "*", params.replace( rUnescapeQuotes, "$1" ) ]);
-                       }
-               } else if ( tagName ) {
-                       if ( tagName === "else" ) {
-                               current[ 5 ] = markup.substring( current[ 5 ], index ); // contentMarkup for block tag
-                               current = stack.pop();
-                               content = current[ 3 ];
-                               block = TRUE;
-                       }
-                       params = (params
-                               ? parseParams( params, bind )
-                                       .replace( rBuildHash, function( all, isCtx, keyValue ) {
-                                               if ( isCtx ) {
-                                                       passedCtx += keyValue + ",";
-                                               } else {
-                                                       hash += keyValue + ",";
-                                               }
-                                               return "";
-                                       })
-                               : "");
-                       hash = hash.slice( 0, -1 );
-                       params = params.slice( 0, -1 );
-                       newNode = [
-                               tagName,
-                               converter || "",
-                               params,
-                               block && [],
-                               "{" + (hash ? ("props:{" + hash + "},"): "") + "path:'" + params + "'" + (passedCtx ? ",ctx:{" + passedCtx.slice( 0, -1 ) + "}" : "") + "}"
-                       ];
-                       if ( block ) {
-                               stack.push( current );
-                               current = newNode;
-                               current[ 5 ] = loc; // Store current location of open tag, to be able to add contentMarkup when we reach closing tag
-                       }
-                       content.push( newNode );
-               } else if ( closeBlock ) {
-                       //if ( closeBlock !== current[ 0 ]) {
-                       //      throw "unmatched close tag: /" + closeBlock + ". Expected /" + current[ 0 ];
-                       //}
-                       current[ 5 ] = markup.substring( current[ 5 ], index ); // contentMarkup for block tag
-                       current = stack.pop();
-               }
-               if ( !current ) {
-                       throw "Expected block tag";
-               }
-               content = current[ 3 ];
-       }
-       //==== /end of nested functions ====
-
-       markup = markup.replace( rEscapeQuotes, "\\$1" );
-
-       // Build the AST (abstract syntax tree) under astTop
-       markup.replace( rTag, parseTag );
-
-       pushPreceedingContent( markup.length );
-
-       // Use the AST (astTop) to build the template function
-       l = astTop.length;
-       code = (l ? "" : '"";');
-
-       for ( i = 0; i < l; i++ ) {
-               // AST nodes: [ tagName, converter, params, content, hash, contentMarkup ]
-               node = astTop[ i ];
-               if ( node[ 0 ] === "*" ) {
-                       code = code.slice( 0, i ? -1 : -3 ) + ";" + node[ 1 ] + (i + 1 < l ? "ret+=" : "");
-               } else if ( "" + node === node ) { // type string
-                       code += '"' + node + '"+';
-               } else {
-                       tag = node[ 0 ];
-                       converter = node[ 1 ];
-                       params = node[ 2 ];
-                       content = node[ 3 ];
-                       hash = node[ 4 ];
-                       markup = node[ 5 ];
-                       if ( content ) {
-                               // Create template object for nested template
-                               nestedTmpl = TmplObject( markup, tmplOptions, tmpl, nestedIndex++ );
-                               // Compile to AST and then to compiled function
-                               tmplFn( markup, nestedTmpl);
-                               nested.push( nestedTmpl );
-                       }
-                       hasViewPath = hasViewPath || hash.indexOf( "view" ) > -1;
-                       code += (tag === ":"
-                               ? (converter === "html"
-                                       ? (hasEncoder = TRUE, "e(" + params)
-                                       : converter
-                                               ? (hasConverter = TRUE, 'c("' + converter + '",view,' + params)
-                                               : (getsValue = TRUE, "((v=" + params + ')!=u?v:""')
-                               )
-                               : (hasTag = TRUE, 't("' + tag + '",view,"' + (converter || "") + '",'
-                                       + (content ? nested.length : '""') // For block tags, pass in the key (nested.length) to the nested content template
-                                       + "," + hash + (params ? "," : "") + params))
-                                       + ")+";
-               }
-       }
-       code =  new Function( "data, view, j, b, u", fnDeclStr
-               + (getsValue ? "v," : "")
-               + (hasTag ? "t=j.tag," : "")
-               + (hasConverter ? "c=j.convert," : "")
-               + (hasEncoder ? "e=j.converters.html," : "")
-               + "ret; try{\n\n"
-               + (tmplOptions.debug ? "debugger;" : "")
-               + (allowCode ? 'ret=' : 'return ')
-               + code.slice( 0, -1 ) + ";\n\n"
-               + (allowCode ? "return ret;" : "")
-               + "}catch(e){return j.err(e);}"
-       );
-
-       // Include only the var references that are needed in the code
-       if ( tmpl ) {
-               tmpl.fn = code;
-               tmpl.useVw = hasConverter || hasViewPath || hasTag;
-       }
-       return code;
-}
-
-function parseParams( params, bind ) {
-       var named,
-               fnCall = {},
-               parenDepth = 0,
-               quoted = FALSE, // boolean for string content in double quotes
-               aposed = FALSE; // or in single quotes
-
-       function parseTokens( all, lftPrn0, lftPrn, path, operator, err, eq, path2, prn, comma, lftPrn2, apos, quot, rtPrn, prn2, space ) {
-               // rParams = /(?:([([])\s*)?(?:([#~]?[\w$.]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*!:?\/]|(=))\s*|([#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*([)\]])([([]?))|(\s+)/g,
-               //            lftPrn                  path    operator err                                                eq         path2       prn    comma   lftPrn3   apos quot        rtPrn   prn2   space
-               // (left paren? followed by (path? followed by operator) or (path followed by paren?)) or comma or apos or quot or right paren or space
-               operator = operator || "";
-               lftPrn = lftPrn || lftPrn0 || lftPrn2;
-               path = path || path2;
-               prn = prn || prn2 || "";
-               operator = operator || "";
-
-               function parsePath( all, object, helper, view, viewProperty, pathTokens, leafToken ) {
-               // rPath = /^(?:null|true|false|\d[\d.]*|([\w$]+|~([\w$]+)|#(view|([\w$]+))?)([\w$.]*?)(?:[.[]([\w$]+)\]?)?|(['"]).*\8)$/g,
-               //                                        object   helper    view  viewProperty pathTokens   leafToken     string
-                       if ( object ) {
-                               var ret = (helper
-                                       ? 'view.hlp("' + helper + '")'
-                                       : view
-                                               ? "view"
-                                               : "data")
-                               + (leafToken
-                                       ? (viewProperty
-                                               ? "." + viewProperty
-                                               : helper
-                                                       ? ""
-                                                       : (view ? "" : "." + object)
-                                               ) + (pathTokens || "")
-                                       : (leafToken = helper ? "" : view ? viewProperty || "" : object, ""));
-
-                               if ( bind && prn !== "(" ) {
-                                       ret = "b(" + ret + ',"' + leafToken + '")';
-                               }
-                               return ret + (leafToken ? "." + leafToken : "");
-                       }
-                       return all;
-               }
-
-               if ( err ) {
-                       syntaxError();
-               } else {
-                       return (aposed
-                               // within single-quoted string
-                               ? (aposed = !apos, (aposed ? all : '"'))
-                               : quoted
-                                       // within double-quoted string
-                                       ? (quoted = !quot, (quoted ? all : '"'))
-                                       :
-                               (
-                                       (lftPrn
-                                                       ? (parenDepth++, lftPrn)
-                                                       : "")
-                                       + (space
-                                               ? (parenDepth
-                                                       ? ""
-                                                       : named
-                                                               ? (named = FALSE, "\b")
-                                                               : ","
-                                               )
-                                               : eq
-                                                       // named param
-                                                       ? (parenDepth && syntaxError(), named = TRUE, '\b' + path + ':')
-                                                       : path
-                                                               // path
-                                                               ? (path.replace( rPath, parsePath )
-                                                                       + (prn
-                                                                               ? (fnCall[ ++parenDepth ] = TRUE, prn)
-                                                                               : operator)
-                                                               )
-                                                               : operator
-                                                                       ? all
-                                                                       : rtPrn
-                                                                               // function
-                                                                               ? ((fnCall[ parenDepth-- ] = FALSE, rtPrn)
-                                                                                       + (prn
-                                                                                               ? (fnCall[ ++parenDepth ] = TRUE, prn)
-                                                                                               : "")
-                                                                               )
-                                                                               : comma
-                                                                                       ? (fnCall[ parenDepth ] || syntaxError(), ",") // We don't allow top-level literal arrays or objects
-                                                                                       : lftPrn0
-                                                                                               ? ""
-                                                                                               : (aposed = apos, quoted = quot, '"')
-                               ))
-                       );
-               }
-       }
-       params = (params + " " ).replace( rParams, parseTokens );
-       return params;
-}
-
-function compile( name, tmpl, parent, options ) {
-       // tmpl is either a template object, a selector for a template script block, the name of a compiled template, or a template object
-       // options is the set of template properties, c
-       var tmplOrMarkup, elem, key, nested, nestedItem;
-
-       //==== nested functions ====
-       function tmplOrMarkupFromStr( value ) {
-               // If value is of type string - treat as selector, or name of compiled template
-               // Return the template object, if already compiled, or the markup string
-
-               if ( ("" + value === value) || value.nodeType > 0 ) {
-                       // If selector is valid and returns at least one element, get first element
-                       elem = value.nodeType > 0 ? value : !rTmplString.test( value ) && jQuery && jQuery( value )[0];
-                       if ( elem && elem.type ) {
-                               // It is a script element
-                               // Create a name for data linking if none provided
-                               value = templates[ elem.getAttribute( tmplAttr )];
-                               if ( !value ) {
-                                       // Not already compiled and cached, so compile and cache the name
-                                       name = name || "_" + autoTmplName++;
-                                       elem.setAttribute( tmplAttr, name );
-                                       value = compile( name, elem.innerHTML, parent, options ); // Use tmpl as options
-                                       templates[ name ] = value;
-                               }
-                       }
-                       return value;
-               }
-               // If value is not a string or dom element, return undefined
-       }
-
-       //==== Compile the template ====
-       tmplOrMarkup = tmplOrMarkupFromStr( tmpl );
-
-       // If tmpl is a template object, use it for options
-       options = options || (tmpl.markup ? tmpl : {});
-       options.name = name;
-       nested = options.templates;
-
-       // If tmpl is not a markup string or a selector string, then it must be a template object
-       // In that case, get it from the markup property of the object
-       if ( !tmplOrMarkup && tmpl.markup && (tmplOrMarkup = tmplOrMarkupFromStr( tmpl.markup ))) {
-               if ( tmplOrMarkup.fn && (tmplOrMarkup.debug !== tmpl.debug || tmplOrMarkup.allowCode !== tmpl.allowCode )) {
-                       // if the string references a compiled template object, but the debug or allowCode props are different, need to recompile
-                       tmplOrMarkup = tmplOrMarkup.markup;
-               }
-       }
-       if ( tmplOrMarkup !== undefined ) {
-               if ( name && !parent ) {
-                       render[ name ] = function() {
-                               return tmpl.render.apply( tmpl, arguments );
-                       };
-               }
-               if ( tmplOrMarkup.fn || tmpl.fn ) {
-                       // tmpl is already compiled, so use it, or if different name is provided, clone it
-                       if ( tmplOrMarkup.fn ) {
-                               if ( name && name !== tmplOrMarkup.name ) {
-                                       tmpl = extend( extend( {}, tmplOrMarkup ), options);
-                               } else {
-                                       tmpl = tmplOrMarkup;
-                               }
-                       }
-               } else {
-                       // tmplOrMarkup is a markup string, not a compiled template
-                       // Create template object
-                       tmpl = TmplObject( tmplOrMarkup, options, parent, 0 );
-                       // Compile to AST and then to compiled function
-                       tmplFn( tmplOrMarkup, tmpl );
-               }
-               for ( key in nested ) {
-                       // compile nested template declarations
-                       nestedItem = nested[ key ];
-                       if ( nestedItem.name !== key ) {
-                               nested[ key ] = compile( key, nestedItem, tmpl );
-                       }
-               }
-               return tmpl;
-       }
-}
-//==== /end of function compile ====
-
-function TmplObject( markup, options, parent, index ) {
-       // Template object constructor
-
-       // nested helper function
-       function extendStore( storeName ) {
-               if ( parent[ storeName ]) {
-                       // Include parent items except if overridden by item of same name in options
-                       tmpl[ storeName ] = extend( extend( {}, parent[ storeName ] ), options[ storeName ] );
-               }
-       }
-
-       options = options || {};
-       var tmpl = {
-                       markup: markup,
-                       tmpls: [],
-                       links: [],
-                       render: renderContent
-               };
-       if ( parent ) {
-               if ( parent.templates ) {
-                       tmpl.templates = extend( extend( {}, parent.templates ), options.templates );
-               }
-               tmpl.parent = parent;
-               tmpl.name = parent.name + "[" + index + "]";
-               tmpl.index = index;
-       }
-
-       extend( tmpl, options );
-       if ( parent ) {
-               extendStore( "templates" );
-               extendStore( "tags" );
-               extendStore( "helpers" );
-               extendStore( "converters" );
-       }
-       return tmpl;
-}
-
-//========================== Initialize ==========================
-
-if ( jQuery ) {
-       ////////////////////////////////////////////////////////////////////////////////////////////////
-       // jQuery is loaded, so make $ the jQuery object
-       $ = jQuery;
-       $.templates = templates;
-       $.render = render;
-       $.views = jsv;
-       $.fn.render = renderContent;
-
-} else {
-       ////////////////////////////////////////////////////////////////////////////////////////////////
-       // jQuery is not loaded.
-
-       $ = window.jsviews = jsv;
-       $.extend = function( target, source ) {
-               var name;
-               target =  target || {};
-               for ( name in source ) {
-                       target[ name ] = source[ name ];
-               }
-               return target;
-       };
-
-       $.isArray = Array && Array.isArray || function( obj ) {
-               return Object.prototype.toString.call( obj ) === "[object Array]";
-       };
-}
-
-extend = $.extend;
-
-jsv.topView = { views: {}, tmpl: {}, hlp: getHelper, ctx: jsv.helpers };
-
-function replacerForHtml( ch ) {
-       // Original code from Mike Samuel <msamuel@google.com>
-       return escapeMapForHtml[ ch ]
-               // Intentional assignment that caches the result of encoding ch.
-               || (escapeMapForHtml[ ch ] = "&#" + ch.charCodeAt( 0 ) + ";");
-}
-
-//========================== Register tags ==========================
-
-tags({
-       "if": function() {
-               var ifTag = this,
-                       view = ifTag.view;
-
-               view.onElse = function( tagObject, args ) {
-                       var i = 0,
-                               l = args.length;
-
-                       while ( l && !args[ i++ ]) {
-                               // Only render content if args.length === 0 (i.e. this is an else with no condition) or if a condition argument is truey
-                               if ( i === l ) {
-                                       return "";
-                               }
-                       }
-                       view.onElse = undefined; // If condition satisfied, so won't run 'else'.
-                       tagObject.path = "";
-                       return tagObject.renderContent( view );
-                       // Test is satisfied, so render content, while remaining in current data context
-                       // By passing the view, we inherit data context from the parent view, and the content is treated as a layout template
-                       // (so if the data is an array, it will not iterate over the data
-               };
-               return view.onElse( this, arguments );
-       },
-       "else": function() {
-               var view = this.view;
-               return view.onElse ? view.onElse( this, arguments ) : "";
-       },
-       "for": function() {
-               var i,
-                       self = this,
-                       result = "",
-                       args = arguments,
-                       l = args.length;
-               if ( self.props.layout ) {
-                       self.tmpl.layout = TRUE;
-               }
-               for ( i = 0; i < l; i++ ) {
-                       result += self.renderContent( args[ i ]);
-               }
-               return result;
-       },
-       "=": function( value ) {
-               return value;
-       },
-       "*": function( value ) {
-               return value;
-       }
-});
-
-//========================== Register global helpers ==========================
-
-//     helpers({ // Global helper functions
-//             // TODO add any useful built-in helper functions
-//     });
-
-//========================== Register converters ==========================
-
-converters({
-       html: function( text ) {
-               // HTML encoding helper: Replace < > & and ' and " by corresponding entities.
-               // inspired by Mike Samuel <msamuel@google.com>
-               return text != undefined ? String( text ).replace( htmlSpecialChar, replacerForHtml ) : "";
-       }
-});
-
-//========================== Define default delimiters ==========================
-setDelimiters( "{{", "}}" );
-
-})( this );
-
-/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
- * Licensed under the MIT License (LICENSE.txt).
- *
- * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
- * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
- * Thanks to: Seamus Leahy for adding deltaX and deltaY
- *
- * Version: 3.0.6
- * 
- * Requires: 1.2.2+
- */
-
-(function($) {
-
-var types = ['DOMMouseScroll', 'mousewheel'];
-
-if ($.event.fixHooks) {
-    for ( var i=types.length; i; ) {
-        $.event.fixHooks[ types[--i] ] = $.event.mouseHooks;
-    }
-}
-
-$.event.special.mousewheel = {
-    setup: function() {
-        if ( this.addEventListener ) {
-            for ( var i=types.length; i; ) {
-                this.addEventListener( types[--i], handler, false );
-            }
-        } else {
-            this.onmousewheel = handler;
-        }
-    },
-    
-    teardown: function() {
-        if ( this.removeEventListener ) {
-            for ( var i=types.length; i; ) {
-                this.removeEventListener( types[--i], handler, false );
-            }
-        } else {
-            this.onmousewheel = null;
-        }
-    }
-};
-
-$.fn.extend({
-    mousewheel: function(fn) {
-        return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
-    },
-    
-    unmousewheel: function(fn) {
-        return this.unbind("mousewheel", fn);
-    }
-});
-
-
-function handler(event) {
-    var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
-    event = $.event.fix(orgEvent);
-    event.type = "mousewheel";
-    
-    // Old school scrollwheel delta
-    if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; }
-    if ( orgEvent.detail     ) { delta = -orgEvent.detail/3; }
-    
-    // New school multidimensional scroll (touchpads) deltas
-    deltaY = delta;
-    
-    // Gecko
-    if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
-        deltaY = 0;
-        deltaX = -1*delta;
-    }
-    
-    // Webkit
-    if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }
-    if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
-    
-    // Add event and delta to the front of the arguments
-    args.unshift(event, delta, deltaX, deltaY);
-    
-    return ($.event.dispatch || $.event.handle).apply(this, args);
-}
-
-})(jQuery);
-
-/*!
- * jQuery UI Widget 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Widget
- */
-
-if ( ! $.widget ) {
-
-(function( $, undefined ) {
-
-// jQuery 1.4+
-if ( $.cleanData ) {
-       var _cleanData = $.cleanData;
-       $.cleanData = function( elems ) {
-               for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
-                       try {
-                               $( elem ).triggerHandler( "remove" );
-                       // http://bugs.jquery.com/ticket/8235
-                       } catch( e ) {}
-               }
-               _cleanData( elems );
-       };
-} else {
-       var _remove = $.fn.remove;
-       $.fn.remove = function( selector, keepData ) {
-               return this.each(function() {
-                       if ( !keepData ) {
-                               if ( !selector || $.filter( selector, [ this ] ).length ) {
-                                       $( "*", this ).add( [ this ] ).each(function() {
-                                               try {
-                                                       $( this ).triggerHandler( "remove" );
-                                               // http://bugs.jquery.com/ticket/8235
-                                               } catch( e ) {}
-                                       });
-                               }
-                       }
-                       return _remove.call( $(this), selector, keepData );
-               });
-       };
-}
-
-$.widget = function( name, base, prototype ) {
-       var namespace = name.split( "." )[ 0 ],
-               fullName;
-       name = name.split( "." )[ 1 ];
-       fullName = namespace + "-" + name;
-
-       if ( !prototype ) {
-               prototype = base;
-               base = $.Widget;
-       }
-
-       // create selector for plugin
-       $.expr[ ":" ][ fullName ] = function( elem ) {
-               return !!$.data( elem, name );
-       };
-
-       $[ namespace ] = $[ namespace ] || {};
-       $[ namespace ][ name ] = function( options, element ) {
-               // allow instantiation without initializing for simple inheritance
-               if ( arguments.length ) {
-                       this._createWidget( options, element );
-               }
-       };
-
-       var basePrototype = new base();
-       // we need to make the options hash a property directly on the new instance
-       // otherwise we'll modify the options hash on the prototype that we're
-       // inheriting from
-//     $.each( basePrototype, function( key, val ) {
-//             if ( $.isPlainObject(val) ) {
-//                     basePrototype[ key ] = $.extend( {}, val );
-//             }
-//     });
-       basePrototype.options = $.extend( true, {}, basePrototype.options );
-       $[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
-               namespace: namespace,
-               widgetName: name,
-               widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
-               widgetBaseClass: fullName
-       }, prototype );
-
-       $.widget.bridge( name, $[ namespace ][ name ] );
-};
-
-$.widget.bridge = function( name, object ) {
-       $.fn[ name ] = function( options ) {
-               var isMethodCall = typeof options === "string",
-                       args = Array.prototype.slice.call( arguments, 1 ),
-                       returnValue = this;
-
-               // allow multiple hashes to be passed on init
-               options = !isMethodCall && args.length ?
-                       $.extend.apply( null, [ true, options ].concat(args) ) :
-                       options;
-
-               // prevent calls to internal methods
-               if ( isMethodCall && options.charAt( 0 ) === "_" ) {
-                       return returnValue;
-               }
-
-               if ( isMethodCall ) {
-                       this.each(function() {
-                               var instance = $.data( this, name ),
-                                       methodValue = instance && $.isFunction( instance[options] ) ?
-                                               instance[ options ].apply( instance, args ) :
-                                               instance;
-                               // TODO: add this back in 1.9 and use $.error() (see #5972)
-//                             if ( !instance ) {
-//                                     throw "cannot call methods on " + name + " prior to initialization; " +
-//                                             "attempted to call method '" + options + "'";
-//                             }
-//                             if ( !$.isFunction( instance[options] ) ) {
-//                                     throw "no such method '" + options + "' for " + name + " widget instance";
-//                             }
-//                             var methodValue = instance[ options ].apply( instance, args );
-                               if ( methodValue !== instance && methodValue !== undefined ) {
-                                       returnValue = methodValue;
-                                       return false;
-                               }
-                       });
-               } else {
-                       this.each(function() {
-                               var instance = $.data( this, name );
-                               if ( instance ) {
-                                       instance.option( options || {} )._init();
-                               } else {
-                                       $.data( this, name, new object( options, this ) );
-                               }
-                       });
-               }
-
-               return returnValue;
-       };
-};
-
-$.Widget = function( options, element ) {
-       // allow instantiation without initializing for simple inheritance
-       if ( arguments.length ) {
-               this._createWidget( options, element );
-       }
-};
-
-$.Widget.prototype = {
-       widgetName: "widget",
-       widgetEventPrefix: "",
-       options: {
-               disabled: false
-       },
-       _createWidget: function( options, element ) {
-               // $.widget.bridge stores the plugin instance, but we do it anyway
-               // so that it's stored even before the _create function runs
-               $.data( element, this.widgetName, this );
-               this.element = $( element );
-               this.options = $.extend( true, {},
-                       this.options,
-                       this._getCreateOptions(),
-                       options );
-
-               var self = this;
-               this.element.bind( "remove." + this.widgetName, function() {
-                       self.destroy();
-               });
-
-               this._create();
-               this._trigger( "create" );
-               this._init();
-       },
-       _getCreateOptions: function() {
-               return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];
-       },
-       _create: function() {},
-       _init: function() {},
-
-       destroy: function() {
-               this.element
-                       .unbind( "." + this.widgetName )
-                       .removeData( this.widgetName );
-               this.widget()
-                       .unbind( "." + this.widgetName )
-                       .removeAttr( "aria-disabled" )
-                       .removeClass(
-                               this.widgetBaseClass + "-disabled " +
-                               "ui-state-disabled" );
-       },
-
-       widget: function() {
-               return this.element;
-       },
-
-       option: function( key, value ) {
-               var options = key;
-
-               if ( arguments.length === 0 ) {
-                       // don't return a reference to the internal hash
-                       return $.extend( {}, this.options );
-               }
-
-               if  (typeof key === "string" ) {
-                       if ( value === undefined ) {
-                               return this.options[ key ];
-                       }
-                       options = {};
-                       options[ key ] = value;
-               }
-
-               this._setOptions( options );
-
-               return this;
-       },
-       _setOptions: function( options ) {
-               var self = this;
-               $.each( options, function( key, value ) {
-                       self._setOption( key, value );
-               });
-
-               return this;
-       },
-       _setOption: function( key, value ) {
-               this.options[ key ] = value;
-
-               if ( key === "disabled" ) {
-                       this.widget()
-                               [ value ? "addClass" : "removeClass"](
-                                       this.widgetBaseClass + "-disabled" + " " +
-                                       "ui-state-disabled" )
-                               .attr( "aria-disabled", value );
-               }
-
-               return this;
-       },
-
-       enable: function() {
-               return this._setOption( "disabled", false );
-       },
-       disable: function() {
-               return this._setOption( "disabled", true );
-       },
-
-       _trigger: function( type, event, data ) {
-               var prop, orig,
-                       callback = this.options[ type ];
-
-               data = data || {};
-               event = $.Event( event );
-               event.type = ( type === this.widgetEventPrefix ?
-                       type :
-                       this.widgetEventPrefix + type ).toLowerCase();
-               // the original event may come from any element
-               // so we need to reset the target on the new event
-               event.target = this.element[ 0 ];
-
-               // copy original event properties over to the new event
-               orig = event.originalEvent;
-               if ( orig ) {
-                       for ( prop in orig ) {
-                               if ( !( prop in event ) ) {
-                                       event[ prop ] = orig[ prop ];
-                               }
-                       }
-               }
-
-               this.element.trigger( event, data );
-
-               return !( $.isFunction(callback) &&
-                       callback.call( this.element[0], event, data ) === false ||
-                       event.isDefaultPrevented() );
-       }
-};
-
-})( jQuery );
-
-};
-
-
-(function ($, window, undefined) {
-  var pos_oo = Number.POSITIVE_INFINITY,
-      neg_oo = Number.NEGATIVE_INFINITY;
-
-  $.geo = {
-    //
-    // utility functions
-    //
-
-    _allCoordinates: function (geom) {
-      // return array of all positions in all geometries of geom
-      // not in JTS
-      var geometries = this._flatten(geom),
-          curGeom = 0,
-          result = [];
-
-      for (; curGeom < geometries.length; curGeom++) {
-        var coordinates = geometries[curGeom].coordinates,
-            isArray = coordinates && $.isArray(coordinates[0]),
-            isDblArray = isArray && $.isArray(coordinates[0][0]),
-            isTriArray = isDblArray && $.isArray(coordinates[0][0][0]),
-            i, j, k;
-
-        if (!isTriArray) {
-          if (!isDblArray) {
-            if (!isArray) {
-              coordinates = [coordinates];
-            }
-            coordinates = [coordinates];
-          }
-          coordinates = [coordinates];
-        }
-
-        for (i = 0; i < coordinates.length; i++) {
-          for (j = 0; j < coordinates[i].length; j++) {
-            for (k = 0; k < coordinates[i][j].length; k++) {
-              result.push(coordinates[i][j][k]);
-            }
-          }
-        }
-      }
-      return result;
-    },
-
-    _isGeodetic: function( coords ) {
-      // returns true if the first coordinate it can find is geodetic
-
-      while ( $.isArray( coords ) ) {
-        if ( coords.length > 1 && ! $.isArray( coords[ 0 ] ) ) {
-          return ( coords[ 0 ] >= -180 && coords[ 0 ] <= 180 && coords[ 1 ] >= -85 && coords[ 1 ] <= 85 );
-        } else {
-          coords = coords[ 0 ];
-        }
-      }
-
-      return false;
-    },
-
-    //
-    // bbox functions
-    //
-
-    center: function (bbox, _ignoreGeo /* Internal Use Only */) {
-      // Envelope.centre in JTS
-      // bbox only, use centroid for geom
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      var center = [(bbox[0] + bbox[2]) / 2, (bbox[1] + bbox[3]) / 2];
-      return wasGeodetic ? $.geo.proj.toGeodetic(center) : center;
-    },
-
-    expandBy: function (bbox, dx, dy, _ignoreGeo /* Internal Use Only */) {
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      bbox = [bbox[0] - dx, bbox[1] - dy, bbox[2] + dx, bbox[3] + dy];
-      return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    height: function (bbox, _ignoreGeo /* Internal Use Only */ ) {
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      return bbox[3] - bbox[1];
-    },
-
-    _in: function(bbox1, bbox2) {
-      return bbox1[0] <= bbox2[0] &&
-             bbox1[1] <= bbox2[1] &&
-             bbox1[2] >= bbox2[2] &&
-             bbox1[3] >= bbox2[3];
-    },
-
-    _bboxDisjoint: function( bbox1, bbox2 ) {
-      return bbox2[ 0 ] > bbox1[ 2 ] || 
-             bbox2[ 2 ] < bbox1[ 0 ] || 
-             bbox2[ 1 ] > bbox1[ 3 ] ||
-             bbox2[ 3 ] < bbox1[ 1 ];
-    },
-
-    include: function( bbox, value, _ignoreGeo /* Internal Use Only */ ) {
-      // similar to Envelope.expandToInclude in JTS
-      if ( !value || !$.isArray( value ) ) {
-        return bbox;
-      }
-
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox || value ) ) {
-        wasGeodetic = true;
-      }
-
-      if ( !bbox ) {
-        bbox = [ pos_oo, pos_oo, neg_oo, neg_oo ];
-      } else if ( wasGeodetic ) {
-        bbox = $.geo.proj.fromGeodetic( bbox );
-      }
-
-      if ( value.length === 2 ) {
-        value = [ value[ 0 ], value[ 1 ], value[ 0 ], value[ 1 ] ];
-      }
-
-      value = $.geo.proj.fromGeodetic( value );
-
-      bbox[0] = Math.min( value[ 0 ], bbox[ 0 ] );
-      bbox[1] = Math.min( value[ 1 ], bbox[ 1 ] );
-      bbox[2] = Math.max( value[ 2 ], bbox[ 2 ] );
-      bbox[3] = Math.max( value[ 3 ], bbox[ 3 ] );
-
-      return wasGeodetic ? $.geo.proj.toGeodetic( bbox ) : bbox;
-    },
-
-    polygonize: function( bbox, _ignoreGeo /* Internal Use Only */ ) {
-      // adaptation of Polygonizer class in JTS for use with bboxes
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      var polygon = {
-        type: "Polygon",
-        coordinates: [ [
-          [ bbox[ 0 ], bbox[ 1 ] ],
-          [ bbox[ 0 ], bbox[ 3 ] ],
-          [ bbox[ 2 ], bbox[ 3 ] ],
-          [ bbox[ 2 ], bbox[ 1 ] ],
-          [ bbox[ 0 ], bbox[ 1 ] ]
-        ] ]
-      };
-
-      if ( wasGeodetic ) {
-        polygon.coordinates = $.geo.proj.toGeodetic( polygon.coordinates );
-      }
-
-      return polygon;
-    },
-
-    reaspect: function (bbox, ratio, _ignoreGeo /* Internal Use Only */ ) {
-      // not in JTS
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      var width = this.width(bbox, true),
-          height = this.height(bbox, true),
-          center = this.center(bbox, true),
-          dx, dy;
-
-      if (width !== 0 && height !== 0 && ratio > 0) {
-        if (width / height > ratio) {
-          dx = width / 2;
-          dy = dx / ratio;
-        } else {
-          dy = height / 2;
-          dx = dy * ratio;
-        }
-
-        bbox = [center[0] - dx, center[1] - dy, center[0] + dx, center[1] + dy];
-      }
-
-      return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    recenter: function( bbox, center, _ignoreGeo /* Internal Use Only */ ) {
-      // not in JTS
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj ) {
-        if ( this._isGeodetic( bbox ) ) {
-          wasGeodetic = true;
-          bbox = $.geo.proj.fromGeodetic(bbox);
-        }
-
-        if ( this._isGeodetic( center ) ) {
-          center = $.geo.proj.fromGeodetic(center);
-        }
-      }
-
-      var halfWidth = ( bbox[ 2 ] - bbox[ 0 ] ) / 2,
-          halfHeight = ( bbox[ 3 ] - bbox[ 1 ] ) / 2;
-
-      bbox = [
-        center[ 0 ] - halfWidth,
-        center[ 1 ] - halfHeight,
-        center[ 0 ] + halfWidth,
-        center[ 1 ] + halfHeight
-      ];
-
-      return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    scaleBy: function ( bbox, scale, _ignoreGeo /* Internal Use Only */ ) {
-      // not in JTS
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      var c = this.center(bbox, true),
-          dx = (bbox[2] - bbox[0]) * scale / 2,
-          dy = (bbox[3] - bbox[1]) * scale / 2;
-
-      bbox = [c[0] - dx, c[1] - dy, c[0] + dx, c[1] + dy];
-
-      return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    width: function (bbox, _ignoreGeo /* Internal Use Only */ ) {
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      return bbox[2] - bbox[0];
-    },
-
-    //
-    // geometry functions
-    //
-
-    // bbox (Geometry.getEnvelope in JTS)
-
-    bbox: function ( geom, _ignoreGeo /* Internal Use Only */ ) {
-      var result, wasGeodetic = false;
-      if ( !geom ) {
-        return undefined;
-      } else if ( geom.bbox ) {
-        result = ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom.bbox ) ) ? $.geo.proj.fromGeodetic( geom.bbox ) : geom.bbox;
-      } else {
-        result = [ pos_oo, pos_oo, neg_oo, neg_oo ];
-
-        var coordinates = this._allCoordinates( geom ),
-            curCoord = 0;
-
-        if ( coordinates.length === 0 ) {
-          return undefined;
-        }
-
-        if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( coordinates ) ) {
-          wasGeodetic = true;
-          coordinates = $.geo.proj.fromGeodetic( coordinates );
-        }
-
-        for ( ; curCoord < coordinates.length; curCoord++ ) {
-          result[0] = Math.min(coordinates[curCoord][0], result[0]);
-          result[1] = Math.min(coordinates[curCoord][1], result[1]);
-          result[2] = Math.max(coordinates[curCoord][0], result[2]);
-          result[3] = Math.max(coordinates[curCoord][1], result[3]);
-        }
-      }
-
-      return wasGeodetic ? $.geo.proj.toGeodetic(result) : result;
-    },
-
-    // centroid
-    
-    centroid: function( geom, _ignoreGeo /* Internal Use Only */ ) {
-      switch (geom.type) {
-        case "Point":
-          return $.extend({}, geom);
-
-        case "LineString":
-        case "Polygon":
-          var a = 0,
-              c = [0, 0],
-              coords = $.merge( [ ], geom.type == "Polygon" ? geom.coordinates[0] : geom.coordinates ),
-              i = 1, j, n,
-              bbox = [ pos_oo, pos_oo, neg_oo, neg_oo ];
-
-          var wasGeodetic = false;
-          if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( coords ) ) {
-            wasGeodetic = true;
-            coords = $.geo.proj.fromGeodetic(coords);
-          }
-
-          //if (coords[0][0] != coords[coords.length - 1][0] || coords[0][1] != coords[coords.length - 1][1]) {
-          //  coords.push(coords[0]);
-          //}
-
-          for (; i <= coords.length; i++) {
-            j = i % coords.length;
-
-            bbox[0] = Math.min(coords[j][0], bbox[0]);
-            bbox[1] = Math.min(coords[j][1], bbox[1]);
-            bbox[2] = Math.max(coords[j][0], bbox[2]);
-            bbox[3] = Math.max(coords[j][1], bbox[3]);
-
-            n = (coords[i - 1][0] * coords[j][1]) - (coords[j][0] * coords[i - 1][1]);
-            a += n;
-            c[0] += (coords[i - 1][0] + coords[j][0]) * n;
-            c[1] += (coords[i - 1][1] + coords[j][1]) * n;
-          }
-
-          if (a === 0) {
-            if (coords.length > 0) {
-              c[0] = Math.min( Math.max( coords[0][0], bbox[ 0 ] ), bbox[ 2 ] );
-              c[1] = Math.min( Math.max( coords[0][1], bbox[ 1 ] ), bbox[ 3 ] );
-              return { type: "Point", coordinates: wasGeodetic ? $.geo.proj.toGeodetic(c) : c };
-            } else {
-              return undefined;
-            }
-          }
-
-          a *= 3;
-          //c[0] /= a;
-          //c[1] /= a;
-
-          c[0] = Math.min( Math.max( c[0] / a, bbox[ 0 ] ), bbox[ 2 ] );
-          c[1] = Math.min( Math.max( c[1] / a, bbox[ 1 ] ), bbox[ 3 ] );
-
-          return { type: "Point", coordinates: wasGeodetic ? $.geo.proj.toGeodetic(c) : c };
-      }
-      return undefined;
-    },
-
-    // contains
-
-    contains: function (geom1, geom2) {
-      if (geom1.type != "Polygon") {
-        return false;
-      }
-
-      switch (geom2.type) {
-        case "Point":
-          return this._containsPolygonPoint(geom1.coordinates, geom2.coordinates);
-
-        case "LineString":
-          return this._containsPolygonLineString(geom1.coordinates, geom2.coordinates);
-
-        case "Polygon":
-          return this._containsPolygonLineString(geom1.coordinates, geom2.coordinates[0]);
-
-        default:
-          return false;
-      }
-    },
-
-    _containsPolygonPoint: function (polygonCoordinates, pointCoordinate) {
-      if (polygonCoordinates.length === 0 || polygonCoordinates[0].length < 4) {
-        return false;
-      }
-
-      var rayCross = 0,
-          a = polygonCoordinates[0][0],
-          i = 1,
-          b,
-          x;
-
-      for (; i < polygonCoordinates[0].length; i++) {
-        b = polygonCoordinates[0][i];
-
-        if ((a[1] <= pointCoordinate[1] && pointCoordinate[1] < b[1]) || (b[1] <= pointCoordinate[1] && pointCoordinate[1] < a[1]) && (pointCoordinate[0] < a[0] || pointCoordinate[0] < b[0])) {
-          x = a[0] + (b[0] - a[0]) * (pointCoordinate[1] - a[1]) / (b[1] - a[1]);
-
-          if (x > pointCoordinate[0]) {
-            rayCross++;
-          }
-        }
-
-        a = b;
-      }
-
-      return rayCross % 2 == 1;
-    },
-
-    _containsPolygonLineString: function (polygonCoordinates, lineStringCoordinates) {
-      for (var i = 0; i < lineStringCoordinates.length; i++) {
-        if (!this._containsPolygonPoint(polygonCoordinates, lineStringCoordinates[i])) {
-          return false;
-        }
-      }
-      return true;
-    },
-
-    // distance
-
-    distance: function ( geom1, geom2, _ignoreGeo /* Internal Use Only */ ) {
-      var geom1CoordinatesProjected = ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom1.coordinates ) ) ? $.geo.proj.fromGeodetic(geom1.coordinates) : geom1.coordinates,
-          geom2CoordinatesProjected = ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom2.coordinates ) ) ? $.geo.proj.fromGeodetic(geom2.coordinates) : geom2.coordinates;
-
-      switch (geom1.type) {
-        case "Point":
-          switch (geom2.type) {
-            case "Point":
-              return this._distancePointPoint(geom2CoordinatesProjected, geom1CoordinatesProjected);
-            case "LineString":
-              return this._distanceLineStringPoint(geom2CoordinatesProjected, geom1CoordinatesProjected);
-            case "Polygon":
-              return this._containsPolygonPoint(geom2CoordinatesProjected, geom1CoordinatesProjected) ? 0 : this._distanceLineStringPoint(geom2CoordinatesProjected[0], geom1CoordinatesProjected);
-            default:
-              return undefined;
-          }
-          break;
-
-        case "LineString":
-          switch (geom2.type) {
-            case "Point":
-              return this._distanceLineStringPoint(geom1CoordinatesProjected, geom2CoordinatesProjected);
-            case "LineString":
-              return this._distanceLineStringLineString(geom1CoordinatesProjected, geom2CoordinatesProjected);
-            case "Polygon":
-              return this._containsPolygonLineString(geom2CoordinatesProjected, geom1CoordinatesProjected) ? 0 : this._distanceLineStringLineString(geom2CoordinatesProjected[0], geom1CoordinatesProjected);
-            default:
-              return undefined;
-          }
-          break;
-
-        case "Polygon":
-          switch (geom2.type) {
-            case "Point":
-              return this._containsPolygonPoint(geom1CoordinatesProjected, geom2CoordinatesProjected) ? 0 : this._distanceLineStringPoint(geom1CoordinatesProjected[0], geom2CoordinatesProjected);
-            case "LineString":
-              return this._containsPolygonLineString(geom1CoordinatesProjected, geom2CoordinatesProjected) ? 0 : this._distanceLineStringLineString(geom1CoordinatesProjected[0], geom2CoordinatesProjected);
-            case "Polygon":
-              return this._containsPolygonLineString(geom1CoordinatesProjected, geom2CoordinatesProjected[0]) ? 0 : this._distanceLineStringLineString(geom1CoordinatesProjected[0], geom2CoordinatesProjected[0]);
-            default:
-              return undefined;
-          }
-          break;
-      }
-    },
-
-    _distancePointPoint: function (coordinate1, coordinate2) {
-      var dx = coordinate2[0] - coordinate1[0],
-          dy = coordinate2[1] - coordinate1[1];
-      return Math.sqrt((dx * dx) + (dy * dy));
-    },
-
-    _distanceLineStringPoint: function (lineStringCoordinates, pointCoordinate) {
-      var minDist = pos_oo;
-
-      if (lineStringCoordinates.length > 0) {
-        var a = lineStringCoordinates[0],
-
-            apx = pointCoordinate[0] - a[0],
-            apy = pointCoordinate[1] - a[1];
-
-        if (lineStringCoordinates.length == 1) {
-          return Math.sqrt(apx * apx + apy * apy);
-        } else {
-          for (var i = 1; i < lineStringCoordinates.length; i++) {
-            var b = lineStringCoordinates[i],
-
-                abx = b[0] - a[0],
-                aby = b[1] - a[1],
-                bpx = pointCoordinate[0] - b[0],
-                bpy = pointCoordinate[1] - b[1],
-
-                d = this._distanceSegmentPoint(abx, aby, apx, apy, bpx, bpy);
-
-            if (d === 0) {
-              return 0;
-            }
-
-            if (d < minDist) {
-              minDist = d;
-            }
-
-            a = b;
-            apx = bpx;
-            apy = bpy;
-          }
-        }
-      }
-
-      return Math.sqrt(minDist);
-    },
-
-    _distanceSegmentPoint: function (abx, aby, apx, apy, bpx, bpy) {
-      var dot1 = abx * apx + aby * apy;
-
-      if (dot1 <= 0) {
-        return apx * apx + apy * apy;
-      }
-
-      var dot2 = abx * abx + aby * aby;
-
-      if (dot1 >= dot2) {
-        return bpx * bpx + bpy * bpy;
-      }
-
-      return apx * apx + apy * apy - dot1 * dot1 / dot2;
-    },
-
-    _distanceLineStringLineString: function (lineStringCoordinates1, lineStringCoordinates2) {
-      var minDist = pos_oo;
-      for (var i = 0; i < lineStringCoordinates2.length; i++) {
-        minDist = Math.min(minDist, this._distanceLineStringPoint(lineStringCoordinates1, lineStringCoordinates2[i]));
-      }
-      return minDist;
-    },
-
-    // buffer
-
-    _buffer: function( geom, distance, _ignoreGeo /* Internal Use Only */ ) {
-      var wasGeodetic = false,
-          coords = geom.coordinates;
-
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom.coordinates ) ) {
-        wasGeodetic = true;
-        coords = $.geo.proj.fromGeodetic( geom.coordinates );
-      }
-
-      if ( geom.type === "Point" ) {
-        var resultCoords = [],
-            slices = 180,
-            i = 0,
-            a;
-
-        for ( ; i <= slices; i++ ) {
-          a = ( i * 360 / slices ) * ( Math.PI / 180 );
-          resultCoords.push( [
-            coords[ 0 ] + Math.cos( a ) * distance,
-            coords[ 1 ] + Math.sin( a ) * distance
-          ] );
-        }
-
-        return {
-          type: "Polygon",
-          coordinates: [ ( wasGeodetic ? $.geo.proj.toGeodetic( resultCoords ) : resultCoords ) ]
-        };
-      } else {
-        return undefined;
-      }
-    },
-
-    
-    //
-    // feature
-    //
-
-    _flatten: function (geom) {
-      // return an array of all basic geometries
-      // not in JTS
-      var geometries = [],
-          curGeom = 0;
-      switch (geom.type) {
-        case "Feature":
-          $.merge(geometries, this._flatten(geom.geometry));
-          break;
-
-        case "FeatureCollection":
-          for (; curGeom < geom.features.length; curGeom++) {
-            $.merge(geometries, this._flatten(geom.features[curGeom].geometry));
-          }
-          break;
-
-        case "GeometryCollection":
-          for (; curGeom < geom.geometries.length; curGeom++) {
-            $.merge(geometries, this._flatten(geom.geometries[curGeom]));
-          }
-          break;
-
-        default:
-          geometries[0] = geom;
-          break;
-      }
-      return geometries;
-    },
-
-    length: function( geom, _ignoreGeo /* Internal Use Only */ ) {
-      var sum = 0,
-          lineStringCoordinates,
-          i = 1, dx, dy;
-
-      switch ( geom.type ) {
-        case "Point":
-          return 0;
-
-        case "LineString":
-          lineStringCoordinates = geom.coordinates;
-          break;
-
-        case "Polygon":
-          lineStringCoordinates = geom.coordinates[ 0 ];
-          break;
-      }
-
-      if ( lineStringCoordinates ) {
-        if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( lineStringCoordinates ) ) {
-          lineStringCoordinates = $.geo.proj.fromGeodetic( lineStringCoordinates );
-        }
-
-        for ( ; i < lineStringCoordinates.length; i++ ) {
-          dx = lineStringCoordinates[ i ][0] - lineStringCoordinates[ i - 1 ][0];
-          dy = lineStringCoordinates[ i ][1] - lineStringCoordinates[ i - 1 ][1];
-          sum += Math.sqrt((dx * dx) + (dy * dy));
-        }
-
-        return sum;
-      }
-
-      // return undefined;
-    },
-
-    area: function( geom, _ignoreGeo /* Internal Use Only */ ) {
-      var sum = 0,
-          polygonCoordinates,
-          i = 1, j;
-
-      switch ( geom.type ) {
-        case "Point":
-        case "LineString":
-          return 0;
-
-        case "Polygon":
-          polygonCoordinates = geom.coordinates[ 0 ];
-          break;
-      }
-
-      if ( polygonCoordinates ) {
-        if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( polygonCoordinates ) ) {
-          polygonCoordinates = $.geo.proj.fromGeodetic( polygonCoordinates );
-        }
-
-        for ( ; i <= polygonCoordinates.length; i++) {
-          j = i %  polygonCoordinates.length;
-          sum += ( polygonCoordinates[ i - 1 ][ 0 ] - polygonCoordinates[ j ][ 0 ] ) * ( polygonCoordinates[ i - 1 ][ 1 ] + polygonCoordinates[ j ][ 1 ] ) / 2;
-        }
-
-        return Math.abs( sum );
-      }
-    },
-
-    pointAlong: function( geom, percentage, _ignoreGeo /* Internal Use Only */ ) {
-      var totalLength = 0,
-          previousPercentageSum = 0,
-          percentageSum = 0,
-          remainderPercentageSum,
-          len,
-          lineStringCoordinates,
-          segmentLengths = [],
-          i = 1, dx, dy,
-          c, c0, c1,
-          wasGeodetic = false;
-
-      switch ( geom.type ) {
-        case "Point":
-          return $.extend( { }, geom );
-
-        case "LineString":
-          lineStringCoordinates = geom.coordinates;
-          break;
-
-        case "Polygon":
-          lineStringCoordinates = geom.coordinates[ 0 ];
-          break;
-      }
-
-      if ( lineStringCoordinates ) {
-        if ( percentage === 0 ) {
-          return {
-            type: "Point",
-            coordinates: [ lineStringCoordinates[ 0 ][ 0 ], lineStringCoordinates[ 0 ][ 1 ] ]
-          };
-        } else if ( percentage === 1 ) {
-          i = lineStringCoordinates.length - 1;
-          return {
-            type: "Point",
-            coordinates: [ lineStringCoordinates[ i ][ 0 ], lineStringCoordinates[ i ][ 1 ] ]
-          };
-        } else {
-          if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( lineStringCoordinates ) ) {
-            wasGeodetic = true;
-            lineStringCoordinates = $.geo.proj.fromGeodetic( lineStringCoordinates );
-          }
-
-          for ( ; i < lineStringCoordinates.length; i++ ) {
-            dx = lineStringCoordinates[ i ][ 0 ] - lineStringCoordinates[ i - 1 ][ 0 ];
-            dy = lineStringCoordinates[ i ][ 1 ] - lineStringCoordinates[ i - 1 ][ 1 ];
-            len = Math.sqrt((dx * dx) + (dy * dy));
-            segmentLengths.push( len );
-            totalLength += len;
-          }
-
-          for ( i = 0; i < segmentLengths.length && percentageSum < percentage; i++ ) {
-            previousPercentageSum = percentageSum;
-            percentageSum += ( segmentLengths[ i ] / totalLength );
-          }
-
-          remainderPercentageSum = percentage - previousPercentageSum;
-
-          c0 = lineStringCoordinates[ i - 1 ];
-          c1 = lineStringCoordinates[ i ];
-
-          c = [
-            c0[ 0 ] + ( remainderPercentageSum * ( c1[ 0 ] - c0[ 0 ] ) ),
-            c0[ 1 ] + ( remainderPercentageSum * ( c1[ 1 ] - c0[ 1 ] ) )
-          ];
-
-          return {
-            type: "Point",
-            coordinates: wasGeodetic ? $.geo.proj.toGeodetic(c) : c
-          };
-        }
-      }
-    },
-
-    //
-    // WKT functions
-    //
-
-    _WKT: (function () {
-      function pointToString(value) {
-        return "POINT " + pointToUntaggedString(value.coordinates);
-      }
-
-      function pointToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMPTY";
-        } else {
-          return "(" + coordinates.join(" ") + ")";
-        }
-      }
-
-      function lineStringToString(value) {
-        return "LINESTRING " + lineStringToUntaggedString(value.coordinates);
-      }
-
-      function lineStringToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMPTY";
-        } else {
-          var points = [];
-
-          for (var i = 0; i < coordinates.length; i++) {
-            points.push(coordinates[i].join(" "));
-          }
-
-          return "(" + points + ")";
-        }
-      }
-
-      function polygonToString(value) {
-        return "POLYGON " + polygonToUntaggedString(value.coordinates);
-      }
-
-      function polygonToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMTPY";
-        } else {
-          var lineStrings = [];
-
-          for (var i = 0; i < coordinates.length; i++) {
-            lineStrings.push(lineStringToUntaggedString(coordinates[i]));
-          }
-
-          return "(" + lineStrings + ")";
-        }
-      }
-
-      function multiPointToString(value) {
-        return "MULTIPOINT " + lineStringToUntaggedString(value.coordinates);
-      }
-
-      function multiLineStringToString(value) {
-        return "MULTILINSTRING " + polygonToUntaggedString(value.coordinates);
-      }
-
-      function multiPolygonToString(value) {
-        return "MULTIPOLYGON " + multiPolygonToUntaggedString(value.coordinates);
-      }
-
-      function multiPolygonToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMPTY";
-        } else {
-          var polygons = [];
-          for (var i = 0; i < coordinates.length; i++) {
-            polygons.push(polygonToUntaggedString(coordinates[i]));
-          }
-          return "(" + polygons + ")";
-        }
-      }
-
-      function geometryCollectionToString(value) {
-        return "GEOMETRYCOLLECTION " + geometryCollectionToUntaggedString(value.geometries);
-      }
-
-      function geometryCollectionToUntaggedString(geometries) {
-        if (!(geometries && geometries.length)) {
-          return "EMPTY";
-        } else {
-          var geometryText = [];
-          for (var i = 0; i < geometries.length; i++) {
-            geometryText.push(stringify(geometries[i]));
-          }
-          return "(" + geometries + ")";
-        }
-      }
-
-      function stringify(value) {
-        if (!(value && value.type)) {
-          return "";
-        } else {
-          switch (value.type) {
-            case "Point":
-              return pointToString(value);
-
-            case "LineString":
-              return lineStringToString(value);
-
-            case "Polygon":
-              return polygonToString(value);
-
-            case "MultiPoint":
-              return multiPointToString(value);
-
-            case "MultiLineString":
-              return multiLineStringToString(value);
-
-            case "MultiPolygon":
-              return multiPolygonToString(value);
-
-            case "GeometryCollection":
-              return geometryCollectionToString(value);
-
-            default:
-              return "";
-          }
-        }
-      }
-
-      function pointParseUntagged(wkt) {
-        var pointString = wkt.match( /\(\s*([\d\.\-]+)\s+([\d\.\-]+)\s*\)/ );
-        return pointString && pointString.length > 2 ? {
-          type: "Point",
-          coordinates: [
-            parseFloat(pointString[1]),
-            parseFloat(pointString[2])
-          ]
-        } : null;
-      }
-
-      function lineStringParseUntagged(wkt) {
-        var lineString = wkt.match( /\s*\((.*)\)/ ),
-            coords = [],
-            pointStrings,
-            pointParts,
-            i = 0;
-
-        if ( lineString && lineString.length > 1 ) {
-          pointStrings = lineString[ 1 ].match( /[\d\.\-]+\s+[\d\.\-]+/g );
-
-          for ( ; i < pointStrings.length; i++ ) {
-            pointParts = pointStrings[ i ].match( /\s*([\d\.\-]+)\s+([\d\.\-]+)\s*/ );
-            coords[ i ] = [ parseFloat( pointParts[ 1 ] ), parseFloat( pointParts[ 2 ] ) ];
-          }
-
-          return {
-            type: "LineString",
-            coordinates: coords
-          };
-        } else {
-          return null;
-        }
-      }
-
-      function polygonParseUntagged(wkt) {
-        var polygon = wkt.match( /\s*\(\s*\((.*)\)\s*\)/ ),
-            coords = [],
-            pointStrings,
-            pointParts,
-            i = 0;
-
-        if ( polygon && polygon.length > 1 ) {
-          pointStrings = polygon[ 1 ].match( /[\d\.\-]+\s+[\d\.\-]+/g );
-
-          for ( ; i < pointStrings.length; i++ ) {
-            pointParts = pointStrings[ i ].match( /\s*([\d\.\-]+)\s+([\d\.\-]+)\s*/ );
-            coords[ i ] = [ parseFloat( pointParts[ 1 ] ), parseFloat( pointParts[ 2 ] ) ];
-          }
-
-          return {
-            type: "Polygon",
-            coordinates: [ coords ]
-          };
-        } else {
-          return null;
-        }
-      }
-
-      function multiPointParseUntagged(wkt) {
-        var multiSomething;
-
-        if ( wkt.indexOf( "((" ) === -1 ) {
-          multiSomething = lineStringParseUntagged( wkt );
-        } else {
-          multiSomething = multiLineStringParseUntagged( wkt );
-          multiSomething.coordinates = $.geo._allCoordinates( multiSomething );
-        }
-
-        multiSomething.type = "MultiPoint";
-
-        return multiSomething;
-      }
-
-      function multiLineStringParseUntagged(wkt) {
-        var lineStringsWkt = wkt.substr( 1, wkt.length - 2 ),
-            lineStrings = lineStringsWkt.split( ")),((" ),
-            i = 0,
-            multiLineString = {
-              type: "MultiLineString",
-              coordinates: [ ]
-            };
-
-        for ( ; i < lineStrings.length; i++ ) {
-          multiLineString.coordinates.push( lineStringParseUntagged( lineStrings[ i ] ).coordinates );
-        }
-
-        return multiLineString;
-      }
-
-      function multiPolygonParseUntagged(wkt) {
-        var polygonsWkt = wkt.substr( 1, wkt.length - 2 ),
-            polygons = polygonsWkt.split( ")),((" ),
-            i = 0,
-            multiPolygon = {
-              type: "MultiPolygon",
-              coordinates: [ ]
-            };
-
-        for ( ; i < polygons.length; i++ ) {
-          multiPolygon.coordinates.push( polygonParseUntagged( polygons[ i ] ).coordinates );
-        }
-
-        return multiPolygon;
-      }
-
-      function geometryCollectionParseUntagged( wkt ) {
-        var geometriesWkt = wkt.substr( 1, wkt.length - 2 ),
-            geometries = geometriesWkt.match( /\),[a-zA-Z]/g ),
-            geometryCollection = {
-              type: "GeometryCollection",
-              geometries: [ ]
-            },
-            curGeom,
-            i = 0, curStart = 0, curLen;
-
-        if ( geometries && geometries.length > 0 ) {
-          for ( ; i < geometries.length; i++ ) {
-            curLen = geometriesWkt.indexOf( geometries[ i ], curStart ) - curStart + 1;
-            curGeom = parse( geometriesWkt.substr( curStart, curLen ) );
-            if ( curGeom ) {
-              geometryCollection.geometries.push( curGeom );
-            }
-            curStart += curLen + 1;
-          }
-
-          // one more
-          curGeom = parse( geometriesWkt.substr( curStart ) );
-          if ( curGeom ) {
-            geometryCollection.geometries.push( curGeom );
-          }
-
-          return geometryCollection;
-        } else {
-          return null;
-        }
-      }
-
-      function parse(wkt) {
-        wkt = $.trim(wkt);
-
-        var typeIndex = wkt.indexOf( "(" ),
-            untagged = wkt.substr( typeIndex  );
-
-        switch ($.trim(wkt.substr(0, typeIndex)).toUpperCase()) {
-          case "POINT":
-            return pointParseUntagged( untagged );
-
-          case "LINESTRING":
-            return lineStringParseUntagged( untagged );
-
-          case "POLYGON":
-            return polygonParseUntagged( untagged );
-
-          case "MULTIPOINT":
-            return multiPointParseUntagged( untagged );
-
-          case "MULTILINESTRING":
-            return multiLineStringParseUntagged( untagged );
-
-          case "MULTIPOLYGON":
-            return multiPolygonParseUntagged( untagged );
-
-          case "GEOMETRYCOLLECTION":
-            return geometryCollectionParseUntagged( untagged );
-
-          default:
-            return null;
-        }
-      }
-
-      return {
-        stringify: stringify,
-
-        parse: parse
-      };
-    }()),
-
-    //
-    // projection functions
-    //
-
-    proj: (function () {
-      var halfPi = 1.5707963267948966192,
-          quarterPi = 0.7853981633974483096,
-          radiansPerDegree = 0.0174532925199432958,
-          degreesPerRadian = 57.295779513082320877,
-          semiMajorAxis = 6378137;
-
-      return {
-        fromGeodeticPos: function (coordinate) {
-          return [
-            semiMajorAxis * coordinate[ 0 ] * radiansPerDegree,
-            semiMajorAxis * Math.log(Math.tan(quarterPi + coordinate[ 1 ] * radiansPerDegree / 2))
-          ];
-        },
-
-        fromGeodetic: function ( coordinates ) {
-          if ( ! $.geo._isGeodetic( coordinates ) ) {
-            return coordinates;
-          }
-
-          var isMultiPointOrLineString = $.isArray(coordinates[ 0 ]),
-              fromGeodeticPos = this.fromGeodeticPos;
-
-          if (!isMultiPointOrLineString && coordinates.length == 4) {
-            // bbox
-            var min = fromGeodeticPos([ coordinates[ 0 ], coordinates[ 1 ] ]),
-                max = fromGeodeticPos([ coordinates[ 2 ], coordinates[ 3 ] ]);
-            return [ min[ 0 ], min[ 1 ], max[ 0 ], max[ 1 ] ];
-          } else {
-            // geometry
-            var isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray(coordinates[ 0 ][ 0 ]),
-                isMultiPolygon = isMultiLineStringOrPolygon && $.isArray(coordinates[ 0 ][ 0 ][ 0 ]),
-                result = [ ],
-                i, j, k;
-
-            if (!isMultiPolygon) {
-              if (!isMultiLineStringOrPolygon) {
-                if (!isMultiPointOrLineString) {
-                  coordinates = [ coordinates ];
-                }
-                coordinates = [ coordinates ];
-              }
-              coordinates = [ coordinates ];
-            }
-
-            for ( i = 0; i < coordinates.length; i++ ) {
-              result[ i ] = [ ];
-              for ( j = 0; j < coordinates[ i ].length; j++ ) {
-                result[ i ][ j ] = [ ];
-                for ( k = 0; k < coordinates[ i ][ j ].length; k++ ) {
-                  result[ i ][ j ][ k ] = fromGeodeticPos(coordinates[ i ][ j ][ k ]);
-                }
-              }
-            }
-
-            return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-          }
-        },
-
-        toGeodeticPos: function (coordinate) {
-          return [
-            (coordinate[ 0 ] / semiMajorAxis) * degreesPerRadian,
-            (halfPi - 2 * Math.atan(1 / Math.exp(coordinate[ 1 ] / semiMajorAxis))) * degreesPerRadian
-          ];
-        },
-
-        toGeodetic: function (coordinates) {
-          if ( $.geo._isGeodetic( coordinates ) ) {
-            return coordinates;
-          }
-
-          var isMultiPointOrLineString = $.isArray(coordinates[ 0 ]),
-              toGeodeticPos = this.toGeodeticPos;
-
-          if (!isMultiPointOrLineString && coordinates.length == 4) {
-            // bbox
-            var min = toGeodeticPos([ coordinates[ 0 ], coordinates[ 1 ] ]),
-                max = toGeodeticPos([ coordinates[ 2 ], coordinates[ 3 ] ]);
-            return [ min[ 0 ], min[ 1 ], max[ 0 ], max[ 1 ] ];
-          } else {
-            // geometry
-            var isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray(coordinates[ 0 ][ 0 ]),
-                isMultiPolygon = isMultiLineStringOrPolygon && $.isArray(coordinates[ 0 ][ 0 ][ 0 ]),
-                result = [ ],
-                i, j, k;
-
-            if (!isMultiPolygon) {
-              if (!isMultiLineStringOrPolygon) {
-                if (!isMultiPointOrLineString) {
-                  coordinates = [ coordinates ];
-                }
-                coordinates = [ coordinates ];
-              }
-              coordinates = [ coordinates ];
-            }
-
-            for ( i = 0; i < coordinates.length; i++ ) {
-              result[ i ] = [ ];
-              for ( j = 0; j < coordinates[ i ].length; j++ ) {
-                result[ i ][ j ] = [ ];
-                for ( k = 0; k < coordinates[ i ][ j ].length; k++ ) {
-                  result[ i ][ j ][ k ] = toGeodeticPos(coordinates[ i ][ j ][ k ]);
-                }
-              }
-            }
-
-            return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-          }
-        }
-      };
-    }()),
-
-    //
-    // service types (defined in other files)
-    //
-
-    _serviceTypes: {}
-  };
-}(jQuery, this));
-
-(function ($, undefined) {
-  var _ieVersion = ( function () {
-    var v = 5, div = document.createElement("div"), a = div.all || [];
-    do {
-      div.innerHTML = "<!--[if gt IE " + (++v) + "]><br><![endif]-->";
-    } while ( a[0] );
-    return v > 6 ? v : !v;
-  }() );
-
-  $.widget("geo.geographics", {
-    _$elem: undefined,
-    _options: {},
-    _trueCanvas: true,
-    _trueDoubleBuffer: true,
-
-    _width: 0,
-    _height: 0,
-
-    _$canvas: undefined,
-    _context: undefined,
-
-    _$canvasSceneFront: undefined, //< if _trueCanvas, where canvas images get written (front buffer)
-    _$canvasSceneBack: undefined, //< if _trueCanvas, where canvas images get written (back buffer)
-    _timeoutEnd:  null,
-    _requireFlip: false,
-
-    _blitcanvas: undefined,
-    _blitcontext: undefined,
-
-    _$labelsContainerFront: undefined,
-    _$labelsContainerBack: undefined,
-    _labelsHtml: "",
-
-    options: {
-      style: {
-        borderRadius: "8px",
-        color: "#7f0000",
-        //fill: undefined,
-        fillOpacity: 0.2,
-        height: "8px",
-        opacity: 1,
-        //stroke: undefined,
-        strokeOpacity: 1,
-        strokeWidth: "2px",
-        visibility: "visible",
-        width: "8px"
-      },
-
-      doubleBuffer: true
-    },
-
-    _create: function () {
-      this._$elem = this.element;
-      this._options = this.options;
-
-      this._$elem.css( {
-        webkitTransform: "translateZ(0)",
-        display: "inline-block",
-        overflow: "hidden",
-        textAlign: "left"
-      } );
-
-      if (this._$elem.css("position") == "static") {
-        this._$elem.css("position", "relative");
-      }
-
-      this._$elem.addClass( "geo-graphics" );
-
-      this._width = this._$elem.width();
-      this._height = this._$elem.height();
-
-      if (!(this._width && this._height)) {
-        this._width = parseInt(this._$elem.css("width"), 10);
-        this._height = parseInt(this._$elem.css("height"), 10);
-      }
-
-      var posCss = 'position:absolute;left:0;top:0;margin:0;padding:0;',
-          sizeCss = 'width:' + this._width + 'px;height:' + this._height + 'px;',
-          sizeAttr = 'width="' + this._width + '" height="' + this._height + '"';
-
-      this._blitcanvas = document.createElement( "canvas" );
-
-      if ( this._blitcanvas.getContext ) {
-        //this._$elem.append('<canvas ' + sizeAttr + ' style="-webkit-transform:translateZ(0);' + posCss + '"></canvas>');
-        //this._$canvas = this._$elem.children(':last');
-        this._$canvas = $('<canvas ' + sizeAttr + ' style="-webkit-transform:translateZ(0);' + posCss + '"></canvas>');
-
-        // test _trueDoubleBuffer
-        this._blitcanvas.width = 1;
-        this._blitcanvas.height = 1;
-        this._trueDoubleBuffer = this._blitcanvas.toDataURL().length > 6;
-
-        if ( !(this._options.doubleBuffer && this._trueDoubleBuffer) ) {
-          this._$elem.append( this._$canvas );
-        }
-
-        this._context = this._$canvas[0].getContext("2d");
-
-        //this._blitcanvas = document.createElement( "canvas" );
-        this._blitcanvas.width = this._width;
-        this._blitcanvas.height = this._height;
-        this._blitcontext = this._blitcanvas.getContext("2d");
-
-        // create our front & back buffers
-        this._$canvasSceneFront = $('<img id="scene0" style="-webkit-transform:translateZ(0);' + posCss + sizeCss + '" />');
-        this._$canvasSceneBack = $('<img id="scene1" style="-webkit-transform:translateZ(0);' + posCss + sizeCss + '" />');
-
-      } else if (_ieVersion <= 8) {
-        this._trueCanvas = false;
-        this._$elem.append( '<div ' + sizeAttr + ' style="' + posCss + sizeCss + '"></div>');
-        this._$canvas = this._$elem.children(':last');
-
-        G_vmlCanvasManager.initElement(this._$canvas[0]);
-        this._context = this._$canvas[0].getContext("2d");
-        this._$canvas.children().css({ backgroundColor: "transparent", width: this._width, height: this._height });
-      }
-
-      // create our front & back label containers
-      this._$labelsContainerFront = $('<div class="geo-labels-container" style="-webkit-transform:translateZ(0);' + posCss + sizeCss + '"></div>');
-      this._$labelsContainerBack = $('<div class="geo-labels-container" style="-webkit-transform:translateZ(0);' + posCss + sizeCss + '"></div>');
-    },
-
-    _setOption: function (key, value) {
-      if (key == "style") {
-        value = $.extend({}, this._options.style, value);
-      }
-      $.Widget.prototype._setOption.apply(this, arguments);
-    },
-
-    destroy: function () {
-      $.Widget.prototype.destroy.apply(this, arguments);
-      this._$elem.html("");
-      this._$elem.removeClass( "geo-graphics" );
-    },
-
-    clear: function () {
-      this._context.clearRect(0, 0, this._width, this._height);
-      this._labelsHtml = "";
-
-          //if ( this._options.doubleBuffer ) console.log("clear:_end " + $.now());
-      this._end( );
-    },
-
-    drawArc: function (coordinates, startAngle, sweepAngle, style) {
-      style = this._getGraphicStyle(style);
-
-      if (style.visibility != "hidden" && style.opacity > 0 && style.widthValue > 0 && style.heightValue > 0) {
-        var r = Math.min(style.widthValue, style.heightValue) / 2;
-
-        startAngle = (startAngle * Math.PI / 180);
-        sweepAngle = (sweepAngle * Math.PI / 180);
-
-        this._context.save();
-        this._context.translate(coordinates[0], coordinates[1]);
-        if (style.widthValue > style.heightValue) {
-          this._context.scale(style.widthValue / style.heightValue, 1);
-        } else {
-          this._context.scale(1, style.heightValue / style.widthValue);
-        }
-
-        this._context.beginPath();
-        this._context.arc(0, 0, r, startAngle, sweepAngle, false);
-
-        if (this._trueCanvas) {
-          this._context.restore();
-        }
-
-        if (style.doFill) {
-          this._context.fillStyle = style.fill;
-          this._context.globalAlpha = style.opacity * style.fillOpacity;
-          this._context.fill();
-        }
-
-        if (style.doStroke) {
-          this._context.lineJoin = "round";
-          this._context.lineWidth = style.strokeWidthValue;
-          this._context.strokeStyle = style.stroke;
-
-          this._context.globalAlpha = style.opacity * style.strokeOpacity;
-          this._context.stroke();
-        }
-
-        if (!this._trueCanvas) {
-          this._context.restore();
-        }
-      }
-
-          //if ( this._options.doubleBuffer ) console.log("drawArc:_end " + $.now());
-      this._end( );
-    },
-
-    drawPoint: function (coordinates, style) {
-      style = this._getGraphicStyle(style);
-      if (style.widthValue == style.heightValue && style.heightValue == style.borderRadiusValue) {
-        this.drawArc(coordinates, 0, 360, style);
-      } else if (style.visibility != "hidden" && style.opacity > 0) {
-        style.borderRadiusValue = Math.min(Math.min(style.widthValue, style.heightValue) / 2, style.borderRadiusValue);
-        coordinates[0] -= style.widthValue / 2;
-        coordinates[1] -= style.heightValue / 2;
-        this._context.beginPath();
-        this._context.moveTo(coordinates[0] + style.borderRadiusValue, coordinates[1]);
-        this._context.lineTo(coordinates[0] + style.widthValue - style.borderRadiusValue, coordinates[1]);
-        this._context.quadraticCurveTo(coordinates[0] + style.widthValue, coordinates[1], coordinates[0] + style.widthValue, coordinates[1] + style.borderRadiusValue);
-        this._context.lineTo(coordinates[0] + style.widthValue, coordinates[1] + style.heightValue - style.borderRadiusValue);
-        this._context.quadraticCurveTo(coordinates[0] + style.widthValue, coordinates[1] + style.heightValue, coordinates[0] + style.widthValue - style.borderRadiusValue, coordinates[1] + style.heightValue);
-        this._context.lineTo(coordinates[0] + style.borderRadiusValue, coordinates[1] + style.heightValue);
-        this._context.quadraticCurveTo(coordinates[0], coordinates[1] + style.heightValue, coordinates[0], coordinates[1] + style.heightValue - style.borderRadiusValue);
-        this._context.lineTo(coordinates[0], coordinates[1] + style.borderRadiusValue);
-        this._context.quadraticCurveTo(coordinates[0], coordinates[1], coordinates[0] + style.borderRadiusValue, coordinates[1]);
-        this._context.closePath();
-
-        if (style.doFill) {
-          this._context.fillStyle = style.fill;
-          this._context.globalAlpha = style.opacity * style.fillOpacity;
-          this._context.fill();
-        }
-
-        if (style.doStroke) {
-          this._context.lineJoin = "round";
-          this._context.lineWidth = style.strokeWidthValue;
-          this._context.strokeStyle = style.stroke;
-
-          this._context.globalAlpha = style.opacity * style.strokeOpacity;
-
-          this._context.stroke();
-        }
-
-          //if ( this._options.doubleBuffer ) console.log("drawPoint:_end " + $.now());
-        this._end( );
-      }
-    },
-
-    drawLineString: function (coordinates, style) {
-      this._drawLines([coordinates], false, style);
-    },
-
-    drawPolygon: function (coordinates, style) {
-      if ( !this._trueCanvas || coordinates.length == 1 ) {
-        // either we don't have fancy rendering or there's no need for it (no holes)
-        this._drawLines( coordinates, true, style );
-      } else {
-        if ( !coordinates || !coordinates.length || coordinates[ 0 ].length < 3 ) {
-          // this is not a Polygon or it doesn't have a proper outer ring
-          return;
-        }
-
-        style = this._getGraphicStyle(style);
-
-        var pixelBbox, i, j;
-
-        if ( style.visibility != "hidden" && style.opacity > 0 ) {
-          this._blitcontext.clearRect(0, 0, this._width, this._height);
-
-          if ( style.doFill ) {
-            if ( coordinates.length > 1 ) {
-              // stencil inner rings
-              this._blitcontext.globalCompositeOperation = "source-out";
-              this._blitcontext.globalAlpha = 1;
-
-              for ( i = 1; i < coordinates.length; i++ ) {
-                this._blitcontext.beginPath();
-                this._blitcontext.moveTo( coordinates[ i ][ 0 ][ 0 ], coordinates[ i ][ 0 ][ 1 ] );
-                for ( j = 1; j < coordinates[ i ].length; j++ ) {
-                  this._blitcontext.lineTo( coordinates[ i ][ j ][ 0 ], coordinates[ i ][ j ][ 1 ] );
-                }
-                this._blitcontext.closePath();
-
-                this._blitcontext.fill( );
-              }
-            }
-          }
-
-          // path outer ring
-          this._blitcontext.beginPath();
-          this._blitcontext.moveTo( coordinates[ 0 ][ 0 ][ 0 ], coordinates[ 0 ][ 0 ][ 1 ] );
-
-          pixelBbox = [ coordinates[ 0 ][ 0 ][ 0 ] - style.strokeWidthValue, coordinates[ 0 ][ 0 ][ 1 ] - style.strokeWidthValue, coordinates[ 0 ][ 0 ][ 0 ] + style.strokeWidthValue, coordinates[ 0 ][ 0 ][ 1 ] + style.strokeWidthValue ];
-
-          for ( i = 1; i < coordinates[ 0 ].length - 1; i++ ) {
-            this._blitcontext.lineTo( coordinates[ 0 ][ i ][ 0 ], coordinates[ 0 ][ i ][ 1 ] );
-
-            pixelBbox[ 0 ] = Math.min( coordinates[ 0 ][ i ][ 0 ] - style.strokeWidthValue, pixelBbox[ 0 ] );
-            pixelBbox[ 1 ] = Math.min( coordinates[ 0 ][ i ][ 1 ] - style.strokeWidthValue, pixelBbox[ 1 ] );
-            pixelBbox[ 2 ] = Math.max( coordinates[ 0 ][ i ][ 0 ] + style.strokeWidthValue, pixelBbox[ 2 ] );
-            pixelBbox[ 3 ] = Math.max( coordinates[ 0 ][ i ][ 1 ] + style.strokeWidthValue, pixelBbox[ 3 ] );
-          }
-
-          this._blitcontext.closePath();
-
-          this._blitcontext.globalCompositeOperation = "source-out";
-          if ( style.doFill ) {
-            // fill outer ring
-            this._blitcontext.fillStyle = style.fill;
-            this._blitcontext.globalAlpha = style.opacity * style.fillOpacity;
-            this._blitcontext.fill( );
-          }
-
-          this._blitcontext.globalCompositeOperation = "source-over";
-          if ( style.doStroke ) {
-            // stroke outer ring
-            this._blitcontext.lineCap = this._blitcontext.lineJoin = "round";
-            this._blitcontext.lineWidth = style.strokeWidthValue;
-            this._blitcontext.strokeStyle = style.stroke;
-
-            this._blitcontext.globalAlpha = style.opacity * style.strokeOpacity;
-            this._blitcontext.stroke( );
-
-            if ( coordinates.length > 1 ) {
-              // stroke inner rings
-              for ( i = 1; i < coordinates.length; i++ ) {
-                this._blitcontext.beginPath();
-                this._blitcontext.moveTo( coordinates[ i ][ 0 ][ 0 ], coordinates[ i ][ 0 ][ 1 ] );
-                for ( j = 1; j < coordinates[ i ].length; j++ ) {
-                  this._blitcontext.lineTo( coordinates[ i ][ j ][ 0 ], coordinates[ i ][ j ][ 1 ] );
-                }
-                this._blitcontext.closePath();
-
-                this._blitcontext.stroke( );
-              }
-            }
-          }
-
-          // blit
-          pixelBbox[ 0 ] = Math.min( Math.max( pixelBbox[ 0 ], 0), this._width );
-          pixelBbox[ 1 ] = Math.min( Math.max( pixelBbox[ 1 ], 0), this._height );
-          pixelBbox[ 2 ] = Math.min( Math.max( pixelBbox[ 2 ], 0), this._width );
-          pixelBbox[ 3 ] = Math.min( Math.max( pixelBbox[ 3 ], 0), this._height );
-
-          if ( pixelBbox[ 0 ] !== pixelBbox[ 2 ] && pixelBbox[ 1 ] !== pixelBbox[ 3 ] ) {
-            this._context.drawImage(this._blitcanvas, pixelBbox[ 0 ], pixelBbox[ 1 ], pixelBbox[ 2 ] - pixelBbox[ 0 ], pixelBbox[ 3 ] - pixelBbox[ 1 ], pixelBbox[ 0 ], pixelBbox[ 1 ], pixelBbox[ 2 ] - pixelBbox[ 0 ], pixelBbox[ 3 ] - pixelBbox[ 1 ] );
-
-          //if ( this._options.doubleBuffer ) console.log("drawPolygon:_end " + $.now());
-            this._end( );
-          }
-        }
-      }
-    },
-
-    drawBbox: function (bbox, style) {
-      this._drawLines([[
-        [bbox[0], bbox[1]],
-        [bbox[0], bbox[3]],
-        [bbox[2], bbox[3]],
-        [bbox[2], bbox[1]],
-        [bbox[0], bbox[1]]
-      ]], true, style);
-    },
-
-    drawLabel: function( coordinates, label ) {
-      this._labelsHtml += '<div class="geo-label" style="-webkit-transform:translateZ(0);position:absolute; left:' + ( coordinates[ 0 ] / this._width * 100 ) + '%; top:' + ( coordinates[ 1 ] / this._height * 100 ) + '%;">' + label + '</div>';
-    },
-
-    resize: function( ) {
-      this._width = this._$elem.width();
-      this._height = this._$elem.height();
-
-      if (!(this._width && this._height)) {
-        this._width = parseInt(this._$elem.css("width"), 10);
-        this._height = parseInt(this._$elem.css("height"), 10);
-      }
-
-      if ( this._trueCanvas ) {
-        this._$canvas[0].width = this._width;
-        this._$canvas[0].height = this._height;
-
-        this._$canvasSceneFront.css( {
-          width: this._width,
-          height: this._height
-        } );
-
-        this._$canvasSceneBack.css( {
-          width: this._width,
-          height: this._height
-        } );
-      } else {
-        this._$canvas.css( {
-          width: this._width,
-          height: this._height
-        } );
-      }
-
-      this._$labelsContainerFront.css( {
-        width: this._width,
-        height: this._height
-      } );
-
-      this._$labelsContainerBack.css( {
-        width: this._width,
-        height: this._height
-      } );
-    },
-
-    interactiveTransform: function( origin, scale ) {
-      if ( this._timeoutEnd ) {
-        clearTimeout( this._timeoutEnd );
-        this._timeoutEnd = null;
-      }
-
-      // hide labels for now until they are on the interactive div 
-      //this._$labelsContainerFront.html("");
-
-      if ( this._trueCanvas ) {
-        if ( this._options.doubleBuffer && this._trueDoubleBuffer ) {
-
-
-          if ( this._requireFlip ) {
-            var geographics = this;
-
-            var oldCanvasScene = geographics._$canvasSceneFront;
-
-            geographics._$canvasSceneFront = geographics._$canvasSceneBack.css( {
-              left: 0,
-              top: 0,
-              width: geographics._width,
-              height: geographics._height
-            } ).prop( "src", geographics._$canvas[ 0 ].toDataURL( ) ).prependTo( geographics._$elem );
-
-            geographics._$canvasSceneBack = oldCanvasScene.detach();
-
-            geographics._requireFlip = false;
-          }
-
-
-          //console.log("geographics:interactiveTransform " + this._$canvasSceneFront.prop( "id" ) + ": origin: " + origin.toString() + ", scale: " + scale);
-          // transform a finished scene, can assume no drawing during these calls
-          this._$canvasSceneFront.css( {
-            left: Math.round( origin[ 0 ] ),
-            top: Math.round( origin[ 1 ] ),
-            width: this._width * scale,
-            height: this._height * scale
-          } );
-        } else {
-          this._context.clearRect(0, 0, this._width, this._height);
-        }
-      } else {
-        this._context.clearRect(0, 0, this._width, this._height);
-      }
-
-      // transform labels
-      this._$labelsContainerFront.css( {
-        left: Math.round( origin[ 0 ] ),
-        top: Math.round( origin[ 1 ] ),
-        width: this._width * scale,
-        height: this._height * scale
-      } );
-    },
-
-    _end: function( ) {
-      // end/finalize a scene
-      if ( this._timeoutEnd ) {
-        clearTimeout( this._timeoutEnd );
-        this._timeoutEnd = null;
-      }
-
-      this._requireFlip = true;
-
-      var geographics = this;
-
-      function endCallback( ) {
-        if ( !geographics._timeoutEnd ) {
-          // something has canceled the draw
-          return;
-        }
-
-        if ( geographics._trueCanvas && geographics._options.doubleBuffer && geographics._trueDoubleBuffer ) {
-          //console.log("    endCallback...");
-
-          //geographics._$canvasSceneFront = 
-          geographics._$canvasSceneBack.prop( "src", "" ).one( "load", function( e ) {
-            //console.log("    ...flip: show " + geographics._$canvasSceneBack.prop( "id" ) + ", hide " + geographics._$canvasSceneFront.prop("id"));
-            geographics._requireFlip = false;
-            var oldCanvasScene = geographics._$canvasSceneFront;
-
-            geographics._$canvasSceneFront = geographics._$canvasSceneBack.css( {
-              left: 0,
-              top: 0,
-              width: geographics._width,
-              height: geographics._height
-            } ).prependTo( geographics._$elem );
-
-            geographics._$canvasSceneBack = oldCanvasScene.detach();
-          } ).prop( "src", geographics._$canvas[ 0 ].toDataURL( ) );
-        }
-
-
-        geographics._$labelsContainerBack.html( geographics._labelsHtml );
-
-        var oldLabelsContainer = geographics._$labelsContainerFront;
-
-        geographics._$labelsContainerFront = geographics._$labelsContainerBack.css( {
-          left: 0,
-          top: 0,
-          width: geographics._width,
-          height: geographics._height
-        } ).prependTo( geographics._$elem );
-
-        geographics._$labelsContainerBack = oldLabelsContainer.detach();
-
-
-        geographics._timeoutEnd = null;
-      }
-
-      //if ( this._options.doubleBuffer ) {
-        this._timeoutEnd = setTimeout( endCallback, 20 );
-      //} else {
-        //geographics._$labelsContainerFront.html( geographics._labelsHtml );
-      //}
-    },
-
-    _getGraphicStyle: function (style) {
-      function safeParse(value) {
-        value = parseInt(value, 10);
-        return (+value + '') === value ? +value : value;
-      }
-
-      style = $.extend({}, this._options.style, style);
-      style.borderRadiusValue = safeParse(style.borderRadius);
-      style.fill = style.fill || style.color;
-      style.doFill = style.fill && style.fillOpacity > 0;
-      style.stroke = style.stroke || style.color;
-      style.strokeWidthValue = safeParse(style.strokeWidth);
-      style.doStroke = style.stroke && style.strokeOpacity > 0 && style.strokeWidthValue > 0;
-      style.widthValue = safeParse(style.width);
-      style.heightValue = safeParse(style.height);
-      return style;
-    },
-
-    _drawLines: function (coordinates, close, style) {
-      if (!coordinates || !coordinates.length || coordinates[0].length < 2) {
-        return;
-      }
-
-      var i, j;
-      style = this._getGraphicStyle(style);
-
-      if (style.visibility != "hidden" && style.opacity > 0) {
-        this._context.beginPath();
-
-        for (i = 0; i < coordinates.length; i++) {
-          this._context.moveTo(coordinates[i][0][0], coordinates[i][0][1]);
-          for (j = 1; j < coordinates[i].length; j++) {
-            this._context.lineTo(coordinates[i][j][0], coordinates[i][j][1]);
-          }
-        }
-
-        if (close) {
-          this._context.closePath();
-        }
-
-        if (close && style.doFill) {
-          this._context.fillStyle = style.fill;
-          this._context.globalAlpha = style.opacity * style.fillOpacity;
-          this._context.fill();
-        }
-
-        if (style.doStroke) {
-          this._context.lineCap = this._context.lineJoin = "round";
-          this._context.lineWidth = style.strokeWidthValue;
-          this._context.strokeStyle = style.stroke;
-
-          this._context.globalAlpha = style.opacity * style.strokeOpacity;
-          this._context.stroke();
-        }
-
-          //if ( this._options.doubleBuffer ) console.log("_drawLines:_end " + $.now());
-        this._end( );
-      }
-    }
-  });
-}(jQuery));
-
-
-(function ($, undefined) {
-  var _widgetIdSeed = 0,
-      _ieVersion = ( function () {
-        var v = 5, div = document.createElement("div"), a = div.all || [];
-        do {
-          div.innerHTML = "<!--[if gt IE " + (++v) + "]><br><![endif]-->";
-        } while ( a[0] );
-        return v > 6 ? v : !v;
-      }() ),
-
-      _defaultOptions = {
-        bbox: [-180, -85, 180, 85],
-        bboxMax: [-180, -85, 180, 85],
-        center: [0, 0],
-        cursors: {
-          "static": "default",
-          pan: "url(data:image/vnd.microsoft.icon;base64,AAACAAEAICACAAgACAAwAQAAFgAAACgAAAAgAAAAQAAAAAEAAQAAAAAAAAEAAAAAAAAAAAAAAgAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8AAAA/AAAAfwAAAP+AAAH/gAAB/8AAA//AAAd/wAAGf+AAAH9gAADbYAAA2yAAAZsAAAGbAAAAGAAAAAAAAA//////////////////////////////////////////////////////////////////////////////////////gH///4B///8Af//+AD///AA///wAH//4AB//8AAf//AAD//5AA///gAP//4AD//8AF///AB///5A////5///8=), move",
-          zoom: "crosshair",
-          dragBox: "crosshair",
-          dragCircle: "crosshair",
-          drawPoint: "crosshair",
-          drawLineString: "crosshair",
-          drawPolygon: "crosshair",
-          measureLength: "crosshair",
-          measureArea: "crosshair"
-        },
-        measureLabels: {
-          length: "{{:length.toFixed( 2 )}} m",
-          area: "{{:area.toFixed( 2 )}} sq m"
-        },
-        drawStyle: {},
-        shapeStyle: {},
-        mode: "pan",
-        pannable: true,
-        scroll: "default",
-        shift: "default",
-        services: [
-            {
-              "class": "osm",
-              type: "tiled",
-              src: function (view) {
-                return "http://otile" + ((view.index % 4) + 1) + ".mqcdn.com/tiles/1.0.0/osm/" + view.zoom + "/" + view.tile.column + "/" + view.tile.row + ".png";
-              },
-              attr: "Tiles Courtesy of <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png'>"
-            }
-          ],
-        tilingScheme: {
-          tileWidth: 256,
-          tileHeight: 256,
-          levels: 18,
-          basePixelSize: 156543.03392799936,
-          origin: [-20037508.342787, 20037508.342787]
-        },
-        axisLayout: "map",
-        zoom: 0,
-        zoomMin: 0,
-        zoomMax: Number.POSITIVE_INFINITY,
-        pixelSize: 0
-      };
-
-  $.widget("geo.geomap", {
-    // private widget members
-    _$elem: undefined, //< map div for maps, service div for services
-    _map: undefined, //< only defined in services
-    _created: false,
-    _createdGraphics: false,
-    _widgetId: 0,
-    _tmplLengthId: "",
-    _tmplAreaId: "",
-
-    _contentBounds: {},
-
-    _$resizeContainer: undefined, //< all elements that should match _contentBounds' size
-
-    _$eventTarget: undefined,
-    _$contentFrame: undefined,
-    _$existingChildren: undefined,
-    _$attrList: undefined,
-    _$servicesContainer: undefined,
-    _$shapesContainers: undefined, //< all shapesContainer divs (map only)
-
-    _$panContainer: undefined, //< all non-service elements that move while panning
-    _$shapesContainer: undefined, //< just "our" shapesContainer div (map & service)
-    _$drawContainer: undefined,
-    _$measureContainer: undefined,
-    _$measureLabel: undefined,
-
-    _dpi: 96,
-
-    _currentServices: [], //< internal copy
-
-    _center: undefined,
-    _pixelSize: undefined,
-    _centerMax: undefined,
-    _pixelSizeMax: undefined,
-
-    _userGeodetic: true,
-
-    _centerInteractive: undefined,
-    _pixelSizeInteractive: undefined,
-    _timeoutInteractive: null,
-    _triggerInteractive: false,
-
-    _timeoutRefreshShapes: null,
-
-    _loadCount: 0,
-
-    _wheelTimeout: null,
-    _wheelLevel: 0,
-
-    _zoomFactor: 2, //< determines what a zoom level means
-
-    _fullZoomFactor: 2, //< interactiveScale factor needed to zoom a whole level
-    _partialZoomFactor: 1.18920711500273, //< interactiveScale factor needed to zoom a fraction of a level (the fourth root of 2)
-
-    _mouseDown: undefined,
-    _inOp: undefined,
-    _toolPan: undefined,
-    _shiftDown: undefined,
-    _anchor: undefined,
-    _current: undefined,
-    _downDate: undefined,
-    _moveDate: undefined,
-    _clickDate: undefined,
-    _lastMove: undefined,
-    _lastDrag: undefined,
-
-    _windowHandler: null,
-    _resizeTimeout: null,
-
-    _panning: undefined,
-    _velocity: undefined,
-    _friction: undefined,
-
-    _supportTouch: undefined,
-    _softDblClick: undefined,
-    _isTap: undefined,
-    _isDbltap: undefined,
-
-    _isMultiTouch: undefined,
-    _multiTouchAnchor: [], //< TouchList
-    _multiTouchAnchorBbox: undefined, //< bbox
-    _multiTouchCurrentBbox: undefined, //< bbox
-
-    _drawTimeout: null, //< used in drawPoint mode so we don't send two shape events on dbltap
-    _drawPixels: [], //< an array of coordinate arrays for drawing lines & polygons, in pixel coordinates
-    _drawCoords: [],
-
-    _graphicShapes: [], //< an array of objects containing style object refs & GeoJSON object refs
-
-    _initOptions: {},
-
-    _options: {},
-
-    options: $.extend({}, _defaultOptions),
-
-    _createWidget: function (options, element) {
-      this._$elem = $(element);
-
-      if (this._$elem.is(".geo-service")) {
-        this._graphicShapes = [];
-        $.Widget.prototype._createWidget.apply(this, arguments);
-        return;
-      }
-
-      this._widgetId = _widgetIdSeed++;
-      this._tmplLengthId = "geoMeasureLength" + this._widgetId;
-      this._tmplAreaId = "geoMeasureArea" + this._widgetId;
-
-      this._$elem.addClass("geo-map").css( {
-        webkitTransform: "translateZ(0)"
-      } );
-        
-
-      this._initOptions = options || {};
-
-      this._forcePosition(this._$elem);
-
-      this._$elem.css("text-align", "left");
-
-      var size = this._findMapSize();
-      this._contentBounds = {
-        x: parseInt(this._$elem.css("padding-left"), 10),
-        y: parseInt(this._$elem.css("padding-top"), 10),
-        width: size["width"],
-        height: size["height"]
-      };
-
-      this._createChildren();
-
-      this._center = [ 0, 0 ];
-      this._centerMax = [ 0, 0 ];
-      this._centerInteractive = [ 0, 0 ];
-
-      this.options["pixelSize"] = this._pixelSize = this._pixelSizeMax = 156543.03392799936;
-
-      this._mouseDown =
-          this._inOp =
-          this._toolPan =
-          this._shiftDown =
-          this._panning =
-          this._isTap =
-          this._isDbltap = false;
-
-      this._anchor = [ 0, 0 ];
-      this._current = [ 0, 0 ];
-      this._lastMove = [ 0, 0 ];
-      this._lastDrag = [ 0, 0 ];
-      this._velocity = [ 0, 0 ];
-
-      this._friction = [0.8, 0.8];
-
-      this._downDate =
-          this._moveDate =
-          this._clickDate = 0;
-
-      this._drawPixels = [];
-      this._drawCoords =  [];
-      this._graphicShapes = [];
-
-
-      $.Widget.prototype._createWidget.apply(this, arguments);
-    },
-
-    _create: function () {
-      this._options = this.options;
-
-      if (this._$elem.is(".geo-service")) {
-        this._map = this._$elem.data( "geoMap" );
-        this._$elem.data( "geoService", this );
-        return;
-      }
-
-      this._map = this;
-
-      this._supportTouch = "ontouchend" in document;
-      this._softDblClick = this._supportTouch || _ieVersion == 7;
-
-      var geomap = this,
-          touchStartEvent = this._supportTouch ? "touchstart" : "mousedown",
-          touchStopEvent = this._supportTouch ? "touchend touchcancel" : "mouseup",
-          touchMoveEvent = this._supportTouch ? "touchmove" : "mousemove";
-
-      $(document).keydown($.proxy(this._document_keydown, this));
-
-      this._$eventTarget.dblclick($.proxy(this._eventTarget_dblclick, this));
-
-      this._$eventTarget.bind(touchStartEvent, $.proxy(this._eventTarget_touchstart, this));
-
-      var dragTarget = (this._$eventTarget[0].setCapture) ? this._$eventTarget : $(document);
-      dragTarget.bind(touchMoveEvent, $.proxy(this._dragTarget_touchmove, this));
-      dragTarget.bind(touchStopEvent, $.proxy(this._dragTarget_touchstop, this));
-
-      this._$eventTarget.mousewheel($.proxy(this._eventTarget_mousewheel, this));
-
-      this._windowHandler = function () {
-        if (geomap._resizeTimeout) {
-          clearTimeout(geomap._resizeTimeout);
-        }
-        geomap._resizeTimeout = setTimeout(function () {
-          if (geomap._created) {
-            geomap._$elem.geomap( "resize", true );
-          }
-        }, 500);
-      };
-
-      $(window).resize(this._windowHandler);
-
-      this._$drawContainer.geographics({ style: this._initOptions.drawStyle || {}, doubleBuffer: false });
-      this._options["drawStyle"] = this._$drawContainer.geographics("option", "style");
-
-      this._$shapesContainer.geographics( { style: this._initOptions.shapeStyle || { } } );
-      this._createdGraphics = true;
-
-      this._options["shapeStyle"] = this._$shapesContainer.geographics("option", "style");
-
-      if (this._initOptions) {
-        // always init tilingScheme right away, even if it's null
-        if ( this._initOptions.tilingScheme !== undefined ) {
-          this._setOption("tilingScheme", this._initOptions.tilingScheme || null, false);
-        }
-
-        if ( this._initOptions.services ) {
-          // jQuery UI Widget Factory merges user services with our default, we want to clobber the default
-          this._options[ "services" ] = $.merge( [ ], this._initOptions.services );
-        }
-        if (this._initOptions.bboxMax) {
-          this._setOption("bboxMax", this._initOptions.bboxMax, false);
-          this._setOption("bbox", this._initOptions.bboxMax, false);
-        }
-        if (this._initOptions.zoomMin !== undefined) {
-          this._setOption("zoomMin", this._initOptions.zoomMin, false);
-        }
-        if (this._initOptions.zoomMax !== undefined) {
-          this._setOption("zoomMax", this._initOptions.zoomMax, false);
-        }
-        if (this._initOptions.bbox) {
-          this._setOption("bbox", this._initOptions.bbox, false);
-        }
-        if (this._initOptions.center) {
-          this._setOption("center", this._initOptions.center, false);
-        }
-        if (this._initOptions.zoom !== undefined) {
-          this._setOption("zoom", this._initOptions.zoom, false);
-        }
-      }
-
-      $.templates( this._tmplLengthId, this._options[ "measureLabels" ].length );
-      $.templates( this._tmplAreaId, this._options[ "measureLabels" ].area );
-
-      this._$eventTarget.css("cursor", this._options["cursors"][this._options["mode"]]);
-
-      this._createServices();
-      this._refresh();
-
-      this._created = true;
-    },
-
-    _setOption: function (key, value, refresh) {
-      if ( key == "pixelSize" ) {
-        return;
-      }
-
-      refresh = (refresh === undefined || refresh);
-
-      if ( this._$elem.is( ".geo-map" ) ) {
-        this._panFinalize();
-      }
-
-      var center, pixelSize, bbox, zoom;
-
-      switch (key) {
-        case "bbox":
-          if ( this._created ) {
-            this._clearInteractiveTimeout( );
-          }
-
-          this._userGeodetic = $.geo.proj && $.geo._isGeodetic( value );
-          if ( this._userGeodetic ) {
-            value = $.geo.proj.fromGeodetic( value );
-          }
-
-          center = [value[0] + (value[2] - value[0]) / 2, value[1] + (value[3] - value[1]) / 2];
-          pixelSize = Math.max($.geo.width(value, true) / this._contentBounds.width, $.geo.height(value, true) / this._contentBounds.height);
-
-          // clamp to zoom
-          zoom = this._getZoom( center, pixelSize );
-
-          if ( this._options[ "tilingScheme" ] ) {
-            pixelSize = this._getPixelSize( Math.min( Math.max( zoom, this._options[ "zoomMin" ] ), this._options[ "zoomMax" ] ) );
-          } else {
-            if ( zoom < this._options[ "zoomMin" ] ) {
-              pixelSize = this._getPixelSize( this._options[ "zoomMin" ] );
-            } else if ( zoom > this._options[ "zoomMax" ] ) {
-              pixelSize = this._getPixelSize( this._options[ "zoomMax" ] );
-            }
-          }
-
-          if ( this._created ) {
-            this._setInteractiveCenterAndSize( center, pixelSize );
-            this._setInteractiveTimeout( false );
-          } else {
-            this._setCenterAndSize( center, pixelSize, false, refresh );
-          }
-
-          value = this._getBbox( center, pixelSize );
-          break;
-
-        case "bboxMax":
-          this._userGeodetic = $.geo.proj && $.geo._isGeodetic( value );
-          break;
-
-        case "center":
-          if ( this._created ) {
-            this._clearInteractiveTimeout( );
-          }
-
-          this._userGeodetic = $.geo.proj && $.geo._isGeodetic( value );
-          if ( this._userGeodetic ) {
-            value = $.geo.proj.fromGeodetic( value );
-          }
-
-          if ( this._created ) {
-            this._setInteractiveCenterAndSize( value, this._pixelSizeInteractive );
-            this._interactiveTransform( );
-            this._setInteractiveTimeout( false );
-          } else {
-            this._setCenterAndSize( value, this._pixelSize, false, refresh );
-          }
-          break;
-
-        case "measureLabels":
-          value = $.extend( this._options[ "measureLabels" ], value );
-
-
-          $.templates( this._tmplLengthId, this._options[ "measureLabels" ].length );
-          $.templates( this._tmplAreaId, this._options[ "measureLabels" ].area );
-
-          break;
-
-        case "drawStyle":
-          if (this._$drawContainer) {
-            this._$drawContainer.geographics("option", "style", value);
-            value = this._$drawContainer.geographics("option", "style");
-          }
-          break;
-
-        case "shapeStyle":
-          if ( this._$elem.is( ".geo-service" ) && !this._createdGraphics ) {
-            this._createServiceGraphics( );
-          }
-
-          if ( this._createdGraphics ) {
-            this._$shapesContainer.geographics("option", "style", value);
-            value = this._$shapesContainer.geographics("option", "style");
-          }
-          break;
-
-        case "mode":
-          this._resetDrawing( );
-          this._$eventTarget.css("cursor", this._options["cursors"][value]);
-          break;
-
-        case "zoom":
-          if ( this._created ) {
-            this._setZoom(value, false, refresh);
-          } else {
-            value = Math.max( value, 0 );
-            this._setCenterAndSize( this._center, this._getPixelSize( value ), false, refresh );
-          }
-          break;
-      }
-
-      $.Widget.prototype._setOption.apply(this, arguments);
-
-      switch ( key ) {
-        case "bbox":
-        case "center":
-          if ( this._userGeodetic ) {
-            this._options[ "bbox" ] = $.geo.proj.toGeodetic( this._options[ "bbox" ] );
-            this._options[ "center" ] = $.geo.proj.toGeodetic( this._center );
-          }
-          break;
-
-        case "tilingScheme":
-          if ( value !== null ) {
-            this._pixelSizeMax = this._getPixelSize( 0 );
-            this._centerMax = [
-              value.origin[ 0 ] + this._pixelSizeMax * value.tileWidth / 2,
-              value.origin[ 1 ] + this._pixelSizeMax * value.tileHeight / 2
-            ];
-          }
-          break;
-
-        case "bboxMax":
-          if ( $.geo.proj && $.geo._isGeodetic( value ) ) {
-            bbox = $.geo.proj.fromGeodetic( value );
-          } else {
-            bbox = value;
-          }
-
-          this._centerMax = $.geo.center( bbox );
-          this._pixelSizeMax = Math.max( $.geo.width( bbox, true ) / this._contentBounds.width, $.geo.height( bbox, true ) / this._contentBounds.height );
-          break;
-
-        case "services":
-          this._createServices();
-          if (refresh) {
-            this._refresh();
-            this._refreshAllShapes();
-          }
-          break;
-
-        case "shapeStyle":
-          if ( refresh && this._createdGraphics ) {
-            this._$shapesContainer.geographics("clear");
-            this._refreshShapes( this._$shapesContainer, this._graphicShapes, this._graphicShapes, this._graphicShapes );
-          }
-          break;
-      }
-    },
-
-    destroy: function () {
-      if ( this._$elem.is(".geo-service") ) {
-        if ( this._createdGraphics ) {
-          this._$shapesContainer.geographics("destroy");
-          this._$shapesContainer = undefined;
-          this._createdGraphics = false;
-        }
-      } else {
-        clearTimeout( this._timeoutInteractive );
-        this._timeoutInteractive = null;
-
-        this._created = false;
-
-        $(window).unbind("resize", this._windowHandler);
-
-        for ( var i = 0; i < this._currentServices.length; i++ ) {
-          this._currentServices[ i ].serviceContainer.geomap("destroy");
-          $.geo["_serviceTypes"][this._currentServices[i].type].destroy(this, this._$servicesContainer, this._currentServices[i]);
-        }
-
-        this._$shapesContainer.geographics("destroy");
-        this._$shapesContainer = undefined;
-        this._createdGraphics = false;
-
-        this._$drawContainer.geographics("destroy");
-        this._$drawContainer = undefined;
-
-        this._$existingChildren.detach();
-        this._$elem.html("");
-        this._$elem.append(this._$existingChildren);
-        this._$elem.removeClass("geo-map");
-      }
-
-      $.Widget.prototype.destroy.apply(this, arguments);
-    },
-
-    toMap: function (p) {
-      p = this._toMap(p);
-      return this._userGeodetic ? $.geo.proj.toGeodetic(p) : p;
-    },
-
-    toPixel: function ( p, _center /* Internal Use Only */, _pixelSize /* Internal Use Only */ ) {
-      return this._toPixel( $.geo.proj ? $.geo.proj.fromGeodetic( p ) : p, _center, _pixelSize );
-    },
-
-    opacity: function ( value, _serviceContainer ) {
-      if ( this._$elem.is( ".geo-service" ) ) {
-        this._$elem.closest( ".geo-map" ).geomap( "opacity", value, this._$elem );
-      } else {
-        if ( value >= 0 || value <= 1 ) {
-          for ( var i = 0; i < this._currentServices.length; i++ ) {
-            var service = this._currentServices[ i ];
-            if ( !_serviceContainer || service.serviceContainer[ 0 ] == _serviceContainer[ 0 ] ) {
-              service.style.opacity = value;
-
-              // update the original service object's style property
-              service.serviceObject.style = $.extend( { }, service.serviceObject.style, service.style );
-
-              $.geo[ "_serviceTypes" ][ service.type ].opacity( this, service );
-            }
-          }
-        }
-      }
-    },
-
-    toggle: function ( value, _serviceContainer ) {
-      if ( this._$elem.is( ".geo-service" ) ) {
-        this._$elem.closest( ".geo-map" ).geomap( "toggle", value, this._$elem );
-      } else {
-
-        for ( var i = 0; i < this._currentServices.length; i++ ) {
-          var service = this._currentServices[ i ];
-
-          if ( !_serviceContainer || service.serviceContainer[ 0 ] == _serviceContainer[ 0 ] ) {
-            if ( value === undefined ) {
-              // toggle visibility
-              value = ( service.style.visibility !== "visible" );
-            }
-
-            service.style.visibility = ( value ? "visible" : "hidden" );
-
-            // update the original service object's style property
-            service.serviceObject.style = $.extend( { }, service.serviceObject.style, service.style );
-
-            service.serviceContainer.toggle( value );
-
-            if ( value ) {
-              $.geo[ "_serviceTypes" ][ service.type ].refresh( this, service );
-            }
-          }
-        }
-      }
-    },
-
-    zoom: function (numberOfLevels) {
-      if (numberOfLevels !== null) {
-        this._setZoom(this._options["zoom"] + numberOfLevels, false, true);
-      }
-    },
-
-    refresh: function ( force, _serviceContainer ) {
-      if ( this._$elem.is( ".geo-service" ) ) {
-        this._$elem.closest( ".geo-map" ).geomap( "refresh", force, this._$elem );
-      } else {
-        this._refresh( force, _serviceContainer );
-        this._refreshAllShapes( );
-      }
-    },
-
-    resize: function ( _trigger /* Internal Use Only */ ) {
-      var size = this._findMapSize(),
-          dx = size["width"]/2 - this._contentBounds.width/2,
-          dy = size["height"]/2 - this._contentBounds.height/2,
-          i;
-
-      this._contentBounds = {
-        x: parseInt(this._$elem.css("padding-left"), 10),
-        y: parseInt(this._$elem.css("padding-top"), 10),
-        width: size["width"],
-        height: size["height"]
-      };
-
-      this._$resizeContainer.css( {
-        width: size["width"],
-        height: size["height"]
-      } );
-
-      for (i = 0; i < this._currentServices.length; i++) {
-        $.geo["_serviceTypes"][this._currentServices[i].type].resize(this, this._currentServices[i]);
-      }
-
-      this._$elem.find( ".geo-graphics" ).css( {
-        width: size["width"],
-        height: size["height"]
-      }).geographics( "resize" );
-
-      for (i = 0; i < this._drawPixels.length; i++) {
-        this._drawPixels[i][0] += dx;
-        this._drawPixels[i][1] += dy;
-      }
-
-      this._setCenterAndSize(this._center, this._pixelSize, _trigger, true);
-    },
-
-    append: function ( shape, style, label, refresh ) {
-      if ( shape && ( $.isPlainObject( shape ) || ( $.isArray( shape ) && shape.length > 0 ) ) ) {
-        if ( !this._createdGraphics ) {
-          this._createServiceGraphics( );
-        }
-
-        var shapes, arg, i, realStyle, realLabel, realRefresh;
-
-        if ( $.isArray( shape ) ) {
-          shapes = shape;
-        } else if ( shape.type == "FeatureCollection" ) {
-          shapes = shape.features;
-        } else {
-          shapes = [ shape ];
-        }
-
-        for ( i = 1; i < arguments.length; i++ ) {
-          arg = arguments[ i ];
-
-          if ( typeof arg === "object" ) {
-            realStyle = arg;
-          } else if ( typeof arg === "number" || typeof arg === "string" ) {
-            realLabel = arg;
-          } else if ( typeof arg === "boolean" ) {
-            realRefresh = arg;
-          }
-        }
-
-        for ( i = 0; i < shapes.length; i++ ) {
-          if ( shapes[ i ].type != "Point" ) {
-            var bbox = $.geo.bbox( shapes[ i ] );
-            if ( $.geo.proj && $.geo._isGeodetic( bbox ) ) {
-              bbox = $.geo.proj.fromGeodetic( bbox );
-            }
-            $.data( shapes[ i ], "geoBbox", bbox );
-          }
-
-          this._graphicShapes.push( {
-            shape: shapes[ i ],
-            style: realStyle,
-            label: realLabel
-          } );
-        }
-
-        if ( realRefresh === undefined || realRefresh ) {
-          if ( this._$elem.is( ".geo-service" ) ) {
-            this._refresh( false, this._$elem );
-          } else {
-            this._refresh( );
-          }
-          this._refreshAllShapes( );
-        }
-      }
-    },
-
-    empty: function ( refresh ) {
-      for ( var i = 0; i < this._graphicShapes.length; i++ ) {
-        $.removeData( this._graphicShapes[ i ].shape, "geoBbox" );
-      }
-
-      this._graphicShapes = [];
-
-      if ( refresh === undefined || refresh ) {
-        if ( this._$elem.is( ".geo-service" ) ) {
-          this._refresh( false, this._$elem );
-        } else {
-          this._refresh( );
-        }
-        this._refreshAllShapes( );
-      }
-    },
-
-    find: function ( selector, pixelTolerance ) {
-      var isPoint = $.isPlainObject( selector ),
-          searchPixel = isPoint ? this._map.toPixel( selector.coordinates ) : undefined,
-          mapTol = this._map._pixelSize * pixelTolerance,
-          result = [],
-          graphicShape,
-          geometries,
-          curGeom,
-          i = 0;
-
-      for ( ; i < this._graphicShapes.length; i++ ) {
-        graphicShape = this._graphicShapes[ i ];
-
-        if ( isPoint ) {
-          if ( graphicShape.shape.type == "Point" ) {
-            if ( $.geo.distance( graphicShape.shape, selector ) <= mapTol ) {
-              result.push( graphicShape.shape );
-            }
-          } else {
-            var bbox = $.data( graphicShape.shape, "geoBbox" ),
-                bboxPolygon = {
-                  type: "Polygon",
-                  coordinates: [ [
-                    [bbox[0], bbox[1]],
-                    [bbox[0], bbox[3]],
-                    [bbox[2], bbox[3]],
-                    [bbox[2], bbox[1]],
-                    [bbox[0], bbox[1]]
-                  ] ]
-                },
-                projectedPoint = {
-                  type: "Point",
-                  coordinates: $.geo.proj && $.geo._isGeodetic( selector.coordinates ) ? $.geo.proj.fromGeodetic( selector.coordinates ) : selector.coordinates
-                };
-
-            if ( $.geo.distance( bboxPolygon, projectedPoint, true ) <= mapTol ) {
-              geometries = $.geo._flatten( graphicShape.shape );
-              for ( curGeom = 0; curGeom < geometries.length; curGeom++ ) {
-                if ( $.geo.distance( geometries[ curGeom ], selector ) <= mapTol ) {
-                  result.push( graphicShape.shape );
-                  break;
-                }
-              }
-            }
-          }
-        } else {
-          result.push( graphicShape.shape );
-        }
-      }
-
-      if ( this._$elem.is( ".geo-map" ) ) {
-        this._$elem.find( ".geo-service" ).each( function( ) {
-          result = $.merge( result, $( this ).geomap( "find", selector, pixelTolerance ) );
-        } );
-      }
-
-      return result;
-    },
-
-    remove: function ( shape, refresh ) {
-      if ( shape && ( $.isPlainObject( shape ) || ( $.isArray( shape ) && shape.length > 0 ) ) ) {
-        var shapes = $.isArray( shape ) ? shape : [ shape ],
-            rest;
-
-        for ( var i = 0; i < this._graphicShapes.length; i++ ) {
-          if ( $.inArray( this._graphicShapes[ i ].shape, shapes ) >= 0 ) {
-            $.removeData( shape, "geoBbox" );
-            rest = this._graphicShapes.slice( i + 1 );
-            this._graphicShapes.length = i;
-            this._graphicShapes.push.apply( this._graphicShapes, rest );
-            i--;
-          }
-        }
-
-        if ( refresh === undefined || refresh ) {
-          if ( this._$elem.is( ".geo-service" ) ) {
-            this._refresh( false, this._$elem );
-          } else {
-            this._refresh( );
-          }
-          this._refreshAllShapes( );
-        }
-      }
-    },
-
-    _getBbox: function (center, pixelSize) {
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      // calculate the internal bbox
-      var halfWidth = this._contentBounds[ "width" ] / 2 * pixelSize,
-          halfHeight = this._contentBounds[ "height" ] / 2 * pixelSize;
-      return [ center[ 0 ] - halfWidth, center[ 1 ] - halfHeight, center[ 0 ] + halfWidth, center[ 1 ] + halfHeight ];
-    },
-
-    _setBbox: function (value, trigger, refresh) {
-      var center = [value[0] + (value[2] - value[0]) / 2, value[1] + (value[3] - value[1]) / 2],
-          pixelSize = Math.max($.geo.width(value, true) / this._contentBounds.width, $.geo.height(value, true) / this._contentBounds.height),
-          zoom = this._getZoom( center, pixelSize );
-
-      // clamp to zoom
-      if ( this._options[ "tilingScheme" ] ) {
-        pixelSize = this._getPixelSize( Math.min( Math.max( zoom, this._options[ "zoomMin" ] ), this._options[ "zoomMax" ] ) );
-      } else {
-        if ( zoom < this._options[ "zoomMin" ] ) {
-          pixelSize = this._getPixelSize( this._options[ "zoomMin" ] );
-        } else if ( zoom > this._options[ "zoomMax" ] ) {
-          pixelSize = this._getPixelSize( this._options[ "zoomMax" ] );
-        }
-      }
-
-      this._setInteractiveCenterAndSize( center, pixelSize );
-      this._interactiveTransform( );
-    },
-
-    _getBboxMax: function () {
-      // calculate the internal bboxMax
-      var halfWidth = this._contentBounds["width"] / 2 * this._pixelSizeMax,
-        halfHeight = this._contentBounds["height"] / 2 * this._pixelSizeMax;
-      return [this._centerMax[0] - halfWidth, this._centerMax[1] - halfHeight, this._centerMax[0] + halfWidth, this._centerMax[1] + halfHeight];
-    },
-
-    _getCenter: function () {
-      return this._center;
-    },
-
-    _getContentBounds: function () {
-      return this._contentBounds;
-    },
-
-    _getServicesContainer: function () {
-      return this._$servicesContainer;
-    },
-
-    _getZoom: function ( center, pixelSize ) {
-      // calculate the internal zoom level, vs. public zoom property
-      // this does not take zoomMin or zoomMax into account
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      var tilingScheme = this._options["tilingScheme"];
-      if ( tilingScheme ) {
-        if ( tilingScheme.pixelSizes ) {
-          var roundedPixelSize = Math.floor(pixelSize * 1000),
-              levels = tilingScheme.pixelSizes.length,
-              i = levels - 1;
-
-          for ( ; i >= 0; i-- ) {
-            if ( Math.floor( tilingScheme.pixelSizes[ i ] * 1000 ) >= roundedPixelSize ) {
-              return i;
-            }
-          }
-
-          return 0;
-        } else {
-          return Math.round( Math.log( tilingScheme.basePixelSize / pixelSize) / Math.log( 2 ) );
-        }
-      } else {
-        var ratio = this._contentBounds["width"] / this._contentBounds["height"],
-            bbox = $.geo.reaspect( this._getBbox( center, pixelSize ), ratio, true ),
-            bboxMax = $.geo.reaspect(this._getBboxMax(), ratio, true);
-
-        return Math.round( Math.log($.geo.width(bboxMax, true) / $.geo.width(bbox, true)) / Math.log(this._zoomFactor) );
-      }
-    },
-
-    _setZoom: function ( value, trigger, refresh ) {
-      // set the map widget's zoom, taking zoomMin and zoomMax into account
-      this._clearInteractiveTimeout( );
-
-      value = Math.min( Math.max( value, this._options[ "zoomMin" ] ), this._options[ "zoomMax" ] );
-
-      this._setInteractiveCenterAndSize( this._centerInteractive, this._getPixelSize( value ) );
-      this._interactiveTransform( );
-      this._setInteractiveTimeout( trigger );
-    },
-
-    _createChildren: function () {
-      this._$existingChildren = this._$elem.children();
-
-      this._forcePosition(this._$existingChildren);
-
-      this._$existingChildren.detach().css( {
-        mozUserSelect: "none"
-      } );
-
-
-      var contentSizeCss = "width:" + this._contentBounds["width"] + "px; height:" + this._contentBounds["height"] + "px; margin:0; padding:0;",
-          contentPosCss = "position:absolute; left:0; top:0;";
-
-      this._$elem.prepend('<div class="geo-event-target geo-content-frame" style="position:absolute; left:' + this._contentBounds.x + 'px; top:' + this._contentBounds.y + 'px;' + contentSizeCss + 'overflow:hidden; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none;" unselectable="on"></div>');
-      this._$eventTarget = this._$contentFrame = this._$elem.children(':first');
-
-      this._$contentFrame.append('<div class="geo-services-container" style="' + contentPosCss + contentSizeCss + '"></div>');
-      this._$servicesContainer = this._$contentFrame.children(':last');
-
-      this._$contentFrame.append('<div class="geo-shapes-container" style="' + contentPosCss + contentSizeCss + '"></div>');
-      this._$shapesContainer = this._$contentFrame.children(':last');
-
-      this._$contentFrame.append( '<ul style="position: absolute; bottom: 8px; left: 8px; list-style-type: none; max-width: 50%; padding: 0; margin: 0;"></ul>' );
-      this._$attrList = this._$contentFrame.children( ":last" );
-
-      this._$contentFrame.append('<div class="geo-draw-container" style="' + contentPosCss + contentSizeCss + '"></div>');
-      this._$drawContainer = this._$contentFrame.children(':last');
-
-      this._$contentFrame.append('<div class="geo-measure-container" style="' + contentPosCss + contentSizeCss + '"><span class="geo-measure-label" style="' + contentPosCss + '; display: none;"></span></div>');
-      this._$measureContainer = this._$contentFrame.children(':last');
-      this._$measureLabel = this._$measureContainer.children();
-
-      this._$panContainer = $( [ this._$shapesContainer[ 0 ], this._$drawContainer[ 0 ], this._$measureContainer[ 0 ] ] );
-
-      this._$resizeContainer = $( [ this._$contentFrame[ 0 ], this._$servicesContainer[ 0 ], this._$eventTarget[ 0 ], this._$measureContainer[ 0 ] ] ); 
-
-      this._$contentFrame.append(this._$existingChildren);
-
-      if ( ! $("#geo-measure-style").length ) {
-        $("head").prepend( '<style type="text/css" id="geo-measure-style">.geo-measure-label { margin: 4px 0 0 6px; font-family: sans-serif;' + ( _ieVersion ? 'letter-spacing: 2px; color: #444; filter:progid:DXImageTransform.Microsoft.DropShadow(Color=white, OffX=1, OffY=2, Positive=true);' : 'color: #000; text-shadow: #fff 1px 2px; font-weight: bold;' ) + ' }</style>' );
-      }
-    },
-
-    _createServices: function () {
-      var service, i;
-
-      for ( i = 0; i < this._currentServices.length; i++ ) {
-        this._currentServices[ i ].serviceContainer.geomap( "destroy" );
-        $.geo[ "_serviceTypes" ][ this._currentServices[ i ].type ].destroy( this, this._$servicesContainer, this._currentServices[ i ] );
-      }
-
-      this._currentServices = [ ];
-      this._$servicesContainer.html( "" );
-      this._$attrList.html( "" );
-
-      for ( i = 0; i < this._options[ "services" ].length; i++ ) {
-        service = this._currentServices[ i ] = $.extend( { }, this._options[ "services" ][ i ] );
-
-        // keep a reference to the original
-        service.serviceObject = this._options[ "services" ][ i ];
-
-        // default the service style property on our copy
-        service.style = $.extend( {
-                          visibility: "visible",
-                          opacity: 1
-                        }, service.style );
-
-        var idString = service.id ? ' id="' + service.id + '"' : "",
-            classString = 'class="geo-service ' + ( service["class"] ? service["class"] : '' ) + '"',
-            scHtml = '<div ' + idString + classString + ' style="-webkit-transform:translateZ(0);position:absolute; left:0; top:0; width:32px; height:32px; margin:0; padding:0; display:' + ( service.style.visibility === "visible" ? "block" : "none" ) + ';"></div>',
-            servicesContainer;
-
-        this._$servicesContainer.append( scHtml );
-        serviceContainer = this._$servicesContainer.children( ":last" );
-        service.serviceContainer = serviceContainer;
-        
-        $.geo[ "_serviceTypes" ][ service.type ].create( this, serviceContainer, service, i );
-
-        serviceContainer.data( "geoMap", this ).geomap();
-
-        if ( service.attr ) {
-          this._$attrList.append( '<li>' + service.attr + '</li>' );
-        }
-      }
-
-      // start with our map-level shapesContainer
-      this._$shapesContainers = this._$shapesContainer;
-
-      this._$attrList.find( "a" ).css( {
-        position: "relative",
-        zIndex: 100
-      } );
-    },
-
-    _createServiceGraphics: function( ) { 
-      // only called in the context of a service-level geomap
-      var $contentFrame = this._$elem.closest( ".geo-content-frame" );
-      this._$elem.append('<div class="geo-shapes-container" style="position:absolute; left:0; top:0; width:' + $contentFrame.css( "width" ) + '; height:' + $contentFrame.css( "height" ) + '; margin:0; padding:0;"></div>');
-      this._$shapesContainer = this._$elem.children(':last');
-
-      this._map._$shapesContainers = this._map._$shapesContainers.add( this._$shapesContainer );
-
-      this._$shapesContainer.geographics( );
-      this._createdGraphics = true;
-
-      this._options["shapeStyle"] = this._$shapesContainer.geographics("option", "style");
-    },
-
-    _refreshDrawing: function ( ) {
-      this._$drawContainer.geographics("clear");
-
-      if ( this._drawPixels.length > 0 ) {
-        var mode = this._options[ "mode" ],
-            pixels = this._drawPixels,
-            coords = this._drawCoords,
-            label,
-            labelShape,
-            labelPixel,
-            widthOver,
-            heightOver;
-
-        switch ( mode ) {
-          case "measureLength":
-            mode = "drawLineString";
-            labelShape = {
-              type: "LineString",
-              coordinates: coords
-            };
-            label = $.render[ this._tmplLengthId ]( { length: $.geo.length( labelShape, true ) } );
-            labelPixel = $.merge( [], pixels[ pixels.length - 1 ] );
-            break;
-
-          case "measureArea":
-            mode = "drawPolygon";
-
-            labelShape = {
-              type: "Polygon",
-              coordinates: [ $.merge( [ ], coords ) ]
-            };
-            labelShape.coordinates[ 0 ].push( coords[ 0 ] );
-
-            label = $.render[ this._tmplAreaId ]( { area: $.geo.area( labelShape, true ) } );
-            labelPixel = this._toPixel( $.geo.centroid( labelShape ).coordinates );
-            pixels = [ pixels ];
-            break;
-
-          case "drawPolygon":
-            pixels = [ pixels ];
-            break;
-        }
-
-        this._$drawContainer.geographics( mode, pixels );
-        
-        if ( label ) {
-          this._$measureLabel.html( label );
-
-          widthOver = this._contentBounds.width - ( this._$measureLabel.outerWidth( true ) + labelPixel[ 0 ] );
-          heightOver = this._contentBounds.height - ( this._$measureLabel.outerHeight( true ) + labelPixel[ 1 ] );
-
-          if ( widthOver < 0 ) {
-            labelPixel[ 0 ] += widthOver;
-          }
-
-          if ( heightOver < 0 ) {
-            labelPixel[ 1 ] += heightOver;
-          }
-
-          this._$measureLabel.css( {
-            left: Math.max( labelPixel[ 0 ], 0 ),
-            top: Math.max( labelPixel[ 1 ], 0 )
-          } ).show();
-        }
-      }
-    },
-
-    _resetDrawing: function () {
-      this._drawPixels = [];
-      this._drawCoords = [];
-      this._$drawContainer.geographics("clear");
-      this._$measureLabel.hide();
-    },
-
-    _refreshAllShapes: function ( ) {
-      this._timeoutRefreshShapes = null;
-
-      var service,
-          geoService,
-          i = 0;
-
-      for ( ; i < this._currentServices.length; i++ ) {
-        service = this._currentServices[ i ];
-        geoService = service.serviceContainer.data( "geoService" );
-
-        if ( geoService._createdGraphics ) {
-          geoService._$shapesContainer.geographics( "clear" );
-          if ( geoService._graphicShapes.length > 0 ) {
-            geoService._refreshShapes( geoService._$shapesContainer, geoService._graphicShapes, geoService._graphicShapes, geoService._graphicShapes );
-          }
-        }
-      }
-
-      if ( this._createdGraphics ) {
-        this._$shapesContainer.geographics( "clear" );
-        if ( this._graphicShapes.length > 0 ) {
-          this._refreshShapes( this._$shapesContainer, this._graphicShapes, this._graphicShapes, this._graphicShapes );
-        }
-      }
-    },
-
-
-    _refreshShapes: function (geographics, shapes, styles, labels, center, pixelSize) {
-      var i, mgi,
-          shape,
-          shapeBbox,
-          style,
-          label,
-          hasLabel,
-          labelPixel,
-          bbox = this._map._getBbox(center, pixelSize);
-
-      /*
-      if ( shapes.length > 0 ) {
-        console.log( "_refreshShapes " + $.now() );
-      }
-      */
-      for (i = 0; i < shapes.length; i++) {
-        shape = shapes[i].shape || shapes[i];
-        shape = shape.geometry || shape;
-        shapeBbox = $.data(shape, "geoBbox");
-
-        if ( shapeBbox && $.geo._bboxDisjoint( bbox, shapeBbox ) ) {
-          continue;
-        }
-
-        style = $.isArray(styles) ? styles[i].style : styles;
-        label = $.isArray(labels) ? labels[i].label : labels;
-        hasLabel = ( label !== undefined );
-        labelPixel = undefined;
-
-        switch (shape.type) {
-          case "Point":
-            labelPixel = this._map.toPixel( shape.coordinates, center, pixelSize );
-            this._$shapesContainer.geographics("drawPoint", labelPixel, style);
-            break;
-          case "LineString":
-            this._$shapesContainer.geographics("drawLineString", this._map.toPixel(shape.coordinates, center, pixelSize), style);
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.pointAlong( shape, 0.5 ).coordinates, center, pixelSize );
-            }
-            break;
-          case "Polygon":
-            this._$shapesContainer.geographics("drawPolygon", this._map.toPixel(shape.coordinates, center, pixelSize), style);
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize );
-            }
-            break;
-          case "MultiPoint":
-            for (mgi = 0; mgi < shape.coordinates.length; mgi++) {
-              this._$shapesContainer.geographics("drawPoint", this._map.toPixel(shape.coordinates[mgi], center, pixelSize), style);
-            }
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize );
-            }
-            break;
-          case "MultiLineString":
-            for (mgi = 0; mgi < shape.coordinates.length; mgi++) {
-              this._$shapesContainer.geographics("drawLineString", this._map.toPixel(shape.coordinates[mgi], center, pixelSize), style);
-            }
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize );
-            }
-            break;
-          case "MultiPolygon":
-            for (mgi = 0; mgi < shape.coordinates.length; mgi++) {
-              this._$shapesContainer.geographics("drawPolygon", this._map.toPixel(shape.coordinates[mgi], center, pixelSize), style);
-            }
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize );
-            }
-            break;
-
-          case "GeometryCollection":
-            this._refreshShapes(geographics, shape.geometries, style, label, center, pixelSize);
-            break;
-        }
-
-        if ( hasLabel && labelPixel ) {
-          this._$shapesContainer.geographics( "drawLabel", labelPixel, label );
-        }
-      }
-    },
-
-    _findMapSize: function () {
-      // really, really attempt to find a size for this thing
-      // even if it's hidden (look at parents)
-      var size = { width: 0, height: 0 },
-        sizeContainer = this._$elem;
-
-      while (sizeContainer.size() && !(size["width"] > 0 && size["height"] > 0)) {
-        size = { width: sizeContainer.width(), height: sizeContainer.height() };
-        if (size["width"] <= 0 || size["height"] <= 0) {
-          size = { width: parseInt(sizeContainer.css("width"), 10), height: parseInt(sizeContainer.css("height"), 10) };
-        }
-        sizeContainer = sizeContainer.parent();
-      }
-      return size;
-    },
-
-    _forcePosition: function (elem) {
-      var cssPosition = elem.css("position");
-      if (cssPosition != "relative" && cssPosition != "absolute" && cssPosition != "fixed") {
-        elem.css("position", "relative");
-      }
-    },
-
-    _getPixelSize: function ( zoom ) {
-      var tilingScheme = this._options["tilingScheme"];
-      if (tilingScheme !== null) {
-        if (zoom === 0) {
-          return tilingScheme.pixelSizes ? tilingScheme.pixelSizes[0] : tilingScheme.basePixelSize;
-        }
-
-        zoom = Math.round(zoom);
-        zoom = Math.max(zoom, 0);
-        var levels = tilingScheme.pixelSizes ? tilingScheme.pixelSizes.length : tilingScheme.levels;
-        zoom = Math.min(zoom, levels - 1);
-
-        if ( tilingScheme.pixelSizes ) {
-          return tilingScheme.pixelSizes[zoom];
-        } else {
-          return tilingScheme.basePixelSize / Math.pow(2, zoom);
-        }
-      } else {
-        var bbox = $.geo.scaleBy( this._getBboxMax(), 1 / Math.pow( this._zoomFactor, zoom ), true );
-        return Math.max( $.geo.width( bbox, true ) / this._contentBounds.width, $.geo.height( bbox, true ) / this._contentBounds.height );
-      }
-    },
-
-    _getZoomCenterAndSize: function ( anchor, zoomDelta, full ) {
-      var zoomFactor = ( full ? this._fullZoomFactor : this._partialZoomFactor ),
-          scale = Math.pow( zoomFactor, -zoomDelta ),
-          pixelSize = this._pixelSizeInteractive * scale,
-          zoom = this._getZoom(this._centerInteractive, pixelSize);
-
-      // clamp to zoom
-      if ( full && this._options[ "tilingScheme" ] ) {
-        pixelSize = this._getPixelSize( Math.min( Math.max( zoom, this._options[ "zoomMin" ] ), this._options[ "zoomMax" ] ) );
-      } else {
-        if ( zoomDelta < 0 && zoom < this._options[ "zoomMin" ] ) {
-          pixelSize = this._pixelSizeInteractive;
-        } else if ( zoomDelta > 0 && zoom > this._options[ "zoomMax" ] ) {
-          pixelSize = this._pixelSizeInteractive;
-        }
-      }
-
-      var ratio = pixelSize / this._pixelSizeInteractive,
-          anchorMapCoord = this._toMap( anchor, this._centerInteractive, this._pixelSizeInteractive ),
-          centerDelta = [(this._centerInteractive[0] - anchorMapCoord[0]) * ratio, (this._centerInteractive[1] - anchorMapCoord[1]) * ratio],
-          scaleCenter = [anchorMapCoord[0] + centerDelta[0], anchorMapCoord[1] + centerDelta[1]];
-
-      return { pixelSize: pixelSize, center: scaleCenter };
-    },
-
-    _mouseWheelFinish: function ( refresh ) {
-      this._wheelTimeout = null;
-
-      if (this._wheelLevel !== 0) {
-        var wheelCenterAndSize = this._getZoomCenterAndSize( this._anchor, this._wheelLevel, this._options[ "tilingScheme" ] !== null );
-
-        this._wheelLevel = 0;
-      } else if ( refresh ) {
-        this._refresh();
-        this._refreshAllShapes( );
-      }
-    },
-
-    _panFinalize: function () {
-      if (this._panning) {
-        this._velocity = [0, 0];
-
-        var dx = this._current[0] - this._anchor[0],
-            dy = this._current[1] - this._anchor[1],
-            image = this._options[ "axisLayout" ] === "image",
-            dxMap = -dx * this._pixelSize,
-            dyMap = ( image ? -1 : 1 ) * dy * this._pixelSize;
-
-        this._$eventTarget.css("cursor", this._options["cursors"][this._options["mode"]]);
-
-        this._inOp = false;
-        this._anchor = this._current;
-        this._mouseDown = this._toolPan = this._panning = false;
-      }
-    },
-
-    _panMove: function () {
-      if ( ! this._options[ "pannable" ] ) {
-        return;
-      }
-
-      var dx = this._current[0] - this._lastDrag[0],
-          dy = this._current[1] - this._lastDrag[1],
-          i = 0,
-          service,
-          translateObj;
-
-      if (this._toolPan || dx > 3 || dx < -3 || dy > 3 || dy < -3) {
-        if (!this._toolPan) {
-          this._toolPan = true;
-          this._$eventTarget.css("cursor", this._options["cursors"]["pan"]);
-        }
-
-        if (this._mouseDown) {
-          this._velocity = [dx, dy];
-        }
-
-        if (dx !== 0 || dy !== 0) {
-          this._panning = true;
-          this._lastDrag = this._current;
-
-          this._centerInteractive[ 0 ] -= ( dx * this._pixelSizeInteractive );
-          this._centerInteractive[ 1 ] += ( ( this._options[ "axisLayout" ] === "image" ? -1 : 1 ) * dy * this._pixelSizeInteractive );
-          this._setInteractiveCenterAndSize( this._centerInteractive, this._pixelSizeInteractive );
-          this._interactiveTransform( );
-        }
-      }
-    },
-
-    _clearInteractiveTimeout: function() {
-      if ( this._timeoutRefreshShapes ) {
-        clearTimeout( this._timeoutRefreshShapes );
-        this._timeoutRefreshShapes = null;
-      }
-
-      if ( this._timeoutInteractive ) {
-        clearTimeout( this._timeoutInteractive );
-        this._timeoutInteractive = null;
-        return true;
-      } else {
-        this._centerInteractive[ 0 ] = this._center[ 0 ];
-        this._centerInteractive[ 1 ] = this._center[ 1 ];
-        this._pixelSizeInteractive = this._pixelSize;
-        return false;
-      }
-    },
-
-    _interactiveTransform: function( ) {
-      var mapWidth = this._contentBounds[ "width" ],
-          mapHeight = this._contentBounds[ "height" ],
-
-          halfWidth = mapWidth / 2,
-          halfHeight = mapHeight / 2,
-
-          bbox = [ this._centerInteractive[ 0 ] - halfWidth, this._centerInteractive[ 1 ] - halfHeight, this._centerInteractive[ 0 ] + halfWidth, this._centerInteractive[ 1 ] + halfHeight ];
-
-      var scalePixelSize = this._pixelSize,
-          scaleRatio = scalePixelSize / this._pixelSizeInteractive;
-          
-      if ( scalePixelSize > 0 ) {
-        scaleRatio = Math.round(scaleRatio * 1000) / 1000;
-
-        var oldMapOrigin = this._toMap( [ 0, 0 ] ),
-            newPixelPoint = this._toPixel( oldMapOrigin, this._centerInteractive, this._pixelSizeInteractive );
-
-
-        this._$shapesContainers.geographics("interactiveTransform", newPixelPoint, scaleRatio);
-
-        /*
-        $scaleContainer.css( {
-          left: Math.round( newPixelPoint[ 0 ] ),
-          top: Math.round( newPixelPoint[ 1 ] ),
-          width: mapWidth * scaleRatio,
-          height: mapHeight * scaleRatio
-        } );
-        */
-        
-      }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-      for ( var i = 0; i < this._currentServices.length; i++ ) {
-        service = this._currentServices[ i ];
-        $.geo[ "_serviceTypes" ][ service.type ].interactiveTransform( this, service, this._centerInteractive, this._pixelSizeInteractive );
-      }
-
-      if (this._drawCoords.length > 0) {
-        this._drawPixels = this._toPixel( this._drawCoords, this._centerInteractive, this._pixelSizeInteractive );
-        this._refreshDrawing();
-      }
-    },
-
-    _interactiveTimeout: function( ) {
-      if ( this._isMultiTouch ) {
-        this._timeoutInteractive = setTimeout( $.proxy( interactiveTimeout, this ), 128 );
-      } else if ( this._created && this._timeoutInteractive ) {
-        this._setCenterAndSize( this._centerInteractive, this._pixelSizeInteractive, this._triggerInteractive, true );
-        this._timeoutInteractive = null;
-        this._triggerInteractive = false;
-
-        this._timeoutRefreshShapes = setTimeout( $.proxy( this._refreshAllShapes, this ), 128 );
-      }
-    },
-
-    _setInteractiveTimeout: function( trigger ) {
-      this._timeoutInteractive = setTimeout( $.proxy( this._interactiveTimeout, this ), 128 );
-      this._triggerInteractive |= trigger;
-    },
-
-    _refresh: function ( force, _serviceContainer ) {
-      var service,
-          i = 0;
-
-      for ( ; i < this._currentServices.length; i++ ) {
-        service = this._currentServices[ i ];
-        if ( !_serviceContainer || service.serviceContainer[ 0 ] == _serviceContainer[ 0 ] ) {
-          $.geo[ "_serviceTypes" ][ service.type ].refresh( this, service, force );
-        }
-      }
-    },
-
-    _setInteractiveCenterAndSize: function ( center, pixelSize ) {
-      // set the temporary (interactive) center & size
-      // also, update the public-facing options
-      // this does not take zoomMin or zoomMax into account
-      this._centerInteractive[ 0 ] = center[ 0 ];
-      this._centerInteractive[ 1 ] = center[ 1 ];
-      this._pixelSizeInteractive = pixelSize;
-
-      if ( this._userGeodetic ) {
-        this._options["bbox"] = $.geo.proj.toGeodetic( this._getBbox( center, pixelSize ) );
-        this._options["center"] = $.geo.proj.toGeodetic( center );
-      } else {
-        this._options["bbox"] = this._getBbox( center, pixelSize );
-        this._options["center"][ 0 ] = center[ 0 ];
-        this._options["center"][ 1 ] = center[ 1 ];
-      }
-
-      this._options["pixelSize"] = pixelSize;
-      this._options["zoom"] = this._getZoom( center, pixelSize );
-    },
-
-    _setCenterAndSize: function (center, pixelSize, trigger, refresh) {
-      if ( ! $.isArray( center ) || center.length != 2 || typeof center[ 0 ] !== "number" || typeof center[ 1 ] !== "number" ) {
-        return;
-      }
-
-      // the final call during any extent change
-      // only called by timeoutInteractive & resize
-      // clamp to zoom
-      var zoom = this._getZoom( center, pixelSize );
-
-      if ( this._options[ "tilingScheme" ] ) {
-        this._pixelSizeInteractive = pixelSize = this._getPixelSize( Math.min( Math.max( zoom, this._options[ "zoomMin" ] ), this._options[ "zoomMax" ] ) );
-      } else {
-        if ( zoom < this._options[ "zoomMin" ] ) {
-          this._pixelSizeInteractive = pixelSize = this._getPixelSize( this._options[ "zoomMin" ] );
-        } else if ( zoom > this._options[ "zoomMax" ] ) {
-          this._pixelSizeInteractive = pixelSize = this._getPixelSize( this._options[ "zoomMax" ] );
-        }
-      }
-
-      this._center[ 0 ] = center[ 0 ];
-      this._center[ 1 ] = center[ 1 ];
-      this._options["pixelSize"] = this._pixelSize = pixelSize;
-
-      if ( this._userGeodetic ) {
-        this._options["bbox"] = $.geo.proj.toGeodetic( this._getBbox() );
-        this._options["center"] = $.geo.proj.toGeodetic( this._center );
-      } else {
-        this._options["bbox"] = this._getBbox();
-        this._options["center"] = $.merge( [ ], center );
-      }
-
-      this._options["zoom"] = zoom;
-
-      if (trigger) {
-        this._trigger("bboxchange", window.event, { bbox: $.merge( [ ], this._options["bbox"] ) });
-      }
-
-      if (refresh) {
-        this._refresh();
-        this._refreshAllShapes( );
-        this._refreshDrawing();
-      }
-    },
-
-    _requestQueued: function ( ) {
-      if ( this._loadCount === 0 ) {
-        this._trigger( "loadstart", window.event );
-      }
-      this._loadCount++;
-    },
-
-    _requestComplete: function ( ) {
-      this._loadCount--;
-      if ( this._loadCount <= 0 ) {
-        this._loadCount = 0;
-        this._trigger( "loadend", window.event );
-      }
-    },
-
-    _toMap: function (p, center, pixelSize) {
-      // ignores $.geo.proj
-
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      var isMultiPointOrLineString = $.isArray( p[ 0 ] ),
-          isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray( p[ 0 ][ 0 ] ),
-          isMultiPolygon = isMultiLineStringOrPolygon && $.isArray( p[ 0 ][ 0 ][ 0 ] ),
-          width = this._contentBounds["width"],
-          height = this._contentBounds["height"],
-          halfWidth = width / 2 * pixelSize,
-          halfHeight = height / 2 * pixelSize,
-          bbox = [center[0] - halfWidth, center[1] - halfHeight, center[0] + halfWidth, center[1] + halfHeight],
-          xRatio = $.geo.width(bbox, true) / width,
-          yRatio = $.geo.height(bbox, true) / height,
-          yOffset,
-          image = this._options[ "axisLayout" ] === "image",
-          result = [],
-          i, j, k;
-
-      if ( !isMultiPolygon ) {
-        if ( !isMultiLineStringOrPolygon ) {
-          if ( !isMultiPointOrLineString ) {
-            p = [ p ];
-          }
-          p = [ p ];
-        }
-        p = [ p ];
-      }
-
-      for ( i = 0; i < p.length; i++ ) {
-        result[ i ] = [ ];
-        for ( j = 0; j < p[ i ].length; j++ ) {
-          result[ i ][ j ] = [ ];
-          for ( k = 0; k < p[ i ][ j ].length; k++ ) {
-            yOffset = (p[ i ][ j ][ k ][1] * yRatio);
-            result[ i ][ j ][ k ] = [
-              bbox[ 0 ] + ( p[ i ][ j ][ k ][ 0 ] * xRatio ),
-              image ? bbox[ 1 ] + yOffset : bbox[ 3 ] - yOffset
-            ];
-          }
-        }
-      }
-
-      return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-    },
-
-    _toPixel: function (p, center, pixelSize) {
-      // ignores $.geo.proj
-
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      var isMultiPointOrLineString = $.isArray( p[ 0 ] ),
-          isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray( p[ 0 ][ 0 ] ),
-          isMultiPolygon = isMultiLineStringOrPolygon && $.isArray( p[ 0 ][ 0 ][ 0 ] ),
-          width = this._contentBounds["width"],
-          height = this._contentBounds["height"],
-          halfWidth = width / 2 * pixelSize,
-          halfHeight = height / 2 * pixelSize,
-          bbox = [center[0] - halfWidth, center[1] - halfHeight, center[0] + halfWidth, center[1] + halfHeight],
-          bboxWidth = $.geo.width(bbox, true),
-          bboxHeight = $.geo.height(bbox, true),
-          image = this._options[ "axisLayout" ] === "image",
-          xRatio = width / bboxWidth,
-          yRatio = height / bboxHeight,
-          result = [ ],
-          i, j, k;
-
-      if ( !isMultiPolygon ) {
-        if ( !isMultiLineStringOrPolygon ) {
-          if ( !isMultiPointOrLineString ) {
-            p = [ p ];
-          }
-          p = [ p ];
-        }
-        p = [ p ];
-      }
-
-      for ( i = 0; i < p.length; i++ ) {
-        result[ i ] = [ ];
-        for ( j = 0; j < p[ i ].length; j++ ) {
-          result[ i ][ j ] = [ ];
-          for ( k = 0; k < p[ i ][ j ].length; k++ ) {
-            result[ i ][ j ][ k ] = [
-              Math.round( ( p[ i ][ j ][ k ][ 0 ] - bbox[ 0 ] ) * xRatio ),
-              Math.round( ( image ? p[ i ][ j ][ k ][ 1 ] - bbox[ 1 ] : bbox[ 3 ] - p[ i ][ j ][ k ][ 1 ] ) * yRatio )
-            ];
-          }
-        }
-      }
-
-      return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-    },
-
-    _document_keydown: function (e) {
-      var len = this._drawCoords.length;
-      if (len > 0 && e.which == 27) {
-        if (len <= 2) {
-          this._resetDrawing();
-          this._inOp = false;
-        } else {
-          this._drawCoords[len - 2] = $.merge( [], this._drawCoords[ len - 1 ] );
-          this._drawPixels[len - 2] = $.merge( [], this._drawPixels[ len - 1 ] );
-
-          this._drawCoords.length--;
-          this._drawPixels.length--;
-
-          this._refreshDrawing();
-        }
-      }
-    },
-
-    _eventTarget_dblclick_zoom: function(e) {
-      var doInteractiveTimeout = this._clearInteractiveTimeout( );
-
-      this._trigger("dblclick", e, { type: "Point", coordinates: this._toMap(this._current, this._centerInteractive, this._pixelSizeInteractive ) });
-
-      if (!e.isDefaultPrevented()) {
-        var centerAndSize = this._getZoomCenterAndSize(this._current, 1, true );
-
-        this._setInteractiveCenterAndSize( centerAndSize.center, centerAndSize.pixelSize );
-        this._interactiveTransform( );
-
-        doInteractiveTimeout = true;
-      }
-
-      if ( doInteractiveTimeout ) {
-        this._setInteractiveTimeout( true );
-      }
-    },
-
-    _eventTarget_dblclick: function (e) {
-      if ( this._options[ "mode" ] === "static" ) {
-        return;
-      }
-
-      if (this._drawTimeout) {
-        window.clearTimeout(this._drawTimeout);
-        this._drawTimeout = null;
-      }
-
-      var offset = $(e.currentTarget).offset();
-
-      switch (this._options["mode"]) {
-        case "drawLineString":
-        case "measureLength":
-          if ( this._drawCoords.length > 1 && ! ( this._drawCoords[0][0] == this._drawCoords[1][0] &&
-                                                  this._drawCoords[0][1] == this._drawCoords[1][1] ) ) {
-              this._drawCoords.length--;
-              this._trigger( "shape", e, {
-                type: "LineString",
-                coordinates: this._userGeodetic ? $.geo.proj.toGeodetic(this._drawCoords) : this._drawCoords
-              } );
-          } else {
-            this._eventTarget_dblclick_zoom(e);
-          }
-          this._resetDrawing();
-          break;
-
-        case "drawPolygon":
-        case "measureArea":
-          if ( this._drawCoords.length > 1 && ! ( this._drawCoords[0][0] == this._drawCoords[1][0] &&
-                                                  this._drawCoords[0][1] == this._drawCoords[1][1] ) ) {
-            var endIndex = this._drawCoords.length - 1;
-            if (endIndex > 2) {
-              this._drawCoords[endIndex] = $.merge( [], this._drawCoords[0] );
-              this._trigger( "shape", e, {
-                type: "Polygon",
-                coordinates: [ this._userGeodetic ? $.geo.proj.toGeodetic(this._drawCoords) : this._drawCoords ]
-              } );
-            }
-          } else {
-            this._eventTarget_dblclick_zoom(e);
-          }
-          this._resetDrawing();
-          break;
-
-        default:
-          this._eventTarget_dblclick_zoom(e);
-          break;
-      }
-
-      this._inOp = false;
-    },
-
-    _eventTarget_touchstart: function (e) {
-      var mode = this._options[ "mode" ],
-          shift = this._options[ "shift" ],
-          defaultShift = ( mode === "dragBox" ? "dragBox" : "zoom" );
-
-      if ( mode === "static" ) {
-        return;
-      }
-
-      if ( !this._supportTouch && e.which != 1 ) {
-        return;
-      }
-
-      var doInteractiveTimeout = this._clearInteractiveTimeout( );
-
-      var offset = $(e.currentTarget).offset(),
-          touches = e.originalEvent.changedTouches;
-
-      if ( this._supportTouch ) {
-        this._multiTouchAnchor = $.merge( [ ], touches );
-
-        this._isMultiTouch = this._multiTouchAnchor.length > 1;
-
-        if ( this._isMultiTouch ) {
-          this._multiTouchCurrentBbox = [
-            touches[0].pageX - offset.left,
-            touches[0].pageY - offset.top,
-            touches[1].pageX - offset.left,
-            touches[1].pageY - offset.top
-          ];
-
-          this._multiTouchAnchorBbox = $.merge( [ ], this._multiTouchCurrentBbox );
-
-          this._current = $.geo.center( this._multiTouchCurrentBbox, true );
-        } else {
-          this._multiTouchCurrentBbox = [
-            touches[0].pageX - offset.left,
-            touches[0].pageY - offset.top,
-            NaN,
-            NaN
-          ];
-
-          this._current = [ touches[0].pageX - offset.left, touches[0].pageY - offset.top ];
-        }
-      } else {
-        this._current = [e.pageX - offset.left, e.pageY - offset.top];
-      }
-
-      if (this._softDblClick) {
-        var downDate = $.now();
-        if (downDate - this._downDate < 750) {
-          if (this._isTap) {
-            var dx = this._current[0] - this._anchor[0],
-                dy = this._current[1] - this._anchor[1],
-                distance = Math.sqrt((dx * dx) + (dy * dy));
-            if (distance > 8) {
-              this._isTap = false;
-            } else {
-              this._current = $.merge( [ ], this._anchor );
-            }
-          }
-
-          if (this._isDbltap) {
-            this._isDbltap = false;
-          } else {
-            this._isDbltap = this._isTap;
-          }
-        } else {
-          this._isDbltap = false;
-        }
-        this._isTap = true;
-        this._downDate = downDate;
-      }
-
-      this._mouseDown = true;
-      this._anchor = $.merge( [ ], this._current );
-
-      if (!this._inOp && e.shiftKey && shift !== "off") {
-        this._shiftDown = true;
-        this._$eventTarget.css( "cursor", this._options[ "cursors" ][ shift === "default" ? defaultShift : shift ] );
-      } else if ( !this._isMultiTouch && ( this._options[ "pannable" ] || mode === "dragBox" || mode === "dragCircle" ) ) {
-        this._inOp = true;
-
-        if ( mode !== "zoom" && mode !== "dragBox" && mode !== "dragCircle" ) {
-          this._lastDrag = this._current;
-
-          if (e.currentTarget.setCapture) {
-            e.currentTarget.setCapture();
-          }
-        }
-      }
-
-      e.preventDefault();
-
-      if ( doInteractiveTimeout ) {
-        this._setInteractiveTimeout( true );
-      }
-
-      return false;
-    },
-
-    _dragTarget_touchmove: function (e) {
-      if ( this._options[ "mode" ] === "static" ) {
-        return;
-      }
-
-      var doInteractiveTimeout = false;
-      if ( this._mouseDown ) {
-        doInteractiveTimeout = this._clearInteractiveTimeout( );
-      }
-
-      var offset = this._$eventTarget.offset(),
-          drawCoordsLen = this._drawCoords.length,
-          touches = e.originalEvent.changedTouches,
-          current,
-          service,
-          i = 0;
-
-      if ( this._supportTouch ) {
-        if ( !this._isMultiTouch && this._mouseDown && this._multiTouchAnchor.length > 0 && touches[ 0 ].identifier !== this._multiTouchAnchor[ 0 ].identifier ) {
-          // switch to multitouch
-          this._mouseDown = false;
-          this._isMultiTouch = true;
-          this._wheelLevel = 0;
-
-          this._multiTouchAnchor.push( touches[ 0 ] );
-
-
-
-
-          this._multiTouchCurrentBbox = [
-            this._multiTouchCurrentBbox[ 0 ],
-            this._multiTouchCurrentBbox[ 1 ],
-            this._multiTouchAnchor[1].pageX - offset.left,
-            this._multiTouchAnchor[1].pageY - offset.top
-          ];
-
-          this._multiTouchAnchorBbox = $.merge( [ ], this._multiTouchCurrentBbox );
-
-          this._mouseDown = true;
-          this._anchor = this._current = $.geo.center( this._multiTouchCurrentBbox, true );
-
-
-          if ( doInteractiveTimeout ) {
-            this._setInteractiveTimeout( true );
-          }
-          return false;
-        }
-
-        if ( this._isMultiTouch ) {
-
-          for ( ; i < touches.length; i++ ) {
-            if ( touches[ i ].identifier === this._multiTouchAnchor[ 0 ].identifier ) {
-              this._multiTouchCurrentBbox[ 0 ] = touches[ i ].pageX - offset.left;
-              this._multiTouchCurrentBbox[ 1 ] = touches[ i ].pageY - offset.top;
-            } else if ( touches[ i ].identifier === this._multiTouchAnchor[ 1 ].identifier ) {
-              this._multiTouchCurrentBbox[ 2 ] = touches[ i ].pageX - offset.left;
-              this._multiTouchCurrentBbox[ 3 ] = touches[ i ].pageY - offset.top;
-            }
-          }
-
-          var anchorDistance = $.geo._distancePointPoint( [ this._multiTouchAnchorBbox[ 0 ], this._multiTouchAnchorBbox[ 1 ] ], [ this._multiTouchAnchorBbox[ 2 ], this._multiTouchAnchorBbox[ 3 ] ] ),
-              currentDistance = $.geo._distancePointPoint( [ this._multiTouchCurrentBbox[ 0 ], this._multiTouchCurrentBbox[ 1 ] ], [ this._multiTouchCurrentBbox[ 2 ], this._multiTouchCurrentBbox[ 3 ] ] );
-
-          current = $.geo.center( this._multiTouchCurrentBbox, true );
-
-          var wheelLevel = ( ( currentDistance - anchorDistance ) / anchorDistance );
-
-          if ( wheelLevel > 0 ) {
-            wheelLevel *= 5;
-          } else {
-            wheelLevel *= 10;
-          }
-
-          var delta = wheelLevel - this._wheelLevel;
-
-          this._wheelLevel = wheelLevel;
-
-          var pinchCenterAndSize = this._getZoomCenterAndSize( this._anchor, delta, false );
-
-          this._setInteractiveCenterAndSize( pinchCenterAndSize.center, pinchCenterAndSize.pixelSize );
-          this._interactiveTransform( );
-
-          doInteractiveTimeout = true;
-
-          current = $.geo.center( this._multiTouchCurrentBbox, true );
-        } else {
-          current = [e.originalEvent.changedTouches[0].pageX - offset.left, e.originalEvent.changedTouches[0].pageY - offset.top];
-        }
-      } else {
-        current = [e.pageX - offset.left, e.pageY - offset.top];
-      }
-
-      if (current[0] === this._lastMove[0] && current[1] === this._lastMove[1]) {
-        if ( this._inOp ) {
-          e.preventDefault();
-          if ( doInteractiveTimeout ) {
-            this._setInteractiveTimeout( true );
-          }
-          return false;
-        }
-      }
-
-      if ( _ieVersion == 7 ) {
-        this._isDbltap = this._isTap = false;
-      }
-
-      if (this._mouseDown) {
-        this._current = current;
-        this._moveDate = $.now();
-      }
-
-      if ( this._isMultiTouch ) {
-        e.preventDefault( );
-        this._isDbltap = this._isTap = false;
-        if ( doInteractiveTimeout ) {
-          this._setInteractiveTimeout( true );
-        }
-        return false;
-      }
-
-      var mode = this._options["mode"],
-          shift = this._options[ "shift" ],
-          defaultShift = ( mode === "dragBox" ? "dragBox" : "zoom" ),
-          dx, dy, circleSize;
-
-      if ( this._shiftDown ) {
-        mode = ( shift === "default" ? defaultShift : shift );
-      }
-
-      switch (mode) {
-        case "zoom":
-        case "dragBox":
-          if ( this._mouseDown ) {
-            this._$drawContainer.geographics( "clear" );
-            this._$drawContainer.geographics( "drawBbox", [
-              this._anchor[ 0 ],
-              this._anchor[ 1 ],
-              current[ 0 ],
-              current[ 1 ]
-            ] );
-          } else {
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-
-        case "dragCircle":
-          if ( this._mouseDown ) {
-            dx = current[ 0 ] - this._anchor[ 0 ];
-            dy = current[ 1 ] - this._anchor[ 1 ];
-            circleSize = Math.sqrt( ( dx * dx) + ( dy * dy ) ) * 2;
-            //circleSize = Math.max( Math.abs( current[ 0 ] - this._anchor[ 0 ] ), Math.abs( current[ 1 ] - this._anchor[ 1 ] ) ) * 2;
-
-            // not part of _refreshDrawing
-            this._$drawContainer.geographics( "clear" );
-            this._$drawContainer.geographics( "drawArc", this._anchor, 0, 360, {
-              width: circleSize,
-              height: circleSize
-            } );
-          } else {
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-
-        case "drawLineString":
-        case "drawPolygon":
-        case "measureLength":
-        case "measureArea":
-          if (this._mouseDown || this._toolPan) {
-            this._panMove();
-            doInteractiveTimeout = true;
-          } else {
-            if (drawCoordsLen > 0) {
-              this._drawCoords[drawCoordsLen - 1] = this._toMap( current, this._centerInteractive, this._pixelSizeInteractive );
-              this._drawPixels[drawCoordsLen - 1] = current;
-
-              this._refreshDrawing();
-            }
-
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-
-        default:
-          if (this._mouseDown || this._toolPan) {
-            this._panMove();
-            doInteractiveTimeout = true;
-          } else {
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-      }
-
-      this._lastMove = current;
-
-      if ( doInteractiveTimeout ) {
-        this._setInteractiveTimeout( true );
-      }
-
-      if ( this._inOp ) {
-        e.preventDefault();
-        return false;
-      }
-    },
-
-    _dragTarget_touchstop: function (e) {
-      if ( this._options[ "mode" ] === "static" ) {
-        return;
-      }
-
-      if ( !this._mouseDown ) {
-        if ( _ieVersion == 7 ) {
-          // ie7 doesn't appear to trigger dblclick on this._$eventTarget,
-          // we fake regular click here to cause soft dblclick
-          this._eventTarget_touchstart(e);
-        } else {
-          // Chrome & Firefox trigger a rogue mouseup event when doing a dblclick maximize in Windows(/Linux?)
-          // ignore it
-          return;
-        }
-      }
-
-      var doInteractiveTimeout = this._clearInteractiveTimeout( );
-
-      var mouseWasDown = this._mouseDown,
-          wasToolPan = this._toolPan,
-          offset = this._$eventTarget.offset(),
-          mode = this._options[ "mode" ],
-          shift = this._options[ "shift" ],
-          defaultShift = ( mode === "dragBox" ? "dragBox" : "zoom" ),
-          current, i, clickDate,
-          dx, dy,
-          coordBuffer,
-          triggerShape;
-
-      if ( this._shiftDown ) {
-        mode = ( shift === "default" ? defaultShift : shift );
-      }
-
-      if (this._supportTouch) {
-        current = [e.originalEvent.changedTouches[0].pageX - offset.left, e.originalEvent.changedTouches[0].pageY - offset.top];
-        this._multiTouchAnchor = [];
-        this._inOp = false;
-      } else {
-        current = [e.pageX - offset.left, e.pageY - offset.top];
-      }
-
-      if (this._softDblClick) {
-        if (this._isTap) {
-          dx = current[0] - this._anchor[0];
-          dy = current[1] - this._anchor[1];
-          if (Math.sqrt((dx * dx) + (dy * dy)) <= 8) {
-            current = $.merge( [ ], this._anchor );
-          }
-        }
-      }
-
-      dx = current[0] - this._anchor[0];
-      dy = current[1] - this._anchor[1];
-
-      this._$eventTarget.css("cursor", this._options["cursors"][this._options["mode"]]);
-
-      this._shiftDown = this._mouseDown = this._toolPan = false;
-
-      if ( this._isMultiTouch ) {
-        e.preventDefault( );
-        this._isMultiTouch = false;
-
-        this._wheelLevel = 0;
-
-        if ( doInteractiveTimeout ) {
-          this._setInteractiveTimeout( true );
-        }
-        return;
-      }
-
-      if (document.releaseCapture) {
-        document.releaseCapture();
-      }
-
-      if (mouseWasDown) {
-        clickDate = $.now();
-        this._current = current;
-
-        switch ( mode ) {
-          case "zoom":
-          case "dragBox":
-            if ( dx !== 0 || dy !== 0 ) {
-              var minSize = this._pixelSize * 6,
-                  bboxCoords = this._toMap( [ [
-                      Math.min( this._anchor[ 0 ], current[ 0 ] ),
-                      Math.max( this._anchor[ 1 ], current[ 1 ] )
-                    ], [
-                      Math.max( this._anchor[ 0 ], current[ 0 ] ),
-                      Math.min( this._anchor[ 1 ], current[ 1 ] )
-                    ]
-                  ] ),
-                  bbox = [
-                    bboxCoords[0][0],
-                    bboxCoords[0][1],
-                    bboxCoords[1][0],
-                    bboxCoords[1][1]
-                  ];
-
-              if ( mode === "zoom" ) {
-                if ( ( bbox[2] - bbox[0] ) < minSize && ( bbox[3] - bbox[1] ) < minSize ) {
-                  bbox = $.geo.scaleBy( this._getBbox( $.geo.center( bbox, true ) ), 0.5, true );
-                }
-
-                this._setBbox(bbox, true, true);
-                doInteractiveTimeout = true;
-              } else {
-                triggerShape = $.geo.polygonize( bbox, true );
-                triggerShape.bbox = bbox;
-
-                if ( this._userGeodetic ) {
-                  triggerShape.coordinates = $.geo.proj.toGeodetic( triggerShape.coordinates );
-                  triggerShape.bbox = $.geo.proj.toGeodetic( triggerShape.bbox );
-                }
-                this._trigger( "shape", e, triggerShape );
-              }
-            } else {
-              if ( mode === "dragBox" ) {
-                coordBuffer = this._toMap( current );
-
-                triggerShape = {
-                  type: "Point",
-                  coordinates: [ coordBuffer[ 0 ], coordBuffer[ 1 ] ],
-                  bbox: [ coordBuffer[ 0 ], coordBuffer[ 1 ], coordBuffer[ 0 ], coordBuffer[ 1 ] ]
-                };
-
-                if ( this._userGeodetic ) {
-                  triggerShape.coordinates = $.geo.proj.toGeodetic( triggerShape.coordinates );
-                  triggerShape.bbox = $.geo.proj.toGeodetic( triggerShape.bbox );
-                }
-
-                this._trigger( "shape", e, triggerShape );
-              }
-            }
-
-            this._resetDrawing();
-            break;
-
-          case "dragCircle":
-            if ( dx !== 0 || dy !== 0 ) {
-              var image = this._options[ "axisLayout" ] === "image",
-                  d = Math.sqrt( ( dx * dx) + ( dy * dy ) ),
-                  n = 180,
-                  a;
-
-              this._drawPixels.length = n + 1;
-
-              for ( i = 0; i < n; i++ ) {
-                a = ( i * 360 / n ) * ( Math.PI / 180 );
-                this._drawPixels[ i ] = [
-                  this._anchor[ 0 ] + Math.cos( a ) * d,
-                  this._anchor[ 1 ] + Math.sin( a ) * d
-                ];
-              }
-
-              this._drawPixels[ n ] = [
-                this._drawPixels[ 0 ][ 0 ],
-                this._drawPixels[ 0 ][ 1 ]
-              ];
-
-              // using coordBuffer for bbox coords
-              coordBuffer = this._toMap( [
-                [ this._anchor[ 0 ] - d, this._anchor[ 1 ] + ( image ? -d : d ) ],
-                [ this._anchor[ 0 ] + d, this._anchor[ 1 ] + ( image ? d : -d ) ]
-              ] );
-
-              triggerShape = {
-                type: "Polygon",
-                coordinates: [ this._toMap( this._drawPixels ) ],
-                bbox: [ coordBuffer[ 0 ][ 0 ], coordBuffer[ 0 ][ 1 ], coordBuffer[ 1 ][ 0 ], coordBuffer[ 1 ][ 1 ] ]
-              };
-
-              if ( this._userGeodetic ) {
-                triggerShape.coordinates = $.geo.proj.toGeodetic( triggerShape.coordinates );
-                triggerShape.bbox = $.geo.proj.toGeodetic( triggerShape.bbox );
-              }
-
-              this._trigger( "shape", e, triggerShape );
-
-              this._resetDrawing();
-            } else {
-              coordBuffer = this._toMap( current );
-
-              triggerShape = {
-                type: "Point",
-                coordinates: [ coordBuffer[ 0 ], coordBuffer[ 1 ] ],
-                bbox: [ coordBuffer[ 0 ], coordBuffer[ 1 ], coordBuffer[ 0 ], coordBuffer[ 1 ] ]
-              };
-
-              if ( this._userGeodetic ) {
-                triggerShape.coordinates = $.geo.proj.toGeodetic( triggerShape.coordinates );
-                triggerShape.bbox = $.geo.proj.toGeodetic( triggerShape.bbox );
-              }
-
-              this._trigger( "shape", e, triggerShape );
-            }
-            break;
-
-          case "drawPoint":
-            if (this._drawTimeout) {
-              window.clearTimeout(this._drawTimeout);
-              this._drawTimeout = null;
-            }
-
-            if (wasToolPan) {
-              this._panFinalize();
-            } else {
-              if (clickDate - this._clickDate > 100) {
-                var geomap = this;
-                this._drawTimeout = setTimeout(function () {
-                  if (geomap._drawTimeout) {
-                    geomap._trigger("shape", e, { type: "Point", coordinates: geomap.toMap(current) });
-                    geomap._inOp = false;
-                    geomap._drawTimeout = null;
-                  }
-                }, 250);
-              }
-            }
-            break;
-
-          case "drawLineString":
-          case "drawPolygon":
-          case "measureLength":
-          case "measureArea":
-            if (wasToolPan) {
-              this._panFinalize();
-            } else {
-              i = (this._drawCoords.length === 0 ? 0 : this._drawCoords.length - 1);
-
-              this._drawCoords[i] = this._toMap(current);
-              this._drawPixels[i] = current;
-
-              if (i < 2 || !(this._drawCoords[i][0] == this._drawCoords[i-1][0] &&
-                             this._drawCoords[i][1] == this._drawCoords[i-1][1])) {
-                this._drawCoords[i + 1] = this._toMap( current, this._centerInteractive, this._pixelSizeInteractive );
-                this._drawPixels[i + 1] = current;
-              }
-
-              this._refreshDrawing();
-            }
-            break;
-
-          default:
-            if (wasToolPan) {
-              this._panFinalize();
-            } else {
-              if (clickDate - this._clickDate > 100) {
-                this._trigger("click", e, { type: "Point", coordinates: this.toMap(current) });
-                this._inOp = false;
-              }
-            }
-            break;
-        }
-
-        this._clickDate = clickDate;
-
-        if (this._softDblClick && this._isDbltap) {
-          this._isDbltap = this._isTap = false;
-          if ( doInteractiveTimeout ) {
-            this._setInteractiveTimeout( true );
-          }
-          this._$eventTarget.trigger("dblclick", e);
-          return false;
-        }
-      }
-
-      if ( doInteractiveTimeout ) {
-        this._setInteractiveTimeout( true );
-      }
-
-      if ( this._inOp ) {
-        e.preventDefault();
-        return false;
-      }
-    },
-
-    _eventTarget_mousewheel: function (e, delta) {
-      if ( this._options[ "mode" ] === "static" || this._options[ "scroll" ] === "off" ) {
-        return;
-      }
-
-      e.preventDefault();
-
-      if ( this._mouseDown ) {
-        return false;
-      }
-
-      if (delta !== 0) {
-        this._clearInteractiveTimeout( );
-
-        if ( delta > 0 ) {
-          delta = Math.ceil( delta );
-        } else { 
-          delta = Math.floor( delta );
-        }
-
-        var offset = $(e.currentTarget).offset();
-        this._anchor = [e.pageX - offset.left, e.pageY - offset.top];
-
-        var wheelCenterAndSize = this._getZoomCenterAndSize( this._anchor, delta, this._options[ "tilingScheme" ] !== null ),
-            service,
-            i = 0;
-
-        this._setInteractiveCenterAndSize( wheelCenterAndSize.center, wheelCenterAndSize.pixelSize );
-        this._interactiveTransform( );
-
-        this._setInteractiveTimeout( true );
-      }
-
-      return false;
-    }
-  }
-  );
-}(jQuery));
-
-
-(function ($, undefined) {
-  $.geo._serviceTypes.tiled = (function () {
-    return {
-      create: function (map, serviceContainer, service, index) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( !serviceState ) {
-          serviceState = {
-            loadCount: 0,
-            reloadTiles: false
-          };
-
-          var scHtml = '<div data-geo-service="tiled" style="-webkit-transform:translateZ(0); position:absolute; left:0; top:0; width:8px; height:8px; margin:0; padding:0;"></div>';
-
-          serviceContainer.append(scHtml);
-
-          serviceState.serviceContainer = serviceContainer.children( ":last" );
-
-          $.data(service, "geoServiceState", serviceState);
-        }
-
-        return serviceState.serviceContainer;
-      },
-
-      destroy: function (map, serviceContainer, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        serviceState.serviceContainer.remove();
-
-        $.removeData(service, "geoServiceState");
-      },
-
-      interactiveTransform: function ( map, service, center, pixelSize ) {
-        //console.log( "tiled.interactiveTransform( " + center.join( ", " ) + ", " + pixelSize + ")" );
-        var serviceState = $.data( service, "geoServiceState" ),
-            tilingScheme = map.options[ "tilingScheme" ];
-
-        if ( serviceState ) {
-          this._cancelUnloaded( map, service );
-
-          serviceState.serviceContainer.children( ).each( function ( i ) {
-            var $scaleContainer = $(this),
-                scalePixelSize = $scaleContainer.data("pixelSize"),
-                scaleRatio = scalePixelSize / pixelSize;
-
-            if ( scalePixelSize > 0 ) {
-              scaleRatio = Math.round(scaleRatio * 1000) / 1000;
-
-              var oldMapCoord = $scaleContainer.data("scaleOrigin"),
-                  newPixelPoint = map._toPixel(oldMapCoord, center, pixelSize);
-
-              $scaleContainer.css( {
-                left: Math.round(newPixelPoint[0]) + "px",
-                top: Math.round(newPixelPoint[1]) + "px",
-                width: tilingScheme.tileWidth * scaleRatio,
-                height: tilingScheme.tileHeight * scaleRatio
-              } );
-
-              /*
-              if ( $("body")[0].filters !== undefined ) {
-                $scaleContainer.children().each( function ( i ) {
-                  $( this ).css( "filter", "progid:DXImageTransform.Microsoft.Matrix(FilterType=bilinear,M11=" + scaleRatio + ",M22=" + scaleRatio + ",sizingmethod='auto expand')" );
-                } );
-              }
-              */
-            }
-          });
-        }
-      },
-
-      refresh: function (map, service, force) {
-        //console.log( "tiled.refresh( " + map._center.join( ", " ) + ", " + map._pixelSize + ")" );
-        var serviceState = $.data( service, "geoServiceState" );
-
-        this._cancelUnloaded(map, service);
-
-        if ( serviceState && force ) {
-          // if hidden atm, we want to make sure we reload this service after it becomes visible
-          serviceState.reloadTiles = true;
-        }
-
-        if ( serviceState && service && service.style.visibility === "visible" && !( serviceState.serviceContainer.is( ":hidden" ) ) ) {
-          var bbox = map._getBbox(),
-              pixelSize = map._pixelSize,
-
-              serviceObj = this,
-              $serviceContainer = serviceState.serviceContainer,
-
-              contentBounds = map._getContentBounds(),
-              mapWidth = contentBounds["width"],
-              mapHeight = contentBounds["height"],
-
-              image = map.options[ "axisLayout" ] === "image",
-              ySign = image ? +1 : -1,
-
-              tilingScheme = map.options["tilingScheme"],
-              tileWidth = tilingScheme.tileWidth,
-              tileHeight = tilingScheme.tileHeight,
-
-              tileX = Math.floor((bbox[0] - tilingScheme.origin[0]) / (pixelSize * tileWidth)),
-              tileY = Math.max( Math.floor( ( image ? bbox[1] - tilingScheme.origin[1] : tilingScheme.origin[1] - bbox[ 3 ] ) / (pixelSize * tileHeight) ), 0 ),
-              tileX2 = Math.ceil((bbox[2] - tilingScheme.origin[0]) / (pixelSize * tileWidth)),
-              tileY2 = Math.ceil( ( image ? bbox[3] - tilingScheme.origin[1] : tilingScheme.origin[1] - bbox[ 1 ] ) / (pixelSize * tileHeight) ),
-
-              bboxMax = map._getBboxMax(),
-              pixelSizeAtZero = map._getPixelSize(0),
-              ratio = pixelSizeAtZero / pixelSize,
-              fullXAtScale = Math.floor((bboxMax[0] - tilingScheme.origin[0]) / (pixelSizeAtZero * tileWidth)) * ratio,
-              fullYAtScale = Math.floor((tilingScheme.origin[1] + ySign * bboxMax[3]) / (pixelSizeAtZero * tileHeight)) * ratio,
-
-              fullXMinX = tilingScheme.origin[0] + (fullXAtScale * tileWidth) * pixelSize,
-              fullYMinOrMaxY = tilingScheme.origin[1] + ySign * (fullYAtScale * tileHeight) * pixelSize,
-
-              serviceLeft = Math.round((fullXMinX - bbox[0]) / pixelSize),
-              serviceTop = Math.round( ( image ? fullYMinOrMaxY - bbox[1] : bbox[3] - fullYMinOrMaxY ) / pixelSize),
-
-              scaleContainers = $serviceContainer.children().show(),
-              scaleContainer = scaleContainers.filter("[data-pixel-size='" + pixelSize + "']").appendTo($serviceContainer),
-
-              opacity = service.style.opacity,
-
-              x, y,
-
-              loadImageDeferredDone = function( url ) {
-                // when a Deferred call is done, add the image to the map
-                // a reference to the correct img element is on the Deferred object itself
-                serviceObj._loadImage( $.data( this, "img" ), url, pixelSize, map, serviceState, opacity );
-              },
-
-              loadImageDeferredFail = function( ) {
-                $.data( this, "img" ).remove( );
-                serviceState.loadCount--;
-                map._requestComplete();
-              };
-
-          if (serviceState.reloadTiles) {
-            scaleContainers.find("img").attr("data-dirty", "true");
-          }
-
-          if (!scaleContainer.size()) {
-            $serviceContainer.append("<div style='-webkit-transform:translateZ(0);position:absolute; left:" + serviceLeft % tileWidth + "px; top:" + serviceTop % tileHeight + "px; width:" + tileWidth + "px; height:" + tileHeight + "px; margin:0; padding:0;' data-pixel-size='" + pixelSize + "'></div>");
-            scaleContainer = $serviceContainer.children(":last").data("scaleOrigin", map._toMap( [ (serviceLeft % tileWidth), (serviceTop % tileHeight) ] ) );
-          } else {
-            scaleContainer.css({
-              left: (serviceLeft % tileWidth) + "px",
-              top: (serviceTop % tileHeight) + "px"
-            }).data("scaleOrigin", map._toMap( [ (serviceLeft % tileWidth), (serviceTop % tileHeight) ] ) );
-
-            scaleContainer.children().each(function (i) {
-              var 
-              $img = $(this),
-              tile = $img.attr("data-tile").split(",");
-
-              $img.css({
-                left: Math.round(((parseInt(tile[0], 10) - fullXAtScale) * 100) + (serviceLeft - (serviceLeft % tileWidth)) / tileWidth * 100) + "%",
-                top: Math.round(((parseInt(tile[1], 10) - fullYAtScale) * 100) + (serviceTop - (serviceTop % tileHeight)) / tileHeight * 100) + "%"
-              });
-
-              if (opacity < 1) {
-                $img.fadeTo(0, opacity);
-              }
-            });
-          }
-
-          for (x = tileX; x < tileX2; x++) {
-            for (y = tileY; y < tileY2; y++) {
-              var tileStr = "" + x + "," + y,
-                  $img = scaleContainer.children("[data-tile='" + tileStr + "']").removeAttr("data-dirty");
-
-              if ($img.size() === 0 || serviceState.reloadTiles) {
-                var bottomLeft = [
-                      tilingScheme.origin[0] + (x * tileWidth) * pixelSize,
-                      tilingScheme.origin[1] + ySign * (y * tileHeight) * pixelSize
-                    ],
-
-                    topRight = [
-                      tilingScheme.origin[0] + ((x + 1) * tileWidth - 1) * pixelSize,
-                      tilingScheme.origin[1] + ySign * ((y + 1) * tileHeight - 1) * pixelSize
-                    ],
-
-                    tileBbox = [bottomLeft[0], bottomLeft[1], topRight[0], topRight[1]],
-
-                    urlProp = ( service.hasOwnProperty( "src" ) ? "src" : "getUrl" ),
-                    urlArgs = {
-                      bbox: tileBbox,
-                      width: tileWidth,
-                      height: tileHeight,
-                      zoom: map._getZoom(),
-                      tile: {
-                        row: y,
-                        column: x
-                      },
-                      index: Math.abs(y + x)
-                    },
-                    isFunc = $.isFunction( service[ urlProp ] ),
-                    imageUrl;
-
-                if ( isFunc ) {
-                  imageUrl = service[ urlProp ]( urlArgs );
-                } else {
-                  $.templates( "geoSrc", service[ urlProp ] );
-                  imageUrl = $.render[ "geoSrc" ]( urlArgs );
-                }
-
-                serviceState.loadCount++;
-                map._requestQueued();
-
-                if (serviceState.reloadTiles && $img.size() > 0) {
-                  $img.attr("src", imageUrl);
-                } else {
-                  var imgMarkup = "<img style='-webkit-transform:translateZ(0);position:absolute; " +
-                    "left:" + (((x - fullXAtScale) * 100) + (serviceLeft - (serviceLeft % tileWidth)) / tileWidth * 100) + "%; " +
-                    "top:" + (((y - fullYAtScale) * 100) + (serviceTop - (serviceTop % tileHeight)) / tileHeight * 100) + "%; ";
-
-                  imgMarkup += "width: 100%; height: 100%;";
-
-                  // #newpanzoom
-                  /*
-                  if ($("body")[0].filters === undefined) {
-                    imgMarkup += "width: 100%; height: 100%;";
-                  }
-                  */
-
-                  imgMarkup += "margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;' unselectable='on' data-tile='" + tileStr + "' />";
-
-                  scaleContainer.append(imgMarkup);
-                  $img = scaleContainer.children(":last");
-                }
-
-                if ( typeof imageUrl === "string" ) {
-                  serviceObj._loadImage( $img, imageUrl, pixelSize, map, serviceState, opacity );
-                } else if ( imageUrl ) {
-                  // assume Deferred
-                  $.data( imageUrl, "img", $img );
-                  imageUrl.done( loadImageDeferredDone ).fail( loadImageDeferredFail );
-                } else {
-                  $img.remove( );
-                }
-              }
-            }
-          }
-
-          scaleContainers.find("[data-dirty]").remove();
-          serviceState.reloadTiles = false;
-        }
-      },
-
-      resize: function (map, service) {
-      },
-
-      opacity: function ( map, service ) {
-        var serviceState = $.data( service, "geoServiceState" );
-        serviceState.serviceContainer.find( "img" ).stop( true ).fadeTo( "fast", service.style.opacity );
-      },
-
-      toggle: function ( map, service ) {
-        var serviceState = $.data( service, "geoServiceState" );
-        serviceState.serviceContainer.css( "display", service.style.visibility === "visible" ? "block" : "none" );
-      },
-
-      _cancelUnloaded: function (map, service) {
-        var serviceState = $.data( service, "geoServiceState" );
-
-        if (serviceState && serviceState.loadCount > 0) {
-          serviceState.serviceContainer.find("img:hidden").remove();
-          while (serviceState.loadCount > 0) {
-            serviceState.loadCount--;
-            map._requestComplete();
-          }
-        }
-      },
-
-      _loadImage: function ( $img, url, pixelSize, map, serviceState, opacity ) {
-        var serviceContainer = serviceState.serviceContainer;
-
-        $img.load(function (e) {
-          if (opacity < 1) {
-            $(e.target).fadeTo(0, opacity);
-          } else {
-            $(e.target).show();
-          }
-
-          serviceState.loadCount--;
-          map._requestComplete();
-
-          if (serviceState.loadCount <= 0) {
-            serviceContainer.children(":not([data-pixel-size='" + pixelSize + "'])").remove();
-            serviceState.loadCount = 0;
-          }
-        }).error(function (e) {
-          $(e.target).remove();
-          serviceState.loadCount--;
-          map._requestComplete();
-
-          if (serviceState.loadCount <= 0) {
-            serviceContainer.children(":not([data-pixel-size='" + pixelSize + "'])").remove();
-            serviceState.loadCount = 0;
-          }
-        }).attr("src", url);
-      }
-    };
-  }());
-}(jQuery));
-
-(function ($, undefined) {
-  $.geo._serviceTypes.shingled = (function () {
-    return {
-      create: function (map, serviceContainer, service, index) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( !serviceState ) {
-          serviceState = {
-            loadCount: 0
-          };
-
-          var scHtml = '<div data-geo-service="shingled" style="-webkit-transform:translateZ(0);position:absolute; left:0; top:0; width:16px; height:16px; margin:0; padding:0;"></div>';
-
-          serviceContainer.append(scHtml);
-
-          serviceState.serviceContainer = serviceContainer.children(":last");
-          $.data(service, "geoServiceState", serviceState);
-        }
-
-        return serviceState.serviceContainer;
-      },
-
-      destroy: function (map, serviceContainer, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        serviceState.serviceContainer.remove();
-
-        $.removeData(service, "geoServiceState");
-      },
-
-      interactiveTransform: function ( map, service, center, pixelSize ) {
-        var serviceState = $.data( service, "geoServiceState" ),
-
-            contentBounds = map._getContentBounds(),
-            mapWidth = contentBounds[ "width" ],
-            mapHeight = contentBounds[ "height" ],
-
-            halfWidth = mapWidth / 2,
-            halfHeight = mapHeight / 2,
-
-            bbox = [ center[ 0 ] - halfWidth, center[ 1 ] - halfHeight, center[ 0 ] + halfWidth, center[ 1 ] + halfHeight ];
-
-        if ( serviceState ) {
-          this._cancelUnloaded( map, service );
-
-          serviceState.serviceContainer.children( ).each( function ( i ) {
-            var $scaleContainer = $(this),
-                scalePixelSize = $scaleContainer.data( "pixelSize" ),
-                scaleRatio = scalePixelSize / pixelSize;
-                
-            if ( scalePixelSize > 0 ) {
-              scaleRatio = Math.round(scaleRatio * 1000) / 1000;
-
-              var oldMapOrigin = $scaleContainer.data( "origin" ),
-                  newPixelPoint = map._toPixel( oldMapOrigin, center, pixelSize );
-
-              $scaleContainer.css( {
-                left: Math.round( newPixelPoint[ 0 ] ),
-                top: Math.round( newPixelPoint[ 1 ] ),
-                width: mapWidth * scaleRatio,
-                height: mapHeight * scaleRatio
-              } );
-            }
-          });
-        }
-      },
-
-      refresh: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        this._cancelUnloaded(map, service);
-
-        if ( serviceState && service && service.style.visibility === "visible" && !( serviceState.serviceContainer.is( ":hidden" ) ) ) {
-
-          var bbox = map._getBbox(),
-              pixelSize = map._pixelSize,
-
-              serviceObj = this,
-              serviceContainer = serviceState.serviceContainer,
-
-              contentBounds = map._getContentBounds(),
-              mapWidth = contentBounds["width"],
-              mapHeight = contentBounds["height"],
-
-              scaleContainer = serviceContainer.children('[data-pixel-size="' + pixelSize + '"]'),
-
-              opacity = service.style.opacity,
-
-              $img;
-
-          if (opacity < 1) {
-            serviceContainer.find("img").attr("data-keep-alive", "0");
-          }
-
-          if ( !scaleContainer.size() ) {
-            serviceContainer.append('<div style="-webkit-transform:translateZ(0);position:absolute; left:0px; top: 0px; width:' + mapWidth + 'px; height:' + mapHeight + 'px; margin:0; padding:0;" data-pixel-size="' + pixelSize + '" data-origin="[' + map._toMap( [ 0, 0 ] ) + ']"></div>');
-            scaleContainer = serviceContainer.children(":last");
-          }
-
-          var urlProp = ( service.hasOwnProperty("src") ? "src" : "getUrl" ),
-              urlArgs = {
-                bbox: bbox,
-                width: mapWidth,
-                height: mapHeight,
-                zoom: map._getZoom(),
-                tile: null,
-                index: 0
-              },
-              isFunc = $.isFunction( service[ urlProp ] ),
-              imageUrl,
-              imagePos = scaleContainer.position( );
-
-          imagePos.left = - ( imagePos.left );
-          imagePos.top = - ( imagePos.top );
-
-          if ( isFunc ) {
-            imageUrl = service[ urlProp ]( urlArgs );
-          } else {
-            $.templates( "geoSrc", service[ urlProp ] );
-            imageUrl = $.render[ "geoSrc" ]( urlArgs );
-          }
-
-          serviceState.loadCount++;
-          map._requestQueued();
-
-          scaleContainer.append('<img style="-webkit-transform:translateZ(0);position:absolute; left:' + ( imagePos.left / scaleContainer.width( ) * 100 ) + '%; top:' + ( imagePos.top / scaleContainer.height( ) * 100 ) + '%; width:100%; height:100%; margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;" unselectable="on" />');
-          $img = scaleContainer.children(":last").data("center", map._center);
-
-          if ( typeof imageUrl === "string" ) {
-            serviceObj._loadImage( $img, imageUrl, pixelSize, map, serviceState, opacity );
-          } else {
-            // assume Deferred
-            imageUrl.done( function( url ) {
-              serviceObj._loadImage( $img, url, pixelSize, map, serviceState, opacity );
-            } ).fail( function( ) {
-              $img.remove( );
-              serviceState.loadCount--;
-              map._requestComplete();
-            } );
-          }
-
-        }
-      },
-
-      resize: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( serviceState && service && service.style.visibility === "visible" ) {
-          this._cancelUnloaded(map, service);
-
-          var serviceContainer = serviceState.serviceContainer,
-
-              contentBounds = map._getContentBounds(),
-              mapWidth = contentBounds["width"],
-              mapHeight = contentBounds["height"],
-
-              scaleContainers = serviceContainer.children();
-
-          scaleContainers.attr("data-pixel-size", "0");
-
-          scaleContainers.each( function ( i ) {
-            var $scaleContainer = $(this),
-                position = $scaleContainer.position( );
-
-            var oldMapOrigin = $scaleContainer.data( "origin" ),
-                newPixelPoint = map._toPixel( oldMapOrigin );
-
-            $scaleContainer.css( {
-              left: position.left + ( mapWidth - $scaleContainer.width( ) ) / 2,
-              top: position.top + ( mapHeight - $scaleContainer.height( ) ) / 2
-            } );
-
-          } );
-            
-
-          /*
-          scaleContainer.css({
-            left: halfWidth + 'px',
-            top: halfHeight + 'px'
-          });
-          */
-        }
-      },
-
-      opacity: function ( map, service ) {
-        var serviceState = $.data( service, "geoServiceState" );
-        serviceState.serviceContainer.find( "img" ).stop( true ).fadeTo( "fast", service.style.opacity );
-      },
-
-      toggle: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-        serviceState.serviceContainer.css("display", service.style.visibility === "visible" ? "block" : "none");
-      },
-
-      _cancelUnloaded: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if (serviceState && serviceState.loadCount > 0) {
-          serviceState.serviceContainer.find("img:hidden").remove();
-          while (serviceState.loadCount > 0) {
-            serviceState.loadCount--;
-            map._requestComplete();
-          }
-        }
-      },
-
-      _loadImage: function ( $img, url, pixelSize, map, serviceState, opacity ) {
-        var serviceContainer = serviceState.serviceContainer;
-
-        $img.load(function (e) {
-          if ( !$.contains(document.body, e.target.jquery ? e.target[0] : e.target) ) {
-            // this image has been canceled and removed from the DOM
-            return;
-          }
-
-          if (opacity < 1) {
-            $(e.target).fadeTo(0, opacity);
-          } else {
-            $(e.target).show();
-          }
-
-          serviceState.loadCount--;
-          map._requestComplete();
-
-          if (serviceState.loadCount <= 0) {
-            // #newpanzoom
-            serviceContainer.children(':not([data-pixel-size="' + pixelSize + '"])').remove();
-
-            serviceContainer.find( "img[data-keep-alive]" ).remove( );
-
-            serviceState.loadCount = 0;
-          }
-        }).error(function (e) {
-          if ( !$.contains(document.body, e.target.jquery ? e.target[0] : e.target) ) {
-            // this image has been canceled and removed from the DOM
-            return;
-          }
-
-          $(e.target).remove();
-          serviceState.loadCount--;
-          map._requestComplete();
-
-          if (serviceState.loadCount <= 0) {
-            serviceContainer.children(":not([data-pixel-size='" + pixelSize + "'])").remove();
-            serviceState.loadCount = 0;
-          }
-        }).attr("src", url);
-      }
-    };
-  }());
-}(jQuery));
diff --git a/libs/js/jquery-geo-1.0b2/docs/jquery.geo-test.min.js b/libs/js/jquery-geo-1.0b2/docs/jquery.geo-test.min.js
deleted file mode 100755 (executable)
index 66925f3..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-/*! jQuery Geo - vtest - 2012-11-02
- * http://jquerygeo.com
- * Copyright (c) 2012 Ryan Westphal/Applied Geographics, Inc.; Licensed MIT, GPL */
-document.createElement("canvas").getContext||function(){function f(){return this.context_||(this.context_=new P(this))}function c(e,t,n){var r=l.call(arguments,2);return function(){return e.apply(t,r.concat(l.call(arguments)))}}function h(e){return String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}function p(e,t,n){e.namespaces[t]||e.namespaces.add(t,n,"#default#VML")}function d(e){p(e,"g_vml_","urn:schemas-microsoft-com:vml"),p(e,"g_o_","urn:schemas-microsoft-com:office:office");if(!e.styleSheets.ex_canvas_){var t=e.createStyleSheet();t.owningElement.id="ex_canvas_",t.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function m(e){var t=e.srcElement;switch(e.propertyName){case"width":t.getContext().clearRect(),t.style.width=t.attributes.width.nodeValue+"px",t.firstChild.style.width=t.clientWidth+"px";break;case"height":t.getContext().clearRect(),t.style.height=t.attributes.height.nodeValue+"px",t.firstChild.style.height=t.clientHeight+"px"}}function g(e){var t=e.srcElement;t.firstChild&&(t.firstChild.style.width=t.clientWidth+"px",t.firstChild.style.height=t.clientHeight+"px")}function E(){return[[1,0,0],[0,1,0],[0,0,1]]}function S(e,t){var n=E();for(var r=0;r<3;r++)for(var i=0;i<3;i++){var s=0;for(var o=0;o<3;o++)s+=e[r][o]*t[o][i];n[r][i]=s}return n}function x(e,t){t.fillStyle=e.fillStyle,t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.shadowBlur=e.shadowBlur,t.shadowColor=e.shadowColor,t.shadowOffsetX=e.shadowOffsetX,t.shadowOffsetY=e.shadowOffsetY,t.strokeStyle=e.strokeStyle,t.globalAlpha=e.globalAlpha,t.font=e.font,t.textAlign=e.textAlign,t.textBaseline=e.textBaseline,t.arcScaleX_=e.arcScaleX_,t.arcScaleY_=e.arcScaleY_,t.lineScale_=e.lineScale_}function T(e){var t=e.indexOf("(",3),n=e.indexOf(")",t+1),r=e.substring(t+1,n).split(",");if(r.length!=4||e.charAt(3)!="a")r[3]=1;return r}function N(e){return parseFloat(e)/100}function C(e,t,n){return Math.min(n,Math.max(t,e))}function k(e){var t,n,r,i,s,o;i=parseFloat(e[0])/360%360,i<0&&i++,s=C(N(e[1]),0,1),o=C(N(e[2]),0,1);if(s==0)t=n=r=o;else{var u=o<.5?o*(1+s):o+s-o*s,a=2*o-u;t=L(a,u,i+1/3),n=L(a,u,i),r=L(a,u,i-1/3)}return"#"+y[Math.floor(t*255)]+y[Math.floor(n*255)]+y[Math.floor(r*255)]}function L(e,t,n){return n<0&&n++,n>1&&n--,6*n<1?e+(t-e)*6*n:2*n<1?t:3*n<2?e+(t-e)*(2/3-n)*6:e}function O(e){if(e in A)return A[e];var t,n=1;e=String(e);if(e.charAt(0)=="#")t=e;else if(/^rgb/.test(e)){var r=T(e),t="#",i;for(var s=0;s<3;s++)r[s].indexOf("%")!=-1?i=Math.floor(N(r[s])*255):i=+r[s],t+=y[C(i,0,255)];n=+r[3]}else if(/^hsl/.test(e)){var r=T(e);t=k(r),n=r[3]}else t=e;return A[e]={color:t,alpha:n}}function D(e){return _[e]||"square"}function P(e){this.m_=E(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=o*1,this.globalAlpha=1,this.canvas=e;var t="width:"+e.clientWidth+"px;height:"+e.clientHeight+"px;overflow:hidden;position:absolute",n=e.ownerDocument.createElement("div");n.style.cssText=t,e.appendChild(n);var r=n.cloneNode(!1);r.style.backgroundColor="red",r.style.filter="alpha(opacity=0)",e.appendChild(r),this.element_=n,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function B(e,t,n,r){e.currentPath_.push({type:"bezierCurveTo",cp1x:t.x,cp1y:t.y,cp2x:n.x,cp2y:n.y,x:r.x,y:r.y}),e.currentX_=r.x,e.currentY_=r.y}function j(e,t){var n=O(e.strokeStyle),r=n.color,i=n.alpha*e.globalAlpha,s=e.lineScale_*e.lineWidth;s<1&&(i*=s),t.push("<g_vml_:stroke",' opacity="',i,'"',' joinstyle="',e.lineJoin,'"',' miterlimit="',e.miterLimit,'"',' endcap="',D(e.lineCap),'"',' weight="',s,'px"',' color="',r,'" />')}function F(e,t,n,r){var i=e.fillStyle,s=e.arcScaleX_,o=e.arcScaleY_,u=r.x-n.x,a=r.y-n.y,f=O(e.fillStyle),l=f.color,c=f.alpha*e.globalAlpha;t.push('<g_vml_:fill color="',l,'" opacity="',c,'" />')}function I(e,t,n){var r=e.m_;return{x:o*(t*r[0][0]+n*r[1][0]+r[2][0])-u,y:o*(t*r[0][1]+n*r[1][1]+r[2][1])-u}}function q(e){return isFinite(e[0][0])&&isFinite(e[0][1])&&isFinite(e[1][0])&&isFinite(e[1][1])&&isFinite(e[2][0])&&isFinite(e[2][1])}function R(e,t,n){if(!q(t))return;e.m_=t;if(n){var r=t[0][0]*t[1][1]-t[0][1]*t[1][0];e.lineScale_=s(i(r))}}function U(e){throw new z(e)}function z(e){this.code=this[e],this.message=e+": DOM Exception "+this.code}var e=Math,t=e.round,n=e.sin,r=e.cos,i=e.abs,s=e.sqrt,o=10,u=o/2,a=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],l=Array.prototype.slice;d(document);var v={init:function(e){var t=e||document;t.createElement("canvas"),t.attachEvent("onreadystatechange",c(this.init_,this,t))},init_:function(e){var t=e.getElementsByTagName("canvas");for(var n=0;n<t.length;n++)this.initElement(t[n])},initElement:function(e){if(!e.getContext){e.getContext=f,d(e.ownerDocument),e.innerHTML="",e.attachEvent("onpropertychange",m),e.attachEvent("onresize",g);var t=e.attributes;t.width&&t.width.specified?e.style.width=t.width.nodeValue+"px":e.width=e.clientWidth,t.height&&t.height.specified?e.style.height=t.height.nodeValue+"px":e.height=e.clientHeight}return e}};v.init();var y=[];for(var b=0;b<16;b++)for(var w=0;w<16;w++)y[b*16+w]=b.toString(16)+w.toString(16);var A={},M={style:"normal",variant:"normal",weight:"normal",size:10,family:"sans-serif"},_={butt:"flat",round:"round"},H=P.prototype;H.clearRect=function(){this.textMeasureEl_&&(this.textMeasureEl_.removeNode(!0),this.textMeasureEl_=null),this.element_.innerHTML=""},H.beginPath=function(){this.currentPath_=[]},H.moveTo=function(e,t){var n=I(this,e,t);this.currentPath_.push({type:"moveTo",x:n.x,y:n.y}),this.currentX_=n.x,this.currentY_=n.y},H.lineTo=function(e,t){var n=I(this,e,t);this.currentPath_.push({type:"lineTo",x:n.x,y:n.y}),this.currentX_=n.x,this.currentY_=n.y},H.bezierCurveTo=function(e,t,n,r,i,s){var o=I(this,i,s),u=I(this,e,t),a=I(this,n,r);B(this,u,a,o)},H.quadraticCurveTo=function(e,t,n,r){var i=I(this,e,t),s=I(this,n,r),o={x:this.currentX_+2/3*(i.x-this.currentX_),y:this.currentY_+2/3*(i.y-this.currentY_)},u={x:o.x+(s.x-this.currentX_)/3,y:o.y+(s.y-this.currentY_)/3};B(this,o,u,s)},H.arc=function(e,t,i,s,a,f){i*=o;var l=f?"at":"wa",c=e+r(s)*i-u,h=t+n(s)*i-u,p=e+r(a)*i-u,d=t+n(a)*i-u;c==p&&!f&&(c+=.125);var v=I(this,e,t),m=I(this,c,h),g=I(this,p,d);this.currentPath_.push({type:l,x:v.x,y:v.y,radius:i,xStart:m.x,yStart:m.y,xEnd:g.x,yEnd:g.y})},H.stroke=function(e){var n=[],r=!1,i=10,s=10;n.push("<g_vml_:shape",' filled="',!!e,'"',' style="position:absolute;width:',i,"px;height:",s,'px;"',' coordorigin="0,0"',' coordsize="',o*i,",",o*s,'"',' stroked="',!e,'"',' path="');var u=!1,a={x:null,y:null},f={x:null,y:null};for(var l=0;l<this.currentPath_.length;l++){var c=this.currentPath_[l],h;switch(c.type){case"moveTo":h=c,n.push(" m ",t(c.x),",",t(c.y));break;case"lineTo":n.push(" l ",t(c.x),",",t(c.y));break;case"close":n.push(" x "),c=null;break;case"bezierCurveTo":n.push(" c ",t(c.cp1x),",",t(c.cp1y),",",t(c.cp2x),",",t(c.cp2y),",",t(c.x),",",t(c.y));break;case"at":case"wa":n.push(" ",c.type," ",t(c.x-this.arcScaleX_*c.radius),",",t(c.y-this.arcScaleY_*c.radius)," ",t(c.x+this.arcScaleX_*c.radius),",",t(c.y+this.arcScaleY_*c.radius)," ",t(c.xStart),",",t(c.yStart)," ",t(c.xEnd),",",t(c.yEnd))}if(c){if(a.x==null||c.x<a.x)a.x=c.x;if(f.x==null||c.x>f.x)f.x=c.x;if(a.y==null||c.y<a.y)a.y=c.y;if(f.y==null||c.y>f.y)f.y=c.y}}n.push(' ">'),e?F(this,n,a,f):j(this,n),n.push("</g_vml_:shape>"),this.element_.insertAdjacentHTML("beforeEnd",n.join(""))},H.fill=function(){this.stroke(!0)},H.closePath=function(){this.currentPath_.push({type:"close"})},H.save=function(){var e={};x(this,e),this.aStack_.push(e),this.mStack_.push(this.m_),this.m_=S(E(),this.m_)},H.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},H.translate=function(e,t){var n=[[1,0,0],[0,1,0],[e,t,1]];R(this,S(n,this.m_),!1)},H.scale=function(e,t){this.arcScaleX_*=e,this.arcScaleY_*=t;var n=[[e,0,0],[0,t,0],[0,0,1]];R(this,S(n,this.m_),!0)};var W=z.prototype=new Error;W.INDEX_SIZE_ERR=1,W.DOMSTRING_SIZE_ERR=2,W.HIERARCHY_REQUEST_ERR=3,W.WRONG_DOCUMENT_ERR=4,W.INVALID_CHARACTER_ERR=5,W.NO_DATA_ALLOWED_ERR=6,W.NO_MODIFICATION_ALLOWED_ERR=7,W.NOT_FOUND_ERR=8,W.NOT_SUPPORTED_ERR=9,W.INUSE_ATTRIBUTE_ERR=10,W.INVALID_STATE_ERR=11,W.SYNTAX_ERR=12,W.INVALID_MODIFICATION_ERR=13,W.NAMESPACE_ERR=14,W.INVALID_ACCESS_ERR=15,W.VALIDATION_ERR=16,W.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=v,CanvasRenderingContext2D=P,DOMException=z}(),this.jsviews||this.jQuery&&jQuery.views||function(e,t){function C(e,t){var n="\\"+e.charAt(0),r="\\"+e.charAt(1),o="\\"+t.charAt(0),u="\\"+t.charAt(1);return N.rTag=i=r+"(?:(?:(\\w+(?=[\\/\\s"+o+"]))|(?:(\\w+)?(:)|(>)|(\\*)))"+"\\s*((?:[^"+o+"]|"+o+"(?!"+u+"))*?)"+"(\\/)?|(?:\\/(\\w+)))"+o,i=new RegExp(n+i+u,"g"),s=new RegExp("<.*>|"+e+".*"+t),this}function k(e){var n=this,r=n.tmpl.helpers||{};return e=(n.ctx[e]!==t?n.ctx:r[e]!==t?r:P[e]!==t?P:{})[e],typeof e!="function"?e:function(){return e.apply(n,arguments)}}function L(e,t,n){var r=t.tmpl.converters;return e=r&&r[e]||H[e],e?e.call(t,n):n}function A(e,n,r,i,s){s.props=s.props||{};var u,a=s.props.tmpl,l=n.tmpl.tags,c=n.tmpl.templates,h=arguments,p=l&&l[e]||D[e];return p?(i=i&&n.tmpl.tmpls[i-1],a=a||i||t,s.tmpl=""+a===a?c&&c[a]||_[a]||_(a):a,s.isTag=f,s.converter=r,s.view=n,s.renderContent=B,n.ctx&&o(s.ctx,n.ctx),u=p.apply(s,h.length>5?x.call(h,5):[]),u||(u==t?"":u.toString())):""}function O(e,n,i,s,o,u){var a=i.views,f={tmpl:o,path:n,parent:i,data:s,ctx:e,views:r.isArray(s)?[]:{},hlp:k};return r.isArray(a)?a.splice(f.index=u!==t?u:a.length,0,f):a[f.index="_"+g++]=f,f}function M(e,n,r,i,s){var o,a;if(r&&typeof r=="object"&&!r.nodeType){for(o in r)n(o,r[o]);return e}if(!r||i===t)s&&(i=s(t,i||r));else if(""+r===r)if(i===null)delete n[r];else if(i=s?s(r,i):i)n[r]=i;return(a=u.onStoreItem)&&a(n,r,i,s),i}function _(e,t){return M(this,_,e,t,q)}function D(e,t){return M(this,D,e,t)}function P(e,t){return M(this,P,e,t)}function H(e,t){return M(this,H,e,t)}function B(e,n,i,s,l){var c,h,p,d,v,m,g,y,b,w,E={},S=l===f,x=this,T="";x.isTag?(b=x.tmpl,n=n||x.ctx,i=i||x.view,s=s||x.path,l=l||x.index,E=x.props):b=x.jquery&&x[0]||x,i=i||N.topView,y=i.ctx,w=b.layout,e===i&&(e=i.data,w=f),n=n&&n===y?y:y?(y=o({},y),n)?o(y,n):y:n||{},E.link===a&&(n.link=a),b.fn||(b=_[b]||_(b)),v=n.link&&u.onRenderItem,m=n.link&&u.onRenderItems;if(b){if(r.isArray(e)&&!w){d=S?i:l!==t&&i||O(n,s,i,e,b,l);for(c=0,h=e.length;c<h;c++)p=e[c],g=b.fn(p,O(n,s,d,p,b,(l||0)+c),N),T+=v?v(g,E):g}else d=S?i:O(n,s,i,e,b,l),T+=e||w?b.fn(e,d,N):"";return i.topKey=d.index,m?m(T,s,d.index,b,E):T}return""}function j(){throw"Syntax error"}function F(e,t,n){function P(t){t-=A,t&&M.push(e.substr(A,t).replace(p,"\\n"))}function H(t,i,s,o,u,a,l,c,h,p){u&&(o=":",s="html");var v="",g="",y=!c&&!o;i=i||o,P(p),A=p+t.length,a?N&&M.push(["*",l.replace(d,"$1")]):i?(i==="else"&&(_[5]=e.substring(_[5],p),_=O.pop(),M=_[3],y=f),l=l?I(l,n).replace(m,function(e,t,n){return t?g+=n+",":v+=n+",",""}):"",v=v.slice(0,-1),l=l.slice(0,-1),r=[i,s||"",l,y&&[],"{"+(v?"props:{"+v+"},":"")+"path:'"+l+"'"+(g?",ctx:{"+g.slice(0,-1)+"}":"")+"}"],y&&(O.push(_),_=r,_[5]=A),M.push(r)):h&&(_[5]=e.substring(_[5],p),_=O.pop());if(!_)throw"Expected block tag";M=_[3]}var r,s,o,u,a,l,c,h,g,y,b,w,S,x,T,N,C=t?{allowCode:N=t.allowCode,debug:t.debug}:{},k=t&&t.tmpls,L=[],A=0,O=[],M=L,_=[,,,L],D=0;e=e.replace(v,"\\$1"),e.replace(i,H),P(e.length),u=L.length,a=u?"":'"";';for(o=0;o<u;o++)s=L[o],s[0]==="*"?a=a.slice(0,o?-1:-3)+";"+s[1]+(o+1<u?"ret+=":""):""+s===s?a+='"'+s+'"+':(b=s[0],w=s[1],S=s[2],M=s[3],x=s[4],e=s[5],M&&(T=R(e,C,t,D++),F(e,T),k.push(T)),y=y||x.indexOf("view")>-1,a+=(b===":"?w==="html"?(c=f,"e("+S):w?(g=f,'c("'+w+'",view,'+S):(h=f,"((v="+S+')!=u?v:""'):(l=f,'t("'+b+'",view,"'+(w||"")+'",'+(M?k.length:'""')+","+x+(S?",":"")+S))+")+");return a=new Function("data, view, j, b, u",E+(h?"v,":"")+(l?"t=j.tag,":"")+(g?"c=j.convert,":"")+(c?"e=j.converters.html,":"")+"ret; try{\n\n"+(C.debug?"debugger;":"")+(N?"ret=":"return ")+a.slice(0,-1)+";\n\n"+(N?"return ret;":"")+"}catch(e){return j.err(e);}"),t&&(t.fn=a,t.useVw=g||y||l),a}function I(e,t){function u(e,u,l,h,p,d,v,m,g,y,b,w,E,S,x,T){function N(e,n,r,i,s,o,u){if(n){var a=(r?'view.hlp("'+r+'")':i?"view":"data")+(u?(s?"."+s:r?"":i?"":"."+n)+(o||""):(u=r?"":i?s||"":n,""));return t&&g!=="("&&(a="b("+a+',"'+u+'")'),a+(u?"."+u:"")}return e}p=p||"",l=l||u||b,h=h||m,g=g||x||"",p=p||"";if(!d)return o?(o=!w,o?e:'"'):s?(s=!E,s?e:'"'):(l?(i++,l):"")+(T?i?"":n?(n=a,"\b"):",":v?(i&&j(),n=f,"\b"+h+":"):h?h.replace(c,N)+(g?(r[++i]=f,g):p):p?e:S?(r[i--]=a,S)+(g?(r[++i]=f,g):""):y?(r[i]||j(),","):u?"":(o=w,s=E,'"'));j()}var n,r={},i=0,s=a,o=a;return e=(e+" ").replace(h,u),e}function q(e,n,r,i){function p(t){if(""+t===t||t.nodeType>0)return a=t.nodeType>0?t:!s.test(t)&&l&&l(t)[0],a&&a.type&&(t=_[a.getAttribute(w)],t||(e=e||"_"+y++,a.setAttribute(w,e),t=q(e,a.innerHTML,r,i),_[e]=t)),t}var u,a,f,c,h;u=p(n),i=i||(n.markup?n:{}),i.name=e,c=i.templates,!u&&n.markup&&(u=p(n.markup))&&u.fn&&(u.debug!==n.debug||u.allowCode!==n.allowCode)&&(u=u.markup);if(u!==t){e&&!r&&(T[e]=function(){return n.render.apply(n,arguments)}),u.fn||n.fn?u.fn&&(e&&e!==u.name?n=o(o({},u),i):n=u):(n=R(u,i,r,0),F(u,n));for(f in c)h=c[f],h.name!==f&&(c[f]=q(f,h,n));return n}}function R(e,t,n,r){function i(e){n[e]&&(s[e]=o(o({},n[e]),t[e]))}t=t||{};var s={markup:e,tmpls:[],links:[],render:B};return n&&(n.templates&&(s.templates=o(o({},n.templates),t.templates)),s.parent=n,s.name=n.name+"["+r+"]",s.index=r),o(s,t),n&&(i("templates"),i("tags"),i("helpers"),i("converters")),s}function U(e){return b[e]||(b[e]="&#"+e.charCodeAt(0)+";")}var n="v1.0pre",r,i,s,o,u={},a=!1,f=!0,l=e.jQuery,c=/^(?:null|true|false|\d[\d.]*|([\w$]+|~([\w$]+)|#(view|([\w$]+))?)([\w$.]*?)(?:[.[]([\w$]+)\]?)?|(['"]).*\8)$/g,h=/(\()(?=|\s*\()|(?:([([])\s*)?(?:([#~]?[\w$.]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*!:?\/]|(=))\s*|([#~]?[\w$.]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*([)\]])([([]?))|(\s+)/g,p=/\r?\n/g,d=/\\(['"])/g,v=/\\?(['"])/g,m=/\x08(~)?([^\x08]+)\x08/g,g=0,y=0,b={"&":"&amp;","<":"&lt;",">":"&gt;"},w="data-jsv-tmpl",E="var j=j||"+(l?"jQuery.":"js")+"views,",S=/[\x00"&'<>]/g,x=Array.prototype.slice,T={},N={jsviews:n,sub:u,debugMode:f,err:function(e){return N.debugMode?"<br/><b>Error:</b> <em> "+(e.message||e)+". </em>":'""'},tmplFn:F,render:T,templates:_,tags:D,helpers:P,converters:H,View:O,convert:L,delimiters:C,tag:A};l?(r=l,r.templates=_,r.render=T,r.views=N,r.fn.render=B):(r=e.jsviews=N,r.extend=function(e,t){var n;e=e||{};for(n in t)e[n]=t[n];return e},r.isArray=Array&&Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"}),o=r.extend,N.topView={views:{},tmpl:{},hlp:k,ctx:N.helpers},D({"if":function(){var e=this,n=e.view;return n.onElse=function(e,r){var i=0,s=r.length;while(s&&!r[i++])if(i===s)return"";return n.onElse=t,e.path="",e.renderContent(n)},n.onElse(this,arguments)},"else":function(){var e=this.view;return e.onElse?e.onElse(this,arguments):""},"for":function(){var e,t=this,n="",r=arguments,i=r.length;t.props.layout&&(t.tmpl.layout=f);for(e=0;e<i;e++)n+=t.renderContent(r[e]);return n},"=":function(e){return e},"*":function(e){return e}}),H({html:function(e){return e!=t?String(e).replace(S,U):""}}),C("{{","}}")}(this),function(e){function r(t){var n=t||window.event,r=[].slice.call(arguments,1),i=0,s=!0,o=0,u=0;return t=e.event.fix(n),t.type="mousewheel",n.wheelDelta&&(i=n.wheelDelta/120),n.detail&&(i=-n.detail/3),u=i,n.axis!==undefined&&n.axis===n.HORIZONTAL_AXIS&&(u=0,o=-1*i),n.wheelDeltaY!==undefined&&(u=n.wheelDeltaY/120),n.wheelDeltaX!==undefined&&(o=-1*n.wheelDeltaX/120),r.unshift(t,i,o,u),(e.event.dispatch||e.event.handle).apply(this,r)}var t=["DOMMouseScroll","mousewheel"];if(e.event.fixHooks)for(var n=t.length;n;)e.event.fixHooks[t[--n]]=e.event.mouseHooks;e.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var e=t.length;e;)this.addEventListener(t[--e],r,!1);else this.onmousewheel=r},teardown:function(){if(this.removeEventListener)for(var e=t.length;e;)this.removeEventListener(t[--e],r,!1);else this.onmousewheel=null}},e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}(jQuery),$.widget||function(e,t){if(e.cleanData){var n=e.cleanData;e.cleanData=function(t){for(var r=0,i;(i=t[r])!=null;r++)try{e(i).triggerHandler("remove")}catch(s){}n(t)}}else{var r=e.fn.remove;e.fn.remove=function(t,n){return this.each(function(){return n||(!t||e.filter(t,[this]).length)&&e("*",this).add([this]).each(function(){try{e(this).triggerHandler("remove")}catch(t){}}),r.call(e(this),t,n)})}}e.widget=function(t,n,r){var i=t.split(".")[0],s;t=t.split(".")[1],s=i+"-"+t,r||(r=n,n=e.Widget),e.expr[":"][s]=function(n){return!!e.data(n,t)},e[i]=e[i]||{},e[i][t]=function(e,t){arguments.length&&this._createWidget(e,t)};var o=new n;o.options=e.extend(!0,{},o.options),e[i][t].prototype=e.extend(!0,o,{namespace:i,widgetName:t,widgetEventPrefix:e[i][t].prototype.widgetEventPrefix||t,widgetBaseClass:s},r),e.widget.bridge(t,e[i][t])},e.widget.bridge=function(n,r){e.fn[n]=function(i){var s=typeof i=="string",o=Array.prototype.slice.call(arguments,1),u=this;return i=!s&&o.length?e.extend.apply(null,[!0,i].concat(o)):i,s&&i.charAt(0)==="_"?u:(s?this.each(function(){var r=e.data(this,n),s=r&&e.isFunction(r[i])?r[i].apply(r,o):r;if(s!==r&&s!==t)return u=s,!1}):this.each(function(){var t=e.data(this,n);t?t.option(i||{})._init():e.data(this,n,new r(i,this))}),u)}},e.Widget=function(e,t){arguments.length&&this._createWidget(e,t)},e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(t,n){e.data(n,this.widgetName,this),this.element=e(n),this.options=e.extend(!0,{},this.options,this._getCreateOptions(),t);var r=this;this.element.bind("remove."+this.widgetName,function(){r.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return e.metadata&&e.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(n,r){var i=n;if(arguments.length===0)return e.extend({},this.options);if(typeof n=="string"){if(r===t)return this.options[n];i={},i[n]=r}return this._setOptions(i),this},_setOptions:function(t){var n=this;return e.each(t,function(e,t){n._setOption(e,t)}),this},_setOption:function(e,t){return this.options[e]=t,e==="disabled"&&this.widget()[t?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",t),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(t,n,r){var i,s,o=this.options[t];r=r||{},n=e.Event(n),n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),n.target=this.element[0],s=n.originalEvent;if(s)for(i in s)i in n||(n[i]=s[i]);return this.element.trigger(n,r),!(e.isFunction(o)&&o.call(this.element[0],n,r)===!1||n.isDefaultPrevented())}}}(jQuery),function(e,t,n){var r=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;e.geo={_allCoordinates:function(t){var n=this._flatten(t),r=0,i=[];for(;r<n.length;r++){var s=n[r].coordinates,o=s&&e.isArray(s[0]),u=o&&e.isArray(s[0][0]),a=u&&e.isArray(s[0][0][0]),f,l,c;a||(u||(o||(s=[s]),s=[s]),s=[s]);for(f=0;f<s.length;f++)for(l=0;l<s[f].length;l++)for(c=0;c<s[f][l].length;c++)i.push(s[f][l][c])}return i},_isGeodetic:function(t){while(e.isArray(t)){if(t.length>1&&!e.isArray(t[0]))return t[0]>=-180&&t[0]<=180&&t[1]>=-85&&t[1]<=85;t=t[0]}return!1},center:function(t,n){var r=!1;!n&&e.geo.proj&&this._isGeodetic(t)&&(r=!0,t=e.geo.proj.fromGeodetic(t));var i=[(t[0]+t[2])/2,(t[1]+t[3])/2];return r?e.geo.proj.toGeodetic(i):i},expandBy:function(t,n,r,i){var s=!1;return!i&&e.geo.proj&&this._isGeodetic(t)&&(s=!0,t=e.geo.proj.fromGeodetic(t)),t=[t[0]-n,t[1]-r,t[2]+n,t[3]+r],s?e.geo.proj.toGeodetic(t):t},height:function(t,n){return!n&&e.geo.proj&&this._isGeodetic(t)&&(t=e.geo.proj.fromGeodetic(t)),t[3]-t[1]},_in:function(e,t){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[2]&&e[3]>=t[3]},_bboxDisjoint:function(e,t){return t[0]>e[2]||t[2]<e[0]||t[1]>e[3]||t[3]<e[1]},include:function(t,n,s){if(!n||!e.isArray(n))return t;var o=!1;return!s&&e.geo.proj&&this._isGeodetic(t||n)&&(o=!0),t?o&&(t=e.geo.proj.fromGeodetic(t)):t=[r,r,i,i],n.length===2&&(n=[n[0],n[1],n[0],n[1]]),n=e.geo.proj.fromGeodetic(n),t[0]=Math.min(n[0],t[0]),t[1]=Math.min(n[1],t[1]),t[2]=Math.max(n[2],t[2]),t[3]=Math.max(n[3],t[3]),o?e.geo.proj.toGeodetic(t):t},polygonize:function(t,n){var r=!1;!n&&e.geo.proj&&this._isGeodetic(t)&&(r=!0,t=e.geo.proj.fromGeodetic(t));var i={type:"Polygon",coordinates:[[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]]]]};return r&&(i.coordinates=e.geo.proj.toGeodetic(i.coordinates)),i},reaspect:function(t,n,r){var i=!1;!r&&e.geo.proj&&this._isGeodetic(t)&&(i=!0,t=e.geo.proj.fromGeodetic(t));var s=this.width(t,!0),o=this.height(t,!0),u=this.center(t,!0),a,f;return s!==0&&o!==0&&n>0&&(s/o>n?(a=s/2,f=a/n):(f=o/2,a=f*n),t=[u[0]-a,u[1]-f,u[0]+a,u[1]+f]),i?e.geo.proj.toGeodetic(t):t},recenter:function(t,n,r){var i=!1;!r&&e.geo.proj&&(this._isGeodetic(t)&&(i=!0,t=e.geo.proj.fromGeodetic(t)),this._isGeodetic(n)&&(n=e.geo.proj.fromGeodetic(n)));var s=(t[2]-t[0])/2,o=(t[3]-t[1])/2;return t=[n[0]-s,n[1]-o,n[0]+s,n[1]+o],i?e.geo.proj.toGeodetic(t):t},scaleBy:function(t,n,r){var i=!1;!r&&e.geo.proj&&this._isGeodetic(t)&&(i=!0,t=e.geo.proj.fromGeodetic(t));var s=this.center(t,!0),o=(t[2]-t[0])*n/2,u=(t[3]-t[1])*n/2;return t=[s[0]-o,s[1]-u,s[0]+o,s[1]+u],i?e.geo.proj.toGeodetic(t):t},width:function(t,n){return!n&&e.geo.proj&&this._isGeodetic(t)&&(t=e.geo.proj.fromGeodetic(t)),t[2]-t[0]},bbox:function(t,s){var o,u=!1;if(!t)return n;if(t.bbox)o=!s&&e.geo.proj&&this._isGeodetic(t.bbox)?e.geo.proj.fromGeodetic(t.bbox):t.bbox;else{o=[r,r,i,i];var a=this._allCoordinates(t),f=0;if(a.length===0)return n;!s&&e.geo.proj&&this._isGeodetic(a)&&(u=!0,a=e.geo.proj.fromGeodetic(a));for(;f<a.length;f++)o[0]=Math.min(a[f][0],o[0]),o[1]=Math.min(a[f][1],o[1]),o[2]=Math.max(a[f][0],o[2]),o[3]=Math.max(a[f][1],o[3])}return u?e.geo.proj.toGeodetic(o):o},centroid:function(t,s){switch(t.type){case"Point":return e.extend({},t);case"LineString":case"Polygon":var o=0,u=[0,0],a=e.merge([],t.type=="Polygon"?t.coordinates[0]:t.coordinates),f=1,l,c,h=[r,r,i,i],p=!1;!s&&e.geo.proj&&this._isGeodetic(a)&&(p=!0,a=e.geo.proj.fromGeodetic(a));for(;f<=a.length;f++)l=f%a.length,h[0]=Math.min(a[l][0],h[0]),h[1]=Math.min(a[l][1],h[1]),h[2]=Math.max(a[l][0],h[2]),h[3]=Math.max(a[l][1],h[3]),c=a[f-1][0]*a[l][1]-a[l][0]*a[f-1][1],o+=c,u[0]+=(a[f-1][0]+a[l][0])*c,u[1]+=(a[f-1][1]+a[l][1])*c;if(o===0)return a.length>0?(u[0]=Math.min(Math.max(a[0][0],h[0]),h[2]),u[1]=Math.min(Math.max(a[0][1],h[1]),h[3]),{type:"Point",coordinates:p?e.geo.proj.toGeodetic(u):u}):n;return o*=3,u[0]=Math.min(Math.max(u[0]/o,h[0]),h[2]),u[1]=Math.min(Math.max(u[1]/o,h[1]),h[3]),{type:"Point",coordinates:p?e.geo.proj.toGeodetic(u):u}}return n},contains:function(e,t){if(e.type!="Polygon")return!1;switch(t.type){case"Point":return this._containsPolygonPoint(e.coordinates,t.coordinates);case"LineString":return this._containsPolygonLineString(e.coordinates,t.coordinates);case"Polygon":return this._containsPolygonLineString(e.coordinates,t.coordinates[0]);default:return!1}},_containsPolygonPoint:function(e,t){if(e.length===0||e[0].length<4)return!1;var n=0,r=e[0][0],i=1,s,o;for(;i<e[0].length;i++){s=e[0][i];if(r[1]<=t[1]&&t[1]<s[1]||s[1]<=t[1]&&t[1]<r[1]&&(t[0]<r[0]||t[0]<s[0]))o=r[0]+(s[0]-r[0])*(t[1]-r[1])/(s[1]-r[1]),o>t[0]&&n++;r=s}return n%2==1},_containsPolygonLineString:function(e,t){for(var n=0;n<t.length;n++)if(!this._containsPolygonPoint(e,t[n]))return!1;return!0},distance:function(t,r,i){var s=!i&&e.geo.proj&&this._isGeodetic(t.coordinates)?e.geo.proj.fromGeodetic(t.coordinates):t.coordinates,o=!i&&e.geo.proj&&this._isGeodetic(r.coordinates)?e.geo.proj.fromGeodetic(r.coordinates):r.coordinates;switch(t.type){case"Point":switch(r.type){case"Point":return this._distancePointPoint(o,s);case"LineString":return this._distanceLineStringPoint(o,s);case"Polygon":return this._containsPolygonPoint(o,s)?0:this._distanceLineStringPoint(o[0],s);default:return n}break;case"LineString":switch(r.type){case"Point":return this._distanceLineStringPoint(s,o);case"LineString":return this._distanceLineStringLineString(s,o);case"Polygon":return this._containsPolygonLineString(o,s)?0:this._distanceLineStringLineString(o[0],s);default:return n}break;case"Polygon":switch(r.type){case"Point":return this._containsPolygonPoint(s,o)?0:this._distanceLineStringPoint(s[0],o);case"LineString":return this._containsPolygonLineString(s,o)?0:this._distanceLineStringLineString(s[0],o);case"Polygon":return this._containsPolygonLineString(s,o[0])?0:this._distanceLineStringLineString(s[0],o[0]);default:return n}}},_distancePointPoint:function(e,t){var n=t[0]-e[0],r=t[1]-e[1];return Math.sqrt(n*n+r*r)},_distanceLineStringPoint:function(e,t){var n=r;if(e.length>0){var i=e[0],s=t[0]-i[0],o=t[1]-i[1];if(e.length==1)return Math.sqrt(s*s+o*o);for(var u=1;u<e.length;u++){var a=e[u],f=a[0]-i[0],l=a[1]-i[1],c=t[0]-a[0],h=t[1]-a[1],p=this._distanceSegmentPoint(f,l,s,o,c,h);if(p===0)return 0;p<n&&(n=p),i=a,s=c,o=h}}return Math.sqrt(n)},_distanceSegmentPoint:function(e,t,n,r,i,s){var o=e*n+t*r;if(o<=0)return n*n+r*r;var u=e*e+t*t;return o>=u?i*i+s*s:n*n+r*r-o*o/u},_distanceLineStringLineString:function(e,t){var n=r;for(var i=0;i<t.length;i++)n=Math.min(n,this._distanceLineStringPoint(e,t[i]));return n},_buffer:function(t,r,i){var s=!1,o=t.coordinates;!i&&e.geo.proj&&this._isGeodetic(t.coordinates)&&(s=!0,o=e.geo.proj.fromGeodetic(t.coordinates));if(t.type==="Point"){var u=[],a=180,f=0,l;for(;f<=a;f++)l=f*360/a*(Math.PI/180),u.push([o[0]+Math.cos(l)*r,o[1]+Math.sin(l)*r]);return{type:"Polygon",coordinates:[s?e.geo.proj.toGeodetic(u):u]}}return n},_flatten:function(t){var n=[],r=0;switch(t.type){case"Feature":e.merge(n,this._flatten(t.geometry));break;case"FeatureCollection":for(;r<t.features.length;r++)e.merge(n,this._flatten(t.features[r].geometry));break;case"GeometryCollection":for(;r<t.geometries.length;r++)e.merge(n,this._flatten(t.geometries[r]));break;default:n[0]=t}return n},length:function(t,n){var r=0,i,s=1,o,u;switch(t.type){case"Point":return 0;case"LineString":i=t.coordinates;break;case"Polygon":i=t.coordinates[0]}if(i){!n&&e.geo.proj&&this._isGeodetic(i)&&(i=e.geo.proj.fromGeodetic(i));for(;s<i.length;s++)o=i[s][0]-i[s-1][0],u=i[s][1]-i[s-1][1],r+=Math.sqrt(o*o+u*u);return r}},area:function(t,n){var r=0,i,s=1,o;switch(t.type){case"Point":case"LineString":return 0;case"Polygon":i=t.coordinates[0]}if(i){!n&&e.geo.proj&&this._isGeodetic(i)&&(i=e.geo.proj.fromGeodetic(i));for(;s<=i.length;s++)o=s%i.length,r+=(i[s-1][0]-i[o][0])*(i[s-1][1]+i[o][1])/2;return Math.abs(r)}},pointAlong:function(t,n,r){var i=0,s=0,o=0,u,a,f,l=[],c=1,h,p,d,v,m,g=!1;switch(t.type){case"Point":return e.extend({},t);case"LineString":f=t.coordinates;break;case"Polygon":f=t.coordinates[0]}if(f){if(n===0)return{type:"Point",coordinates:[f[0][0],f[0][1]]};if(n===1)return c=f.length-1,{type:"Point",coordinates:[f[c][0],f[c][1]]};!r&&e.geo.proj&&this._isGeodetic(f)&&(g=!0,f=e.geo.proj.fromGeodetic(f));for(;c<f.length;c++)h=f[c][0]-f[c-1][0],p=f[c][1]-f[c-1][1],a=Math.sqrt(h*h+p*p),l.push(a),i+=a;for(c=0;c<l.length&&o<n;c++)s=o,o+=l[c]/i;return u=n-s,v=f[c-1],m=f[c],d=[v[0]+u*(m[0]-v[0]),v[1]+u*(m[1]-v[1])],{type:"Point",coordinates:g?e.geo.proj.toGeodetic(d):d}}},_WKT:function(){function t(e){return"POINT "+n(e.coordinates)}function n(e){return!e||!e.length?"EMPTY":"("+e.join(" ")+")"}function r(e){return"LINESTRING "+i(e.coordinates)}function i(e){if(!e||!e.length)return"EMPTY";var t=[];for(var n=0;n<e.length;n++)t.push(e[n].join(" "));return"("+t+")"}function s(e){return"POLYGON "+o(e.coordinates)}function o(e){if(!e||!e.length)return"EMTPY";var t=[];for(var n=0;n<e.length;n++)t.push(i(e[n]));return"("+t+")"}function u(e){return"MULTIPOINT "+i(e.coordinates)}function a(e){return"MULTILINSTRING "+o(e.coordinates)}function f(e){return"MULTIPOLYGON "+l(e.coordinates)}function l(e){if(!e||!e.length)return"EMPTY";var t=[];for(var n=0;n<e.length;n++)t.push(o(e[n]));return"("+t+")"}function c(e){return"GEOMETRYCOLLECTION "+h(e.geometries)}function h(e){if(!e||!e.length)return"EMPTY";var t=[];for(var n=0;n<e.length;n++)t.push(p(e[n]));return"("+e+")"}function p(e){if(!e||!e.type)return"";switch(e.type){case"Point":return t(e);case"LineString":return r(e);case"Polygon":return s(e);case"MultiPoint":return u(e);case"MultiLineString":return a(e);case"MultiPolygon":return f(e);case"GeometryCollection":return c(e);default:return""}}function d(e){var t=e.match(/\(\s*([\d\.\-]+)\s+([\d\.\-]+)\s*\)/);return t&&t.length>2?{type:"Point",coordinates:[parseFloat(t[1]),parseFloat(t[2])]}:null}function v(e){var t=e.match(/\s*\((.*)\)/),n=[],r,i,s=0;if(t&&t.length>1){r=t[1].match(/[\d\.\-]+\s+[\d\.\-]+/g);for(;s<r.length;s++)i=r[s].match(/\s*([\d\.\-]+)\s+([\d\.\-]+)\s*/),n[s]=[parseFloat(i[1]),parseFloat(i[2])];return{type:"LineString",coordinates:n}}return null}function m(e){var t=e.match(/\s*\(\s*\((.*)\)\s*\)/),n=[],r,i,s=0;if(t&&t.length>1){r=t[1].match(/[\d\.\-]+\s+[\d\.\-]+/g);for(;s<r.length;s++)i=r[s].match(/\s*([\d\.\-]+)\s+([\d\.\-]+)\s*/),n[s]=[parseFloat(i[1]),parseFloat(i[2])];return{type:"Polygon",coordinates:[n]}}return null}function g(t){var n;return t.indexOf("((")===-1?n=v(t):(n=y(t),n.coordinates=e.geo._allCoordinates(n)),n.type="MultiPoint",n}function y(e){var t=e.substr(1,e.length-2),n=t.split(")),(("),r=0,i={type:"MultiLineString",coordinates:[]};for(;r<n.length;r++)i.coordinates.push(v(n[r]).coordinates);return i}function b(e){var t=e.substr(1,e.length-2),n=t.split(")),(("),r=0,i={type:"MultiPolygon",coordinates:[]};for(;r<n.length;r++)i.coordinates.push(m(n[r]).coordinates);return i}function w(e){var t=e.substr(1,e.length-2),n=t.match(/\),[a-zA-Z]/g),r={type:"GeometryCollection",geometries:[]},i,s=0,o=0,u;if(n&&n.length>0){for(;s<n.length;s++)u=t.indexOf(n[s],o)-o+1,i=E(t.substr(o,u)),i&&r.geometries.push(i),o+=u+1;return i=E(t.substr(o)),i&&r.geometries.push(i),r}return null}function E(t){t=e.trim(t);var n=t.indexOf("("),r=t.substr(n);switch(e.trim(t.substr(0,n)).toUpperCase()){case"POINT":return d(r);case"LINESTRING":return v(r);case"POLYGON":return m(r);case"MULTIPOINT":return g(r);case"MULTILINESTRING":return y(r);case"MULTIPOLYGON":return b(r);case"GEOMETRYCOLLECTION":return w(r);default:return null}}return{stringify:p,parse:E}}(),proj:function(){var t=1.5707963267948966,n=.7853981633974483,r=.017453292519943295,i=57.29577951308232,s=6378137;return{fromGeodeticPos:function(e){return[s*e[0]*r,s*Math.log(Math.tan(n+e[1]*r/2))]},fromGeodetic:function(t){if(!e.geo._isGeodetic(t))return t;var n=e.isArray(t[0]),r=this.fromGeodeticPos;if(!n&&t.length==4){var i=r([t[0],t[1]]),s=r([t[2],t[3]]);return[i[0],i[1],s[0],s[1]]}var o=n&&e.isArray(t[0][0]),u=o&&e.isArray(t[0][0][0]),a=[],f,l,c;u||(o||(n||(t=[t]),t=[t]),t=[t]);for(f=0;f<t.length;f++){a[f]=[];for(l=0;l<t[f].length;l++){a[f][l]=[];for(c=0;c<t[f][l].length;c++)a[f][l][c]=r(t[f][l][c])}}return u?a:o?a[0]:n?a[0][0]:a[0][0][0]},toGeodeticPos:function(e){return[e[0]/s*i,(t-2*Math.atan(1/Math.exp(e[1]/s)))*i]},toGeodetic:function(t){if(e.geo._isGeodetic(t))return t;var n=e.isArray(t[0]),r=this.toGeodeticPos;if(!n&&t.length==4){var i=r([t[0],t[1]]),s=r([t[2],t[3]]);return[i[0],i[1],s[0],s[1]]}var o=n&&e.isArray(t[0][0]),u=o&&e.isArray(t[0][0][0]),a=[],f,l,c;u||(o||(n||(t=[t]),t=[t]),t=[t]);for(f=0;f<t.length;f++){a[f]=[];for(l=0;l<t[f].length;l++){a[f][l]=[];for(c=0;c<t[f][l].length;c++)a[f][l][c]=r(t[f][l][c])}}return u?a:o?a[0]:n?a[0][0]:a[0][0][0]}}}(),_serviceTypes:{}}}(jQuery,this),function(e,t){var n=function(){var e=5,t=document.createElement("div"),n=t.all||[];do t.innerHTML="<!--[if gt IE "+ ++e+"]><br><![endif]-->";while(n[0]);return e>6?e:!e}();e.widget("geo.geographics",{_$elem:t,_options:{},_trueCanvas:!0,_trueDoubleBuffer:!0,_width:0,_height:0,_$canvas:t,_context:t,_$canvasSceneFront:t,_$canvasSceneBack:t,_timeoutEnd:null,_requireFlip:!1,_blitcanvas:t,_blitcontext:t,_$labelsContainerFront:t,_$labelsContainerBack:t,_labelsHtml:"",options:{style:{borderRadius:"8px",color:"#7f0000",fillOpacity:.2,height:"8px",opacity:1,strokeOpacity:1,strokeWidth:"2px",visibility:"visible",width:"8px"},doubleBuffer:!0},_create:function(){this._$elem=this.element,this._options=this.options,this._$elem.css({webkitTransform:"translateZ(0)",display:"inline-block",overflow:"hidden",textAlign:"left"}),this._$elem.css("position")=="static"&&this._$elem.css("position","relative"),this._$elem.addClass("geo-graphics"),this._width=this._$elem.width(),this._height=this._$elem.height();if(!this._width||!this._height)this._width=parseInt(this._$elem.css("width"),10),this._height=parseInt(this._$elem.css("height"),10);var t="position:absolute;left:0;top:0;margin:0;padding:0;",r="width:"+this._width+"px;height:"+this._height+"px;",i='width="'+this._width+'" height="'+this._height+'"';this._blitcanvas=document.createElement("canvas"),this._blitcanvas.getContext?(this._$canvas=e("<canvas "+i+' style="-webkit-transform:translateZ(0);'+t+'"></canvas>'),this._blitcanvas.width=1,this._blitcanvas.height=1,this._trueDoubleBuffer=this._blitcanvas.toDataURL().length>6,(!this._options.doubleBuffer||!this._trueDoubleBuffer)&&this._$elem.append(this._$canvas),this._context=this._$canvas[0].getContext("2d"),this._blitcanvas.width=this._width,this._blitcanvas.height=this._height,this._blitcontext=this._blitcanvas.getContext("2d"),this._$canvasSceneFront=e('<img id="scene0" style="-webkit-transform:translateZ(0);'+t+r+'" />'),this._$canvasSceneBack=e('<img id="scene1" style="-webkit-transform:translateZ(0);'+t+r+'" />')):n<=8&&(this._trueCanvas=!1,this._$elem.append("<div "+i+' style="'+t+r+'"></div>'),this._$canvas=this._$elem.children(":last"),G_vmlCanvasManager.initElement(this._$canvas[0]),this._context=this._$canvas[0].getContext("2d"),this._$canvas.children().css({backgroundColor:"transparent",width:this._width,height:this._height})),this._$labelsContainerFront=e('<div class="geo-labels-container" style="-webkit-transform:translateZ(0);'+t+r+'"></div>'),this._$labelsContainerBack=e('<div class="geo-labels-container" style="-webkit-transform:translateZ(0);'+t+r+'"></div>')},_setOption:function(t,n){t=="style"&&(n=e.extend({},this._options.style,n)),e.Widget.prototype._setOption.apply(this,arguments)},destroy:function(){e.Widget.prototype.destroy.apply(this,arguments),this._$elem.html(""),this._$elem.removeClass("geo-graphics")},clear:function(){this._context.clearRect(0,0,this._width,this._height),this._labelsHtml="",this._end()},drawArc:function(e,t,n,r){r=this._getGraphicStyle(r);if(r.visibility!="hidden"&&r.opacity>0&&r.widthValue>0&&r.heightValue>0){var i=Math.min(r.widthValue,r.heightValue)/2;t=t*Math.PI/180,n=n*Math.PI/180,this._context.save(),this._context.translate(e[0],e[1]),r.widthValue>r.heightValue?this._context.scale(r.widthValue/r.heightValue,1):this._context.scale(1,r.heightValue/r.widthValue),this._context.beginPath(),this._context.arc(0,0,i,t,n,!1),this._trueCanvas&&this._context.restore(),r.doFill&&(this._context.fillStyle=r.fill,this._context.globalAlpha=r.opacity*r.fillOpacity,this._context.fill()),r.doStroke&&(this._context.lineJoin="round",this._context.lineWidth=r.strokeWidthValue,this._context.strokeStyle=r.stroke,this._context.globalAlpha=r.opacity*r.strokeOpacity,this._context.stroke()),this._trueCanvas||this._context.restore()}this._end()},drawPoint:function(e,t){t=this._getGraphicStyle(t),t.widthValue==t.heightValue&&t.heightValue==t.borderRadiusValue?this.drawArc(e,0,360,t):t.visibility!="hidden"&&t.opacity>0&&(t.borderRadiusValue=Math.min(Math.min(t.widthValue,t.heightValue)/2,t.borderRadiusValue),e[0]-=t.widthValue/2,e[1]-=t.heightValue/2,this._context.beginPath(),this._context.moveTo(e[0]+t.borderRadiusValue,e[1]),this._context.lineTo(e[0]+t.widthValue-t.borderRadiusValue,e[1]),this._context.quadraticCurveTo(e[0]+t.widthValue,e[1],e[0]+t.widthValue,e[1]+t.borderRadiusValue),this._context.lineTo(e[0]+t.widthValue,e[1]+t.heightValue-t.borderRadiusValue),this._context.quadraticCurveTo(e[0]+t.widthValue,e[1]+t.heightValue,e[0]+t.widthValue-t.borderRadiusValue,e[1]+t.heightValue),this._context.lineTo(e[0]+t.borderRadiusValue,e[1]+t.heightValue),this._context.quadraticCurveTo(e[0],e[1]+t.heightValue,e[0],e[1]+t.heightValue-t.borderRadiusValue),this._context.lineTo(e[0],e[1]+t.borderRadiusValue),this._context.quadraticCurveTo(e[0],e[1],e[0]+t.borderRadiusValue,e[1]),this._context.closePath(),t.doFill&&(this._context.fillStyle=t.fill,this._context.globalAlpha=t.opacity*t.fillOpacity,this._context.fill()),t.doStroke&&(this._context.lineJoin="round",this._context.lineWidth=t.strokeWidthValue,this._context.strokeStyle=t.stroke,this._context.globalAlpha=t.opacity*t.strokeOpacity,this._context.stroke()),this._end())},drawLineString:function(e,t){this._drawLines([e],!1,t)},drawPolygon:function(e,t){if(!this._trueCanvas||e.length==1)this._drawLines(e,!0,t);else{if(!e||!e.length||e[0].length<3)return;t=this._getGraphicStyle(t);var n,r,i;if(t.visibility!="hidden"&&t.opacity>0){this._blitcontext.clearRect(0,0,this._width,this._height);if(t.doFill&&e.length>1){this._blitcontext.globalCompositeOperation="source-out",this._blitcontext.globalAlpha=1;for(r=1;r<e.length;r++){this._blitcontext.beginPath(),this._blitcontext.moveTo(e[r][0][0],e[r][0][1]);for(i=1;i<e[r].length;i++)this._blitcontext.lineTo(e[r][i][0],e[r][i][1]);this._blitcontext.closePath(),this._blitcontext.fill()}}this._blitcontext.beginPath(),this._blitcontext.moveTo(e[0][0][0],e[0][0][1]),n=[e[0][0][0]-t.strokeWidthValue,e[0][0][1]-t.strokeWidthValue,e[0][0][0]+t.strokeWidthValue,e[0][0][1]+t.strokeWidthValue];for(r=1;r<e[0].length-1;r++)this._blitcontext.lineTo(e[0][r][0],e[0][r][1]),n[0]=Math.min(e[0][r][0]-t.strokeWidthValue,n[0]),n[1]=Math.min(e[0][r][1]-t.strokeWidthValue,n[1]),n[2]=Math.max(e[0][r][0]+t.strokeWidthValue,n[2]),n[3]=Math.max(e[0][r][1]+t.strokeWidthValue,n[3]);this._blitcontext.closePath(),this._blitcontext.globalCompositeOperation="source-out",t.doFill&&(this._blitcontext.fillStyle=t.fill,this._blitcontext.globalAlpha=t.opacity*t.fillOpacity,this._blitcontext.fill()),this._blitcontext.globalCompositeOperation="source-over";if(t.doStroke){this._blitcontext.lineCap=this._blitcontext.lineJoin="round",this._blitcontext.lineWidth=t.strokeWidthValue,this._blitcontext.strokeStyle=t.stroke,this._blitcontext.globalAlpha=t.opacity*t.strokeOpacity,this._blitcontext.stroke();if(e.length>1)for(r=1;r<e.length;r++){this._blitcontext.beginPath(),this._blitcontext.moveTo(e[r][0][0],e[r][0][1]);for(i=1;i<e[r].length;i++)this._blitcontext.lineTo(e[r][i][0],e[r][i][1]);this._blitcontext.closePath(),this._blitcontext.stroke()}}n[0]=Math.min(Math.max(n[0],0),this._width),n[1]=Math.min(Math.max(n[1],0),this._height),n[2]=Math.min(Math.max(n[2],0),this._width),n[3]=Math.min(Math.max(n[3],0),this._height),n[0]!==n[2]&&n[1]!==n[3]&&(this._context.drawImage(this._blitcanvas,n[0],n[1],n[2]-n[0],n[3]-n[1],n[0],n[1],n[2]-n[0],n[3]-n[1]),this._end())}}},drawBbox:function(e,t){this._drawLines([[[e[0],e[1]],[e[0],e[3]],[e[2],e[3]],[e[2],e[1]],[e[0],e[1]]]],!0,t)},drawLabel:function(e,t){this._labelsHtml+='<div class="geo-label" style="-webkit-transform:translateZ(0);position:absolute; left:'+e[0]/this._width*100+"%; top:"+e[1]/this._height*100+'%;">'+t+"</div>"},resize:function(){this._width=this._$elem.width(),this._height=this._$elem.height();if(!this._width||!this._height)this._width=parseInt(this._$elem.css("width"),10),this._height=parseInt(this._$elem.css("height"),10);this._trueCanvas?(this._$canvas[0].width=this._width,this._$canvas[0].height=this._height,this._$canvasSceneFront.css({width:this._width,height:this._height}),this._$canvasSceneBack.css({width:this._width,height:this._height})):this._$canvas.css({width:this._width,height:this._height}),this._$labelsContainerFront.css({width:this._width,height:this._height}),this._$labelsContainerBack.css({width:this._width,height:this._height})},interactiveTransform:function(e,t){this._timeoutEnd&&(clearTimeout(this._timeoutEnd),this._timeoutEnd=null);if(this._trueCanvas)if(this._options.doubleBuffer&&this._trueDoubleBuffer){if(this._requireFlip){var n=this,r=n._$canvasSceneFront;n._$canvasSceneFront=n._$canvasSceneBack.css({left:0,top:0,width:n._width,height:n._height}).prop("src",n._$canvas[0].toDataURL()).prependTo(n._$elem),n._$canvasSceneBack=r.detach(),n._requireFlip=!1}this._$canvasSceneFront.css({left:Math.round(e[0]),top:Math.round(e[1]),width:this._width*t,height:this._height*t})}else this._context.clearRect(0,0,this._width,this._height);else this._context.clearRect(0,0,this._width,this._height);this._$labelsContainerFront.css({left:Math.round(e[0]),top:Math.round(e[1]),width:this._width*t,height:this._height*t})},_end:function(){function t(){if(!e._timeoutEnd)return;e._trueCanvas&&e._options.doubleBuffer&&e._trueDoubleBuffer&&e._$canvasSceneBack.prop("src","").one("load",function(t){e._requireFlip=!1;var n=e._$canvasSceneFront;e._$canvasSceneFront=e._$canvasSceneBack.css({left:0,top:0,width:e._width,height:e._height}).prependTo(e._$elem),e._$canvasSceneBack=n.detach()}).prop("src",e._$canvas[0].toDataURL()),e._$labelsContainerBack.html(e._labelsHtml);var t=e._$labelsContainerFront;e._$labelsContainerFront=e._$labelsContainerBack.css({left:0,top:0,width:e._width,height:e._height}).prependTo(e._$elem),e._$labelsContainerBack=t.detach(),e._timeoutEnd=null}this._timeoutEnd&&(clearTimeout(this._timeoutEnd),this._timeoutEnd=null),this._requireFlip=!0;var e=this;this._timeoutEnd=setTimeout(t,20)},_getGraphicStyle:function(t){function n(e){return e=parseInt(e,10),+e+""===e?+e:e}return t=e.extend({},this._options.style,t),t.borderRadiusValue=n(t.borderRadius),t.fill=t.fill||t.color,t.doFill=t.fill&&t.fillOpacity>0,t.stroke=t.stroke||t.color,t.strokeWidthValue=n(t.strokeWidth),t.doStroke=t.stroke&&t.strokeOpacity>0&&t.strokeWidthValue>0,t.widthValue=n(t.width),t.heightValue=n(t.height),t},_drawLines:function(e,t,n){if(!e||!e.length||e[0].length<2)return;var r,i;n=this._getGraphicStyle(n);if(n.visibility!="hidden"&&n.opacity>0){this._context.beginPath();for(r=0;r<e.length;r++){this._context.moveTo(e[r][0][0],e[r][0][1]);for(i=1;i<e[r].length;i++)this._context.lineTo(e[r][i][0],e[r][i][1])}t&&this._context.closePath(),t&&n.doFill&&(this._context.fillStyle=n.fill,this._context.globalAlpha=n.opacity*n.fillOpacity,this._context.fill()),n.doStroke&&(this._context.lineCap=this._context.lineJoin="round",this._context.lineWidth=n.strokeWidthValue,this._context.strokeStyle=n.stroke,this._context.globalAlpha=n.opacity*n.strokeOpacity,this._context.stroke()),this._end()}}})}(jQuery),function(e,t){var n=0,r=function(){var e=5,t=document.createElement("div"),n=t.all||[];do t.innerHTML="<!--[if gt IE "+ ++e+"]><br><![endif]-->";while(n[0]);return e>6?e:!e}(),i={bbox:[-180,-85,180,85],bboxMax:[-180,-85,180,85],center:[0,0],cursors:{"static":"default",pan:"url(data:image/vnd.microsoft.icon;base64,AAACAAEAICACAAgACAAwAQAAFgAAACgAAAAgAAAAQAAAAAEAAQAAAAAAAAEAAAAAAAAAAAAAAgAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8AAAA/AAAAfwAAAP+AAAH/gAAB/8AAA//AAAd/wAAGf+AAAH9gAADbYAAA2yAAAZsAAAGbAAAAGAAAAAAAAA//////////////////////////////////////////////////////////////////////////////////////gH///4B///8Af//+AD///AA///wAH//4AB//8AAf//AAD//5AA///gAP//4AD//8AF///AB///5A////5///8=), move",zoom:"crosshair",dragBox:"crosshair",dragCircle:"crosshair",drawPoint:"crosshair",drawLineString:"crosshair",drawPolygon:"crosshair",measureLength:"crosshair",measureArea:"crosshair"},measureLabels:{length:"{{:length.toFixed( 2 )}} m",area:"{{:area.toFixed( 2 )}} sq m"},drawStyle:{},shapeStyle:{},mode:"pan",pannable:!0,scroll:"default",shift:"default",services:[{"class":"osm",type:"tiled",src:function(e){return"http://otile"+(e.index%4+1)+".mqcdn.com/tiles/1.0.0/osm/"+e.zoom+"/"+e.tile.column+"/"+e.tile.row+".png"},attr:"Tiles Courtesy of <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png'>"}],tilingScheme:{tileWidth:256,tileHeight:256,levels:18,basePixelSize:156543.03392799935,origin:[-20037508.342787,20037508.342787]},axisLayout:"map",zoom:0,zoomMin:0,zoomMax:Number.POSITIVE_INFINITY,pixelSize:0};e.widget("geo.geomap",{_$elem:t,_map:t,_created:!1,_createdGraphics:!1,_widgetId:0,_tmplLengthId:"",_tmplAreaId:"",_contentBounds:{},_$resizeContainer:t,_$eventTarget:t,_$contentFrame:t,_$existingChildren:t,_$attrList:t,_$servicesContainer:t,_$shapesContainers:t,_$panContainer:t,_$shapesContainer:t,_$drawContainer:t,_$measureContainer:t,_$measureLabel:t,_dpi:96,_currentServices:[],_center:t,_pixelSize:t,_centerMax:t,_pixelSizeMax:t,_userGeodetic:!0,_centerInteractive:t,_pixelSizeInteractive:t,_timeoutInteractive:null,_triggerInteractive:!1,_timeoutRefreshShapes:null,_loadCount:0,_wheelTimeout:null,_wheelLevel:0,_zoomFactor:2,_fullZoomFactor:2,_partialZoomFactor:1.18920711500273,_mouseDown:t,_inOp:t,_toolPan:t,_shiftDown:t,_anchor:t,_current:t,_downDate:t,_moveDate:t,_clickDate:t,_lastMove:t,_lastDrag:t,_windowHandler:null,_resizeTimeout:null,_panning:t,_velocity:t,_friction:t,_supportTouch:t,_softDblClick:t,_isTap:t,_isDbltap:t,_isMultiTouch:t,_multiTouchAnchor:[],_multiTouchAnchorBbox:t,_multiTouchCurrentBbox:t,_drawTimeout:null,_drawPixels:[],_drawCoords:[],_graphicShapes:[],_initOptions:{},_options:{},options:e.extend({},i),_createWidget:function(t,r){this._$elem=e(r);if(this._$elem.is(".geo-service")){this._graphicShapes=[],e.Widget.prototype._createWidget.apply(this,arguments);return}this._widgetId=n++,this._tmplLengthId="geoMeasureLength"+this._widgetId,this._tmplAreaId="geoMeasureArea"+this._widgetId,this._$elem.addClass("geo-map").css({webkitTransform:"translateZ(0)"}),this._initOptions=t||{},this._forcePosition(this._$elem),this._$elem.css("text-align","left");var i=this._findMapSize();this._contentBounds={x:parseInt(this._$elem.css("padding-left"),10),y:parseInt(this._$elem.css("padding-top"),10),width:i.width,height:i.height},this._createChildren(),this._center=[0,0],this._centerMax=[0,0],this._centerInteractive=[0,0],this.options.pixelSize=this._pixelSize=this._pixelSizeMax=156543.03392799935,this._mouseDown=this._inOp=this._toolPan=this._shiftDown=this._panning=this._isTap=this._isDbltap=!1,this._anchor=[0,0],this._current=[0,0],this._lastMove=[0,0],this._lastDrag=[0,0],this._velocity=[0,0],this._friction=[.8,.8],this._downDate=this._moveDate=this._clickDate=0,this._drawPixels=[],this._drawCoords=[],this._graphicShapes=[],e.Widget.prototype._createWidget.apply(this,arguments)},_create:function(){this._options=this.options;if(this._$elem.is(".geo-service")){this._map=this._$elem.data("geoMap"),this._$elem.data("geoService",this);return}this._map=this,this._supportTouch="ontouchend"in document,this._softDblClick=this._supportTouch||r==7;var n=this,i=this._supportTouch?"touchstart":"mousedown",s=this._supportTouch?"touchend touchcancel":"mouseup",o=this._supportTouch?"touchmove":"mousemove";e(document).keydown(e.proxy(this._document_keydown,this)),this._$eventTarget.dblclick(e.proxy(this._eventTarget_dblclick,this)),this._$eventTarget.bind(i,e.proxy(this._eventTarget_touchstart,this));var u=this._$eventTarget[0].setCapture?this._$eventTarget:e(document);u.bind(o,e.proxy(this._dragTarget_touchmove,this)),u.bind(s,e.proxy(this._dragTarget_touchstop,this)),this._$eventTarget.mousewheel(e.proxy(this._eventTarget_mousewheel,this)),this._windowHandler=function(){n._resizeTimeout&&clearTimeout(n._resizeTimeout),n._resizeTimeout=setTimeout(function(){n._created&&n._$elem.geomap("resize",!0)},500)},e(window).resize(this._windowHandler),this._$drawContainer.geographics({style:this._initOptions.drawStyle||{},doubleBuffer:!1}),this._options.drawStyle=this._$drawContainer.geographics("option","style"),this._$shapesContainer.geographics({style:this._initOptions.shapeStyle||{}}),this._createdGraphics=!0,this._options.shapeStyle=this._$shapesContainer.geographics("option","style"),this._initOptions&&(this._initOptions.tilingScheme!==t&&this._setOption("tilingScheme",this._initOptions.tilingScheme||null,!1),this._initOptions.services&&(this._options.services=e.merge([],this._initOptions.services)),this._initOptions.bboxMax&&(this._setOption("bboxMax",this._initOptions.bboxMax,!1),this._setOption("bbox",this._initOptions.bboxMax,!1)),this._initOptions.zoomMin!==t&&this._setOption("zoomMin",this._initOptions.zoomMin,!1),this._initOptions.zoomMax!==t&&this._setOption("zoomMax",this._initOptions.zoomMax,!1),this._initOptions.bbox&&this._setOption("bbox",this._initOptions.bbox,!1),this._initOptions.center&&this._setOption("center",this._initOptions.center,!1),this._initOptions.zoom!==t&&this._setOption("zoom",this._initOptions.zoom,!1)),e.templates(this._tmplLengthId,this._options.measureLabels.length),e.templates(this._tmplAreaId,this._options.measureLabels.area),this._$eventTarget.css("cursor",this._options.cursors[this._options.mode]),this._createServices(),this._refresh(),this._created=!0},_setOption:function(n,r,i){if(n=="pixelSize")return;i=i===t||i,this._$elem.is(".geo-map")&&this._panFinalize();var s,o,u,a;switch(n){case"bbox":this._created&&this._clearInteractiveTimeout(),this._userGeodetic=e.geo.proj&&e.geo._isGeodetic(r),this._userGeodetic&&(r=e.geo.proj.fromGeodetic(r)),s=[r[0]+(r[2]-r[0])/2,r[1]+(r[3]-r[1])/2],o=Math.max(e.geo.width(r,!0)/this._contentBounds.width,e.geo.height(r,!0)/this._contentBounds.height),a=this._getZoom(s,o),this._options.tilingScheme?o=this._getPixelSize(Math.min(Math.max(a,this._options.zoomMin),this._options.zoomMax)):a<this._options.zoomMin?o=this._getPixelSize(this._options.zoomMin):a>this._options.zoomMax&&(o=this._getPixelSize(this._options.zoomMax)),this._created?(this._setInteractiveCenterAndSize(s,o),this._setInteractiveTimeout(!1)):this._setCenterAndSize(s,o,!1,i),r=this._getBbox(s,o);break;case"bboxMax":this._userGeodetic=e.geo.proj&&e.geo._isGeodetic(r);break;case"center":this._created&&this._clearInteractiveTimeout(),this._userGeodetic=e.geo.proj&&e.geo._isGeodetic(r),this._userGeodetic&&(r=e.geo.proj.fromGeodetic(r)),this._created?(this._setInteractiveCenterAndSize(r,this._pixelSizeInteractive),this._interactiveTransform(),this._setInteractiveTimeout(!1)):this._setCenterAndSize(r,this._pixelSize,!1,i);break;case"measureLabels":r=e.extend(this._options.measureLabels,r),e.templates(this._tmplLengthId,this._options.measureLabels.length),e.templates(this._tmplAreaId,this._options.measureLabels.area);break;case"drawStyle":this._$drawContainer&&(this._$drawContainer.geographics("option","style",r),r=this._$drawContainer.geographics("option","style"));break;case"shapeStyle":this._$elem.is(".geo-service")&&!this._createdGraphics&&this._createServiceGraphics(),this._createdGraphics&&(this._$shapesContainer.geographics("option","style",r),r=this._$shapesContainer.geographics("option","style"));break;case"mode":this._resetDrawing(),this._$eventTarget.css("cursor",this._options.cursors[r]);break;case"zoom":this._created?this._setZoom(r,!1,i):(r=Math.max(r,0),this._setCenterAndSize(this._center,this._getPixelSize(r),!1,i))}e.Widget.prototype._setOption.apply(this,arguments);switch(n){case"bbox":case"center":this._userGeodetic&&(this._options.bbox=e.geo.proj.toGeodetic(this._options.bbox),this._options.center=e.geo.proj.toGeodetic(this._center));break;case"tilingScheme":r!==null&&(this._pixelSizeMax=this._getPixelSize(0),this._centerMax=[r.origin[0]+this._pixelSizeMax*r.tileWidth/2,r.origin[1]+this._pixelSizeMax*r.tileHeight/2]);break;case"bboxMax":e.geo.proj&&e.geo._isGeodetic(r)?u=e.geo.proj.fromGeodetic(r):u=r,this._centerMax=e.geo.center(u),this._pixelSizeMax=Math.max(e.geo.width(u,!0)/this._contentBounds.width,e.geo.height(u,!0)/this._contentBounds.height);break;case"services":this._createServices(),i&&(this._refresh(),this._refreshAllShapes());break;case"shapeStyle":i&&this._createdGraphics&&(this._$shapesContainer.geographics("clear"),this._refreshShapes(this._$shapesContainer,this._graphicShapes,this._graphicShapes,this._graphicShapes))}},destroy:function(){if(this._$elem.is(".geo-service"))this._createdGraphics&&(this._$shapesContainer.geographics("destroy"),this._$shapesContainer=t,this._createdGraphics=!1);else{clearTimeout(this._timeoutInteractive),this._timeoutInteractive=null,this._created=!1,e(window).unbind("resize",this._windowHandler);for(var n=0;n<this._currentServices.length;n++)this._currentServices[n].serviceContainer.geomap("destroy"),e.geo._serviceTypes[this._currentServices[n].type].destroy(this,this._$servicesContainer,this._currentServices[n]);this._$shapesContainer.geographics("destroy"),this._$shapesContainer=t,this._createdGraphics=!1,this._$drawContainer.geographics("destroy"),this._$drawContainer=t,this._$existingChildren.detach(),this._$elem.html(""),this._$elem.append(this._$existingChildren),this._$elem.removeClass("geo-map")}e.Widget.prototype.destroy.apply(this,arguments)},toMap:function(t){return t=this._toMap(t),this._userGeodetic?e.geo.proj.toGeodetic(t):t},toPixel:function(t,n,r){return this._toPixel(e.geo.proj?e.geo.proj.fromGeodetic(t):t,n,r)},opacity:function(t,n){if(this._$elem.is(".geo-service"))this._$elem.closest(".geo-map").geomap("opacity",t,this._$elem);else if(t>=0||t<=1)for(var r=0;r<this._currentServices.length;r++){var i=this._currentServices[r];if(!n||i.serviceContainer[0]==n[0])i.style.opacity=t,i.serviceObject.style=e.extend({},i.serviceObject.style,i.style),e.geo._serviceTypes[i.type].opacity(this,i)}},toggle:function(n,r){if(this._$elem.is(".geo-service"))this._$elem.closest(".geo-map").geomap("toggle",n,this._$elem);else for(var i=0;i<this._currentServices.length;i++){var s=this._currentServices[i];if(!r||s.serviceContainer[0]==r[0])n===t&&(n=s.style.visibility!=="visible"),s.style.visibility=n?"visible":"hidden",s.serviceObject.style=e.extend({},s.serviceObject.style,s.style),s.serviceContainer.toggle(n),n&&e.geo._serviceTypes[s.type].refresh(this,s)}},zoom:function(e){e!==null&&this._setZoom(this._options.zoom+e,!1,!0)},refresh:function(e,t){this._$elem.is(".geo-service")?this._$elem.closest(".geo-map").geomap("refresh",e,this._$elem):(this._refresh(e,t),this._refreshAllShapes())},resize:function(t){var n=this._findMapSize(),r=n.width/2-this._contentBounds.width/2,i=n.height/2-this._contentBounds.height/2,s;this._contentBounds={x:parseInt(this._$elem.css("padding-left"),10),y:parseInt(this._$elem.css("padding-top"),10),width:n.width,height:n.height},this._$resizeContainer.css({width:n.width,height:n.height});for(s=0;s<this._currentServices.length;s++)e.geo._serviceTypes[this._currentServices[s].type].resize(this,this._currentServices[s]);this._$elem.find(".geo-graphics").css({width:n.width,height:n.height}).geographics("resize");for(s=0;s<this._drawPixels.length;s++)this._drawPixels[s][0]+=r,this._drawPixels[s][1]+=i;this._setCenterAndSize(this._center,this._pixelSize,t,!0)},append:function(n,r,i,s){if(n&&(e.isPlainObject(n)||e.isArray(n)&&n.length>0)){this._createdGraphics||this._createServiceGraphics();var o,u,a,f,l,c;e.isArray(n)?o=n:n.type=="FeatureCollection"?o=n.features:o=[n];for(a=1;a<arguments.length;a++)u=arguments[a],typeof u=="object"?f=u:typeof u=="number"||typeof u=="string"?l=u:typeof u=="boolean"&&(c=u);for(a=0;a<o.length;a++){if(o[a].type!="Point"){var h=e.geo.bbox(o[a]);e.geo.proj&&e.geo._isGeodetic(h)&&(h=e.geo.proj.fromGeodetic(h)),e.data(o[a],"geoBbox",h)}this._graphicShapes.push({shape:o[a],style:f,label:l})}if(c===t||c)this._$elem.is(".geo-service")?this._refresh(!1,this._$elem):this._refresh(),this._refreshAllShapes()}},empty:function(n){for(var r=0;r<this._graphicShapes.length;r++)e.removeData(this._graphicShapes[r].shape,"geoBbox");this._graphicShapes=[];if(n===t||n)this._$elem.is(".geo-service")?this._refresh(!1,this._$elem):this._refresh(),this._refreshAllShapes()},find:function(n,r){var i=e.isPlainObject(n),s=i?this._map.toPixel(n.coordinates):t,o=this._map._pixelSize*r,u=[],a,f,l,c=0;for(;c<this._graphicShapes.length;c++){a=this._graphicShapes[c];if(i)if(a.shape.type=="Point")e.geo.distance(a.shape,n)<=o&&u.push(a.shape);else{var h=e.data(a.shape,"geoBbox"),p={type:"Polygon",coordinates:[[[h[0],h[1]],[h[0],h[3]],[h[2],h[3]],[h[2],h[1]],[h[0],h[1]]]]},d={type:"Point",coordinates:e.geo.proj&&e.geo._isGeodetic(n.coordinates)?e.geo.proj.fromGeodetic(n.coordinates):n.coordinates};if(e.geo.distance(p,d,!0)<=o){f=e.geo._flatten(a.shape);for(l=0;l<f.length;l++)if(e.geo.distance(f[l],n)<=o){u.push(a.shape);break}}}else u.push(a.shape)}return this._$elem.is(".geo-map")&&this._$elem.find(".geo-service").each(function(){u=e.merge(u,e(this).geomap("find",n,r))}),u},remove:function(n,r){if(n&&(e.isPlainObject(n)||e.isArray(n)&&n.length>0)){var i=e.isArray(n)?n:[n],s;for(var o=0;o<this._graphicShapes.length;o++)e.inArray(this._graphicShapes[o].shape,i)>=0&&(e.removeData(n,"geoBbox"),s=this._graphicShapes.slice(o+1),this._graphicShapes.length=o,this._graphicShapes.push.apply(this._graphicShapes,s),o--);if(r===t||r)this._$elem.is(".geo-service")?this._refresh(!1,this._$elem):this._refresh(),this._refreshAllShapes()}},_getBbox:function(e,t){e=e||this._center,t=t||this._pixelSize;var n=this._contentBounds.width/2*t,r=this._contentBounds.height/2*t;return[e[0]-n,e[1]-r,e[0]+n,e[1]+r]},_setBbox:function(t,n,r){var i=[t[0]+(t[2]-t[0])/2,t[1]+(t[3]-t[1])/2],s=Math.max(e.geo.width(t,!0)/this._contentBounds.width,e.geo.height(t,!0)/this._contentBounds.height),o=this._getZoom(i,s);this._options.tilingScheme?s=this._getPixelSize(Math.min(Math.max(o,this._options.zoomMin),this._options.zoomMax)):o<this._options.zoomMin?s=this._getPixelSize(this._options.zoomMin):o>this._options.zoomMax&&(s=this._getPixelSize(this._options.zoomMax)),this._setInteractiveCenterAndSize(i,s),this._interactiveTransform()},_getBboxMax:function(){var e=this._contentBounds.width/2*this._pixelSizeMax,t=this._contentBounds.height/2*this._pixelSizeMax;return[this._centerMax[0]-e,this._centerMax[1]-t,this._centerMax[0]+e,this._centerMax[1]+t]},_getCenter:function(){return this._center},_getContentBounds:function(){return this._contentBounds},_getServicesContainer:function(){return this._$servicesContainer},_getZoom:function(t,n){t=t||this._center,n=n||this._pixelSize;var r=this._options.tilingScheme;if(r){if(r.pixelSizes){var i=Math.floor(n*1e3),s=r.pixelSizes.length,o=s-1;for(;o>=0;o--)if(Math.floor(r.pixelSizes[o]*1e3)>=i)return o;return 0}return Math.round(Math.log(r.basePixelSize/n)/Math.log(2))}var u=this._contentBounds.width/this._contentBounds.height,a=e.geo.reaspect(this._getBbox(t,n),u,!0),f=e.geo.reaspect(this._getBboxMax(),u,!0);return Math.round(Math.log(e.geo.width(f,!0)/e.geo.width(a,!0))/Math.log(this._zoomFactor))},_setZoom:function(e,t,n){this._clearInteractiveTimeout(),e=Math.min(Math.max(e,this._options.zoomMin),this._options.zoomMax),this._setInteractiveCenterAndSize(this._centerInteractive,this._getPixelSize(e)),this._interactiveTransform(),this._setInteractiveTimeout(t)},_createChildren:function(){this._$existingChildren=this._$elem.children(),this._forcePosition(this._$existingChildren),this._$existingChildren.detach().css({mozUserSelect:"none"});var t="width:"+this._contentBounds.width+"px; height:"+this._contentBounds.height+"px; margin:0; padding:0;",n="position:absolute; left:0; top:0;";this._$elem.prepend('<div class="geo-event-target geo-content-frame" style="position:absolute; left:'+this._contentBounds.x+"px; top:"+this._contentBounds.y+"px;"+t+'overflow:hidden; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none;" unselectable="on"></div>'),this._$eventTarget=this._$contentFrame=this._$elem.children(":first"),this._$contentFrame.append('<div class="geo-services-container" style="'+n+t+'"></div>'),this._$servicesContainer=this._$contentFrame.children(":last"),this._$contentFrame.append('<div class="geo-shapes-container" style="'+n+t+'"></div>'),this._$shapesContainer=this._$contentFrame.children(":last"),this._$contentFrame.append('<ul style="position: absolute; bottom: 8px; left: 8px; list-style-type: none; max-width: 50%; padding: 0; margin: 0;"></ul>'),this._$attrList=this._$contentFrame.children(":last"),this._$contentFrame.append('<div class="geo-draw-container" style="'+n+t+'"></div>'),this._$drawContainer=this._$contentFrame.children(":last"),this._$contentFrame.append('<div class="geo-measure-container" style="'+n+t+'"><span class="geo-measure-label" style="'+n+'; display: none;"></span></div>'),this._$measureContainer=this._$contentFrame.children(":last"),this._$measureLabel=this._$measureContainer.children(),this._$panContainer=e([this._$shapesContainer[0],this._$drawContainer[0],this._$measureContainer[0]]),this._$resizeContainer=e([this._$contentFrame[0],this._$servicesContainer[0],this._$eventTarget[0],this._$measureContainer[0]]),this._$contentFrame.append(this._$existingChildren),e("#geo-measure-style").length||e("head").prepend('<style type="text/css" id="geo-measure-style">.geo-measure-label { margin: 4px 0 0 6px; font-family: sans-serif;'+(r?"letter-spacing: 2px; color: #444; filter:progid:DXImageTransform.Microsoft.DropShadow(Color=white, OffX=1, OffY=2, Positive=true);":"color: #000; text-shadow: #fff 1px 2px; font-weight: bold;")+" }</style>")},_createServices:function(){var t,n;for(n=0;n<this._currentServices.length;n++)this._currentServices[n].serviceContainer.geomap("destroy"),e.geo._serviceTypes[this._currentServices[n].type].destroy(this,this._$servicesContainer,this._currentServices[n]);this._currentServices=[],this._$servicesContainer.html(""),this._$attrList.html("");for(n=0;n<this._options.services.length;n++){t=this._currentServices[n]=e.extend({},this._options.services[n]),t.serviceObject=this._options.services[n],t.style=e.extend({visibility:"visible",opacity:1},t.style);var r=t.id?' id="'+t.id+'"':"",i='class="geo-service '+(t["class"]?t["class"]:"")+'"',s="<div "+r+i+' style="-webkit-transform:translateZ(0);position:absolute; left:0; top:0; width:32px; height:32px; margin:0; padding:0; display:'+(t.style.visibility==="visible"?"block":"none")+';"></div>',o;this._$servicesContainer.append(s),serviceContainer=this._$servicesContainer.children(":last"),t.serviceContainer=serviceContainer,e.geo._serviceTypes[t.type].create(this,serviceContainer,t,n),serviceContainer.data("geoMap",this).geomap(),t.attr&&this._$attrList.append("<li>"+t.attr+"</li>")}this._$shapesContainers=this._$shapesContainer,this._$attrList.find("a").css({position:"relative",zIndex:100})},_createServiceGraphics:function(){var e=this._$elem.closest(".geo-content-frame");this._$elem.append('<div class="geo-shapes-container" style="position:absolute; left:0; top:0; width:'+e.css("width")+"; height:"+e.css("height")+'; margin:0; padding:0;"></div>'),this._$shapesContainer=this._$elem.children(":last"),this._map._$shapesContainers=this._map._$shapesContainers.add(this._$shapesContainer),this._$shapesContainer.geographics(),this._createdGraphics=!0,this._options.shapeStyle=this._$shapesContainer.geographics("option","style")},_refreshDrawing:function(){this._$drawContainer.geographics("clear");if(this._drawPixels.length>0){var t=this._options.mode,n=this._drawPixels,r=this._drawCoords,i,s,o,u,a;switch(t){case"measureLength":t="drawLineString",s={type:"LineString",coordinates:r},i=e.render[this._tmplLengthId]({length:e.geo.length(s,!0)}),o=e.merge([],n[n.length-1]);break;case"measureArea":t="drawPolygon",s={type:"Polygon",coordinates:[e.merge([],r)]},s.coordinates[0].push(r[0]),i=e.render[this._tmplAreaId]({area:e.geo.area(s,!0)}),o=this._toPixel(e.geo.centroid(s).coordinates),n=[n];break;case"drawPolygon":n=[n]}this._$drawContainer.geographics(t,n),i&&(this._$measureLabel.html(i),u=this._contentBounds.width-(this._$measureLabel.outerWidth(!0)+o[0]),a=this._contentBounds.height-(this._$measureLabel.outerHeight(!0)+o[1]),u<0&&(o[0]+=u),a<0&&(o[1]+=a),this._$measureLabel.css({left:Math.max(o[0],0),top:Math.max(o[1],0)}).show())}},_resetDrawing:function(){this._drawPixels=[],this._drawCoords=[],this._$drawContainer.geographics("clear"),this._$measureLabel.hide()},_refreshAllShapes:function(){this._timeoutRefreshShapes=null;var e,t,n=0;for(;n<this._currentServices.length;n++)e=this._currentServices[n],t=e.serviceContainer.data("geoService"),t._createdGraphics&&(t._$shapesContainer.geographics("clear"),t._graphicShapes.length>0&&t._refreshShapes(t._$shapesContainer,t._graphicShapes,t._graphicShapes,t._graphicShapes));this._createdGraphics&&(this._$shapesContainer.geographics("clear"),this._graphicShapes.length>0&&this._refreshShapes(this._$shapesContainer,this._graphicShapes,this._graphicShapes,this._graphicShapes))},_refreshShapes:function(n,r,i,s,o,u){var a,f,l,c,h,p,d,v,m=this._map._getBbox(o,u);for(a=0;a<r.length;a++){l=r[a].shape||r[a],l=l.geometry||l,c=e.data(l,"geoBbox");if(c&&e.geo._bboxDisjoint(m,c))continue;h=e.isArray(i)?i[a].style:i,p=e.isArray(s)?s[a].label:s,d=p!==t,v=t;switch(l.type){case"Point":v=this._map.toPixel(l.coordinates,o,u),this._$shapesContainer.geographics("drawPoint",v,h);break;case"LineString":this._$shapesContainer.geographics("drawLineString",this._map.toPixel(l.coordinates,o,u),h),d&&(v=this._map.toPixel(e.geo.pointAlong(l,.5).coordinates,o,u));break;case"Polygon":this._$shapesContainer.geographics("drawPolygon",this._map.toPixel(l.coordinates,o,u),h),d&&(v=this._map.toPixel(e.geo.centroid(l).coordinates,o,u));break;case"MultiPoint":for(f=0;f<l.coordinates.length;f++)this._$shapesContainer.geographics("drawPoint",this._map.toPixel(l.coordinates[f],o,u),h);d&&(v=this._map.toPixel(e.geo.centroid(l).coordinates,o,u));break;case"MultiLineString":for(f=0;f<l.coordinates.length;f++)this._$shapesContainer.geographics("drawLineString",this._map.toPixel(l.coordinates[f],o,u),h);d&&(v=this._map.toPixel(e.geo.centroid(l).coordinates,o,u));break;case"MultiPolygon":for(f=0;f<l.coordinates.length;f++)this._$shapesContainer.geographics("drawPolygon",this._map.toPixel(l.coordinates[f],o,u),h);d&&(v=this._map.toPixel(e.geo.centroid(l).coordinates,o,u));break;case"GeometryCollection":this._refreshShapes(n,l.geometries,h,p,o,u)}d&&v&&this._$shapesContainer.geographics("drawLabel",v,p)}},_findMapSize:function(){var e={width:0,height:0},t=this._$elem;while(t.size()&&!(e.width>0&&e.height>0)){e={width:t.width(),height:t.height()};if(e.width<=0||e.height<=0)e={width:parseInt(t.css("width"),10),height:parseInt(t.css("height"),10)};t=t.parent()}return e},_forcePosition:function(e){var t=e.css("position");t!="relative"&&t!="absolute"&&t!="fixed"&&e.css("position","relative")},_getPixelSize:function(t){var n=this._options.tilingScheme;if(n!==null){if(t===0)return n.pixelSizes?n.pixelSizes[0]:n.basePixelSize;t=Math.round(t),t=Math.max(t,0);var r=n.pixelSizes?n.pixelSizes.length:n.levels;return t=Math.min(t,r-1),n.pixelSizes?n.pixelSizes[t]:n.basePixelSize/Math.pow(2,t)}var i=e.geo.scaleBy(this._getBboxMax(),1/Math.pow(this._zoomFactor,t),!0);return Math.max(e.geo.width(i,!0)/this._contentBounds.width,e.geo.height(i,!0)/this._contentBounds.height)},_getZoomCenterAndSize:function(e,t,n){var r=n?this._fullZoomFactor:this._partialZoomFactor,i=Math.pow(r,-t),s=this._pixelSizeInteractive*i,o=this._getZoom(this._centerInteractive,s);n&&this._options.tilingScheme?s=this._getPixelSize(Math.min(Math.max(o,this._options.zoomMin),this._options.zoomMax)):t<0&&o<this._options.zoomMin?s=this._pixelSizeInteractive:t>0&&o>this._options.zoomMax&&(s=this._pixelSizeInteractive);var u=s/this._pixelSizeInteractive,a=this._toMap(e,this._centerInteractive,this._pixelSizeInteractive),f=[(this._centerInteractive[0]-a[0])*u,(this._centerInteractive[1]-a[1])*u],l=[a[0]+f[0],a[1]+f[1]];return{pixelSize:s,center:l}},_mouseWheelFinish:function(e){this._wheelTimeout=null;if(this._wheelLevel!==0){var t=this._getZoomCenterAndSize(this._anchor,this._wheelLevel,this._options.tilingScheme!==null);this._wheelLevel=0}else e&&(this._refresh(),this._refreshAllShapes())},_panFinalize:function(){if(this._panning){this._velocity=[0,0];var e=this._current[0]-this._anchor[0],t=this._current[1]-this._anchor[1],n=this._options.axisLayout==="image",r=-e*this._pixelSize,i=(n?-1:1)*t*this._pixelSize;this._$eventTarget.css("cursor",this._options.cursors[this._options.mode]),this._inOp=!1,this._anchor=this._current,this._mouseDown=this._toolPan=this._panning=!1}},_panMove:function(){if(!this._options.pannable)return;var e=this._current[0]-this._lastDrag[0],t=this._current[1]-this._lastDrag[1],n=0,r,i;if(this._toolPan||e>3||e<-3||t>3||t<-3){this._toolPan||(this._toolPan=!0,this._$eventTarget.css("cursor",this._options.cursors.pan)),this._mouseDown&&(this._velocity=[e,t]);if(e!==0||t!==0)this._panning=!0,this._lastDrag=this._current,this._centerInteractive[0]-=e*this._pixelSizeInteractive,this._centerInteractive[1]+=(this._options.axisLayout==="image"?-1:1)*t*this._pixelSizeInteractive,this._setInteractiveCenterAndSize(this._centerInteractive,this._pixelSizeInteractive),this._interactiveTransform()}},_clearInteractiveTimeout:function(){return this._timeoutRefreshShapes&&(clearTimeout(this._timeoutRefreshShapes),this._timeoutRefreshShapes=null),this._timeoutInteractive?(clearTimeout(this._timeoutInteractive),this._timeoutInteractive=null,!0):(this._centerInteractive[0]=this._center[0],this._centerInteractive[1]=this._center[1],this._pixelSizeInteractive=this._pixelSize,!1)},_interactiveTransform:function(){var t=this._contentBounds.width,n=this._contentBounds.height,r=t/2,i=n/2,s=[this._centerInteractive[0]-r,this._centerInteractive[1]-i,this._centerInteractive[0]+r,this._centerInteractive[1]+i],o=this._pixelSize,u=o/this._pixelSizeInteractive;if(o>0){u=Math.round(u*1e3)/1e3;var a=this._toMap([0,0]),f=this._toPixel(a,this._centerInteractive,this._pixelSizeInteractive);this._$shapesContainers.geographics("interactiveTransform",f,u)}for(var l=0;l<this._currentServices.length;l++)service=this._currentServices[l],e.geo._serviceTypes[service.type].interactiveTransform(this,service,this._centerInteractive,this._pixelSizeInteractive);this._drawCoords.length>0&&(this._drawPixels=this._toPixel(this._drawCoords,this._centerInteractive,this._pixelSizeInteractive),this._refreshDrawing())},_interactiveTimeout:function(){this._isMultiTouch?this._timeoutInteractive=setTimeout(e.proxy(interactiveTimeout,this),128):this._created&&this._timeoutInteractive&&(this._setCenterAndSize(this._centerInteractive,this._pixelSizeInteractive,this._triggerInteractive,!0),this._timeoutInteractive=null,this._triggerInteractive=!1,this._timeoutRefreshShapes=setTimeout(e.proxy(this._refreshAllShapes,this),128))},_setInteractiveTimeout:function(t){this._timeoutInteractive=setTimeout(e.proxy(this._interactiveTimeout,this),128),this._triggerInteractive|=t},_refresh:function(t,n){var r,i=0;for(;i<this._currentServices.length;i++)r=this._currentServices[i],(!n||r.serviceContainer[0]==n[0])&&e.geo._serviceTypes[r.type].refresh(this,r,t)},_setInteractiveCenterAndSize:function(t,n){this._centerInteractive[0]=t[0],this._centerInteractive[1]=t[1],this._pixelSizeInteractive=n,this._userGeodetic?(this._options.bbox=e.geo.proj.toGeodetic(this._getBbox(t,n)),this._options.center=e.geo.proj.toGeodetic(t)):(this._options.bbox=this._getBbox(t,n),this._options.center[0]=t[0],this._options.center[1]=t[1]),this._options.pixelSize=n,this._options.zoom=this._getZoom(t,n)},_setCenterAndSize:function(t,n,r,i){if(!e.isArray(t)||t.length!=2||typeof t[0]!="number"||typeof t[1]!="number")return;var s=this._getZoom(t,n);this._options.tilingScheme?this._pixelSizeInteractive=n=this._getPixelSize(Math.min(Math.max(s,this._options.zoomMin),this._options.zoomMax)):s<this._options.zoomMin?this._pixelSizeInteractive=n=this._getPixelSize(this._options.zoomMin):s>this._options.zoomMax&&(this._pixelSizeInteractive=n=this._getPixelSize(this._options.zoomMax)),this._center[0]=t[0],this._center[1]=t[1],this._options.pixelSize=this._pixelSize=n,this._userGeodetic?(this._options.bbox=e.geo.proj.toGeodetic(this._getBbox()),this._options.center=e.geo.proj.toGeodetic(this._center)):(this._options.bbox=this._getBbox(),this._options.center=e.merge([],t)),this._options.zoom=s,r&&this._trigger("bboxchange",window.event,{bbox:e.merge([],this._options.bbox)}),i&&(this._refresh(),this._refreshAllShapes(),this._refreshDrawing())},_requestQueued:function(){this._loadCount===0&&this._trigger("loadstart",window.event),this._loadCount++},_requestComplete:function(){this._loadCount--,this._loadCount<=0&&(this._loadCount=0,this._trigger("loadend",window.event))},_toMap:function(t,n,r){n=n||this._center,r=r||this._pixelSize;var i=e.isArray(t[0]),s=i&&e.isArray(t[0][0]),o=s&&e.isArray(t[0][0][0]),u=this._contentBounds.width,a=this._contentBounds.height,f=u/2*r,l=a/2*r,c=[n[0]-f,n[1]-l,n[0]+f,n[1]+l],h=e.geo.width(c,!0)/u,p=e.geo.height(c,!0)/a,d,v=this._options.axisLayout==="image",m=[],g,y,b;o||(s||(i||(t=[t]),t=[t]),t=[t]);for(g=0;g<t.length;g++){m[g]=[];for(y=0;y<t[g].length;y++){m[g][y]=[];for(b=0;b<t[g][y].length;b++)d=t[g][y][b][1]*p,m[g][y][b]=[c[0]+t[g][y][b][0]*h,v?c[1]+d:c[3]-d]}}return o?m:s?m[0]:i?m[0][0]:m[0][0][0]},_toPixel:function(t,n,r){n=n||this._center,r=r||this._pixelSize;var i=e.isArray(t[0]),s=i&&e.isArray(t[0][0]),o=s&&e.isArray(t[0][0][0]),u=this._contentBounds.width,a=this._contentBounds.height,f=u/2*r,l=a/2*r,c=[n[0]-f,n[1]-l,n[0]+f,n[1]+l],h=e.geo.width(c,!0),p=e.geo.height(c,!0),d=this._options.axisLayout==="image",v=u/h,m=a/p,g=[],y,b,w;o||(s||(i||(t=[t]),t=[t]),t=[t]);for(y=0;y<t.length;y++){g[y]=[];for(b=0;b<t[y].length;b++){g[y][b]=[];for(w=0;w<t[y][b].length;w++)g[y][b][w]=[Math.round((t[y][b][w][0]-c[0])*v),Math.round((d?t[y][b][w][1]-c[1]:c[3]-t[y][b][w][1])*m)]}}return o?g:s?g[0]:i?g[0][0]:g[0][0][0]},_document_keydown:function(t){var n=this._drawCoords.length;n>0&&t.which==27&&(n<=2?(this._resetDrawing(),this._inOp=!1):(this._drawCoords[n-2]=e.merge([],this._drawCoords[n-1]),this._drawPixels[n-2]=e.merge([],this._drawPixels[n-1]),this._drawCoords.length--,this._drawPixels.length--,this._refreshDrawing()))},_eventTarget_dblclick_zoom:function(e){var t=this._clearInteractiveTimeout();this._trigger("dblclick",e,{type:"Point",coordinates:this._toMap(this._current,this._centerInteractive,this._pixelSizeInteractive)});if(!e.isDefaultPrevented()){var n=this._getZoomCenterAndSize(this._current,1,!0);this._setInteractiveCenterAndSize(n.center,n.pixelSize),this._interactiveTransform(),t=!0}t&&this._setInteractiveTimeout(!0)},_eventTarget_dblclick:function(t){if(this._options.mode==="static")return;this._drawTimeout&&(window.clearTimeout(this._drawTimeout),this._drawTimeout=null);var n=e(t.currentTarget).offset();switch(this._options.mode){case"drawLineString":case"measureLength":this._drawCoords.length>1&&(this._drawCoords[0][0]!=this._drawCoords[1][0]||this._drawCoords[0][1]!=this._drawCoords[1][1])?(this._drawCoords.length--,this._trigger("shape",t,{type:"LineString",coordinates:this._userGeodetic?e.geo.proj.toGeodetic(this._drawCoords):this._drawCoords})):this._eventTarget_dblclick_zoom(t),this._resetDrawing();break;case"drawPolygon":case"measureArea":if(this._drawCoords.length>1&&(this._drawCoords[0][0]!=this._drawCoords[1][0]||this._drawCoords[0][1]!=this._drawCoords[1][1])){var r=this._drawCoords.length-1;r>2&&(this._drawCoords[r]=e.merge([],this._drawCoords[0]),this._trigger("shape",t,{type:"Polygon",coordinates:[this._userGeodetic?e.geo.proj.toGeodetic(this._drawCoords):this._drawCoords]}))}else this._eventTarget_dblclick_zoom(t);this._resetDrawing();break;default:this._eventTarget_dblclick_zoom(t)}this._inOp=!1},_eventTarget_touchstart:function(t){var n=this._options.mode,r=this._options.shift,i=n==="dragBox"?"dragBox":"zoom";if(n==="static")return;if(!this._supportTouch&&t.which!=1)return;var s=this._clearInteractiveTimeout(),o=e(t.currentTarget).offset(),u=t.originalEvent.changedTouches;this._supportTouch?(this._multiTouchAnchor=e.merge([],u),this._isMultiTouch=this._multiTouchAnchor.length>1,this._isMultiTouch?(this._multiTouchCurrentBbox=[u[0].pageX-o.left,u[0].pageY-o.top,u[1].pageX-o.left,u[1].pageY-o.top],this._multiTouchAnchorBbox=e.merge([],this._multiTouchCurrentBbox),this._current=e.geo.center(this._multiTouchCurrentBbox,!0)):(this._multiTouchCurrentBbox=[u[0].pageX-o.left,u[0].pageY-o.top,NaN,NaN],this._current=[u[0].pageX-o.left,u[0].pageY-o.top])):this._current=[t.pageX-o.left,t.pageY-o.top];if(this._softDblClick){var a=e.now();if(a-this._downDate<750){if(this._isTap){var f=this._current[0]-this._anchor[0],l=this._current[1]-this._anchor[1],c=Math.sqrt(f*f+l*l);c>8?this._isTap=!1:this._current=e.merge([],this._anchor)}this._isDbltap?this._isDbltap=!1:this._isDbltap=this._isTap}else this._isDbltap=!1;this._isTap=!0,this._downDate=a}return this._mouseDown=!0,this._anchor=e.merge([],this._current),!this._inOp&&t.shiftKey&&r!=="off"?(this._shiftDown=!0,this._$eventTarget.css("cursor",this._options.cursors[r==="default"?i:r])):!this._isMultiTouch&&(this._options.pannable||n==="dragBox"||n==="dragCircle")&&(this._inOp=!0,n!=="zoom"&&n!=="dragBox"&&n!=="dragCircle"&&(this._lastDrag=this._current,t.currentTarget.setCapture&&t.currentTarget.setCapture())),t.preventDefault(),s&&this._setInteractiveTimeout(!0),!1},_dragTarget_touchmove:function(t){if(this._options.mode==="static")return;var n=!1;this._mouseDown&&(n=this._clearInteractiveTimeout());var i=this._$eventTarget.offset(),s=this._drawCoords.length,o=t.originalEvent.changedTouches,u,a,f=0;if(this._supportTouch){if(!this._isMultiTouch&&this._mouseDown&&this._multiTouchAnchor.length>0&&o[0].identifier!==this._multiTouchAnchor[0].identifier)return this._mouseDown=!1,this._isMultiTouch=!0,this._wheelLevel=0,this._multiTouchAnchor.push(o[0]),this._multiTouchCurrentBbox=[this._multiTouchCurrentBbox[0],this._multiTouchCurrentBbox[1],this._multiTouchAnchor[1].pageX-i.left,this._multiTouchAnchor[1].pageY-i.top],this._multiTouchAnchorBbox=e.merge([],this._multiTouchCurrentBbox),this._mouseDown=!0,this._anchor=this._current=e.geo.center(this._multiTouchCurrentBbox,!0),n&&this._setInteractiveTimeout(!0),!1;if(this._isMultiTouch){for(;f<o.length;f++)o[f].identifier===this._multiTouchAnchor[0].identifier?(this._multiTouchCurrentBbox[0]=o[f].pageX-i.left,this._multiTouchCurrentBbox[1]=o[f].pageY-i.top):o[f].identifier===this._multiTouchAnchor[1].identifier&&(this._multiTouchCurrentBbox[2]=o[f].pageX-i.left,this._multiTouchCurrentBbox[3]=o[f].pageY-i.top);var l=e.geo._distancePointPoint([this._multiTouchAnchorBbox[0],this._multiTouchAnchorBbox[1]],[this._multiTouchAnchorBbox[2],this._multiTouchAnchorBbox[3]]),c=e.geo._distancePointPoint([this._multiTouchCurrentBbox[0],this._multiTouchCurrentBbox[1]],[this._multiTouchCurrentBbox[2],this._multiTouchCurrentBbox[3]]);u=e.geo.center(this._multiTouchCurrentBbox,!0);var h=(c-l)/l;h>0?h*=5:h*=10;var p=h-this._wheelLevel;this._wheelLevel=h;var d=this._getZoomCenterAndSize(this._anchor,p,!1);this._setInteractiveCenterAndSize(d.center,d.pixelSize),this._interactiveTransform(),n=!0,u=e.geo.center(this._multiTouchCurrentBbox,!0)}else u=[t.originalEvent.changedTouches[0].pageX-i.left,t.originalEvent.changedTouches[0].pageY-i.top]}else u=[t.pageX-i.left,t.pageY-i.top];if(u[0]===this._lastMove[0]&&u[1]===this._lastMove[1]&&this._inOp)return t.preventDefault(),n&&this._setInteractiveTimeout(!0),!1;r==7&&(this._isDbltap=this._isTap=!1),this._mouseDown&&(this._current=u,this._moveDate=e.now());if(this._isMultiTouch)return t.preventDefault(),this._isDbltap=this._isTap=!1,n&&this._setInteractiveTimeout(!0),!1;var v=this._options.mode,m=this._options.shift,g=v==="dragBox"?"dragBox":"zoom",y,b,w;this._shiftDown&&(v=m==="default"?g:m);switch(v){case"zoom":case"dragBox":this._mouseDown?(this._$drawContainer.geographics("clear"),this._$drawContainer.geographics("drawBbox",[this._anchor[0],this._anchor[1],u[0],u[1]])):this._trigger("move",t,{type:"Point",coordinates:this.toMap(u)});break;case"dragCircle":this._mouseDown?(y=u[0]-this._anchor[0],b=u[1]-this._anchor[1],w=Math.sqrt(y*y+b*b)*2,this._$drawContainer.geographics("clear"),this._$drawContainer.geographics("drawArc",this._anchor,0,360,{width:w,height:w})):this._trigger("move",t,{type:"Point",coordinates:this.toMap(u)});break;case"drawLineString":case"drawPolygon":case"measureLength":case"measureArea":this._mouseDown||this._toolPan?(this._panMove(),n=!0):(s>0&&(this._drawCoords[s-1]=this._toMap(u,this._centerInteractive,this._pixelSizeInteractive),this._drawPixels[s-1]=u,this._refreshDrawing()),this._trigger("move",t,{type:"Point",coordinates:this.toMap(u)}));break;default:this._mouseDown||this._toolPan?(this._panMove(),n=!0):this._trigger("move",t,{type:"Point",coordinates:this.toMap(u)})}this._lastMove=u,n&&this._setInteractiveTimeout(!0);if(this._inOp)return t.preventDefault(),!1},_dragTarget_touchstop:function(t){if(this._options.mode==="static")return;if(!this._mouseDown){if(r!=7)return;this._eventTarget_touchstart(t)}var n=this._clearInteractiveTimeout(),i=this._mouseDown,s=this._toolPan,o=this._$eventTarget.offset(),u=this._options.mode,a=this._options.shift,f=u==="dragBox"?"dragBox":"zoom",l,c,h,p,d,v,m;this._shiftDown&&(u=a==="default"?f:a),this._supportTouch?(l=[t.originalEvent.changedTouches[0].pageX-o.left,t.originalEvent.changedTouches[0].pageY-o.top],this._multiTouchAnchor=[],this._inOp=!1):l=[t.pageX-o.left,t.pageY-o.top],this._softDblClick&&this._isTap&&(p=l[0]-this._anchor[0],d=l[1]-this._anchor[1],Math.sqrt(p*p+d*d)<=8&&(l=e.merge([],this._anchor))),p=l[0]-this._anchor[0],d=l[1]-this._anchor[1],this._$eventTarget.css("cursor",this._options.cursors[this._options.mode]),this._shiftDown=this._mouseDown=this._toolPan=!1;if(this._isMultiTouch){t.preventDefault(),this._isMultiTouch=!1,this._wheelLevel=0,n&&this._setInteractiveTimeout(!0);return}document.releaseCapture&&document.releaseCapture();if(i){h=e.now(),this._current=l;switch(u){case"zoom":case"dragBox":if(p!==0||d!==0){var g=this._pixelSize*6,y=this._toMap([[Math.min(this._anchor[0],l[0]),Math.max(this._anchor[1],l[1])],[Math.max(this._anchor[0],l[0]),Math.min(this._anchor[1],l[1])]]),b=[y[0][0],y[0][1],y[1][0],y[1][1]];u==="zoom"?(b[2]-b[0]<g&&b[3]-b[1]<g&&(b=e.geo.scaleBy(this._getBbox(e.geo.center(b,!0)),.5,!0)),this._setBbox(b,!0,!0),n=!0):(m=e.geo.polygonize(b,!0),m.bbox=b,this._userGeodetic&&(m.coordinates=e.geo.proj.toGeodetic(m.coordinates),m.bbox=e.geo.proj.toGeodetic(m.bbox)),this._trigger("shape",t,m))}else u==="dragBox"&&(v=this._toMap(l),m={type:"Point",coordinates:[v[0],v[1]],bbox:[v[0],v[1],v[0],v[1]]},this._userGeodetic&&(m.coordinates=e.geo.proj.toGeodetic(m.coordinates),m.bbox=e.geo.proj.toGeodetic(m.bbox)),this._trigger("shape",t,m));this._resetDrawing();break;case"dragCircle":if(p!==0||d!==0){var w=this._options.axisLayout==="image",E=Math.sqrt(p*p+d*d),S=180,x;this._drawPixels.length=S+1;for(c=0;c<S;c++)x=c*360/S*(Math.PI/180),this._drawPixels[c]=[this._anchor[0]+Math.cos(x)*E,this._anchor[1]+Math.sin(x)*E];this._drawPixels[S]=[this._drawPixels[0][0],this._drawPixels[0][1]],v=this._toMap([[this._anchor[0]-E,this._anchor[1]+(w?-E:E)],[this._anchor[0]+E,this._anchor[1]+(w?E:-E)]]),m={type:"Polygon",coordinates:[this._toMap(this._drawPixels)],bbox:[v[0][0],v[0][1],v[1][0],v[1][1]]},this._userGeodetic&&(m.coordinates=e.geo.proj.toGeodetic(m.coordinates),m.bbox=e.geo.proj.toGeodetic(m.bbox)),this._trigger("shape",t,m),this._resetDrawing()}else v=this._toMap(l),m={type:"Point",coordinates:[v[0],v[1]],bbox:[v[0],v[1],v[0],v[1]]},this._userGeodetic&&(m.coordinates=e.geo.proj.toGeodetic(m.coordinates),m.bbox=e.geo.proj.toGeodetic(m.bbox)),this._trigger("shape",t,m);break;case"drawPoint":this._drawTimeout&&(window.clearTimeout(this._drawTimeout),this._drawTimeout=null);if(s)this._panFinalize();else if(h-this._clickDate>100){var T=this;this._drawTimeout=setTimeout(function(){T._drawTimeout&&(T._trigger("shape",t,{type:"Point",coordinates:T.toMap(l)}),T._inOp=!1,T._drawTimeout=null)},250)}break;case"drawLineString":case"drawPolygon":case"measureLength":case"measureArea":if(s)this._panFinalize();else{c=this._drawCoords.length===0?0:this._drawCoords.length-1,this._drawCoords[c]=this._toMap(l),this._drawPixels[c]=l;if(c<2||this._drawCoords[c][0]!=this._drawCoords[c-1][0]||this._drawCoords[c][1]!=this._drawCoords[c-1][1])this._drawCoords[c+1]=this._toMap(l,this._centerInteractive,this._pixelSizeInteractive),this._drawPixels[c+1]=l;this._refreshDrawing()}break;default:s?this._panFinalize():h-this._clickDate>100&&(this._trigger("click",t,{type:"Point",coordinates:this.toMap(l)}),this._inOp=!1)}this._clickDate=h;if(this._softDblClick&&this._isDbltap)return this._isDbltap=this._isTap=!1,n&&this._setInteractiveTimeout(!0),this._$eventTarget.trigger("dblclick",t),!1}n&&this._setInteractiveTimeout(!0);if(this._inOp)return t.preventDefault(),!1},_eventTarget_mousewheel:function(t,n){if(this._options.mode==="static"||this._options.scroll==="off")return;t.preventDefault();if(this._mouseDown)return!1;if(n!==0){this._clearInteractiveTimeout(),n>0?n=Math.ceil(n):n=Math.floor(n);var r=e(t.currentTarget).offset();this._anchor=[t.pageX-r.left,t.pageY-r.top];var i=this._getZoomCenterAndSize(this._anchor,n,this._options.tilingScheme!==null),s,o=0;this._setInteractiveCenterAndSize(i.center,i.pixelSize),this._interactiveTransform(),this._setInteractiveTimeout(!0)}return!1}})}(jQuery),function(e,t){e.geo._serviceTypes.tiled=function(){return{create:function(t,n,r,i){var s=e.data(r,"geoServiceState");if(!s){s={loadCount:0,reloadTiles:!1};var o='<div data-geo-service="tiled" style="-webkit-transform:translateZ(0); position:absolute; left:0; top:0; width:8px; height:8px; margin:0; padding:0;"></div>';n.append(o),s.serviceContainer=n.children(":last"),e.data(r,"geoServiceState",s)}return s.serviceContainer},destroy:function(t,n,r){var i=e.data(r,"geoServiceState");i.serviceContainer.remove(),e.removeData(r,"geoServiceState")},interactiveTransform:function(t,n,r,i){var s=e.data(n,"geoServiceState"),o=t.options.tilingScheme;s&&(this._cancelUnloaded(t,n),s.serviceContainer.children().each(function(n){var s=e(this),u=s.data("pixelSize"),a=u/i;if(u>0){a=Math.round(a*1e3)/1e3;var f=s.data("scaleOrigin"),l=t._toPixel(f,r,i);s.css({left:Math.round(l[0])+"px",top:Math.round(l[1])+"px",width:o.tileWidth*a,height:o.tileHeight*a})}}))},refresh:function(t,n,r){var i=e.data(n,"geoServiceState");this._cancelUnloaded(t,n),i&&r&&(i.reloadTiles=!0);if(i&&n&&n.style.visibility==="visible"&&!i.serviceContainer.is(":hidden")){var s=t._getBbox(),o=t._pixelSize,u=this,a=i.serviceContainer,f=t._getContentBounds(),l=f.width,c=f.height,h=t.options.axisLayout==="image",p=h?1:-1,d=t.options.tilingScheme,v=d.tileWidth,m=d.tileHeight,g=Math.floor((s[0]-d.origin[0])/(o*v)),y=Math.max(Math.floor((h?s[1]-d.origin[1]:d.origin[1]-s[3])/(o*m)),0),b=Math.ceil((s[2]-d.origin[0])/(o*v)),w=Math.ceil((h?s[3]-d.origin[1]:d.origin[1]-s[1])/(o*m)),E=t._getBboxMax(),S=t._getPixelSize(0),x=S/o,T=Math.floor((E[0]-d.origin[0])/(S*v))*x,N=Math.floor((d.origin[1]+p*E[3])/(S*m))*x,C=d.origin[0]+T*v*o,k=d.origin[1]+p*N*m*o,L=Math.round((C-s[0])/o),A=Math.round((h?k-s[1]:s[3]-k)/o),O=a.children().show(),M=O.filter("[data-pixel-size='"+o+"']").appendTo(a),_=n.style.opacity,D,P,H=function(n){u._loadImage(e.data(this,"img"),n,o,t,i,_)},B=function(){e.data(this,"img").remove(),i.loadCount--,t._requestComplete()};i.reloadTiles&&O.find("img").attr("data-dirty","true"),M.size()?(M.css({left:L%v+"px",top:A%m+"px"}).data("scaleOrigin",t._toMap([L%v,A%m])),M.children().each(function(t){var n=e(this),r=n.attr("data-tile").split(",");n.css({left:Math.round((parseInt(r[0],10)-T)*100+(L-L%v)/v*100)+"%",top:Math.round((parseInt(r[1],10)-N)*100+(A-A%m)/m*100)+"%"}),_<1&&n.fadeTo(0,_)})):(a.append("<div style='-webkit-transform:translateZ(0);position:absolute; left:"+L%v+"px; top:"+A%m+"px; width:"+v+"px; height:"+m+"px; margin:0; padding:0;' data-pixel-size='"+o+"'></div>"),M=a.children(":last").data("scaleOrigin",t._toMap([L%v,A%m])));for(D=g;D<b;D++)for(P=y;P<w;P++){var j=""+D+","+P,F=M.children("[data-tile='"+j+"']").removeAttr("data-dirty");if(F.size()===0||i.reloadTiles){var I=[d.origin[0]+D*v*o,d.origin[1]+p*P*m*o],q=[d.origin[0]+((D+1)*v-1)*o,d.origin[1]+p*((P+1)*m-1)*o],R=[I[0],I[1],q[0],q[1]],U=n.hasOwnProperty("src")?"src":"getUrl",z={bbox:R,width:v,height:m,zoom:t._getZoom(),tile:{row:P,column:D},index:Math.abs(P+D)},W=e.isFunction(n[U]),X;W?X=n[U](z):(e.templates("geoSrc",n[U]),X=e.render.geoSrc(z)),i.loadCount++,t._requestQueued();if(i.reloadTiles&&F.size()>0)F.attr("src",X);else{var V="<img style='-webkit-transform:translateZ(0);position:absolute; left:"+((D-T)*100+(L-L%v)/v*100)+"%; "+"top:"+((P-N)*100+(A-A%m)/m*100)+"%; ";V+="width: 100%; height: 100%;",V+="margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;' unselectable='on' data-tile='"+j+"' />",M.append(V),F=M.children(":last")}typeof X=="string"?u._loadImage(F,X,o,t,i,_):X?(e.data(X,"img",F),X.done(H).fail(B)):F.remove()}}O.find("[data-dirty]").remove(),i.reloadTiles=!1}},resize:function(e,t){},opacity:function(t,n){var r=e.data(n,"geoServiceState");r.serviceContainer.find("img").stop(!0).fadeTo("fast",n.style.opacity)},toggle:function(t,n){var r=e.data(n,"geoServiceState");r.serviceContainer.css("display",n.style.visibility==="visible"?"block":"none")},_cancelUnloaded:function(t,n){var r=e.data(n,"geoServiceState");if(r&&r.loadCount>0){r.serviceContainer.find("img:hidden").remove();while(r.loadCount>0)r.loadCount--,t._requestComplete()}},_loadImage:function(t,n,r,i,s,o){var u=s.serviceContainer;t.load(function(t){o<1?e(t.target).fadeTo(0,o):e(t.target).show(),s.loadCount--,i._requestComplete(),s.loadCount<=0&&(u.children(":not([data-pixel-size='"+r+"'])").remove(),s.loadCount=0)}).error(function(t){e(t.target).remove(),s.loadCount--,i._requestComplete(),s.loadCount<=0&&(u.children(":not([data-pixel-size='"+r+"'])").remove(),s.loadCount=0)}).attr("src",n)}}}()}(jQuery),function(e,t){e.geo._serviceTypes.shingled=function(){return{create:function(t,n,r,i){var s=e.data(r,"geoServiceState");if(!s){s={loadCount:0};var o='<div data-geo-service="shingled" style="-webkit-transform:translateZ(0);position:absolute; left:0; top:0; width:16px; height:16px; margin:0; padding:0;"></div>';n.append(o),s.serviceContainer=n.children(":last"),e.data(r,"geoServiceState",s)}return s.serviceContainer},destroy:function(t,n,r){var i=e.data(r,"geoServiceState");i.serviceContainer.remove(),e.removeData(r,"geoServiceState")},interactiveTransform:function(t,n,r,i){var s=e.data(n,"geoServiceState"),o=t._getContentBounds(),u=o.width,a=o.height,f=u/2,l=a/2,c=[r[0]-f,r[1]-l,r[0]+f,r[1]+l];s&&(this._cancelUnloaded(t,n),s.serviceContainer.children().each(function(n){var s=e(this),o=s.data("pixelSize"),f=o/i;if(o>0){f=Math.round(f*1e3)/1e3;var l=s.data("origin"),c=t._toPixel(l,r,i);s.css({left:Math.round(c[0]),top:Math.round(c[1]),width:u*f,height:a*f})}}))},refresh:function(t,n){var r=e.data(n,"geoServiceState");this._cancelUnloaded(t,n);if(r&&n&&n.style.visibility==="visible"&&!r.serviceContainer.is(":hidden")){var i=t._getBbox(),s=t._pixelSize,o=this,u=r.serviceContainer,a=t._getContentBounds(),f=a.width,l=a.height,c=u.children('[data-pixel-size="'+s+'"]'),h=n.style.opacity,p;h<1&&u.find("img").attr("data-keep-alive","0"),c.size()||(u.append('<div style="-webkit-transform:translateZ(0);position:absolute; left:0px; top: 0px; width:'+f+"px; height:"+l+'px; margin:0; padding:0;" data-pixel-size="'+s+'" data-origin="['+t._toMap([0,0])+']"></div>'),c=u.children(":last"));var d=n.hasOwnProperty("src")?"src":"getUrl",v={bbox:i,width:f,height:l,zoom:t._getZoom(),tile:null,index:0},m=e.isFunction(n[d]),g,y=c.position();y.left=-y.left,y.top=-y.top,m?g=n[d](v):(e.templates("geoSrc",n[d]),g=e.render.geoSrc(v)),r.loadCount++,t._requestQueued(),c.append('<img style="-webkit-transform:translateZ(0);position:absolute; left:'+y.left/c.width()*100+"%; top:"+y.top/c.height()*100+'%; width:100%; height:100%; margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;" unselectable="on" />'),p=c.children(":last").data("center",t._center),typeof g=="string"?o._loadImage(p,g,s,t,r,h):g.done(function(e){o._loadImage(p,e,s,t,r,h)}).fail(function(){p.remove(),r.loadCount--,t._requestComplete()})}},resize:function(t,n){var r=e.data(n,"geoServiceState");if(r&&n&&n.style.visibility==="visible"){this._cancelUnloaded(t,n);var i=r.serviceContainer,s=t._getContentBounds(),o=s.width,u=s.height,a=i.children();a.attr("data-pixel-size","0"),a.each(function(n){var r=e(this),i=r.position(),s=r.data("origin"),a=t._toPixel(s);r.css({left:i.left+(o-r.width())/2,top:i.top+(u-r.height())/2})})}},opacity:function(t,n){var r=e.data(n,"geoServiceState");r.serviceContainer.find("img").stop(!0).fadeTo("fast",n.style.opacity)},toggle:function(t,n){var r=e.data(n,"geoServiceState");r.serviceContainer.css("display",n.style.visibility==="visible"?"block":"none")},_cancelUnloaded:function(t,n){var r=e.data(n,"geoServiceState");if(r&&r.loadCount>0){r.serviceContainer.find("img:hidden").remove();while(r.loadCount>0)r.loadCount--,t._requestComplete()}},_loadImage:function(t,n,r,i,s,o){var u=s.serviceContainer;t.load(function(t){if(!e.contains(document.body,t.target.jquery?t.target[0]:t.target))return;o<1?e(t.target).fadeTo(0,o):e(t.target).show(),s.loadCount--,i._requestComplete(),s.loadCount<=0&&(u.children(':not([data-pixel-size="'+r+'"])').remove(),u.find("img[data-keep-alive]").remove(),s.loadCount=0)}).error(function(t){if(!e.contains(document.body,t.target.jquery?t.target[0]:t.target))return;e(t.target).remove(),s.loadCount--,i._requestComplete(),s.loadCount<=0&&(u.children(":not([data-pixel-size='"+r+"'])").remove(),s.loadCount=0)}).attr("src",n)}}}()}(jQuery);
\ No newline at end of file
diff --git a/libs/js/jquery-geo-1.0b2/docs/js/plugins.js b/libs/js/jquery-geo-1.0b2/docs/js/plugins.js
deleted file mode 100755 (executable)
index c1ba19f..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-
-(function($){
-
-
-
-
-
-
-
-
-
-})(this.jQuery);
-
-
-
-
-window.log = function(){
-  log.history = log.history || [];   
-  log.history.push(arguments);
-  if(this.console){
-    console.log( Array.prototype.slice.call(arguments) );
-  }
-};
-(function(doc){
-  var write = doc.write;
-  doc.write = function(q){ 
-    log('document.write(): ',arguments); 
-    if (/docwriteregexwhitelist/.test(q)) write.apply(doc,arguments);  
-  };
-})(document);
-
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/js/rainbow-custom.min.js b/libs/js/jquery-geo-1.0b2/docs/js/rainbow-custom.min.js
deleted file mode 100755 (executable)
index 2837315..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Rainbow v1.0 rainbowco.de | included languages: generic, javascript, html */
-window.Rainbow=function(){function q(b){var d=b.getAttribute&&b.getAttribute("data-language")||null;if(!d){var b=b.attributes.length,c;for(c=0;c<b;++c)"data-language"==="data-language"[c].nodeName&&(d="data-language"[c].nodeValue)}return d}function C(b,d){for(var c in g[f]){c=parseInt(c,10);if(b==c&&d==g[f][c]?0:b<=c&&d>=g[f][c])delete g[f][c],delete i[f][c];if(b>=c&&b<g[f][c]||d>c&&d<g[f][c])return!0}return!1}function r(b,d){return'<span class="'+b.replace(/\./g," ")+(l?" "+l:"")+'">'+d+"</span>"}
-function D(b,d){var c=0,e;for(e=1;e<d;++e)b[e]&&(c+=b[e].length);return c}function s(b,d,c,e){var k=b.exec(c);if(k){++t;!d.name&&d.matches[0]&&(d.name=d.matches[0],delete d.matches[0]);var h=k[0],j=k.index,u=k[0].length+j,m=function(){function k(){s(b,d,c,e)}t%100>0?k():setTimeout(k,0)};if(C(j,u))m();else{var n=v(d.matches),l=function(c,b,e){if(c>=b.length)e(h);else{var f=function(){l(++c,b,e)},g=k[b[c]];if(g){var j=d.matches[b[c]],i=j.language;if(i)w(g,i,function(c){h=h.replace(g,c);f()});else if(typeof j===
-"object")x(g,j.length?j:[j],function(c){h=h.replace(g,c);f()});else{h=y(D(k,b[c]),g,r(j,g),h);f()}}else f()}};l(0,n,function(c){d.name&&(c=r(d.name,c));if(!i[f]){i[f]={};g[f]={}}i[f][j]={replace:k[0],"with":c};g[f][j]=u;m()})}}else e()}function E(b){var d=n[b]||[],c=n[z]||[];return A[b]?d:d.concat(c)}function y(b,d,c,e){return e.substr(0,b)+e.substr(b).replace(d,c)}function v(b){var d=[],c;for(c in b)b.hasOwnProperty(c)&&d.push(c);return d.sort(function(c,b){return b-c})}function x(b,d,c){function e(d,
-h){h<d.length?s(d[h].pattern,d[h],b,function(){e(d,++h)}):F(b,function(b){delete i[f];delete g[f];--f;c(b)})}++f;e(d,0)}function F(b,d){function c(b,d,e,g){if(e<d.length){++B;var m=d[e],l=i[f][m],b=y(m,l.replace,l["with"],b),m=function(){c(b,d,++e,g)};0<B%250?m():setTimeout(m,0)}else g(b)}var e=v(i[f]);c(b,e,0,d)}function w(b,d,c){x(b,E(d),function(b){c(b)})}function o(b,d){if(d<b.length){var c=q(b[d])||q(b[d].parentNode);c?(c=c.toLowerCase(),b[d].className=c,w(b[d].innerHTML,c,function(e){b[d].innerHTML=
-e;i={};g={};p&&p(b[d],c);setTimeout(function(){o(b,++d)},0)})):o(b,++d)}}var i={},g={},n={},A={},f=0,z=0,t=0,B=0,l,p;return{extend:function(b,d,c){1==arguments.length&&(d=b,b=z);A[b]=c;n[b]=d.concat(n[b]||[])},d:function(b){p=b},c:function(b){l=b},b:function(){var b=document.getElementsByTagName("pre"),d=document.getElementsByTagName("code"),c,e=[];for(c=d.length>>>0;c--;)e[c]=d[c];for(c=0;c<b.length;++c)b[c].getElementsByTagName("code").length||e.push(b[c]);o(e,0)}}}();
-window.addEventListener?window.addEventListener("load",Rainbow.b,!1):window.attachEvent("onload",Rainbow.b);Rainbow.onHighlight=Rainbow.d;Rainbow.addClass=Rainbow.c;window.a=window.a||{};
-Rainbow.extend([{name:"comment",pattern:/\/\*[\s\S]*?\*\/|(\/\/|\#)[\s\S]*?$/gm},{matches:{1:{name:"keyword.operator",pattern:/\=/g},2:"string"},pattern:/(\(|\s|\[|\=)(('|")[\s\S]*?(\3))/gm},{name:"integer",pattern:/\b(0x[\da-f]+|\d+)\b/g},{name:"constant",pattern:/\b[A-Z0-9_]{2,}\b/g},{matches:{1:"keyword"},pattern:/\b(and|array|as|bool(ean)?|c(atch|har|lass|onst)|d(ef|elete|ie|o(uble)?)|e(cho|lse(if)?|xit|xtends)|f(inally|loat|or(each)?|unction)|global|if|import|int(eger)?|long|new|object|or|pr(int|ivate|otected)|public|return|self|st(ring|ruct|atic)|switch|th(en|is|row)|try|(un)?signed|var|void|while)(?=\(|\b)/g},{name:"constant.language",
-pattern:/true|false|null/g},{name:"keyword.operator",pattern:/\+|\!|\-|&(gt|lt|amp);|\||\*|\=/g},{matches:{1:"function.call"},pattern:/(\w+?)(?=\()/g},{matches:{1:"keyword",2:"meta.function-call"},pattern:/(function)\s(.*?)(?=\()/g}]);window.a=window.a||{};
-Rainbow.extend("javascript",[{name:"selector",pattern:/\s\$(?=\.|\()/g},{name:"support",pattern:/\b(window|document)\b/g},{matches:{1:"support.property"},pattern:/\.(length|node(Name|Value))\b/g},{matches:{1:"support.function"},pattern:/(setTimeout|setInterval)(?=\()/g},{matches:{1:"support.method"},pattern:/\.(getAttribute|push|getElementById|getElementsByClassName|log|setTimeout|setInterval)(?=\()/g},{name:"constant.regex",matches:{1:"support.regex.open",2:{name:"constant.regex.escape",pattern:/\\(.){1}/g},
-3:"support.regex.close",4:"support.regex.modifier"},pattern:/(\/)(.*)(\/)([igm]{0,3})/g},{name:"meta.function-call",pattern:/(\w+)(?=:\s{0,}function)/g},{matches:{2:[{name:"string",pattern:/('|")(.*?)(\1)/g},{name:"meta.script-tag",pattern:/(\w+)/g}]},pattern:/(&lt;\/?)(script(.*?))(&gt;)/g}]);window.a=window.a||{};
-Rainbow.extend("html",[{name:"php",matches:{2:{language:"php"}},pattern:/&lt;\?(php)?([\s\S]*?)(\?&gt;)/gm},{name:"css",matches:{"0":{language:"css"}},pattern:/&lt;style(.*?)&gt;([\s\S]*?)&lt;\/style&gt;/gm},{name:"js",matches:{"0":{language:"javascript"}},pattern:/&lt;script(?! src)(.*?)&gt;([\s\S]*?)&lt;\/script&gt;/gm},{name:"comment.html",pattern:/&lt;\!--[\S\s]*?--&gt;/g},{matches:{1:"support.tag.open",2:"support.tag.close"},pattern:/(&lt;)|(&gt;)/g},{name:"support.tag",matches:{1:"support.tag",
-2:"support.tag.special",3:"support.tag-name"},pattern:/(&lt;)(\/|\!?)(\w+)/g},{matches:{1:"support.attribute"},pattern:/([a-z-]+)(?=\=)/g},{matches:{1:"support.operator",2:"string.quote",3:"string.value",4:"string.quote"},pattern:/(=)('|")(.*?)(\2)/g},{matches:{1:"support.operator",2:"support.value"},pattern:/(=)([a-zA-Z\-0-9]*)\b/g},{name:"support.attribute",pattern:/(\w+)(?=&gt;)/g}],!0);
diff --git a/libs/js/jquery-geo-1.0b2/docs/js/script.js b/libs/js/jquery-geo-1.0b2/docs/js/script.js
deleted file mode 100755 (executable)
index 04a3af7..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Author: Ryan Westphal
-
-*/
-
-$(function () {
-  $("a[data-href]").live("click", function (e) {
-    $("#" + $(this).data("href"))[0].scrollIntoView();
-  });
-
-  $(".ui-page").live("pageshow", function () {
-    $(this).find(".geomap-indoc").geomap({ zoom: 2, scroll: "off" });
-  });
-
-  $(".ui-page").live("pagebeforehide", function () {
-    $(this).find(".geomap-indoc").geomap("destroy");
-  });
-});
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/quickstart/index.html b/libs/js/jquery-geo-1.0b2/docs/quickstart/index.html
deleted file mode 100755 (executable)
index f33e0be..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>quickstart | jQuery Geo</title>
-  <meta name="description" content="jQuery Geo quickstart">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="quickstart" data-role="page">
-    <div data-role="header" data-theme="b">
-      <h1>quickstart</h1>
-    </div>
-    
-    <div data-role="content">
-      <p>The jQuery Geo plugin has one widget, geomap, that you can instantiate on any div with a computable width and height.</p>
-      <h2>html</h2>
-      <pre><code>&lt;div id=&quot;map&quot; style=&quot;width: 640px; height: 480px;&quot;&gt;&lt;/div&gt;
-&lt;script src=&quot;//code.jquery.com/jquery-1.7.2.min.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;//code.jquerygeo.com/jquery.geo-1.0b1.min.js&quot;&gt;&lt;/script&gt;</code></pre>
-      <h2>javascript</h2>
-      <pre><code>$(&quot;#map&quot;).geomap();</code></pre>
-      <p>By default, this one line of code will create a fully functional map on your page showing the whole world and using <a href="http://www.openstreetmap.org/" rel="external">OpenStreetMap</a> data via the <a href="http://open.mapquest.com/" rel="external">mapquest open</a> tile set.</p>
-      <p>The default units are <i>longitude &amp; latitude degrees</i> which is the most common format for GPS and other online spatial data. <!--More advanced users can easily switch to <i>web mercator meters</i> which is the same unit type that Google, Bing and ESRI now use.--> You can set the center and zoom of the map at the same time you initialize it by passing a JavaScript object of options.</p>
-      <pre><code>$(&quot;#map&quot;).geomap({
-  center: [ -71.037598, 42.363281 ],
-  zoom: 10
-});</code></pre>
-      <p><b>Please note that longitude is the first value, x, even though it is commonly spoken second.</b> This plugin does not distinguish between lon/lat and any other x/y coordinate system.</p>
-      <p>The above example will show the City of Boston. The value passed to the center property is a <a href="http://geojson.org/geojson-spec.html#positions" rel="external">GeoJSON</a> position, which is an array with an x value followed by a y value.</p>
-      <p>If you need help determining the center point values the <a href="../examples/events.html" rel="external">events example</a> can help. Pan and zoom the map to an area and click the location you want. Then copy the coordinates value displayed under the <b>geo argument</b> heading of the click event and paste it into you code.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/docs/what/index.html b/libs/js/jquery-geo-1.0b2/docs/what/index.html
deleted file mode 100755 (executable)
index 6515e96..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-<!doctype html>  
-
-<html lang="en" class="no-js">
-<head>
-  <meta charset="utf-8">
-
-  <title>what? | jQuery Geo</title>
-  <meta name="description" content="What is jQuery Geo?">
-  <meta name="author" content="Ryan Westphal">
-
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-
-  <link rel="stylesheet" href="../css/style.css?v=2">
-  <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
-</head>
-
-<body>
-
-  <div id="what" data-role="page">
-    <div data-role="header" data-theme="b">
-      <h1>what?</h1>
-    </div>
-    
-    <div data-role="content">
-      <h2>open-source</h2>
-      <p>jQuery Geo is a jQuery plugin, which means it is 100% JavaScript and ties into the popular jQuery library. It helps make interacting with various web mapping servers and tile sets such as Open Street Map, MapBox, WMS, and Esri ArcGIS Server as simple as possible.</p>
-      <p>Internally, Applied Geographics, Inc. has been developing a JavaScript mapping component over the last five years or so and are proud to give our reasearch to the open-source community.</p>
-      <p>Our intention is to be a simple &amp; fast approach to a decent percentage of the spatial web's needs.</p>
-
-      <h2>geomap widget</h2>
-      <p>The primary component of our geospatial plugin is a single user interface widget that pulls in tiled or dynamic map images from map servers. By default, this component targets Open Street Map data as tiles rendered by <a href="http://open.mapquest.com/" rel="external">mapquest open</a> but can be easilly configured to use other cached tile sets and/or dynamic services.</p>
-
-      <div class="geomap-indoc"></div>
-
-      <p>The map widget includes only what is required to show mapping data and handle direct user interaction with the map. The rest can be handled programmatically by the web developer and any other UI framework they choose, e.g., showing and hiding services, changing the widget's mode, hooking into an external zoom bar, etc.</p>
-
-      <h2>geo namespace</h2>
-      <p>Apart from the widget, jQuery Geo has useful geospatial functions in the $.geo namespace. These functions help you calculate bounding boxes, measure the distance between geometries, determine if one geometry contains another, and other functions you might find in the well-known Java Topology Suite. They are all implemented in JavaScript and are included with the rest of jQuery Geo.</p>
-    </div>
-  </div> <!-- end of #container -->
-
-  <script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script src="../js/script.js"></script>
-  <script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
-</body>
-</html>
-
diff --git a/libs/js/jquery-geo-1.0b2/favicon.ico b/libs/js/jquery-geo-1.0b2/favicon.ico
deleted file mode 100755 (executable)
index 5717d04..0000000
Binary files a/libs/js/jquery-geo-1.0b2/favicon.ico and /dev/null differ
diff --git a/libs/js/jquery-geo-1.0b2/grunt.js b/libs/js/jquery-geo-1.0b2/grunt.js
deleted file mode 100755 (executable)
index 1c66e01..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*global module:false*/
-module.exports = function(grunt) {
-
-  // Project configuration.
-  grunt.initConfig({
-    pkg: '<json:package.json>',
-    meta: {
-      banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
-        '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
-        '<%= pkg.homepage ? " * " + pkg.homepage + "\n" : "" %>' +
-        ' * Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>/<%= pkg.author.company %>;' +
-        ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */'
-    },
-    concat: {
-      dist: {
-        src: [
-          '<banner>',
-          'js/excanvas.js',
-          'js/jsrender.js',
-          'js/jquery.mousewheel.js',
-          'js/jquery.ui.widget.js',
-          'js/jquery.geo.core.js',
-          'js/jquery.geo.geographics.js',
-          'js/jquery.geo.geomap.js',
-          'js/jquery.geo.tiled.js',
-          'js/jquery.geo.shingled.js'
-        ],
-        dest: 'docs/<%= pkg.name %>-<%= pkg.version %>.js'
-      }
-    },
-    min: {
-      excanvas: {
-        src: ['js/excanvas.js'],
-        dest: 'js/excanvas.min.js'
-      },
-      jsrender: {
-        src: ['js/jsrender.js'],
-        dest: 'js/jsrender.min.js'
-      },
-      widget: {
-        src: ['js/jquery.ui.widget.js'],
-        dest: 'js/jquery.ui.widget.min.js'
-      },
-      dist: {
-        src: ['<banner>', '<config:concat.dist.dest>'],
-        dest: 'docs/<%= pkg.name %>-<%= pkg.version %>.min.js'
-      }
-    },
-    qunit: {
-      files: ['test/**/*.html']
-    },
-    lint: {
-      files: ['js/jquery.geo.core.js', 'js/jquery.geo.geographics.js', 'js/jquery.geo.geomap.js', 'js/jquery.geo.shingled.js', 'js/jquery.geo.tiled.js']
-    },
-    watch: {
-      files: '<config:lint.files>',
-      tasks: 'lint qunit'
-    },
-    jshint: {
-      options: {
-        curly: true,
-        eqeqeq: false,
-        immed: true,
-        latedef: true,
-        newcap: true,
-        noarg: true,
-        sub: true,
-        undef: false,
-        boss: true,
-        eqnull: false,
-        browser: true
-      },
-      globals: {
-        jQuery: true
-      }
-    },
-    uglify: {}
-  });
-
-  grunt.registerTask('default', 'lint concat:dist min:dist');
-};
diff --git a/libs/js/jquery-geo-1.0b2/index-full.html b/libs/js/jquery-geo-1.0b2/index-full.html
deleted file mode 100755 (executable)
index aa6442d..0000000
+++ /dev/null
@@ -1,511 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-  <meta charset="utf-8" />
-  <title>jQuery Geo</title>
-  <meta name="description" content="jQuery Geo - A spatial mapping plugin for jQuery" />
-  <meta name="author" content="Ryan Westphal" />
-  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <style type="text/css">
-    html { font:13px/1.231 sans-serif; }
-    
-    body, h1 { margin: 0; padding: 0; }
-    
-    body, select, input, textarea
-    {
-      color: #444;
-    }
-
-    pre
-    {
-      white-space: pre-wrap;
-      white-space: pre-line;
-    }
-    
-    .geomap
-    {
-      background: #444;
-      bottom: 0;
-      left: 0;
-      position: fixed;
-      right: 0;
-      top: 0;
-    }
-    
-    .container
-    {
-      position: relative;
-      margin: 32px auto;
-      width: 80%;
-    }
-    
-    .project-links
-    {
-      float: right;
-    }
-    
-    .header
-    {
-      margin: 32px 0 0 10%;
-    }
-    
-    .header img
-    {
-      height: 64px;
-      width: 64px;
-      vertical-align: bottom;
-    }
-    
-    .header h1
-    {
-      display: inline-block;
-    }
-    
-    .header h1 .framework
-    {
-      color: #fff;
-      font-size: 32px;
-    }
-    
-    .header h1 .subtitle
-    {
-      color: #faa;
-      display: block;
-      font-size: 14px;
-      font-style: italic;
-      margin-left: 48px;
-    }
-    
-    h2
-    {
-      clear: both;
-      margin-bottom: 8px;
-    }
-
-    time
-    {
-      font-size: 8pt;
-      font-style: italic;
-      margin: 2px;
-    }
-
-    .main
-    {
-      background: #fff;
-      border-radius: 8px;
-      box-shadow: 2px 2px #555;
-      margin-top: 128px;
-      padding: 32px;
-    }
-
-    .thanks
-    {
-      list-style-type: none;
-    }
-
-    .thanks li
-    {
-      display: inline-block;
-      margin: 1em;
-    }
-
-    #jQueryLogo
-    {
-      background: #39414A;
-      border-radius: 8px;
-      padding: .5em;
-    }
-
-  </style>
-</head>
-<body>
-  <div class="geomap">
-    <div class="header">
-      <img src="apple-touch-icon.png" alt="" />
-      <h1><span class="framework">jQuery Geo</span><span class="subtitle">write less, map more</span></h1>
-    </div>
-  </div>
-  <div class="container">
-    <div class="main" role="main">
-      <div class="nav project-links">
-        <a href="http://jquerygeo.com/1.0b1/" title="Documentation and demos">Docs &amp; Demos</a>
-        <a href="https://github.com/AppGeo/geo/" title="Source code on GitHub">GitHub</a>
-      </div>
-
-      <h2>jQuery Geo - an interactive mapping plugin</h2>
-
-      <p>jQuery Geo, an open-source geospatial mapping project from Applied Geographics, provides a streamlined JavaScript API for a large percentage of your online mapping needs. Whether you just want to display a map on a wep page as quickly as possible or you are a more advanced GIS user, jQuery Geo can help!</p>
-      
-      <p>You can check back here or follow <a href="https://twitter.com/jQueryGeo">@jQueryGeo</a> on Twitter for release announcements. Also, head over to the lead developer's Twitter account, <a href="https://twitter.com/ryanttb">@ryanttb</a>, for development info, links, or to ask questions.</p>
-
-      <h2>Download</h2>
-
-      <p>Using jQuery Geo requires adding one element, including one script (apart from jQuery itself) and calling one function. The following copy-and-paste snippet will help you get started.</p>
-      <pre>&lt;div id=&quot;map&quot; style=&quot;height: 320px;&quot;&gt;&lt;/div&gt;
-&lt;script src=&quot;http://code.jquery.com/jquery-1.7.2.min.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;http://code.jquerygeo.com/jquery.geo-1.0b1.min.js&quot;&gt;&lt;/script&gt;
-&lt;script&gt;$(function() { $( &quot;#map&quot; ).geomap( ); });&lt;/script&gt;</pre>
-
-      <p>code.jquerygeo.com is on the CloudFlare Content Delivery Network (CDN) so our minified, gzipped library will get to your client as fast as possible!</p>
-
-      <h2>Beta 1 released!</h2>
-      <time>2012-07-30</time>
-
-      <p>Over 120 commits and five months after the release of alpha 4, jQuery Geo is now feature complete with what we planned for version 1.0!</p>
-
-      <h3>New interaction engine</h3>
-
-      <p>User interaction is a big part of an interactive map widget, obviously!, and in beta 1 we have optimized panning, zooming, and how they work together. Your maps should feel more responsive overall.</p>
-
-      <h3>Wicked fast mobile</h3>
-
-      <p>Using CSS3 features on modern mobile devices brings tremendous speed improvements to iOS and Android.</p>
-
-      <h3>New default map</h3>
-
-      <p>Probably the most noticable change, jQuery Geo is still using OpenStreetMap data by default but in the form of tiles rendered by <a href="http://open.mapquest.com/" target="_blank">mapquest open</a>. It's your same open data but the servers are faster and the cartography is nicer.</p>
-
-      <h3>New build environment</h3>
-
-      <p>jQuery Geo now builds with <a href="https://github.com/cowboy/grunt" target="_blank">grunt</a> from Ben Alman making it 100% lint free, smaller, and supporting the next generation of the jQuery Plugins website.</p>
-
-      <h3>Drag modes</h3>
-
-      <p>There is a whole new mode style called drag. Previously, draw modes such as drawPoint and drawPolygon, allow the user to perform individual clicks or taps to create shapes. New modes have been added that trigger shape events on a single motion: dragBox and dragCircle. They disable map panning and allow quick digitization of rectangles and circles, great for spatial queries and selecting! They both send GeoJSON Polygon objects as the geo argument to your shape event handler.</p>
-
-      <h3>Load events</h3>
-
-      <p>Two new events, loadstart and loadend, allow you to display indicators or give feedback to users while map tiles or other images are downloading.</p>
-
-      <h3>Forcing refresh</h3>
-
-      <p>Sometimes you have time-dependent, continuously updated data and images coming from a map server. New arguments to refresh allow you to get updated images even if the map's viewport (and thus, image URLs) hasn't changed. You can also refresh only specific services that you know will have changed, leaving other more static images in place.</p>
-
-      <h3>Zoom level constraints</h3>
-
-      <p>Whether you have a tiled or non-tiled (all shingled) map, you can now limit how far in and/or out a user can zoom with the new zoomMax and zoomMin options.</p>
-
-      <h3>Breaking</h3>
-
-      <p>There is one, small breaking change in how all template strings are processed. This is due to a change (and finalization in the API) to jsRender, which jQuery Geo uses for a service's src template strings and measureLabels template strings. In short, use {{:variable}} where you used to use {{=variable}}. You can read more about this change on Boris Moore's blog post: <a href="http://www.borismoore.com/2012/03/approaching-beta-whats-changing-in_06.html" target="_blank">http://www.borismoore.com/2012/03/approaching-beta-whats-changing-in_06.html</a>.</p>
-
-      <h3>Enjoy!</h3>
-
-      <p>Thanks for checking out jQuery Geo! We hope you find it useful and will keep you updated as we press on to a 1.0 release!</p>
-
-      <p>Here's the full changelog:</p>
-
-      <pre>* geographics - use canvas compositing for Polygons with holes
-* geographics - [bug] on polygons with holes, stroke draws a line from exterior ring to interior one
-* docs - geomap - trigger a shape event when a user finishes measuring
-* geomap - trigger a shape event when a user finishes measuring
-* geomap - [bug] elements inside the map div lose their position setting
-* geomap - trigger bboxchange when we update the map size after the window resizes
-* geomap - [bug] multiple map widgets share the same compiled measureLabels template names and overwrite each other
-* examples - inset map/multiple maps example
-* geomap - [bug] in zoom mode, dragging from bottom-right to top-left draws box but doesn't zoom
-* geomap - [bug] any mouse down triggers refresh, even without pan
-* cdn - fix caching
-** Cache-Control header max-age set to 5 years
-** remove Expires header
-* geomap - upgrade to jsrender 1.0pre
-* deploy - build releases using grunt
-* deploy - make a package for new jQuery plugin directory
-** https://github.com/jquery/plugins.jquery.com/blob/master/docs/package.md
-* deploy - lint JavaScript files
-* docs - geomap - dragBbox mode
-* docs - geo - polygonize function for bbox
-* geo - polygonize function for bbox
-* geomap - dragBbox mode
-* docs - geomap - shift option (default, zoom, dragBbox, off)
-* geomap - shift option (default, zoom, dragBbox, off)
-* docs - geomap - loadstart, loadend events
-* docs - geomap - allow append to take an array of shapes
-* docs - geomap - allow remove to take an array of shapes
-* docs - geomap - improve services option documentation
-* geomap - clamp measure labels to [0, 0]
-* geo - clamp centroid to bbox
-* geomap - measure label for polygon should be in centroid
-* geomap - merge interactive pan and zoom into one, faster system (pan/zoom rewrite)
-* geomap - [bug] iOS - panning is visually jumpy but settles on the correct bbox in the end
-* geomap - pinch-zoom doesn't follow user's fingers close enough when scaling
-* geomap - [bug] pinch zoom on iPad 2 (iOS 5) doesn't refresh tiles when zooming out
-* geomap - request new image in shingled service during interactive pan
-* geomap - [bug] zoom in more than once with zoom method moves tiles to the wrong spot
-* geomap - [bug] only services that have finished refreshing move when the user pans
-* geomap - [bug] map panning is jumpy, appears to be related to shapes and/or drawing context
-* geomap - [bug] pan sometimes lags on first drag
-* geomap - tiled data-scaleOrigin should be stored as an array
-* geomap - android - [bug] cannot always pan map after appending shapes
-* geomap - android - browser stops pan/zoom after 7 logos on logo demo
-* geomap - [bug] mouse wheel on bad or missing tile doesn't zoom out on first rotate
-* geomap - increase mobile performance by 9000
-* docs - geomap - add argument to refresh to force reload of images for dynamic data
-* docs - geomap - allow service-level refresh
-* docs - geomap - zoomMax option (tiled &amp; shingled)
-* docs - geo - include method for bbox
-* geomap - bboxMax should reset center &amp; pixelSize
-* geomap - [bug] initializing center, zoom, &amp; bbox doesn't set all properties
-* geo - [bug] polygonize doesn't return valid polygon when using geodetic coordinates
-* geomap - [bug] dragBbox doesn't include the bbox property in the shape
-* geomap - dragBbox should send a Point (with bbox) for single clicks
-* docs - geomap - dragCircle mode
-* geo - include method for bbox
-* geomap - dragCircle mode
-* geomap - [regression] refresh &amp; toggle methods no longer keep original service objects in sync
-* geomap - [bug] when a singled image hasn't loaded after pan and you double click on empty space, the zoomed bbox seems wrong
-* geomap - allow service-level refresh
-* geographics - remove the blit canvas from the DOM, i.e., don't attach
-* geomap - don't initialze service-level geographics until they're used
-* geomap - add argument to refresh to force reload of images (in case of dynamic data)
-* geomap - loadstart, loadend events
-* geomap - allow append to take an array of shapes
-* geomap - allow remove to take an array of shapes
-* geomap - zoomMax option
-* geomap - [bug] cannot interact with other elements on the page on iOS after panning the map (#71)
-* geomap - iOS - [bug] after one finger is removed, stop processing as if multitouch is still on
-* geomap - dumb high-precision mice down on tiled maps
-** otherwise, the high precision rounds down to zero change in zoom
-* geomap - use linear distance for pinch zoom calculation
-* docs - geomap - zoomMin option
-* geomap - zoomMin option
-* docs - geomap - use MapQuest Open by default; can't deny that it looks much nicer
-* geomap - use MapQuest Open by default; can't deny that it looks much nicer
-* docs - geomap - rename dragBbox to dragBox
-* geomap - rename dragBbox to dragBox
-* geomap - [bug] error using tiled deferred services</pre>
-
-      <h2>Alpha 4 released!</h2>
-      <time>2012-02-19</time>
-
-      <p>It's been a long three months but we're very happy to announce the release of jQuery Geo 1.0a4! Here are some highlights and details:</p>
-
-      <h3>At the service level</h3>
-
-      <p>In alpha 3, you could append and interact with shapes on the map. In alpha 4, this is extended to services! Service-level shapes have their own shapeStyle apart from the map's and hide when their service is hidden.</p>
-
-      <h3>More modes!</h3>
-
-      <p>There are new modes to let you measure distance &amp; area, and a static mode for when you want to display a map but not let users interact with it. Apart from the three new built-in modes, you can also create custom modes to help organize your app.</p>
-
-      <h3>What's that? CSS labels!</h3>
-
-      <p>You can now give any shape a label when you append it. You can style the label from your regular style sheet using the .geo-label class which opens labeling up to all the design power of CSS3. There's even more potential if you put a class or id on your map service because you can target labels on different services using CSS rules. Also, labels can be any HTML which opens them up to new features in HTML5!</p>
-
-      <h3>More service src options</h3>
-
-      <p>The old getUrl property has been renamed to src (see Breaking below) and you can now set it to a string template. jQuery Geo will stick your tile row, column, zoom, or image bbox in for you. Services defined as a string are a little easier on the eyes than a function and can be stored as JSON data.</p> 
-
-      <p>You can still use a function and the function can now return a <a href="http://api.jquery.com/category/deferred-object/">jQuery Promise</a> to delay loading of the map image or tile. Want to calculate a Mandlebrot image in a JavaScript web worker without blocking user interaction? Return a new jQuery.Deferred() and call resolve when you're done!</p>
-
-      <h3>Mobile</h3>
-
-      <p>This version has better mobile support including pinch zoom on iOS and Android 3+ as well as other bug fixes for mobile devices.</p>
-
-      <h3>Don't worry about $.geo.proj so much</h3>
-
-      <p>You can now send either geodetic (lon, lat) or projected (x, y) coordinates to any library function and it will return accordingly if you stay on the default web mercator projection. You should still set it to null or implement the (to|from)GeodeticPos functions if you need to change projections.</p>
-
-      <h3>Breaking</h3>
-
-      <p>There is one deprecation (a service object property will be renamed in beta) and one minor breaking change.</p>
-
-      <p>To align this API with HTML itself, the getUrl property on service objects will be renamed to src. Using either src or getUrl will work for this alpha release but getUrl will be removed for beta. Please update any map services to use the new src property when you're defining them.</p>
-
-      <p>Also on service objects, the initial opacity and visibility are in a property of the service object itself named style. Your old services will still function but ones you may expect to be hidden initially will be visible until you update the service object.</p>
-
-      <p>To exemplify both of these changes, instead of: <pre><code>{
-  type: &quot;tiled&quot;,
-  getUrl: function( view ) { return &quot;&quot;; },
-  visibility: &quot;hidden&quot;
-}</code></pre> you should write: <pre><code>{
-  type: &quot;tiled&quot;,
-  src: function( view ) { return &quot;&quot;; },
-  style: { visibility: &quot;hidden&quot; }
-}</code></pre></p>
-
-      <h3>Everything else</h3>
-
-      <p>With over 60 commits, there are more features and bug fixes to write about. If you dare to click the link below (or read the README file on the project's GitHub page) you can get a better idea of what went into this build. This is the last alpha release (!) and the path to beta will add unit testing, a better build process, and smaller, more refined source code. Thanks for all your support!</p>
-
-<pre>* geomap - [bug] changing the tilingScheme doesn't update pixelSize, maxPixelSize, center or centerMax
-* geomap - [bug] shingled services throw exception during resize
-* docs - geomap - axisLayout option
-* geomap - axisLayout option
-* docs - upgrade to jQuery Mobile rc3
-* docs - allow page refreshing
-* docs - geomap - more modes: measureDistance, measureArea, static
-* docs - geomap - append label argument
-* docs - geomap - toPixel/toMap should take all coordinate dimensions like the proj functions
-* geomap - toPixel/toMap should take all coordinate dimensions like the proj functions
-* geomap - move the drawing container instead of individual points during pan
-* geomap - [bug] drawStyle resets after window resize
-* geomap - append label argument
-* docs - geomap - measureLabels option
-* geomap - measureLabels option
-* geomap - measureDistance mode
-* geomap - measureArea mode
-* docs - geomap - service-level shapeStyle
-* docs - geomap - getUrl string option
-* geomap - [bug] create doesn't clear drawing shapes
-* docs - geomap - service-level shapes
-* docs - geo - detect geodetic coordinates and call $.geo.proj automatically, don't require devs to set $.geo.proj to null
-* docs - geomap - add projection section explaining how bbox &amp; center affect map unit type
-* docs - geomap - rename getUrl to src
-* docs - geomap - scroll option
-* docs - geomap - pannable option
-* geomap - src string option
-* examples - string service src
-* geomap - [bug] map tracks mouse when not panning if click on other elements
-* geomap - pannable option
-* geomap - scroll option
-* geomap - [bug] shapesContainer is being cleared twice during mouse wheel zoom
-* geomap - support pinch zoom on iOS
-* docs - geo - add recenter function for bbox
-* geomap - static mode
-* docs - geomap - allow Deferred or Promise as return value from src function
-* geomap - [bug] widget factory merges first service with default sometimes causing exceptions with shingled services
-* geomap - allow Deferred or Promise as return value from src function
-* geomap - [bug] resize event triggered too many times during resize
-* geomap - service-level shapes
-* geomap - service-level find
-* geographics - add a resize method, call from geomap.resize
-* geo - add recenter function for bbox
-* geomap - [bug] errors creating second un-tiled map after destroying a first on same element
-* geomap - refresh shouldn't request new images if the map element is hidden
-* geomap - [bug] delayed multitouch isn't nearly as smooth as true multitouch
-* geomap - [bug] tiled pinch zoom isn't smooth
-* geo - detect geodetic coordinates and call $.geo.proj automatically, don't require devs to set $.geo.proj to null
-* geomap - [bug] mouse wheel doesn't work with jQuery 1.7
-** upgrade to latest jquery.mousewheel plugin
-* geomap - service object visibility and opacity options should be moved to a style property
-* geomap - use _currentServices in all functions unless we actually need to update the public options services object
-* geomap - don't change user's service objects in opacity/toggle
-* geomap - show attr text
-* docs - geomap - selector argument to find method
-* geomap - selector argument to find method
-* geomap - pan mode should use a hand cursor by default
-* geomap - [bug] only services that have finished refreshing move when the user pans
-** for a4: hide unfinished services
-* geomap - [bug] a user can mess with the center option, e.g., convert numbers to strings, and it can wreck havoc with map state
-* geomap - [bug] zoom option doesn't return proper values for shingled services
-* geomap - [bug] non-tiled maps can zoom out past zoom 0
-* geomap - don't request tiles that are -y index
-* geomap - [bug] initializing tiled map by non-geodetic bbox always causes zoom level 0
-* docs - geomap - empty string needed for label element
-* geomap - [bug] double tap to end shapes adds two points before ending the shape, in different places
-* geomap - [bug] lifting fingers after pinch zoom in drawLineString or drawPolygon modes sometimes adds fake visual coordinate on touch point last lifted
-* docs - upgrade to jQuery 1.7.2
-* geomap - [bug] scroll=off doesn't zoom map but also doesn't allow document scroll
-* geomap - [bug] changing mode does not reset measure drawing
-* geomap - [bug] jQuery UI Widget Factory no longer passes pageX &amp; pageY event properties during _trigger when using jQuery 1.7
-** upgrade to Widget Factory 1.8.17
-* examples - all demo (shingled)
-* docs - geomap - custom modes
-* examples - all demo (tiled)</pre>
-
-      <h2>Alpha 3 released!</h2>
-      <time>2011-11-01</time>
-
-      <h3>jQuery Geo 1.0 Alpha 3 is mostly about sketching!</h3>
-      <ul>
-        <li>new modes: drawPoint, drawLineString, and drawPolygon allow users to draw on your map</li>
-        <li>new event: shape triggers anytime a user draws a feature</li>
-        <li>new style option: drawStyle lets you change how the shapes look while being drawn</li>
-      </ul>
-      <h3>It's also about geometry functions!</h3>
-      <ul>
-        <li>$.geo's center, height/width, expandBy, scaleBy &amp; reaspect functions operate on bounding boxes</li>
-        <li>$.geo's bbox, distance, contains &amp; centroid functions operate on geometries</li>
-      </ul>
-      <p>Many examples have more class and now link to jsFiddles to further explain what's going on!</p>
-      <h3>And a tiny bit about size</h3>
-      <p>jQuery Geo is now hosted on a CDN with gzip enabled bringing the entire library to your neighborhood at under 18k.</p>
-      <h3>Breaking</h3>
-      <p>There are some minor breaking changes to make the API more consistent.</p>
-      <ul>
-        <li>The getPixelSize function is now a read-only option named pixelSize: <pre><code>$( &quot;#map&quot; ).geomap( &quot;option&quot;, &quot;pixelSize&quot; );</code></pre></li>
-        <li>The shapeStyle function is also now an option, e.g.: <pre><code>$( &quot;#map&quot; ).geomap( &quot;option&quot;, &quot;shapeStyle&quot;, { color: &quot;red&quot; } );</code></pre></li>
-        <li>
-          The boolean visible property on service objects is now the visibility property found in CSS and geomap styles and can be &quot;visible&quot; or &quot;hidden&quot;:
-          <pre><code>$( &quot;#map&quot; ).geomap( { services: [ { id: &quot;roads&quot;, visibility: &quot;hidden&quot;, ... } ] } );</code></pre>
-        </li>
-      </ul>
-
-      <h2>Edge</h2>
-      <p>The links above will always point to the latest stable release. However, you can test the most recently committed docs, code &amp; demos by heading over to the test release.</p>
-      <a data-role="button" href="http://jquerygeo.com/test/" title="jQuery Geo test build">Test docs &amp; demos</a>
-
-      <h2>Thanks!</h2>
-
-      <ul class="thanks">
-        <li>
-          <!-- AppGeo -->
-          <a href="http://www.appgeo.com"><img width="180" height="48" title="Applied Geographics" alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAAwCAIAAAA3jserAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAD/NJREFUeF7tnAlwVeUVx8Vax7HWqqXKqG2t2tbasdZaW7XtOOp0H1u1KjqtC4KAKIvKvoUlJAQIJIQQQkJMWBOyQEIgIQtJCCSQBBII2clC9n3fN/vDi9fL/e67776XhxJ5mTtMePmW853v/53zP+d89133mf3HrgETGrjOrhm7Bkxp4IqAo7ipZd2xE/2Dg994vbf39h0tK9+Ymj4jMmby/kPysyg20f/0mbTK6lGtAduDY2h4+JU9odctXrUl7fSoVo2O8BVt7Tuysp//dNdNy1xYqc7zPcd1rwWGbTuVVdvROeq0YXtwcFzudnFHX8/47mjo6hp1GtERePizz5q6u52PpjzisdUsLJSIudFh9S83bl125GhRY/MoUojtwTHtQPSYJU6o5tsOziHn8keRLsyKmlFV8/eAQH1TofNX1PJ26AGzs1w9DWwMDoznLSvWyAp6ZtuOrv7+q2e1I5HE8+Sp21e5Wo0MOt7u6BpzvmQkMnzFfW0JjoGhoSVxSUr14XH35xVcoSUNDQ/1DPS097W39rbwNHU31nbWSA+/Sx/yV9oMDA2MRIa+wcGt6Zm3rFg7EmTQ91879/YMjEiSkazCir62BEdZS+sv3L1VGnxpV4gVYpnqwk4XNhUkXUgIzgvyy/L1SHd3SXVyPLacxyFp0Zz4j6RnadJC6UOXlFW08cn03n1uZ0xJ9KmajAttZYPDloVR4XmFoHyEyABbsedLbaiKr2AoW4IDpqapwdPVNVavpHewt6SlGDT4n/VblDB/yqGJ7x2cMPJnUeJ8z4yNkUURwKWstbR7oNuUhNm19T9c66GPjJuXr3l887YXdu6VQtn/Bof/2X/3Tzd4wbrkjpPDD40us4FCbAaOmo7ORzf5aCrxndAD3f0WmNPh4WHcwfnmorD84FXHVnwSN8tWmBBR9UH0lNlxsxyOLt6a6YVpKWkpaexuAJESVgjLX94dcv3n/Fp8IJj3rds0Ozoeolrd3tHe1yf1wg219PSUNrccKS57PyLqIbct31259kxtndUn5OvqaDNwEMqbiu7GrXbn/BlcYW1nbUThfpzFtKjJOhZi/pHZCxLmjNyEqEaYemjS4sQFGJXTtacQ+ERF1Q1Lvzz9Knz8Y3ugEaN4oaXtQH6RweVfVc1sAw6o6APrN+vY3vf2H9Rfdmd/x8mqExvT3ZS7xZkGJXCL6OJDGTXpVe2Vrb2t4jgcdCBV2V5xpi7rRGXK4eKovbl7Pmckbs7HHRckzMU8WAojhurs638tcJ/mor61xOnFXcHf+BSwDcBBaigir1DfK//E1TO3vlHc1+HPhlt6mpPLj65IXipt4cexM1YkO+zIDsisPU3cgX8hKrHiPEmxTFtvW31XfUV7eXb9mbjS2ICzfqtTVi1MmDsz5gMdVzUj5oO+wb5zdfV3rXbTXNdvNm+DfVsh1ejqYgNw4F/NpoY4aovjElWqIWpIKDsCq5D2iT0Lyw8pai7s6r+yedWG7oachpwjZXGbMzw+iZspGhUCHETdnpltCvE7s84p13KlBf66IGUDcBwuKjGSSyaD1NpziegRHSSUxRMysDFz4z/xP+MHJvQtBH3zGxqhfvyLwbdCX/2DQ9REGAFuKFc6mLS6o+rQ+YObMtxnx32EPCAVyDL+myERmuAgMIF+ygLg0egFU/HL8km6kFjQlNfS02KFeHKX3oGBkuaWU9U1iFre2tZtYWqE7rCczOpaujNOxxc02QqRRgoOwjNyOyolEtPf7+opanZDSlr3QE9uY86aVGdMN+CAH1R3VPcPXdxsjxMZb+zdr3w+joqr6+w6fqFiSvghahM/XreJqg3/Pua5jT9l1dQRTSjXDD1UjcB/0VFpS6t7avoffbYTXjLCvWs2EkFAGsJy8jF70gj4ILwYvGf7WX+CW1jUE15+muBAmMGhLz0dFki2PQDro9jpixPnQ3fgSQVN+Q1dDYxsZGNAfHxx6fTIw49v9oPA3b1mI6I+uGHzb738mPFkRZV+rlnqPvNgzO+3fPrg+s33fN6dcR7z9AXl+H0r6lwjBQcF67HOG1RKRL6g7FxRs09s8fRI955++H1gEV8W19xzWRWKjVR1YYVTw6NMJaAgBCQuiRtl1R/I16A+0yKioAia24zBo2R6QYs9YFoAkGYvv1Nn5Bn7BnvxTTpsd1HCPJxUeME+cnfSGdD8yalvIDuiY4BRwgcHok2Vds12J+PyvN+uuOJSIzCV24wUHK8Ehoka9Eq7GAf+SpH2uGGp4883znsrfOKsmDkYbc0cpQgOI0lJjpqcXNIEh9lBOF4iPjDIpuIvZlH4lBoSsgZDIYJzx2SXoHOpKhtAeZJjYFZOGmBFRHxwDr/vtN5Id9q4paQZz8WNCBxFTc0i2B9Y71nY2IT61h8/KSUJ7nBa+mzA9PGhk3/tNfsPPpupemvi1zpw3LpynU96pjSgdeBAQi6gyP5FGgqfhffR1LgSHKRDJh981wg43gh775lPZ9zlsuRJb1+ZsuAUz9bWG99a5MFHtPVeom5kC8mzWdSddBxXk1Tu2JQ5sR4ceOW50fGi+nCQUD/mI3a9z9XjvvULgMVzAdPHOi+lMXQk5FyeDcHBmBw7iaJaDQ7xdgGcDs9tFhwVbeXk4Lec8pTItebzZvikp7fNut3JYcySi2lWJZ/lnJgN9FQycBqhSpICARke3KDNkJtRDYCHGfEv1oNDMw2Aqciuu5QMbeppmhnt/GLQ1HvXLRqzxFEWDgZgETioU3ikprPxe87mcMQ1HTOnQQccZFkgsIywL7fAIf6o5lF70tufO3+yYNA3sYgoLQGLqCk/uThirrjSmD05u9zSXFcmL5t4YNajXrNvWrZCuX9KcGDzxK3FncGlUGNBYxMs4S/+e1Rt/hawRzp+msUsqBisCO/DgQk+lwd5F6eADFxBcGDQ0LI46598dmCyiA9LW0rc09a7pvqOc1EXJihVQGNF4US3AtQmhEVyvOSYpKWnF14mzvvvncGUNjQtB9pJq6ySDSm/7M3O/YFAou9c7ZZSXilLRbOntgZoHsoJYQeULFhTy8TqBLQrE2PHCEUZGRwM8uy2naopbl6+fHzIgr25gadrTpERJomXWl4m3ayTH7Be2NiMH2QoVXdwDyCUIrF22ovmp0YRjdvYrcDXfubmJU5JhYWZTlalkojMaThX39nxrJ96/fQaH7hPzFWI4Bjn4s7aVKKr7hNJMuACEEkTHC5HU1QjsPGvB6nz4gAxIPOssqUmCpkLi2IwPcotaxFeMjgwvWK99/4N8ydFXnJPRPuk/9ekuD7nv/SetYtuW+Vwo8NKBiRjxKWh5LJyEeJUhiWjokQ5VlMUY9eZy/J4mviw0q04JR0Xa5WkIi60NpHlDMrd09F3KU2EiRMlg3mwNpVAIjg4MZreUTxw+JqsmlpNcLBD4soDz+aIUn0SFadsCTcy5c69Tl4Mx8z+6IMjNCefWr9qCtiJWXoLt30n4t2JkRNeD538asjk57dPf8hj7g1LL+LG82SGKBV2WlzIx4dizcpvDTg49GSixPmmRISG5genVZ+US95MT2NNH/92aIQK48bB8aGWZwFGxsFBudUsOIi5qMhr4uNhd++cugazytUHh29GpnTZVvm8HDRvmm6ZcGrUpJkxH16sJkbNe8p31o9cF35nxfLrv6B0u8/miFLBXcRVcO/ErPzWgEPTGNzquHLl0S35jRqRiOZeEmKQ4lXKZxwc5DbE1VoEDhqbBQf5gHfDIjXBwaZSrzdbldUHh3f6aXHw/flp1J/jS2M5ZhBbMq3SszM7IDgvkKwrZefchpz6rjqvtAyx+9cMDlw+xF4U6429AZr1dLafYzpOq7xJ9tM6cIg8Bvt8pqbOuOWgciYuAYqtOkxUYXSyluBD337og4M3X5RXxSR5SIGbPdBSA44o5UzVKnwyMsXuvCwiLnZG5GGzE1lsOSAy4pKYW+deNbT8hR3q+gtdYB4VrW2yiAYtR31nl+iqycZSVDMIDtwZuWqVvni1ZEdmtqgv0jbiHkh9sR+k2Iknzzc1y9fApBGYgpqZpoWTCSk4uGOVOrPpmHjM7J5JDVC4eBueS3eqBBdx5ZrkVBEcRl45swwcVPzEsJuJCc3JiemsyhS5W5lwTF6MCI6xTuuTSi8ohwVnC2ISxKVSIsELaIKDC/EqfR0pKRN5vujmpHl5tdNUkUUW4z7XTYQJUDxMBc+c6Pj/BYc/4uGjeYpkcICeBzeoIz4C78q2diP4IAMmBoxkdSHmyu5Yes1EGUTE7CyWgYM0vnhDnyCQjL3+TDUdHb/TyuURghc0XJJSM31OsAfGU8srYQncDRgftE/z3p5ktzTBgcAfRh6mLyMwDukyzddPGNnUEmD7qkyDqSjGyOfKJBgpE7ELBZTowmL2XsI0+QxyzXxC8u0/u0OV79/O1zonHFQEJg7guNJY8zCTVzSLDBpYAA5k/eeOIHExpm55KacfHB5elXRc7ItllhOOpmornD+yfmzPbY6uIr0ny/SUt7+UlTKVPqcXfRmBcTRPM+Y98XITpRQeLUcVFltUwtBBiRIc7KLoWehLDRarQCqZxtJdBT6RcgfK/ATFWM3qIHVy7BZGiNu7ok9kIQbvtFoADm5LaJ7at0IijBRyKlrb8eui1h7d5CtVGq0rvN3p7IabkPbS6trK4thEs0lP3s4y+46CpZaDSZnaSC+5jXPSlzk91K4ZOeoPyBcCqJIIpqyIUXDg0d8USBxCwA2VWWd9YwWMRLkBnFQZsQIcGAPOtDypFeDAkLxqrNAg8Q+YrM59dP1d4RBzEqjvqICIWoxcpZMGn7TvIBxTqWd8OrVWgwijVmr8Hp1RcKRXVo91Ul/qQSCKQM3dhm46fX6yizRv7hBrAD6LwMEOPbzRm7qUkghrgsPUWycIj5dZGJtoXH6WQHGO0sxzfruMvwOHU8N38J0DfGOHJtlkzLXJqfgRHVHlvYd6q66DoDq4IPfHdFALLvH+5LWNI8MCzuFyUfot4rP98nqEvuVACy/tDtEcB+8rgoMN4KCIWuMTQj7Yvmo6TXDwPuZfA/aojiaclIACfmrQwKom4mImDHFaRLRY01KeYNwor5ITkRG1EujpKAdjQG1o+ZFkeIbmHhNeQfj4ThgUpRkY4pphb097B6i6AzjUteJIsvFXh2Q5jVoOI+R2hG108hxVbR0QC/Ye2ljVbjLS08lzcGLgTAcLimiTV99olmEYXwu7criomCK7FMfyEF5FFZ4nVtQP701NgagwTcZEVMahdi9fzDYilXKlpB8bu0y+6Wl2tNEBDrPL0CGkmoU3gwNe483s4LjGAaC3fDs47OAwqQE7OOzgsIPDjgHLNWC3HJbr7JrpYQfHNbPVli/UDg7LdXbN9LiKwOGbkaX8hmh+52KE5ouspnaHi1uqEfjv6Pp2x6sKeFcROK4qvdiFQQN2cNhhYFID/wfNU8THoBH93AAAAABJRU5ErkJggg==" /></a>
-        </li>
-
-        <li>
-          <!-- jQuery -->
-          <a href="http://jquery.com"><img id="jQueryLogo" title="jQuery" alt="" src="http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif" /></a>
-        </li>
-
-        <li>
-          <!-- html5 -->
-          <img title="HTML5" alt="" src="http://www.w3.org/html/logo/downloads/HTML5_Badge_64.png" />
-        </li>
-
-        <li>
-          <!-- (mt) -->
-          <a href="http://mediatemple.net"><img title="Media Temple" alt="" src="http://mediatemple.net/_images/partnerlogos/mt-120x60-dk.png" /></a>
-        </li>
-
-        <li>
-          <!-- CloudFlare -->
-          <a href="http://www.cloudflare.com"><img title="CloudFlare" alt="" src="https://www.cloudflare.com/media/images/web-badges/cf-web-badges-a-gray-on.png" /></a>
-        </li>
-      </ul>
-
-      
-    </div>
-  </div>
-  <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script type="text/javascript" src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script type="text/javascript">
-    $(function () {
-      var map;
-
-      $(".nav").buttonset();
-      $("a").filter("[data-role='button']").button();
-
-      if (navigator.geolocation) {
-        navigator.geolocation.getCurrentPosition(function (p) {
-          initMap([p.coords.longitude, p.coords.latitude]);
-        }, function (error) {
-          initMap();
-        });
-      } else {
-        initMap();
-      }
-
-      function initMap(center) {
-        map = $(".geomap").geomap({
-          center: center || [-71.0597732, 42.3584308],
-          zoom: 7
-        });
-
-        $( ".osm" ).geomap("opacity", .5);
-      }
-   });
-  </script>
-  <script type="text/javascript">
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/index.html b/libs/js/jquery-geo-1.0b2/index.html
deleted file mode 100755 (executable)
index 6556490..0000000
+++ /dev/null
@@ -1,292 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
-  <meta charset="utf-8" />
-  <title>jQuery Geo - JavaScript mapping API</title>
-  <meta name="description" content="jQuery Geo - a JavaScript mapping and spatial API as a jQuery plugin" />
-  <meta name="author" content="Ryan Westphal" />
-  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/themes/blitzer/jquery-ui.css" />
-  <style type="text/css">
-    html { font:13px/1.231 sans-serif; }
-    
-    body, h1 { margin: 0; padding: 0; }
-    
-    body, select, input, textarea
-    {
-      color: #444;
-    }
-
-    pre
-    {
-      white-space: pre-wrap;
-      white-space: pre-line;
-    }
-    
-    .geomap
-    {
-      background: #444;
-      bottom: 0;
-      left: 0;
-      position: fixed;
-      right: 0;
-      top: 0;
-    }
-    
-    .container
-    {
-      position: relative;
-      margin: 32px auto;
-      width: 80%;
-    }
-    
-    .project-links
-    {
-      float: right;
-    }
-    
-    .header
-    {
-      margin: 32px 0 0 10%;
-    }
-    
-    .header img
-    {
-      height: 64px;
-      width: 64px;
-      vertical-align: bottom;
-    }
-    
-    .header h1
-    {
-      display: inline-block;
-    }
-    
-    .header h1 .framework
-    {
-      color: #fff;
-      font-size: 32px;
-    }
-    
-    .header h1 .subtitle
-    {
-      color: #faa;
-      display: block;
-      font-size: 14px;
-      font-style: italic;
-      margin-left: 48px;
-    }
-    
-    h2
-    {
-      clear: both;
-      margin-bottom: 8px;
-    }
-
-    time
-    {
-      font-size: 8pt;
-      font-style: italic;
-      margin: 2px;
-    }
-
-    .main
-    {
-      background: #fff;
-      border-radius: 8px;
-      box-shadow: 2px 2px #555;
-      margin-top: 128px;
-      padding: 32px;
-    }
-
-    .thanks
-    {
-      list-style-type: none;
-    }
-
-    .thanks li
-    {
-      display: inline-block;
-      margin: 1em;
-    }
-
-    #jQueryLogo
-    {
-      background: #39414A;
-      border-radius: 8px;
-      padding: .5em;
-    }
-
-  </style>
-</head>
-<body>
-  <div class="geomap">
-    <div class="header">
-      <img src="apple-touch-icon.png" alt="" />
-      <h1><span class="framework">jQuery Geo</span><span class="subtitle">write less, map more</span></h1>
-    </div>
-  </div>
-  <div class="container">
-    <div class="main" role="main">
-
-      <a href="https://twitter.com/share" class="twitter-share-button">Tweet</a>
-      
-      <g:plusone></g:plusone>
-
-      <div class="nav project-links">
-        <a href="http://jquerygeo.com/1.0b1/" title="Documentation and demos">Docs &amp; Demos</a>
-        <a href="https://github.com/AppGeo/geo/" title="Source code on GitHub">GitHub</a>
-      </div>
-
-      <h2>jQuery Geo - a JavaScript mapping API</h2>
-
-      <p>jQuery Geo, an open-source geospatial mapping project from Applied Geographics, provides a streamlined JavaScript API for a large percentage of your online mapping needs. Whether you just want to display a map on a wep page as quickly as possible or you are a more advanced GIS user, jQuery Geo can help!</p>
-      
-      <p>You can check back here or follow <a href="https://twitter.com/jQueryGeo">@jQueryGeo</a> on Twitter for release announcements. Also, head over to the lead developer's Twitter account, <a href="https://twitter.com/ryanttb">@ryanttb</a>, for development info, links, or to ask questions.</p>
-
-      <h2>Download</h2>
-
-      <p>Using jQuery Geo requires adding one element, including one script (apart from jQuery itself) and calling one function. The following copy-and-paste snippet will help you get started.</p>
-      <pre>&lt;div id=&quot;map&quot; style=&quot;height: 320px;&quot;&gt;&lt;/div&gt;
-&lt;script src=&quot;http://code.jquery.com/jquery-1.7.2.min.js&quot;&gt;&lt;/script&gt;
-&lt;script src=&quot;http://code.jquerygeo.com/jquery.geo-1.0b1.min.js&quot;&gt;&lt;/script&gt;
-&lt;script&gt;$(function() { $( &quot;#map&quot; ).geomap( ); });&lt;/script&gt;</pre>
-
-      <p>code.jquerygeo.com is on the CloudFlare Content Delivery Network (CDN) so our minified, gzipped library will get to your client as fast as possible!</p>
-
-      <h2>Beta 1 released!</h2>
-      <time>2012-07-30</time>
-
-      <p>Over 120 commits and five months after the release of alpha 4, jQuery Geo is now feature complete with what we planned for version 1.0!</p>
-
-      <p>The highlights are mentioned here and you can follow the link at the end to read more details.</p>
-
-      <h3>New interaction engine</h3>
-
-      <p>User interaction is a big part of an interactive map widget, obviously!, and in beta 1 we have optimized panning, zooming, and how they work together. Your maps should feel more responsive overall.</p>
-
-      <h3>Wicked fast mobile</h3>
-
-      <p>Using CSS3 features on modern mobile devices brings tremendous speed improvements to iOS and Android.</p>
-
-      <h3>New default map</h3>
-
-      <p>Probably the most noticable change, jQuery Geo is still using OpenStreetMap data by default but in the form of tiles rendered by <a href="http://open.mapquest.com/" target="_blank">mapquest open</a>. It's your same open data but the servers are faster and the cartography is nicer.</p>
-
-      <h3>New build environment</h3>
-
-      <p>jQuery Geo now builds with <a href="https://github.com/cowboy/grunt" target="_blank">grunt</a> from Ben Alman making it 100% lint free, smaller, and supporting the next generation of the jQuery Plugins website.</p>
-
-      <h3>Drag modes</h3>
-
-      <p>There is a whole new mode style called drag. Previously, draw modes such as drawPoint and drawPolygon, allow the user to perform individual clicks or taps to create shapes. New modes have been added that trigger shape events on a single motion: dragBox and dragCircle. They disable map panning and allow quick digitization of rectangles and circles, great for spatial queries and selecting! They both send GeoJSON Polygon objects as the geo argument to your shape event handler.</p>
-
-      <h3>Load events</h3>
-
-      <p>Two new events, loadstart and loadend, allow you to display indicators or give feedback to users while map tiles or other images are downloading.</p>
-
-      <h3>Forcing refresh</h3>
-
-      <p>Sometimes you have time-dependent, continuously updated data and images coming from a map server. New arguments to refresh allow you to get updated images even if the map's viewport (and thus, image URLs) hasn't changed. You can also refresh only specific services that you know will have changed, leaving other more static images in place.</p>
-
-      <h3>Zoom level constraints</h3>
-
-      <p>Whether you have a tiled or non-tiled (all shingled) map, you can now limit how far in and/or out a user can zoom with the new zoomMax and zoomMin options.</p>
-
-      <h3>Breaking</h3>
-
-      <p>There is one, small breaking change in how all template strings are processed. This is due to a change (and finalization in the API) to jsRender, which jQuery Geo uses for a service's src template strings and measureLabels template strings. In short, use {{:variable}} where you used to use {{=variable}}. You can read more about this change on Boris Moore's blog post: <a href="http://www.borismoore.com/2012/03/approaching-beta-whats-changing-in_06.html" target="_blank">http://www.borismoore.com/2012/03/approaching-beta-whats-changing-in_06.html</a>.</p>
-
-      <h3>Enjoy!</h3>
-
-      <p>Thanks for checking out jQuery Geo! We hope you find it useful and will keep you updated as we press on to a 1.0 release!</p>
-
-      <p><a href="index-full.html">Click here to checkout the full changelog</a></p>
-
-      <h2>Edge</h2>
-      <p>The links above will always point to the latest stable release. However, you can test the most recently committed docs, code &amp; demos by heading over to the test release.</p>
-      <a data-role="button" href="http://jquerygeo.com/test/" title="jQuery Geo test build">Test docs &amp; demos</a>
-
-      <h2>Thanks!</h2>
-
-      <ul class="thanks">
-        <li>
-          <!-- AppGeo -->
-          <a href="http://www.appgeo.com"><img width="180" height="48" title="Applied Geographics" alt="" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALQAAAAwCAIAAAA3jserAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAD/NJREFUeF7tnAlwVeUVx8Vax7HWqqXKqG2t2tbasdZaW7XtOOp0H1u1KjqtC4KAKIvKvoUlJAQIJIQQQkJMWBOyQEIgIQtJCCSQBBII2clC9n3fN/vDi9fL/e67776XhxJ5mTtMePmW853v/53zP+d89133mf3HrgETGrjOrhm7Bkxp4IqAo7ipZd2xE/2Dg994vbf39h0tK9+Ymj4jMmby/kPysyg20f/0mbTK6lGtAduDY2h4+JU9odctXrUl7fSoVo2O8BVt7Tuysp//dNdNy1xYqc7zPcd1rwWGbTuVVdvROeq0YXtwcFzudnFHX8/47mjo6hp1GtERePizz5q6u52PpjzisdUsLJSIudFh9S83bl125GhRY/MoUojtwTHtQPSYJU6o5tsOziHn8keRLsyKmlFV8/eAQH1TofNX1PJ26AGzs1w9DWwMDoznLSvWyAp6ZtuOrv7+q2e1I5HE8+Sp21e5Wo0MOt7u6BpzvmQkMnzFfW0JjoGhoSVxSUr14XH35xVcoSUNDQ/1DPS097W39rbwNHU31nbWSA+/Sx/yV9oMDA2MRIa+wcGt6Zm3rFg7EmTQ91879/YMjEiSkazCir62BEdZS+sv3L1VGnxpV4gVYpnqwk4XNhUkXUgIzgvyy/L1SHd3SXVyPLacxyFp0Zz4j6RnadJC6UOXlFW08cn03n1uZ0xJ9KmajAttZYPDloVR4XmFoHyEyABbsedLbaiKr2AoW4IDpqapwdPVNVavpHewt6SlGDT4n/VblDB/yqGJ7x2cMPJnUeJ8z4yNkUURwKWstbR7oNuUhNm19T9c66GPjJuXr3l887YXdu6VQtn/Bof/2X/3Tzd4wbrkjpPDD40us4FCbAaOmo7ORzf5aCrxndAD3f0WmNPh4WHcwfnmorD84FXHVnwSN8tWmBBR9UH0lNlxsxyOLt6a6YVpKWkpaexuAJESVgjLX94dcv3n/Fp8IJj3rds0Ozoeolrd3tHe1yf1wg219PSUNrccKS57PyLqIbct31259kxtndUn5OvqaDNwEMqbiu7GrXbn/BlcYW1nbUThfpzFtKjJOhZi/pHZCxLmjNyEqEaYemjS4sQFGJXTtacQ+ERF1Q1Lvzz9Knz8Y3ugEaN4oaXtQH6RweVfVc1sAw6o6APrN+vY3vf2H9Rfdmd/x8mqExvT3ZS7xZkGJXCL6OJDGTXpVe2Vrb2t4jgcdCBV2V5xpi7rRGXK4eKovbl7Pmckbs7HHRckzMU8WAojhurs638tcJ/mor61xOnFXcHf+BSwDcBBaigir1DfK//E1TO3vlHc1+HPhlt6mpPLj65IXipt4cexM1YkO+zIDsisPU3cgX8hKrHiPEmxTFtvW31XfUV7eXb9mbjS2ICzfqtTVi1MmDsz5gMdVzUj5oO+wb5zdfV3rXbTXNdvNm+DfVsh1ejqYgNw4F/NpoY4aovjElWqIWpIKDsCq5D2iT0Lyw8pai7s6r+yedWG7oachpwjZXGbMzw+iZspGhUCHETdnpltCvE7s84p13KlBf66IGUDcBwuKjGSSyaD1NpziegRHSSUxRMysDFz4z/xP+MHJvQtBH3zGxqhfvyLwbdCX/2DQ9REGAFuKFc6mLS6o+rQ+YObMtxnx32EPCAVyDL+myERmuAgMIF+ygLg0egFU/HL8km6kFjQlNfS02KFeHKX3oGBkuaWU9U1iFre2tZtYWqE7rCczOpaujNOxxc02QqRRgoOwjNyOyolEtPf7+opanZDSlr3QE9uY86aVGdMN+CAH1R3VPcPXdxsjxMZb+zdr3w+joqr6+w6fqFiSvghahM/XreJqg3/Pua5jT9l1dQRTSjXDD1UjcB/0VFpS6t7avoffbYTXjLCvWs2EkFAGsJy8jF70gj4ILwYvGf7WX+CW1jUE15+muBAmMGhLz0dFki2PQDro9jpixPnQ3fgSQVN+Q1dDYxsZGNAfHxx6fTIw49v9oPA3b1mI6I+uGHzb738mPFkRZV+rlnqPvNgzO+3fPrg+s33fN6dcR7z9AXl+H0r6lwjBQcF67HOG1RKRL6g7FxRs09s8fRI955++H1gEV8W19xzWRWKjVR1YYVTw6NMJaAgBCQuiRtl1R/I16A+0yKioAia24zBo2R6QYs9YFoAkGYvv1Nn5Bn7BnvxTTpsd1HCPJxUeME+cnfSGdD8yalvIDuiY4BRwgcHok2Vds12J+PyvN+uuOJSIzCV24wUHK8Ehoka9Eq7GAf+SpH2uGGp4883znsrfOKsmDkYbc0cpQgOI0lJjpqcXNIEh9lBOF4iPjDIpuIvZlH4lBoSsgZDIYJzx2SXoHOpKhtAeZJjYFZOGmBFRHxwDr/vtN5Id9q4paQZz8WNCBxFTc0i2B9Y71nY2IT61h8/KSUJ7nBa+mzA9PGhk3/tNfsPPpupemvi1zpw3LpynU96pjSgdeBAQi6gyP5FGgqfhffR1LgSHKRDJh981wg43gh775lPZ9zlsuRJb1+ZsuAUz9bWG99a5MFHtPVeom5kC8mzWdSddBxXk1Tu2JQ5sR4ceOW50fGi+nCQUD/mI3a9z9XjvvULgMVzAdPHOi+lMXQk5FyeDcHBmBw7iaJaDQ7xdgGcDs9tFhwVbeXk4Lec8pTItebzZvikp7fNut3JYcySi2lWJZ/lnJgN9FQycBqhSpICARke3KDNkJtRDYCHGfEv1oNDMw2Aqciuu5QMbeppmhnt/GLQ1HvXLRqzxFEWDgZgETioU3ikprPxe87mcMQ1HTOnQQccZFkgsIywL7fAIf6o5lF70tufO3+yYNA3sYgoLQGLqCk/uThirrjSmD05u9zSXFcmL5t4YNajXrNvWrZCuX9KcGDzxK3FncGlUGNBYxMs4S/+e1Rt/hawRzp+msUsqBisCO/DgQk+lwd5F6eADFxBcGDQ0LI46598dmCyiA9LW0rc09a7pvqOc1EXJihVQGNF4US3AtQmhEVyvOSYpKWnF14mzvvvncGUNjQtB9pJq6ySDSm/7M3O/YFAou9c7ZZSXilLRbOntgZoHsoJYQeULFhTy8TqBLQrE2PHCEUZGRwM8uy2naopbl6+fHzIgr25gadrTpERJomXWl4m3ayTH7Be2NiMH2QoVXdwDyCUIrF22ovmp0YRjdvYrcDXfubmJU5JhYWZTlalkojMaThX39nxrJ96/fQaH7hPzFWI4Bjn4s7aVKKr7hNJMuACEEkTHC5HU1QjsPGvB6nz4gAxIPOssqUmCpkLi2IwPcotaxFeMjgwvWK99/4N8ydFXnJPRPuk/9ekuD7nv/SetYtuW+Vwo8NKBiRjxKWh5LJyEeJUhiWjokQ5VlMUY9eZy/J4mviw0q04JR0Xa5WkIi60NpHlDMrd09F3KU2EiRMlg3mwNpVAIjg4MZreUTxw+JqsmlpNcLBD4soDz+aIUn0SFadsCTcy5c69Tl4Mx8z+6IMjNCefWr9qCtiJWXoLt30n4t2JkRNeD538asjk57dPf8hj7g1LL+LG82SGKBV2WlzIx4dizcpvDTg49GSixPmmRISG5genVZ+US95MT2NNH/92aIQK48bB8aGWZwFGxsFBudUsOIi5qMhr4uNhd++cugazytUHh29GpnTZVvm8HDRvmm6ZcGrUpJkxH16sJkbNe8p31o9cF35nxfLrv6B0u8/miFLBXcRVcO/ErPzWgEPTGNzquHLl0S35jRqRiOZeEmKQ4lXKZxwc5DbE1VoEDhqbBQf5gHfDIjXBwaZSrzdbldUHh3f6aXHw/flp1J/jS2M5ZhBbMq3SszM7IDgvkKwrZefchpz6rjqvtAyx+9cMDlw+xF4U6429AZr1dLafYzpOq7xJ9tM6cIg8Bvt8pqbOuOWgciYuAYqtOkxUYXSyluBD337og4M3X5RXxSR5SIGbPdBSA44o5UzVKnwyMsXuvCwiLnZG5GGzE1lsOSAy4pKYW+deNbT8hR3q+gtdYB4VrW2yiAYtR31nl+iqycZSVDMIDtwZuWqVvni1ZEdmtqgv0jbiHkh9sR+k2Iknzzc1y9fApBGYgpqZpoWTCSk4uGOVOrPpmHjM7J5JDVC4eBueS3eqBBdx5ZrkVBEcRl45swwcVPzEsJuJCc3JiemsyhS5W5lwTF6MCI6xTuuTSi8ohwVnC2ISxKVSIsELaIKDC/EqfR0pKRN5vujmpHl5tdNUkUUW4z7XTYQJUDxMBc+c6Pj/BYc/4uGjeYpkcICeBzeoIz4C78q2diP4IAMmBoxkdSHmyu5Yes1EGUTE7CyWgYM0vnhDnyCQjL3+TDUdHb/TyuURghc0XJJSM31OsAfGU8srYQncDRgftE/z3p5ktzTBgcAfRh6mLyMwDukyzddPGNnUEmD7qkyDqSjGyOfKJBgpE7ELBZTowmL2XsI0+QxyzXxC8u0/u0OV79/O1zonHFQEJg7guNJY8zCTVzSLDBpYAA5k/eeOIHExpm55KacfHB5elXRc7ItllhOOpmornD+yfmzPbY6uIr0ny/SUt7+UlTKVPqcXfRmBcTRPM+Y98XITpRQeLUcVFltUwtBBiRIc7KLoWehLDRarQCqZxtJdBT6RcgfK/ATFWM3qIHVy7BZGiNu7ok9kIQbvtFoADm5LaJ7at0IijBRyKlrb8eui1h7d5CtVGq0rvN3p7IabkPbS6trK4thEs0lP3s4y+46CpZaDSZnaSC+5jXPSlzk91K4ZOeoPyBcCqJIIpqyIUXDg0d8USBxCwA2VWWd9YwWMRLkBnFQZsQIcGAPOtDypFeDAkLxqrNAg8Q+YrM59dP1d4RBzEqjvqICIWoxcpZMGn7TvIBxTqWd8OrVWgwijVmr8Hp1RcKRXVo91Ul/qQSCKQM3dhm46fX6yizRv7hBrAD6LwMEOPbzRm7qUkghrgsPUWycIj5dZGJtoXH6WQHGO0sxzfruMvwOHU8N38J0DfGOHJtlkzLXJqfgRHVHlvYd6q66DoDq4IPfHdFALLvH+5LWNI8MCzuFyUfot4rP98nqEvuVACy/tDtEcB+8rgoMN4KCIWuMTQj7Yvmo6TXDwPuZfA/aojiaclIACfmrQwKom4mImDHFaRLRY01KeYNwor5ITkRG1EujpKAdjQG1o+ZFkeIbmHhNeQfj4ThgUpRkY4pphb097B6i6AzjUteJIsvFXh2Q5jVoOI+R2hG108hxVbR0QC/Ye2ljVbjLS08lzcGLgTAcLimiTV99olmEYXwu7criomCK7FMfyEF5FFZ4nVtQP701NgagwTcZEVMahdi9fzDYilXKlpB8bu0y+6Wl2tNEBDrPL0CGkmoU3gwNe483s4LjGAaC3fDs47OAwqQE7OOzgsIPDjgHLNWC3HJbr7JrpYQfHNbPVli/UDg7LdXbN9LiKwOGbkaX8hmh+52KE5ouspnaHi1uqEfjv6Pp2x6sKeFcROK4qvdiFQQN2cNhhYFID/wfNU8THoBH93AAAAABJRU5ErkJggg==" /></a>
-        </li>
-
-        <li>
-          <!-- jQuery -->
-          <a href="http://jquery.com"><img id="jQueryLogo" title="jQuery" alt="" src="http://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif" /></a>
-        </li>
-
-        <li>
-          <!-- html5 -->
-          <img title="HTML5" alt="" src="http://www.w3.org/html/logo/downloads/HTML5_Badge_64.png" />
-        </li>
-
-        <li>
-          <!-- (mt) -->
-          <a href="http://mediatemple.net"><img title="Media Temple" alt="" src="http://mediatemple.net/_images/partnerlogos/mt-120x60-dk.png" /></a>
-        </li>
-
-        <li>
-          <!-- CloudFlare -->
-          <a href="http://www.cloudflare.com"><img title="CloudFlare" alt="" src="https://www.cloudflare.com/media/images/web-badges/cf-web-badges-a-gray-on.png" /></a>
-        </li>
-      </ul>
-
-      
-    </div>
-  </div>
-  <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
-  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
-  <script type="text/javascript" src="http://code.jquerygeo.com/jquery.geo-1.0b1.min.js"></script>
-  <script type="text/javascript">
-    $(function () {
-      var map;
-
-      $(".nav").buttonset();
-      $("a").filter("[data-role='button']").button();
-
-      if (navigator.geolocation) {
-        navigator.geolocation.getCurrentPosition(function (p) {
-          initMap([p.coords.longitude, p.coords.latitude]);
-        }, function (error) {
-          initMap();
-        });
-      } else {
-        initMap();
-      }
-
-      function initMap(center) {
-        map = $(".geomap").geomap({
-          center: center || [-71.0597732, 42.3584308],
-          zoom: 7
-        });
-
-        $( ".osm" ).geomap("opacity", .5);
-      }
-   });
-  </script>
-
-  <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
-
-  <script type="text/javascript">
-    (function() {
-      var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
-      po.src = 'https://apis.google.com/js/plusone.js';
-      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
-    })();
-  </script>
-
-  <script type="text/javascript">
-    var _gaq = [['_setAccount', 'UA-26084853-1'], ['_trackPageview']];
-    (function (d, t) {
-      var g = d.createElement(t), s = d.getElementsByTagName(t)[0]; g.async = 1;
-      g.src = ('https:' == location.protocol ? '//ssl' : '//www') + '.google-analytics.com/ga.js';
-      s.parentNode.insertBefore(g, s);
-    } (document, 'script'));
-  </script>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/js/excanvas.js b/libs/js/jquery-geo-1.0b2/js/excanvas.js
deleted file mode 100755 (executable)
index f40af96..0000000
+++ /dev/null
@@ -1,1417 +0,0 @@
-// Copyright 2006 Google Inc.
-//
-// 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.
-
-
-// Known Issues:
-//
-// * Patterns only support repeat.
-// * Radial gradient are not implemented. The VML version of these look very
-//   different from the canvas one.
-// * Clipping paths are not implemented.
-// * Coordsize. The width and height attribute have higher priority than the
-//   width and height style values which isn't correct.
-// * Painting mode isn't implemented.
-// * Canvas width/height should is using content-box by default. IE in
-//   Quirks mode will draw the canvas using border-box. Either change your
-//   doctype to HTML5
-//   (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype)
-//   or use Box Sizing Behavior from WebFX
-//   (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html)
-// * Non uniform scaling does not correctly scale strokes.
-// * Optimize. There is always room for speed improvements.
-
-// Only add this code if we do not already have a canvas implementation
-if (!document.createElement('canvas').getContext) {
-
-  (function () {
-
-    // alias some functions to make (compiled) code shorter
-    var m = Math;
-    var mr = m.round;
-    var ms = m.sin;
-    var mc = m.cos;
-    var abs = m.abs;
-    var sqrt = m.sqrt;
-
-    // this is used for sub pixel precision
-    var Z = 10;
-    var Z2 = Z / 2;
-
-    var IE_VERSION = +navigator.userAgent.match(/MSIE ([\d.]+)?/)[1];
-
-    /**
-    * This funtion is assigned to the <canvas> elements as element.getContext().
-    * @this {HTMLElement}
-    * @return {CanvasRenderingContext2D_}
-    */
-    function getContext() {
-      return this.context_ ||
-        (this.context_ = new CanvasRenderingContext2D_(this));
-    }
-
-    var slice = Array.prototype.slice;
-
-    /**
-    * Binds a function to an object. The returned function will always use the
-    * passed in {@code obj} as {@code this}.
-    *
-    * Example:
-    *
-    *   g = bind(f, obj, a, b)
-    *   g(c, d) // will do f.call(obj, a, b, c, d)
-    *
-    * @param {Function} f The function to bind the object to
-    * @param {Object} obj The object that should act as this when the function
-    *     is called
-    * @param {*} var_args Rest arguments that will be used as the initial
-    *     arguments when the function is called
-    * @return {Function} A new function that has bound this
-    */
-    function bind(f, obj, var_args) {
-      var a = slice.call(arguments, 2);
-      return function () {
-        return f.apply(obj, a.concat(slice.call(arguments)));
-      };
-    }
-
-    function encodeHtmlAttribute(s) {
-      return String(s).replace(/&/g, '&amp;').replace(/"/g, '&quot;');
-    }
-
-    function addNamespace(doc, prefix, urn) {
-      if (!doc.namespaces[prefix]) {
-        doc.namespaces.add(prefix, urn, '#default#VML');
-      }
-    }
-
-    function addNamespacesAndStylesheet(doc) {
-      addNamespace(doc, 'g_vml_', 'urn:schemas-microsoft-com:vml');
-      addNamespace(doc, 'g_o_', 'urn:schemas-microsoft-com:office:office');
-
-      // Setup default CSS.  Only add one style sheet per document
-      if (!doc.styleSheets['ex_canvas_']) {
-        var ss = doc.createStyleSheet();
-        ss.owningElement.id = 'ex_canvas_';
-        ss.cssText = 'canvas{display:inline-block;overflow:hidden;' +
-        // default size is 300x150 in Gecko and Opera
-          'text-align:left;width:300px;height:150px}';
-      }
-    }
-
-    // Add namespaces and stylesheet at startup.
-    addNamespacesAndStylesheet(document);
-
-    var G_vmlCanvasManager_ = {
-      init: function (opt_doc) {
-        var doc = opt_doc || document;
-        // Create a dummy element so that IE will allow canvas elements to be
-        // recognized.
-        doc.createElement('canvas');
-        doc.attachEvent('onreadystatechange', bind(this.init_, this, doc));
-      },
-
-      init_: function (doc) {
-        // find all canvas elements
-        var els = doc.getElementsByTagName('canvas');
-        for (var i = 0; i < els.length; i++) {
-          this.initElement(els[i]);
-        }
-      },
-
-      /**
-      * Public initializes a canvas element so that it can be used as canvas
-      * element from now on. This is called automatically before the page is
-      * loaded but if you are creating elements using createElement you need to
-      * make sure this is called on the element.
-      * @param {HTMLElement} el The canvas element to initialize.
-      * @return {HTMLElement} the element that was created.
-      */
-      initElement: function (el) {
-        if (!el.getContext) {
-          el.getContext = getContext;
-
-          // Add namespaces and stylesheet to document of the element.
-          addNamespacesAndStylesheet(el.ownerDocument);
-
-          // Remove fallback content. There is no way to hide text nodes so we
-          // just remove all childNodes. We could hide all elements and remove
-          // text nodes but who really cares about the fallback content.
-          el.innerHTML = '';
-
-          // do not use inline function because that will leak memory
-          el.attachEvent('onpropertychange', onPropertyChange);
-          el.attachEvent('onresize', onResize);
-
-          var attrs = el.attributes;
-          if (attrs.width && attrs.width.specified) {
-            // TODO: use runtimeStyle and coordsize
-            // el.getContext().setWidth_(attrs.width.nodeValue);
-            el.style.width = attrs.width.nodeValue + 'px';
-          } else {
-            el.width = el.clientWidth;
-          }
-          if (attrs.height && attrs.height.specified) {
-            // TODO: use runtimeStyle and coordsize
-            // el.getContext().setHeight_(attrs.height.nodeValue);
-            el.style.height = attrs.height.nodeValue + 'px';
-          } else {
-            el.height = el.clientHeight;
-          }
-          //el.getContext().setCoordsize_()
-        }
-        return el;
-      }
-    };
-
-    function onPropertyChange(e) {
-      var el = e.srcElement;
-
-      switch (e.propertyName) {
-        case 'width':
-          el.getContext().clearRect();
-          el.style.width = el.attributes.width.nodeValue + 'px';
-          // In IE8 this does not trigger onresize.
-          el.firstChild.style.width = el.clientWidth + 'px';
-          break;
-        case 'height':
-          el.getContext().clearRect();
-          el.style.height = el.attributes.height.nodeValue + 'px';
-          el.firstChild.style.height = el.clientHeight + 'px';
-          break;
-      }
-    }
-
-    function onResize(e) {
-      var el = e.srcElement;
-      if (el.firstChild) {
-        el.firstChild.style.width = el.clientWidth + 'px';
-        el.firstChild.style.height = el.clientHeight + 'px';
-      }
-    }
-
-    G_vmlCanvasManager_.init();
-
-    // precompute "00" to "FF"
-    var decToHex = [];
-    for (var i = 0; i < 16; i++) {
-      for (var j = 0; j < 16; j++) {
-        decToHex[i * 16 + j] = i.toString(16) + j.toString(16);
-      }
-    }
-
-    function createMatrixIdentity() {
-      return [
-      [1, 0, 0],
-      [0, 1, 0],
-      [0, 0, 1]
-    ];
-    }
-
-    function matrixMultiply(m1, m2) {
-      var result = createMatrixIdentity();
-
-      for (var x = 0; x < 3; x++) {
-        for (var y = 0; y < 3; y++) {
-          var sum = 0;
-
-          for (var z = 0; z < 3; z++) {
-            sum += m1[x][z] * m2[z][y];
-          }
-
-          result[x][y] = sum;
-        }
-      }
-      return result;
-    }
-
-    function copyState(o1, o2) {
-      o2.fillStyle     = o1.fillStyle;
-      o2.lineCap       = o1.lineCap;
-      o2.lineJoin      = o1.lineJoin;
-      o2.lineWidth     = o1.lineWidth;
-      o2.miterLimit    = o1.miterLimit;
-      o2.shadowBlur    = o1.shadowBlur;
-      o2.shadowColor   = o1.shadowColor;
-      o2.shadowOffsetX = o1.shadowOffsetX;
-      o2.shadowOffsetY = o1.shadowOffsetY;
-      o2.strokeStyle   = o1.strokeStyle;
-      o2.globalAlpha   = o1.globalAlpha;
-      o2.font          = o1.font;
-      o2.textAlign     = o1.textAlign;
-      o2.textBaseline  = o1.textBaseline;
-      o2.arcScaleX_    = o1.arcScaleX_;
-      o2.arcScaleY_    = o1.arcScaleY_;
-      o2.lineScale_    = o1.lineScale_;
-    }
-
-    //  var colorData = {
-    //    aliceblue: '#F0F8FF',
-    //    antiquewhite: '#FAEBD7',
-    //    aquamarine: '#7FFFD4',
-    //    azure: '#F0FFFF',
-    //    beige: '#F5F5DC',
-    //    bisque: '#FFE4C4',
-    //    black: '#000000',
-    //    blanchedalmond: '#FFEBCD',
-    //    blueviolet: '#8A2BE2',
-    //    brown: '#A52A2A',
-    //    burlywood: '#DEB887',
-    //    cadetblue: '#5F9EA0',
-    //    chartreuse: '#7FFF00',
-    //    chocolate: '#D2691E',
-    //    coral: '#FF7F50',
-    //    cornflowerblue: '#6495ED',
-    //    cornsilk: '#FFF8DC',
-    //    crimson: '#DC143C',
-    //    cyan: '#00FFFF',
-    //    darkblue: '#00008B',
-    //    darkcyan: '#008B8B',
-    //    darkgoldenrod: '#B8860B',
-    //    darkgray: '#A9A9A9',
-    //    darkgreen: '#006400',
-    //    darkgrey: '#A9A9A9',
-    //    darkkhaki: '#BDB76B',
-    //    darkmagenta: '#8B008B',
-    //    darkolivegreen: '#556B2F',
-    //    darkorange: '#FF8C00',
-    //    darkorchid: '#9932CC',
-    //    darkred: '#8B0000',
-    //    darksalmon: '#E9967A',
-    //    darkseagreen: '#8FBC8F',
-    //    darkslateblue: '#483D8B',
-    //    darkslategray: '#2F4F4F',
-    //    darkslategrey: '#2F4F4F',
-    //    darkturquoise: '#00CED1',
-    //    darkviolet: '#9400D3',
-    //    deeppink: '#FF1493',
-    //    deepskyblue: '#00BFFF',
-    //    dimgray: '#696969',
-    //    dimgrey: '#696969',
-    //    dodgerblue: '#1E90FF',
-    //    firebrick: '#B22222',
-    //    floralwhite: '#FFFAF0',
-    //    forestgreen: '#228B22',
-    //    gainsboro: '#DCDCDC',
-    //    ghostwhite: '#F8F8FF',
-    //    gold: '#FFD700',
-    //    goldenrod: '#DAA520',
-    //    grey: '#808080',
-    //    greenyellow: '#ADFF2F',
-    //    honeydew: '#F0FFF0',
-    //    hotpink: '#FF69B4',
-    //    indianred: '#CD5C5C',
-    //    indigo: '#4B0082',
-    //    ivory: '#FFFFF0',
-    //    khaki: '#F0E68C',
-    //    lavender: '#E6E6FA',
-    //    lavenderblush: '#FFF0F5',
-    //    lawngreen: '#7CFC00',
-    //    lemonchiffon: '#FFFACD',
-    //    lightblue: '#ADD8E6',
-    //    lightcoral: '#F08080',
-    //    lightcyan: '#E0FFFF',
-    //    lightgoldenrodyellow: '#FAFAD2',
-    //    lightgreen: '#90EE90',
-    //    lightgrey: '#D3D3D3',
-    //    lightpink: '#FFB6C1',
-    //    lightsalmon: '#FFA07A',
-    //    lightseagreen: '#20B2AA',
-    //    lightskyblue: '#87CEFA',
-    //    lightslategray: '#778899',
-    //    lightslategrey: '#778899',
-    //    lightsteelblue: '#B0C4DE',
-    //    lightyellow: '#FFFFE0',
-    //    limegreen: '#32CD32',
-    //    linen: '#FAF0E6',
-    //    magenta: '#FF00FF',
-    //    mediumaquamarine: '#66CDAA',
-    //    mediumblue: '#0000CD',
-    //    mediumorchid: '#BA55D3',
-    //    mediumpurple: '#9370DB',
-    //    mediumseagreen: '#3CB371',
-    //    mediumslateblue: '#7B68EE',
-    //    mediumspringgreen: '#00FA9A',
-    //    mediumturquoise: '#48D1CC',
-    //    mediumvioletred: '#C71585',
-    //    midnightblue: '#191970',
-    //    mintcream: '#F5FFFA',
-    //    mistyrose: '#FFE4E1',
-    //    moccasin: '#FFE4B5',
-    //    navajowhite: '#FFDEAD',
-    //    oldlace: '#FDF5E6',
-    //    olivedrab: '#6B8E23',
-    //    orange: '#FFA500',
-    //    orangered: '#FF4500',
-    //    orchid: '#DA70D6',
-    //    palegoldenrod: '#EEE8AA',
-    //    palegreen: '#98FB98',
-    //    paleturquoise: '#AFEEEE',
-    //    palevioletred: '#DB7093',
-    //    papayawhip: '#FFEFD5',
-    //    peachpuff: '#FFDAB9',
-    //    peru: '#CD853F',
-    //    pink: '#FFC0CB',
-    //    plum: '#DDA0DD',
-    //    powderblue: '#B0E0E6',
-    //    rosybrown: '#BC8F8F',
-    //    royalblue: '#4169E1',
-    //    saddlebrown: '#8B4513',
-    //    salmon: '#FA8072',
-    //    sandybrown: '#F4A460',
-    //    seagreen: '#2E8B57',
-    //    seashell: '#FFF5EE',
-    //    sienna: '#A0522D',
-    //    skyblue: '#87CEEB',
-    //    slateblue: '#6A5ACD',
-    //    slategray: '#708090',
-    //    slategrey: '#708090',
-    //    snow: '#FFFAFA',
-    //    springgreen: '#00FF7F',
-    //    steelblue: '#4682B4',
-    //    tan: '#D2B48C',
-    //    thistle: '#D8BFD8',
-    //    tomato: '#FF6347',
-    //    turquoise: '#40E0D0',
-    //    violet: '#EE82EE',
-    //    wheat: '#F5DEB3',
-    //    whitesmoke: '#F5F5F5',
-    //    yellowgreen: '#9ACD32'
-    //  };
-
-
-    function getRgbHslContent(styleString) {
-      var start = styleString.indexOf('(', 3);
-      var end = styleString.indexOf(')', start + 1);
-      var parts = styleString.substring(start + 1, end).split(',');
-      // add alpha if needed
-      if (parts.length != 4 || styleString.charAt(3) != 'a') {
-        parts[3] = 1;
-      }
-      return parts;
-    }
-
-    function percent(s) {
-      return parseFloat(s) / 100;
-    }
-
-    function clamp(v, min, max) {
-      return Math.min(max, Math.max(min, v));
-    }
-
-    function hslToRgb(parts) {
-      var r, g, b, h, s, l;
-      h = parseFloat(parts[0]) / 360 % 360;
-      if (h < 0)
-        h++;
-      s = clamp(percent(parts[1]), 0, 1);
-      l = clamp(percent(parts[2]), 0, 1);
-      if (s == 0) {
-        r = g = b = l; // achromatic
-      } else {
-        var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
-        var p = 2 * l - q;
-        r = hueToRgb(p, q, h + 1 / 3);
-        g = hueToRgb(p, q, h);
-        b = hueToRgb(p, q, h - 1 / 3);
-      }
-
-      return '#' + decToHex[Math.floor(r * 255)] +
-        decToHex[Math.floor(g * 255)] +
-        decToHex[Math.floor(b * 255)];
-    }
-
-    function hueToRgb(m1, m2, h) {
-      if (h < 0)
-        h++;
-      if (h > 1)
-        h--;
-
-      if (6 * h < 1)
-        return m1 + (m2 - m1) * 6 * h;
-      else if (2 * h < 1)
-        return m2;
-      else if (3 * h < 2)
-        return m1 + (m2 - m1) * (2 / 3 - h) * 6;
-      else
-        return m1;
-    }
-
-    var processStyleCache = {};
-
-    function processStyle(styleString) {
-      if (styleString in processStyleCache) {
-        return processStyleCache[styleString];
-      }
-
-      var str, alpha = 1;
-
-      styleString = String(styleString);
-      if (styleString.charAt(0) == '#') {
-        str = styleString;
-      } else if (/^rgb/.test(styleString)) {
-        var parts = getRgbHslContent(styleString);
-        var str = '#', n;
-        for (var i = 0; i < 3; i++) {
-          if (parts[i].indexOf('%') != -1) {
-            n = Math.floor(percent(parts[i]) * 255);
-          } else {
-            n = +parts[i];
-          }
-          str += decToHex[clamp(n, 0, 255)];
-        }
-        alpha = +parts[3];
-      } else if (/^hsl/.test(styleString)) {
-        var parts = getRgbHslContent(styleString);
-        str = hslToRgb(parts);
-        alpha = parts[3];
-      } else {
-        str = /*colorData[styleString] ||*/styleString;
-      }
-      return processStyleCache[styleString] = { color: str, alpha: alpha };
-    }
-
-    var DEFAULT_STYLE = {
-      style: 'normal',
-      variant: 'normal',
-      weight: 'normal',
-      size: 10,
-      family: 'sans-serif'
-    };
-
-    // Internal text style cache
-    //  var fontStyleCache = {};
-
-    //  function processFontStyle(styleString) {
-    //    if (fontStyleCache[styleString]) {
-    //      return fontStyleCache[styleString];
-    //    }
-
-    //    var el = document.createElement('div');
-    //    var style = el.style;
-    //    try {
-    //      style.font = styleString;
-    //    } catch (ex) {
-    //      // Ignore failures to set to invalid font.
-    //    }
-
-    //    return fontStyleCache[styleString] = {
-    //      style: style.fontStyle || DEFAULT_STYLE.style,
-    //      variant: style.fontVariant || DEFAULT_STYLE.variant,
-    //      weight: style.fontWeight || DEFAULT_STYLE.weight,
-    //      size: style.fontSize || DEFAULT_STYLE.size,
-    //      family: style.fontFamily || DEFAULT_STYLE.family
-    //    };
-    //  }
-
-    //  function getComputedStyle(style, element) {
-    //    var computedStyle = {};
-
-    //    for (var p in style) {
-    //      computedStyle[p] = style[p];
-    //    }
-
-    //    // Compute the size
-    //    var canvasFontSize = parseFloat(element.currentStyle.fontSize),
-    //        fontSize = parseFloat(style.size);
-
-    //    if (typeof style.size == 'number') {
-    //      computedStyle.size = style.size;
-    //    } else if (style.size.indexOf('px') != -1) {
-    //      computedStyle.size = fontSize;
-    //    } else if (style.size.indexOf('em') != -1) {
-    //      computedStyle.size = canvasFontSize * fontSize;
-    //    } else if(style.size.indexOf('%') != -1) {
-    //      computedStyle.size = (canvasFontSize / 100) * fontSize;
-    //    } else if (style.size.indexOf('pt') != -1) {
-    //      computedStyle.size = fontSize / .75;
-    //    } else {
-    //      computedStyle.size = canvasFontSize;
-    //    }
-
-    //    // Different scaling between normal text and VML text. This was found using
-    //    // trial and error to get the same size as non VML text.
-    //    computedStyle.size *= 0.981;
-
-    //    return computedStyle;
-    //  }
-
-    //  function buildStyle(style) {
-    //    return style.style + ' ' + style.variant + ' ' + style.weight + ' ' +
-    //        style.size + 'px ' + style.family;
-    //  }
-
-    var lineCapMap = {
-      'butt': 'flat',
-      'round': 'round'
-    };
-
-    function processLineCap(lineCap) {
-      return lineCapMap[lineCap] || 'square';
-    }
-
-    /**
-    * This class implements CanvasRenderingContext2D interface as described by
-    * the WHATWG.
-    * @param {HTMLElement} canvasElement The element that the 2D context should
-    * be associated with
-    */
-    function CanvasRenderingContext2D_(canvasElement) {
-      this.m_ = createMatrixIdentity();
-
-      this.mStack_ = [];
-      this.aStack_ = [];
-      this.currentPath_ = [];
-
-      // Canvas context properties
-      this.strokeStyle = '#000';
-      this.fillStyle = '#000';
-
-      this.lineWidth = 1;
-      this.lineJoin = 'miter';
-      this.lineCap = 'butt';
-      this.miterLimit = Z * 1;
-      this.globalAlpha = 1;
-      //this.font = '10px sans-serif';
-      //this.textAlign = 'left';
-      //this.textBaseline = 'alphabetic';
-      this.canvas = canvasElement;
-
-      var cssText = 'width:' + canvasElement.clientWidth + 'px;height:' +
-        canvasElement.clientHeight + 'px;overflow:hidden;position:absolute';
-      var el = canvasElement.ownerDocument.createElement('div');
-      el.style.cssText = cssText;
-      canvasElement.appendChild(el);
-
-      var overlayEl = el.cloneNode(false);
-      // Use a non transparent background.
-      overlayEl.style.backgroundColor = 'red';
-      overlayEl.style.filter = 'alpha(opacity=0)';
-      canvasElement.appendChild(overlayEl);
-
-      this.element_ = el;
-      this.arcScaleX_ = 1;
-      this.arcScaleY_ = 1;
-      this.lineScale_ = 1;
-    }
-
-    var contextPrototype = CanvasRenderingContext2D_.prototype;
-    contextPrototype.clearRect = function () {
-      if (this.textMeasureEl_) {
-        this.textMeasureEl_.removeNode(true);
-        this.textMeasureEl_ = null;
-      }
-      this.element_.innerHTML = '';
-    };
-
-    contextPrototype.beginPath = function () {
-      // TODO: Branch current matrix so that save/restore has no effect
-      //       as per safari docs.
-      this.currentPath_ = [];
-    };
-
-    contextPrototype.moveTo = function (aX, aY) {
-      var p = getCoords(this, aX, aY);
-      this.currentPath_.push({ type: 'moveTo', x: p.x, y: p.y });
-      this.currentX_ = p.x;
-      this.currentY_ = p.y;
-    };
-
-    contextPrototype.lineTo = function (aX, aY) {
-      var p = getCoords(this, aX, aY);
-      this.currentPath_.push({ type: 'lineTo', x: p.x, y: p.y });
-
-      this.currentX_ = p.x;
-      this.currentY_ = p.y;
-    };
-
-    contextPrototype.bezierCurveTo = function(aCP1x, aCP1y,
-                                              aCP2x, aCP2y,
-                                              aX, aY) {
-      var p = getCoords(this, aX, aY);
-      var cp1 = getCoords(this, aCP1x, aCP1y);
-      var cp2 = getCoords(this, aCP2x, aCP2y);
-      bezierCurveTo(this, cp1, cp2, p);
-    };
-
-    // Helper function that takes the already fixed cordinates.
-    function bezierCurveTo(self, cp1, cp2, p) {
-      self.currentPath_.push({
-        type: 'bezierCurveTo',
-        cp1x: cp1.x,
-        cp1y: cp1.y,
-        cp2x: cp2.x,
-        cp2y: cp2.y,
-        x: p.x,
-        y: p.y
-      });
-      self.currentX_ = p.x;
-      self.currentY_ = p.y;
-    }
-
-    contextPrototype.quadraticCurveTo = function(aCPx, aCPy, aX, aY) {
-      // the following is lifted almost directly from
-      // http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes
-
-      var cp = getCoords(this, aCPx, aCPy);
-      var p = getCoords(this, aX, aY);
-
-      var cp1 = {
-        x: this.currentX_ + 2.0 / 3.0 * (cp.x - this.currentX_),
-        y: this.currentY_ + 2.0 / 3.0 * (cp.y - this.currentY_)
-      };
-      var cp2 = {
-        x: cp1.x + (p.x - this.currentX_) / 3.0,
-        y: cp1.y + (p.y - this.currentY_) / 3.0
-      };
-
-      bezierCurveTo(this, cp1, cp2, p);
-    };
-
-    contextPrototype.arc = function (aX, aY, aRadius,
-                                  aStartAngle, aEndAngle, aClockwise) {
-      aRadius *= Z;
-      var arcType = aClockwise ? 'at' : 'wa';
-
-      var xStart = aX + mc(aStartAngle) * aRadius - Z2;
-      var yStart = aY + ms(aStartAngle) * aRadius - Z2;
-
-      var xEnd = aX + mc(aEndAngle) * aRadius - Z2;
-      var yEnd = aY + ms(aEndAngle) * aRadius - Z2;
-
-      // IE won't render arches drawn counter clockwise if xStart == xEnd.
-      if (xStart == xEnd && !aClockwise) {
-        xStart += 0.125; // Offset xStart by 1/80 of a pixel. Use something
-        // that can be represented in binary
-      }
-
-      var p = getCoords(this, aX, aY);
-      var pStart = getCoords(this, xStart, yStart);
-      var pEnd = getCoords(this, xEnd, yEnd);
-
-      this.currentPath_.push({ type: arcType,
-        x: p.x,
-        y: p.y,
-        radius: aRadius,
-        xStart: pStart.x,
-        yStart: pStart.y,
-        xEnd: pEnd.x,
-        yEnd: pEnd.y
-      });
-
-    };
-
-    //  contextPrototype.rect = function(aX, aY, aWidth, aHeight) {
-    //    this.moveTo(aX, aY);
-    //    this.lineTo(aX + aWidth, aY);
-    //    this.lineTo(aX + aWidth, aY + aHeight);
-    //    this.lineTo(aX, aY + aHeight);
-    //    this.closePath();
-    //  };
-
-    //  contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) {
-    //    var oldPath = this.currentPath_;
-    //    this.beginPath();
-
-    //    this.moveTo(aX, aY);
-    //    this.lineTo(aX + aWidth, aY);
-    //    this.lineTo(aX + aWidth, aY + aHeight);
-    //    this.lineTo(aX, aY + aHeight);
-    //    this.closePath();
-    //    this.stroke();
-
-    //    this.currentPath_ = oldPath;
-    //  };
-
-    //  contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) {
-    //    var oldPath = this.currentPath_;
-    //    this.beginPath();
-
-    //    this.moveTo(aX, aY);
-    //    this.lineTo(aX + aWidth, aY);
-    //    this.lineTo(aX + aWidth, aY + aHeight);
-    //    this.lineTo(aX, aY + aHeight);
-    //    this.closePath();
-    //    this.fill();
-
-    //    this.currentPath_ = oldPath;
-    //  };
-
-    //  contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) {
-    //    var gradient = new CanvasGradient_('gradient');
-    //    gradient.x0_ = aX0;
-    //    gradient.y0_ = aY0;
-    //    gradient.x1_ = aX1;
-    //    gradient.y1_ = aY1;
-    //    return gradient;
-    //  };
-
-    //  contextPrototype.createRadialGradient = function(aX0, aY0, aR0,
-    //                                                   aX1, aY1, aR1) {
-    //    var gradient = new CanvasGradient_('gradientradial');
-    //    gradient.x0_ = aX0;
-    //    gradient.y0_ = aY0;
-    //    gradient.r0_ = aR0;
-    //    gradient.x1_ = aX1;
-    //    gradient.y1_ = aY1;
-    //    gradient.r1_ = aR1;
-    //    return gradient;
-    //  };
-
-    //  contextPrototype.drawImage = function(image, var_args) {
-    //    var dx, dy, dw, dh, sx, sy, sw, sh;
-
-    //    // to find the original width we overide the width and height
-    //    var oldRuntimeWidth = image.runtimeStyle.width;
-    //    var oldRuntimeHeight = image.runtimeStyle.height;
-    //    image.runtimeStyle.width = 'auto';
-    //    image.runtimeStyle.height = 'auto';
-
-    //    // get the original size
-    //    var w = image.width;
-    //    var h = image.height;
-
-    //    // and remove overides
-    //    image.runtimeStyle.width = oldRuntimeWidth;
-    //    image.runtimeStyle.height = oldRuntimeHeight;
-
-    //    if (arguments.length == 3) {
-    //      dx = arguments[1];
-    //      dy = arguments[2];
-    //      sx = sy = 0;
-    //      sw = dw = w;
-    //      sh = dh = h;
-    //    } else if (arguments.length == 5) {
-    //      dx = arguments[1];
-    //      dy = arguments[2];
-    //      dw = arguments[3];
-    //      dh = arguments[4];
-    //      sx = sy = 0;
-    //      sw = w;
-    //      sh = h;
-    //    } else if (arguments.length == 9) {
-    //      sx = arguments[1];
-    //      sy = arguments[2];
-    //      sw = arguments[3];
-    //      sh = arguments[4];
-    //      dx = arguments[5];
-    //      dy = arguments[6];
-    //      dw = arguments[7];
-    //      dh = arguments[8];
-    //    } else {
-    //      throw Error('Invalid number of arguments');
-    //    }
-
-    //    var d = getCoords(this, dx, dy);
-
-    //    var w2 = sw / 2;
-    //    var h2 = sh / 2;
-
-    //    var vmlStr = [];
-
-    //    var W = 10;
-    //    var H = 10;
-
-    //    // For some reason that I've now forgotten, using divs didn't work
-    //    vmlStr.push(' <g_vml_:group',
-    //                ' coordsize="', Z * W, ',', Z * H, '"',
-    //                ' coordorigin="0,0"' ,
-    //                ' style="width:', W, 'px;height:', H, 'px;position:absolute;');
-
-    //    // If filters are necessary (rotation exists), create them
-    //    // filters are bog-slow, so only create them if abbsolutely necessary
-    //    // The following check doesn't account for skews (which don't exist
-    //    // in the canvas spec (yet) anyway.
-
-    //    if (this.m_[0][0] != 1 || this.m_[0][1] ||
-    //        this.m_[1][1] != 1 || this.m_[1][0]) {
-    //      var filter = [];
-
-    //      // Note the 12/21 reversal
-    //      filter.push('M11=', this.m_[0][0], ',',
-    //                  'M12=', this.m_[1][0], ',',
-    //                  'M21=', this.m_[0][1], ',',
-    //                  'M22=', this.m_[1][1], ',',
-    //                  'Dx=', mr(d.x / Z), ',',
-    //                  'Dy=', mr(d.y / Z), '');
-
-    //      // Bounding box calculation (need to minimize displayed area so that
-    //      // filters don't waste time on unused pixels.
-    //      var max = d;
-    //      var c2 = getCoords(this, dx + dw, dy);
-    //      var c3 = getCoords(this, dx, dy + dh);
-    //      var c4 = getCoords(this, dx + dw, dy + dh);
-
-    //      max.x = m.max(max.x, c2.x, c3.x, c4.x);
-    //      max.y = m.max(max.y, c2.y, c3.y, c4.y);
-
-    //      vmlStr.push('padding:0 ', mr(max.x / Z), 'px ', mr(max.y / Z),
-    //                  'px 0;filter:progid:DXImageTransform.Microsoft.Matrix(',
-    //                  filter.join(''), ", sizingmethod='clip');");
-
-    //    } else {
-    //      vmlStr.push('top:', mr(d.y / Z), 'px;left:', mr(d.x / Z), 'px;');
-    //    }
-
-    //    vmlStr.push(' ">' ,
-    //                '<g_vml_:image src="', image.src, '"',
-    //                ' style="width:', Z * dw, 'px;',
-    //                ' height:', Z * dh, 'px"',
-    //                ' cropleft="', sx / w, '"',
-    //                ' croptop="', sy / h, '"',
-    //                ' cropright="', (w - sx - sw) / w, '"',
-    //                ' cropbottom="', (h - sy - sh) / h, '"',
-    //                ' />',
-    //                '</g_vml_:group>');
-
-    //    this.element_.insertAdjacentHTML('BeforeEnd', vmlStr.join(''));
-    //  };
-
-    contextPrototype.stroke = function (aFill) {
-      var lineStr = [];
-      var lineOpen = false;
-
-      var W = 10;
-      var H = 10;
-
-      lineStr.push('<g_vml_:shape',
-                 ' filled="', !!aFill, '"',
-                 ' style="position:absolute;width:', W, 'px;height:', H, 'px;"',
-                 ' coordorigin="0,0"',
-                 ' coordsize="', Z * W, ',', Z * H, '"',
-                 ' stroked="', !aFill, '"',
-                 ' path="');
-
-      var newSeq = false;
-      var min = { x: null, y: null };
-      var max = { x: null, y: null };
-
-      for (var i = 0; i < this.currentPath_.length; i++) {
-        var p = this.currentPath_[i];
-        var c;
-
-        switch (p.type) {
-          case 'moveTo':
-            c = p;
-            lineStr.push(' m ', mr(p.x), ',', mr(p.y));
-            break;
-          case 'lineTo':
-            lineStr.push(' l ', mr(p.x), ',', mr(p.y));
-            break;
-          case 'close':
-            lineStr.push(' x ');
-            p = null;
-            break;
-          case 'bezierCurveTo':
-            lineStr.push(' c ',
-                       mr(p.cp1x), ',', mr(p.cp1y), ',',
-                       mr(p.cp2x), ',', mr(p.cp2y), ',',
-                       mr(p.x), ',', mr(p.y));
-            break;
-          case 'at':
-          case 'wa':
-            lineStr.push(' ', p.type, ' ',
-                       mr(p.x - this.arcScaleX_ * p.radius), ',',
-                       mr(p.y - this.arcScaleY_ * p.radius), ' ',
-                       mr(p.x + this.arcScaleX_ * p.radius), ',',
-                       mr(p.y + this.arcScaleY_ * p.radius), ' ',
-                       mr(p.xStart), ',', mr(p.yStart), ' ',
-                       mr(p.xEnd), ',', mr(p.yEnd));
-            break;
-        }
-
-
-        // TODO: Following is broken for curves due to
-        //       move to proper paths.
-
-        // Figure out dimensions so we can do gradient fills
-        // properly
-        if (p) {
-          if (min.x == null || p.x < min.x) {
-            min.x = p.x;
-          }
-          if (max.x == null || p.x > max.x) {
-            max.x = p.x;
-          }
-          if (min.y == null || p.y < min.y) {
-            min.y = p.y;
-          }
-          if (max.y == null || p.y > max.y) {
-            max.y = p.y;
-          }
-        }
-      }
-      lineStr.push(' ">');
-
-      if (!aFill) {
-        appendStroke(this, lineStr);
-      } else {
-        appendFill(this, lineStr, min, max);
-      }
-
-      lineStr.push('</g_vml_:shape>');
-
-      this.element_.insertAdjacentHTML('beforeEnd', lineStr.join(''));
-    };
-
-    function appendStroke(ctx, lineStr) {
-      var a = processStyle(ctx.strokeStyle);
-      var color = a.color;
-      var opacity = a.alpha * ctx.globalAlpha;
-      var lineWidth = ctx.lineScale_ * ctx.lineWidth;
-
-      // VML cannot correctly render a line if the width is less than 1px.
-      // In that case, we dilute the color to make the line look thinner.
-      if (lineWidth < 1) {
-        opacity *= lineWidth;
-      }
-
-      lineStr.push(
-      '<g_vml_:stroke',
-      ' opacity="', opacity, '"',
-      ' joinstyle="', ctx.lineJoin, '"',
-      ' miterlimit="', ctx.miterLimit, '"',
-      ' endcap="', processLineCap(ctx.lineCap), '"',
-      ' weight="', lineWidth, 'px"',
-      ' color="', color, '" />'
-    );
-    }
-
-    function appendFill(ctx, lineStr, min, max) {
-      var fillStyle = ctx.fillStyle;
-      var arcScaleX = ctx.arcScaleX_;
-      var arcScaleY = ctx.arcScaleY_;
-      var width = max.x - min.x;
-      var height = max.y - min.y;
-      //    if (fillStyle instanceof CanvasGradient_) {
-      //      // TODO: Gradients transformed with the transformation matrix.
-      //      var angle = 0;
-      //      var focus = {x: 0, y: 0};
-
-      //      // additional offset
-      //      var shift = 0;
-      //      // scale factor for offset
-      //      var expansion = 1;
-
-      //      if (fillStyle.type_ == 'gradient') {
-      //        var x0 = fillStyle.x0_ / arcScaleX;
-      //        var y0 = fillStyle.y0_ / arcScaleY;
-      //        var x1 = fillStyle.x1_ / arcScaleX;
-      //        var y1 = fillStyle.y1_ / arcScaleY;
-      //        var p0 = getCoords(ctx, x0, y0);
-      //        var p1 = getCoords(ctx, x1, y1);
-      //        var dx = p1.x - p0.x;
-      //        var dy = p1.y - p0.y;
-      //        angle = Math.atan2(dx, dy) * 180 / Math.PI;
-
-      //        // The angle should be a non-negative number.
-      //        if (angle < 0) {
-      //          angle += 360;
-      //        }
-
-      //        // Very small angles produce an unexpected result because they are
-      //        // converted to a scientific notation string.
-      //        if (angle < 1e-6) {
-      //          angle = 0;
-      //        }
-      //      } else {
-      //        var p0 = getCoords(ctx, fillStyle.x0_, fillStyle.y0_);
-      //        focus = {
-      //          x: (p0.x - min.x) / width,
-      //          y: (p0.y - min.y) / height
-      //        };
-
-      //        width  /= arcScaleX * Z;
-      //        height /= arcScaleY * Z;
-      //        var dimension = m.max(width, height);
-      //        shift = 2 * fillStyle.r0_ / dimension;
-      //        expansion = 2 * fillStyle.r1_ / dimension - shift;
-      //      }
-
-      //      // We need to sort the color stops in ascending order by offset,
-      //      // otherwise IE won't interpret it correctly.
-      //      var stops = fillStyle.colors_;
-      //      stops.sort(function(cs1, cs2) {
-      //        return cs1.offset - cs2.offset;
-      //      });
-
-      //      var length = stops.length;
-      //      var color1 = stops[0].color;
-      //      var color2 = stops[length - 1].color;
-      //      var opacity1 = stops[0].alpha * ctx.globalAlpha;
-      //      var opacity2 = stops[length - 1].alpha * ctx.globalAlpha;
-
-      //      var colors = [];
-      //      for (var i = 0; i < length; i++) {
-      //        var stop = stops[i];
-      //        colors.push(stop.offset * expansion + shift + ' ' + stop.color);
-      //      }
-
-      //      // When colors attribute is used, the meanings of opacity and o:opacity2
-      //      // are reversed.
-      //      lineStr.push('<g_vml_:fill type="', fillStyle.type_, '"',
-      //                   ' method="none" focus="100%"',
-      //                   ' color="', color1, '"',
-      //                   ' color2="', color2, '"',
-      //                   ' colors="', colors.join(','), '"',
-      //                   ' opacity="', opacity2, '"',
-      //                   ' g_o_:opacity2="', opacity1, '"',
-      //                   ' angle="', angle, '"',
-      //                   ' focusposition="', focus.x, ',', focus.y, '" />');
-      //    } else if (fillStyle instanceof CanvasPattern_) {
-      //      if (width && height) {
-      //        var deltaLeft = -min.x;
-      //        var deltaTop = -min.y;
-      //        lineStr.push('<g_vml_:fill',
-      //                     ' position="',
-      //                     deltaLeft / width * arcScaleX * arcScaleX, ',',
-      //                     deltaTop / height * arcScaleY * arcScaleY, '"',
-      //                     ' type="tile"',
-      //                     // TODO: Figure out the correct size to fit the scale.
-      //                     //' size="', w, 'px ', h, 'px"',
-      //                     ' src="', fillStyle.src_, '" />');
-      //       }
-      //    } else {
-      var a = processStyle(ctx.fillStyle);
-      var color = a.color;
-      var opacity = a.alpha * ctx.globalAlpha;
-      lineStr.push('<g_vml_:fill color="', color, '" opacity="', opacity,
-                   '" />');
-      //     }
-    }
-
-    contextPrototype.fill = function () {
-      this.stroke(true);
-    };
-
-    contextPrototype.closePath = function () {
-      this.currentPath_.push({ type: 'close' });
-    };
-
-    function getCoords(ctx, aX, aY) {
-      var m = ctx.m_;
-      return {
-        x: Z * (aX * m[0][0] + aY * m[1][0] + m[2][0]) - Z2,
-        y: Z * (aX * m[0][1] + aY * m[1][1] + m[2][1]) - Z2
-      };
-    };
-
-    contextPrototype.save = function () {
-      var o = {};
-      copyState(this, o);
-      this.aStack_.push(o);
-      this.mStack_.push(this.m_);
-      this.m_ = matrixMultiply(createMatrixIdentity(), this.m_);
-    };
-
-    contextPrototype.restore = function () {
-      if (this.aStack_.length) {
-        copyState(this.aStack_.pop(), this);
-        this.m_ = this.mStack_.pop();
-      }
-    };
-
-    function matrixIsFinite(m) {
-      return isFinite(m[0][0]) && isFinite(m[0][1]) &&
-        isFinite(m[1][0]) && isFinite(m[1][1]) &&
-        isFinite(m[2][0]) && isFinite(m[2][1]);
-    }
-
-    function setM(ctx, m, updateLineScale) {
-      if (!matrixIsFinite(m)) {
-        return;
-      }
-      ctx.m_ = m;
-
-      if (updateLineScale) {
-        // Get the line scale.
-        // Determinant of this.m_ means how much the area is enlarged by the
-        // transformation. So its square root can be used as a scale factor
-        // for width.
-        var det = m[0][0] * m[1][1] - m[0][1] * m[1][0];
-        ctx.lineScale_ = sqrt(abs(det));
-      }
-    }
-
-    contextPrototype.translate = function (aX, aY) {
-      var m1 = [
-      [1, 0, 0],
-      [0, 1, 0],
-      [aX, aY, 1]
-    ];
-
-      setM(this, matrixMultiply(m1, this.m_), false);
-    };
-
-    //  contextPrototype.rotate = function(aRot) {
-    //    var c = mc(aRot);
-    //    var s = ms(aRot);
-
-    //    var m1 = [
-    //      [c,  s, 0],
-    //      [-s, c, 0],
-    //      [0,  0, 1]
-    //    ];
-
-    //    setM(this, matrixMultiply(m1, this.m_), false);
-    //  };
-
-    contextPrototype.scale = function (aX, aY) {
-      this.arcScaleX_ *= aX;
-      this.arcScaleY_ *= aY;
-      var m1 = [
-      [aX, 0, 0],
-      [0, aY, 0],
-      [0, 0, 1]
-    ];
-
-      setM(this, matrixMultiply(m1, this.m_), true);
-    };
-
-    //  contextPrototype.transform = function(m11, m12, m21, m22, dx, dy) {
-    //    var m1 = [
-    //      [m11, m12, 0],
-    //      [m21, m22, 0],
-    //      [dx,  dy,  1]
-    //    ];
-
-    //    setM(this, matrixMultiply(m1, this.m_), true);
-    //  };
-
-    //  contextPrototype.setTransform = function(m11, m12, m21, m22, dx, dy) {
-    //    var m = [
-    //      [m11, m12, 0],
-    //      [m21, m22, 0],
-    //      [dx,  dy,  1]
-    //    ];
-
-    //    setM(this, m, true);
-    //  };
-
-    /**
-    * The text drawing function.
-    * The maxWidth argument isn't taken in account, since no browser supports
-    * it yet.
-    */
-    //  contextPrototype.drawText_ = function(text, x, y, maxWidth, stroke) {
-    //    var m = this.m_,
-    //        delta = 1000,
-    //        left = 0,
-    //        right = delta,
-    //        offset = {x: 0, y: 0},
-    //        lineStr = [];
-
-    //    var fontStyle = getComputedStyle(processFontStyle(this.font),
-    //                                     this.element_);
-
-    //    var fontStyleString = buildStyle(fontStyle);
-
-    //    var elementStyle = this.element_.currentStyle;
-    //    var textAlign = this.textAlign.toLowerCase();
-    //    switch (textAlign) {
-    //      case 'left':
-    //      case 'center':
-    //      case 'right':
-    //        break;
-    //      case 'end':
-    //        textAlign = elementStyle.direction == 'ltr' ? 'right' : 'left';
-    //        break;
-    //      case 'start':
-    //        textAlign = elementStyle.direction == 'rtl' ? 'right' : 'left';
-    //        break;
-    //      default:
-    //        textAlign = 'left';
-    //    }
-
-    //    // 1.75 is an arbitrary number, as there is no info about the text baseline
-    //    switch (this.textBaseline) {
-    //      case 'hanging':
-    //      case 'top':
-    //        offset.y = fontStyle.size / 1.75;
-    //        break;
-    //      case 'middle':
-    //        break;
-    //      default:
-    //      case null:
-    //      case 'alphabetic':
-    //      case 'ideographic':
-    //      case 'bottom':
-    //        offset.y = -fontStyle.size / 2.25;
-    //        break;
-    //    }
-
-    //    switch(textAlign) {
-    //      case 'right':
-    //        left = delta;
-    //        right = 0.05;
-    //        break;
-    //      case 'center':
-    //        left = right = delta / 2;
-    //        break;
-    //    }
-
-    //    var d = getCoords(this, x + offset.x, y + offset.y);
-
-    //    lineStr.push('<g_vml_:line from="', -left ,' 0" to="', right ,' 0.05" ',
-    //                 ' coordsize="100 100" coordorigin="0 0"',
-    //                 ' filled="', !stroke, '" stroked="', !!stroke,
-    //                 '" style="position:absolute;width:1px;height:1px;">');
-
-    //    if (stroke) {
-    //      appendStroke(this, lineStr);
-    //    } else {
-    //      // TODO: Fix the min and max params.
-    //      appendFill(this, lineStr, {x: -left, y: 0},
-    //                 {x: right, y: fontStyle.size});
-    //    }
-
-    //    var skewM = m[0][0].toFixed(3) + ',' + m[1][0].toFixed(3) + ',' +
-    //                m[0][1].toFixed(3) + ',' + m[1][1].toFixed(3) + ',0,0';
-
-    //    var skewOffset = mr(d.x / Z) + ',' + mr(d.y / Z);
-
-    //    lineStr.push('<g_vml_:skew on="t" matrix="', skewM ,'" ',
-    //                 ' offset="', skewOffset, '" origin="', left ,' 0" />',
-    //                 '<g_vml_:path textpathok="true" />',
-    //                 '<g_vml_:textpath on="true" string="',
-    //                 encodeHtmlAttribute(text),
-    //                 '" style="v-text-align:', textAlign,
-    //                 ';font:', encodeHtmlAttribute(fontStyleString),
-    //                 '" /></g_vml_:line>');
-
-    //    this.element_.insertAdjacentHTML('beforeEnd', lineStr.join(''));
-    //  };
-
-    //  contextPrototype.fillText = function(text, x, y, maxWidth) {
-    //    this.drawText_(text, x, y, maxWidth, false);
-    //  };
-
-    //  contextPrototype.strokeText = function(text, x, y, maxWidth) {
-    //    this.drawText_(text, x, y, maxWidth, true);
-    //  };
-
-    //  contextPrototype.measureText = function(text) {
-    //    if (!this.textMeasureEl_) {
-    //      var s = '<span style="position:absolute;' +
-    //          'top:-20000px;left:0;padding:0;margin:0;border:none;' +
-    //          'white-space:pre;"></span>';
-    //      this.element_.insertAdjacentHTML('beforeEnd', s);
-    //      this.textMeasureEl_ = this.element_.lastChild;
-    //    }
-    //    var doc = this.element_.ownerDocument;
-    //    this.textMeasureEl_.innerHTML = '';
-    //    this.textMeasureEl_.style.font = this.font;
-    //    // Don't use innerHTML or innerText because they allow markup/whitespace.
-    //    this.textMeasureEl_.appendChild(doc.createTextNode(text));
-    //    return {width: this.textMeasureEl_.offsetWidth};
-    //  };
-
-    /******** STUBS ********/
-    //  contextPrototype.clip = function() {
-    //    // TODO: Implement
-    //  };
-
-    //  contextPrototype.arcTo = function() {
-    //    // TODO: Implement
-    //  };
-
-    //  contextPrototype.createPattern = function(image, repetition) {
-    //    return new CanvasPattern_(image, repetition);
-    //  };
-
-    //  // Gradient / Pattern Stubs
-    //  function CanvasGradient_(aType) {
-    //    this.type_ = aType;
-    //    this.x0_ = 0;
-    //    this.y0_ = 0;
-    //    this.r0_ = 0;
-    //    this.x1_ = 0;
-    //    this.y1_ = 0;
-    //    this.r1_ = 0;
-    //    this.colors_ = [];
-    //  }
-
-    //  CanvasGradient_.prototype.addColorStop = function(aOffset, aColor) {
-    //    aColor = processStyle(aColor);
-    //    this.colors_.push({offset: aOffset,
-    //                       color: aColor.color,
-    //                       alpha: aColor.alpha});
-    //  };
-
-    //  function CanvasPattern_(image, repetition) {
-    //    assertImageIsValid(image);
-    //    switch (repetition) {
-    //      case 'repeat':
-    //      case null:
-    //      case '':
-    //        this.repetition_ = 'repeat';
-    //        break
-    //      case 'repeat-x':
-    //      case 'repeat-y':
-    //      case 'no-repeat':
-    //        this.repetition_ = repetition;
-    //        break;
-    //      default:
-    //        throwException('SYNTAX_ERR');
-    //    }
-
-    //    this.src_ = image.src;
-    //    this.width_ = image.width;
-    //    this.height_ = image.height;
-    //  }
-
-    function throwException(s) {
-      throw new DOMException_(s);
-    }
-
-    //  function assertImageIsValid(img) {
-    //    if (!img || img.nodeType != 1 || img.tagName != 'IMG') {
-    //      throwException('TYPE_MISMATCH_ERR');
-    //    }
-    //    if (img.readyState != 'complete') {
-    //      throwException('INVALID_STATE_ERR');
-    //    }
-    //  }
-
-    function DOMException_(s) {
-      this.code = this[s];
-      this.message = s + ': DOM Exception ' + this.code;
-    }
-    var p = DOMException_.prototype = new Error;
-    p.INDEX_SIZE_ERR = 1;
-    p.DOMSTRING_SIZE_ERR = 2;
-    p.HIERARCHY_REQUEST_ERR = 3;
-    p.WRONG_DOCUMENT_ERR = 4;
-    p.INVALID_CHARACTER_ERR = 5;
-    p.NO_DATA_ALLOWED_ERR = 6;
-    p.NO_MODIFICATION_ALLOWED_ERR = 7;
-    p.NOT_FOUND_ERR = 8;
-    p.NOT_SUPPORTED_ERR = 9;
-    p.INUSE_ATTRIBUTE_ERR = 10;
-    p.INVALID_STATE_ERR = 11;
-    p.SYNTAX_ERR = 12;
-    p.INVALID_MODIFICATION_ERR = 13;
-    p.NAMESPACE_ERR = 14;
-    p.INVALID_ACCESS_ERR = 15;
-    p.VALIDATION_ERR = 16;
-    p.TYPE_MISMATCH_ERR = 17;
-
-    // set up externs
-    G_vmlCanvasManager = G_vmlCanvasManager_;
-    CanvasRenderingContext2D = CanvasRenderingContext2D_;
-    //CanvasGradient = CanvasGradient_;
-    //CanvasPattern = CanvasPattern_;
-    DOMException = DOMException_;
-  })();
-
-} // if
diff --git a/libs/js/jquery-geo-1.0b2/js/excanvas.min.js b/libs/js/jquery-geo-1.0b2/js/excanvas.min.js
deleted file mode 100755 (executable)
index f90001c..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2006 Google Inc.
-//
-// 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.
-document.createElement("canvas").getContext||function(){function j(){return this.context_||(this.context_=new I(this))}function l(a,b,c){var d=k.call(arguments,2);return function(){return a.apply(b,d.concat(k.call(arguments)))}}function m(a){return String(a).replace(/&/g,"&amp;").replace(/"/g,"&quot;")}function n(a,b,c){a.namespaces[b]||a.namespaces.add(b,c,"#default#VML")}function o(a){n(a,"g_vml_","urn:schemas-microsoft-com:vml"),n(a,"g_o_","urn:schemas-microsoft-com:office:office");if(!a.styleSheets.ex_canvas_){var b=a.createStyleSheet();b.owningElement.id="ex_canvas_",b.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}"}}function q(a){var b=a.srcElement;switch(a.propertyName){case"width":b.getContext().clearRect(),b.style.width=b.attributes.width.nodeValue+"px",b.firstChild.style.width=b.clientWidth+"px";break;case"height":b.getContext().clearRect(),b.style.height=b.attributes.height.nodeValue+"px",b.firstChild.style.height=b.clientHeight+"px"}}function r(a){var b=a.srcElement;b.firstChild&&(b.firstChild.style.width=b.clientWidth+"px",b.firstChild.style.height=b.clientHeight+"px")}function v(){return[[1,0,0],[0,1,0],[0,0,1]]}function w(a,b){var c=v();for(var d=0;d<3;d++)for(var e=0;e<3;e++){var f=0;for(var g=0;g<3;g++)f+=a[d][g]*b[g][e];c[d][e]=f}return c}function x(a,b){b.fillStyle=a.fillStyle,b.lineCap=a.lineCap,b.lineJoin=a.lineJoin,b.lineWidth=a.lineWidth,b.miterLimit=a.miterLimit,b.shadowBlur=a.shadowBlur,b.shadowColor=a.shadowColor,b.shadowOffsetX=a.shadowOffsetX,b.shadowOffsetY=a.shadowOffsetY,b.strokeStyle=a.strokeStyle,b.globalAlpha=a.globalAlpha,b.font=a.font,b.textAlign=a.textAlign,b.textBaseline=a.textBaseline,b.arcScaleX_=a.arcScaleX_,b.arcScaleY_=a.arcScaleY_,b.lineScale_=a.lineScale_}function y(a){var b=a.indexOf("(",3),c=a.indexOf(")",b+1),d=a.substring(b+1,c).split(",");if(d.length!=4||a.charAt(3)!="a")d[3]=1;return d}function z(a){return parseFloat(a)/100}function A(a,b,c){return Math.min(c,Math.max(b,a))}function B(a){var b,c,d,e,f,g;e=parseFloat(a[0])/360%360,e<0&&e++,f=A(z(a[1]),0,1),g=A(z(a[2]),0,1);if(f==0)b=c=d=g;else{var h=g<.5?g*(1+f):g+f-g*f,i=2*g-h;b=C(i,h,e+1/3),c=C(i,h,e),d=C(i,h,e-1/3)}return"#"+s[Math.floor(b*255)]+s[Math.floor(c*255)]+s[Math.floor(d*255)]}function C(a,b,c){return c<0&&c++,c>1&&c--,6*c<1?a+(b-a)*6*c:2*c<1?b:3*c<2?a+(b-a)*(2/3-c)*6:a}function E(a){if(a in D)return D[a];var b,c=1;a=String(a);if(a.charAt(0)=="#")b=a;else if(/^rgb/.test(a)){var d=y(a),b="#",e;for(var f=0;f<3;f++)d[f].indexOf("%")!=-1?e=Math.floor(z(d[f])*255):e=+d[f],b+=s[A(e,0,255)];c=+d[3]}else if(/^hsl/.test(a)){var d=y(a);b=B(d),c=d[3]}else b=a;return D[a]={color:b,alpha:c}}function H(a){return G[a]||"square"}function I(a){this.m_=v(),this.mStack_=[],this.aStack_=[],this.currentPath_=[],this.strokeStyle="#000",this.fillStyle="#000",this.lineWidth=1,this.lineJoin="miter",this.lineCap="butt",this.miterLimit=g*1,this.globalAlpha=1,this.canvas=a;var b="width:"+a.clientWidth+"px;height:"+a.clientHeight+"px;overflow:hidden;position:absolute",c=a.ownerDocument.createElement("div");c.style.cssText=b,a.appendChild(c);var d=c.cloneNode(!1);d.style.backgroundColor="red",d.style.filter="alpha(opacity=0)",a.appendChild(d),this.element_=c,this.arcScaleX_=1,this.arcScaleY_=1,this.lineScale_=1}function K(a,b,c,d){a.currentPath_.push({type:"bezierCurveTo",cp1x:b.x,cp1y:b.y,cp2x:c.x,cp2y:c.y,x:d.x,y:d.y}),a.currentX_=d.x,a.currentY_=d.y}function L(a,b){var c=E(a.strokeStyle),d=c.color,e=c.alpha*a.globalAlpha,f=a.lineScale_*a.lineWidth;f<1&&(e*=f),b.push("<g_vml_:stroke",' opacity="',e,'"',' joinstyle="',a.lineJoin,'"',' miterlimit="',a.miterLimit,'"',' endcap="',H(a.lineCap),'"',' weight="',f,'px"',' color="',d,'" />')}function M(a,b,c,d){var e=a.fillStyle,f=a.arcScaleX_,g=a.arcScaleY_,h=d.x-c.x,i=d.y-c.y,j=E(a.fillStyle),k=j.color,l=j.alpha*a.globalAlpha;b.push('<g_vml_:fill color="',k,'" opacity="',l,'" />')}function N(a,b,c){var d=a.m_;return{x:g*(b*d[0][0]+c*d[1][0]+d[2][0])-h,y:g*(b*d[0][1]+c*d[1][1]+d[2][1])-h}}function O(a){return isFinite(a[0][0])&&isFinite(a[0][1])&&isFinite(a[1][0])&&isFinite(a[1][1])&&isFinite(a[2][0])&&isFinite(a[2][1])}function P(a,b,c){if(!O(b))return;a.m_=b;if(c){var d=b[0][0]*b[1][1]-b[0][1]*b[1][0];a.lineScale_=f(e(d))}}function Q(a){throw new R(a)}function R(a){this.code=this[a],this.message=a+": DOM Exception "+this.code}var a=Math,b=a.round,c=a.sin,d=a.cos,e=a.abs,f=a.sqrt,g=10,h=g/2,i=+navigator.userAgent.match(/MSIE ([\d.]+)?/)[1],k=Array.prototype.slice;o(document);var p={init:function(a){var b=a||document;b.createElement("canvas"),b.attachEvent("onreadystatechange",l(this.init_,this,b))},init_:function(a){var b=a.getElementsByTagName("canvas");for(var c=0;c<b.length;c++)this.initElement(b[c])},initElement:function(a){if(!a.getContext){a.getContext=j,o(a.ownerDocument),a.innerHTML="",a.attachEvent("onpropertychange",q),a.attachEvent("onresize",r);var b=a.attributes;b.width&&b.width.specified?a.style.width=b.width.nodeValue+"px":a.width=a.clientWidth,b.height&&b.height.specified?a.style.height=b.height.nodeValue+"px":a.height=a.clientHeight}return a}};p.init();var s=[];for(var t=0;t<16;t++)for(var u=0;u<16;u++)s[t*16+u]=t.toString(16)+u.toString(16);var D={},F={style:"normal",variant:"normal",weight:"normal",size:10,family:"sans-serif"},G={butt:"flat",round:"round"},J=I.prototype;J.clearRect=function(){this.textMeasureEl_&&(this.textMeasureEl_.removeNode(!0),this.textMeasureEl_=null),this.element_.innerHTML=""},J.beginPath=function(){this.currentPath_=[]},J.moveTo=function(a,b){var c=N(this,a,b);this.currentPath_.push({type:"moveTo",x:c.x,y:c.y}),this.currentX_=c.x,this.currentY_=c.y},J.lineTo=function(a,b){var c=N(this,a,b);this.currentPath_.push({type:"lineTo",x:c.x,y:c.y}),this.currentX_=c.x,this.currentY_=c.y},J.bezierCurveTo=function(a,b,c,d,e,f){var g=N(this,e,f),h=N(this,a,b),i=N(this,c,d);K(this,h,i,g)},J.quadraticCurveTo=function(a,b,c,d){var e=N(this,a,b),f=N(this,c,d),g={x:this.currentX_+2/3*(e.x-this.currentX_),y:this.currentY_+2/3*(e.y-this.currentY_)},h={x:g.x+(f.x-this.currentX_)/3,y:g.y+(f.y-this.currentY_)/3};K(this,g,h,f)},J.arc=function(a,b,e,f,i,j){e*=g;var k=j?"at":"wa",l=a+d(f)*e-h,m=b+c(f)*e-h,n=a+d(i)*e-h,o=b+c(i)*e-h;l==n&&!j&&(l+=.125);var p=N(this,a,b),q=N(this,l,m),r=N(this,n,o);this.currentPath_.push({type:k,x:p.x,y:p.y,radius:e,xStart:q.x,yStart:q.y,xEnd:r.x,yEnd:r.y})},J.stroke=function(a){var c=[],d=!1,e=10,f=10;c.push("<g_vml_:shape",' filled="',!!a,'"',' style="position:absolute;width:',e,"px;height:",f,'px;"',' coordorigin="0,0"',' coordsize="',g*e,",",g*f,'"',' stroked="',!a,'"',' path="');var h=!1,i={x:null,y:null},j={x:null,y:null};for(var k=0;k<this.currentPath_.length;k++){var l=this.currentPath_[k],m;switch(l.type){case"moveTo":m=l,c.push(" m ",b(l.x),",",b(l.y));break;case"lineTo":c.push(" l ",b(l.x),",",b(l.y));break;case"close":c.push(" x "),l=null;break;case"bezierCurveTo":c.push(" c ",b(l.cp1x),",",b(l.cp1y),",",b(l.cp2x),",",b(l.cp2y),",",b(l.x),",",b(l.y));break;case"at":case"wa":c.push(" ",l.type," ",b(l.x-this.arcScaleX_*l.radius),",",b(l.y-this.arcScaleY_*l.radius)," ",b(l.x+this.arcScaleX_*l.radius),",",b(l.y+this.arcScaleY_*l.radius)," ",b(l.xStart),",",b(l.yStart)," ",b(l.xEnd),",",b(l.yEnd))}if(l){if(i.x==null||l.x<i.x)i.x=l.x;if(j.x==null||l.x>j.x)j.x=l.x;if(i.y==null||l.y<i.y)i.y=l.y;if(j.y==null||l.y>j.y)j.y=l.y}}c.push(' ">'),a?M(this,c,i,j):L(this,c),c.push("</g_vml_:shape>"),this.element_.insertAdjacentHTML("beforeEnd",c.join(""))},J.fill=function(){this.stroke(!0)},J.closePath=function(){this.currentPath_.push({type:"close"})},J.save=function(){var a={};x(this,a),this.aStack_.push(a),this.mStack_.push(this.m_),this.m_=w(v(),this.m_)},J.restore=function(){this.aStack_.length&&(x(this.aStack_.pop(),this),this.m_=this.mStack_.pop())},J.translate=function(a,b){var c=[[1,0,0],[0,1,0],[a,b,1]];P(this,w(c,this.m_),!1)},J.scale=function(a,b){this.arcScaleX_*=a,this.arcScaleY_*=b;var c=[[a,0,0],[0,b,0],[0,0,1]];P(this,w(c,this.m_),!0)};var S=R.prototype=new Error;S.INDEX_SIZE_ERR=1,S.DOMSTRING_SIZE_ERR=2,S.HIERARCHY_REQUEST_ERR=3,S.WRONG_DOCUMENT_ERR=4,S.INVALID_CHARACTER_ERR=5,S.NO_DATA_ALLOWED_ERR=6,S.NO_MODIFICATION_ALLOWED_ERR=7,S.NOT_FOUND_ERR=8,S.NOT_SUPPORTED_ERR=9,S.INUSE_ATTRIBUTE_ERR=10,S.INVALID_STATE_ERR=11,S.SYNTAX_ERR=12,S.INVALID_MODIFICATION_ERR=13,S.NAMESPACE_ERR=14,S.INVALID_ACCESS_ERR=15,S.VALIDATION_ERR=16,S.TYPE_MISMATCH_ERR=17,G_vmlCanvasManager=p,CanvasRenderingContext2D=I,DOMException=R}()
diff --git a/libs/js/jquery-geo-1.0b2/js/jquery-1.7.2.js b/libs/js/jquery-geo-1.0b2/js/jquery-1.7.2.js
deleted file mode 100755 (executable)
index 3774ff9..0000000
+++ /dev/null
@@ -1,9404 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.7.2
- * http://jquery.com/
- *
- * Copyright 2011, John Resig
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- * Copyright 2011, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- *
- * Date: Wed Mar 21 12:46:34 2012 -0700
- */
-(function( window, undefined ) {
-
-// Use the correct document accordingly with window argument (sandbox)
-var document = window.document,
-       navigator = window.navigator,
-       location = window.location;
-var jQuery = (function() {
-
-// Define a local copy of jQuery
-var jQuery = function( selector, context ) {
-               // The jQuery object is actually just the init constructor 'enhanced'
-               return new jQuery.fn.init( selector, context, rootjQuery );
-       },
-
-       // Map over jQuery in case of overwrite
-       _jQuery = window.jQuery,
-
-       // Map over the $ in case of overwrite
-       _$ = window.$,
-
-       // A central reference to the root jQuery(document)
-       rootjQuery,
-
-       // A simple way to check for HTML strings or ID strings
-       // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
-       quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
-
-       // Check if a string has a non-whitespace character in it
-       rnotwhite = /\S/,
-
-       // Used for trimming whitespace
-       trimLeft = /^\s+/,
-       trimRight = /\s+$/,
-
-       // Match a standalone tag
-       rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
-
-       // JSON RegExp
-       rvalidchars = /^[\],:{}\s]*$/,
-       rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
-       rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
-       rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
-
-       // Useragent RegExp
-       rwebkit = /(webkit)[ \/]([\w.]+)/,
-       ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
-       rmsie = /(msie) ([\w.]+)/,
-       rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
-
-       // Matches dashed string for camelizing
-       rdashAlpha = /-([a-z]|[0-9])/ig,
-       rmsPrefix = /^-ms-/,
-
-       // Used by jQuery.camelCase as callback to replace()
-       fcamelCase = function( all, letter ) {
-               return ( letter + "" ).toUpperCase();
-       },
-
-       // Keep a UserAgent string for use with jQuery.browser
-       userAgent = navigator.userAgent,
-
-       // For matching the engine and version of the browser
-       browserMatch,
-
-       // The deferred used on DOM ready
-       readyList,
-
-       // The ready event handler
-       DOMContentLoaded,
-
-       // Save a reference to some core methods
-       toString = Object.prototype.toString,
-       hasOwn = Object.prototype.hasOwnProperty,
-       push = Array.prototype.push,
-       slice = Array.prototype.slice,
-       trim = String.prototype.trim,
-       indexOf = Array.prototype.indexOf,
-
-       // [[Class]] -> type pairs
-       class2type = {};
-
-jQuery.fn = jQuery.prototype = {
-       constructor: jQuery,
-       init: function( selector, context, rootjQuery ) {
-               var match, elem, ret, doc;
-
-               // Handle $(""), $(null), or $(undefined)
-               if ( !selector ) {
-                       return this;
-               }
-
-               // Handle $(DOMElement)
-               if ( selector.nodeType ) {
-                       this.context = this[0] = selector;
-                       this.length = 1;
-                       return this;
-               }
-
-               // The body element only exists once, optimize finding it
-               if ( selector === "body" && !context && document.body ) {
-                       this.context = document;
-                       this[0] = document.body;
-                       this.selector = selector;
-                       this.length = 1;
-                       return this;
-               }
-
-               // Handle HTML strings
-               if ( typeof selector === "string" ) {
-                       // Are we dealing with HTML string or an ID?
-                       if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
-                               // Assume that strings that start and end with <> are HTML and skip the regex check
-                               match = [ null, selector, null ];
-
-                       } else {
-                               match = quickExpr.exec( selector );
-                       }
-
-                       // Verify a match, and that no context was specified for #id
-                       if ( match && (match[1] || !context) ) {
-
-                               // HANDLE: $(html) -> $(array)
-                               if ( match[1] ) {
-                                       context = context instanceof jQuery ? context[0] : context;
-                                       doc = ( context ? context.ownerDocument || context : document );
-
-                                       // If a single string is passed in and it's a single tag
-                                       // just do a createElement and skip the rest
-                                       ret = rsingleTag.exec( selector );
-
-                                       if ( ret ) {
-                                               if ( jQuery.isPlainObject( context ) ) {
-                                                       selector = [ document.createElement( ret[1] ) ];
-                                                       jQuery.fn.attr.call( selector, context, true );
-
-                                               } else {
-                                                       selector = [ doc.createElement( ret[1] ) ];
-                                               }
-
-                                       } else {
-                                               ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
-                                               selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
-                                       }
-
-                                       return jQuery.merge( this, selector );
-
-                               // HANDLE: $("#id")
-                               } else {
-                                       elem = document.getElementById( match[2] );
-
-                                       // Check parentNode to catch when Blackberry 4.6 returns
-                                       // nodes that are no longer in the document #6963
-                                       if ( elem && elem.parentNode ) {
-                                               // Handle the case where IE and Opera return items
-                                               // by name instead of ID
-                                               if ( elem.id !== match[2] ) {
-                                                       return rootjQuery.find( selector );
-                                               }
-
-                                               // Otherwise, we inject the element directly into the jQuery object
-                                               this.length = 1;
-                                               this[0] = elem;
-                                       }
-
-                                       this.context = document;
-                                       this.selector = selector;
-                                       return this;
-                               }
-
-                       // HANDLE: $(expr, $(...))
-                       } else if ( !context || context.jquery ) {
-                               return ( context || rootjQuery ).find( selector );
-
-                       // HANDLE: $(expr, context)
-                       // (which is just equivalent to: $(context).find(expr)
-                       } else {
-                               return this.constructor( context ).find( selector );
-                       }
-
-               // HANDLE: $(function)
-               // Shortcut for document ready
-               } else if ( jQuery.isFunction( selector ) ) {
-                       return rootjQuery.ready( selector );
-               }
-
-               if ( selector.selector !== undefined ) {
-                       this.selector = selector.selector;
-                       this.context = selector.context;
-               }
-
-               return jQuery.makeArray( selector, this );
-       },
-
-       // Start with an empty selector
-       selector: "",
-
-       // The current version of jQuery being used
-       jquery: "1.7.2",
-
-       // The default length of a jQuery object is 0
-       length: 0,
-
-       // The number of elements contained in the matched element set
-       size: function() {
-               return this.length;
-       },
-
-       toArray: function() {
-               return slice.call( this, 0 );
-       },
-
-       // Get the Nth element in the matched element set OR
-       // Get the whole matched element set as a clean array
-       get: function( num ) {
-               return num == null ?
-
-                       // Return a 'clean' array
-                       this.toArray() :
-
-                       // Return just the object
-                       ( num < 0 ? this[ this.length + num ] : this[ num ] );
-       },
-
-       // Take an array of elements and push it onto the stack
-       // (returning the new matched element set)
-       pushStack: function( elems, name, selector ) {
-               // Build a new jQuery matched element set
-               var ret = this.constructor();
-
-               if ( jQuery.isArray( elems ) ) {
-                       push.apply( ret, elems );
-
-               } else {
-                       jQuery.merge( ret, elems );
-               }
-
-               // Add the old object onto the stack (as a reference)
-               ret.prevObject = this;
-
-               ret.context = this.context;
-
-               if ( name === "find" ) {
-                       ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
-               } else if ( name ) {
-                       ret.selector = this.selector + "." + name + "(" + selector + ")";
-               }
-
-               // Return the newly-formed element set
-               return ret;
-       },
-
-       // Execute a callback for every element in the matched set.
-       // (You can seed the arguments with an array of args, but this is
-       // only used internally.)
-       each: function( callback, args ) {
-               return jQuery.each( this, callback, args );
-       },
-
-       ready: function( fn ) {
-               // Attach the listeners
-               jQuery.bindReady();
-
-               // Add the callback
-               readyList.add( fn );
-
-               return this;
-       },
-
-       eq: function( i ) {
-               i = +i;
-               return i === -1 ?
-                       this.slice( i ) :
-                       this.slice( i, i + 1 );
-       },
-
-       first: function() {
-               return this.eq( 0 );
-       },
-
-       last: function() {
-               return this.eq( -1 );
-       },
-
-       slice: function() {
-               return this.pushStack( slice.apply( this, arguments ),
-                       "slice", slice.call(arguments).join(",") );
-       },
-
-       map: function( callback ) {
-               return this.pushStack( jQuery.map(this, function( elem, i ) {
-                       return callback.call( elem, i, elem );
-               }));
-       },
-
-       end: function() {
-               return this.prevObject || this.constructor(null);
-       },
-
-       // For internal use only.
-       // Behaves like an Array's method, not like a jQuery method.
-       push: push,
-       sort: [].sort,
-       splice: [].splice
-};
-
-// Give the init function the jQuery prototype for later instantiation
-jQuery.fn.init.prototype = jQuery.fn;
-
-jQuery.extend = jQuery.fn.extend = function() {
-       var options, name, src, copy, copyIsArray, clone,
-               target = arguments[0] || {},
-               i = 1,
-               length = arguments.length,
-               deep = false;
-
-       // Handle a deep copy situation
-       if ( typeof target === "boolean" ) {
-               deep = target;
-               target = arguments[1] || {};
-               // skip the boolean and the target
-               i = 2;
-       }
-
-       // Handle case when target is a string or something (possible in deep copy)
-       if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
-               target = {};
-       }
-
-       // extend jQuery itself if only one argument is passed
-       if ( length === i ) {
-               target = this;
-               --i;
-       }
-
-       for ( ; i < length; i++ ) {
-               // Only deal with non-null/undefined values
-               if ( (options = arguments[ i ]) != null ) {
-                       // Extend the base object
-                       for ( name in options ) {
-                               src = target[ name ];
-                               copy = options[ name ];
-
-                               // Prevent never-ending loop
-                               if ( target === copy ) {
-                                       continue;
-                               }
-
-                               // Recurse if we're merging plain objects or arrays
-                               if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
-                                       if ( copyIsArray ) {
-                                               copyIsArray = false;
-                                               clone = src && jQuery.isArray(src) ? src : [];
-
-                                       } else {
-                                               clone = src && jQuery.isPlainObject(src) ? src : {};
-                                       }
-
-                                       // Never move original objects, clone them
-                                       target[ name ] = jQuery.extend( deep, clone, copy );
-
-                               // Don't bring in undefined values
-                               } else if ( copy !== undefined ) {
-                                       target[ name ] = copy;
-                               }
-                       }
-               }
-       }
-
-       // Return the modified object
-       return target;
-};
-
-jQuery.extend({
-       noConflict: function( deep ) {
-               if ( window.$ === jQuery ) {
-                       window.$ = _$;
-               }
-
-               if ( deep && window.jQuery === jQuery ) {
-                       window.jQuery = _jQuery;
-               }
-
-               return jQuery;
-       },
-
-       // Is the DOM ready to be used? Set to true once it occurs.
-       isReady: false,
-
-       // A counter to track how many items to wait for before
-       // the ready event fires. See #6781
-       readyWait: 1,
-
-       // Hold (or release) the ready event
-       holdReady: function( hold ) {
-               if ( hold ) {
-                       jQuery.readyWait++;
-               } else {
-                       jQuery.ready( true );
-               }
-       },
-
-       // Handle when the DOM is ready
-       ready: function( wait ) {
-               // Either a released hold or an DOMready/load event and not yet ready
-               if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
-                       // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
-                       if ( !document.body ) {
-                               return setTimeout( jQuery.ready, 1 );
-                       }
-
-                       // Remember that the DOM is ready
-                       jQuery.isReady = true;
-
-                       // If a normal DOM Ready event fired, decrement, and wait if need be
-                       if ( wait !== true && --jQuery.readyWait > 0 ) {
-                               return;
-                       }
-
-                       // If there are functions bound, to execute
-                       readyList.fireWith( document, [ jQuery ] );
-
-                       // Trigger any bound ready events
-                       if ( jQuery.fn.trigger ) {
-                               jQuery( document ).trigger( "ready" ).off( "ready" );
-                       }
-               }
-       },
-
-       bindReady: function() {
-               if ( readyList ) {
-                       return;
-               }
-
-               readyList = jQuery.Callbacks( "once memory" );
-
-               // Catch cases where $(document).ready() is called after the
-               // browser event has already occurred.
-               if ( document.readyState === "complete" ) {
-                       // Handle it asynchronously to allow scripts the opportunity to delay ready
-                       return setTimeout( jQuery.ready, 1 );
-               }
-
-               // Mozilla, Opera and webkit nightlies currently support this event
-               if ( document.addEventListener ) {
-                       // Use the handy event callback
-                       document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
-
-                       // A fallback to window.onload, that will always work
-                       window.addEventListener( "load", jQuery.ready, false );
-
-               // If IE event model is used
-               } else if ( document.attachEvent ) {
-                       // ensure firing before onload,
-                       // maybe late but safe also for iframes
-                       document.attachEvent( "onreadystatechange", DOMContentLoaded );
-
-                       // A fallback to window.onload, that will always work
-                       window.attachEvent( "onload", jQuery.ready );
-
-                       // If IE and not a frame
-                       // continually check to see if the document is ready
-                       var toplevel = false;
-
-                       try {
-                               toplevel = window.frameElement == null;
-                       } catch(e) {}
-
-                       if ( document.documentElement.doScroll && toplevel ) {
-                               doScrollCheck();
-                       }
-               }
-       },
-
-       // See test/unit/core.js for details concerning isFunction.
-       // Since version 1.3, DOM methods and functions like alert
-       // aren't supported. They return false on IE (#2968).
-       isFunction: function( obj ) {
-               return jQuery.type(obj) === "function";
-       },
-
-       isArray: Array.isArray || function( obj ) {
-               return jQuery.type(obj) === "array";
-       },
-
-       isWindow: function( obj ) {
-               return obj != null && obj == obj.window;
-       },
-
-       isNumeric: function( obj ) {
-               return !isNaN( parseFloat(obj) ) && isFinite( obj );
-       },
-
-       type: function( obj ) {
-               return obj == null ?
-                       String( obj ) :
-                       class2type[ toString.call(obj) ] || "object";
-       },
-
-       isPlainObject: function( obj ) {
-               // Must be an Object.
-               // Because of IE, we also have to check the presence of the constructor property.
-               // Make sure that DOM nodes and window objects don't pass through, as well
-               if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
-                       return false;
-               }
-
-               try {
-                       // Not own constructor property must be Object
-                       if ( obj.constructor &&
-                               !hasOwn.call(obj, "constructor") &&
-                               !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
-                               return false;
-                       }
-               } catch ( e ) {
-                       // IE8,9 Will throw exceptions on certain host objects #9897
-                       return false;
-               }
-
-               // Own properties are enumerated firstly, so to speed up,
-               // if last one is own, then all properties are own.
-
-               var key;
-               for ( key in obj ) {}
-
-               return key === undefined || hasOwn.call( obj, key );
-       },
-
-       isEmptyObject: function( obj ) {
-               for ( var name in obj ) {
-                       return false;
-               }
-               return true;
-       },
-
-       error: function( msg ) {
-               throw new Error( msg );
-       },
-
-       parseJSON: function( data ) {
-               if ( typeof data !== "string" || !data ) {
-                       return null;
-               }
-
-               // Make sure leading/trailing whitespace is removed (IE can't handle it)
-               data = jQuery.trim( data );
-
-               // Attempt to parse using the native JSON parser first
-               if ( window.JSON && window.JSON.parse ) {
-                       return window.JSON.parse( data );
-               }
-
-               // Make sure the incoming data is actual JSON
-               // Logic borrowed from http://json.org/json2.js
-               if ( rvalidchars.test( data.replace( rvalidescape, "@" )
-                       .replace( rvalidtokens, "]" )
-                       .replace( rvalidbraces, "")) ) {
-
-                       return ( new Function( "return " + data ) )();
-
-               }
-               jQuery.error( "Invalid JSON: " + data );
-       },
-
-       // Cross-browser xml parsing
-       parseXML: function( data ) {
-               if ( typeof data !== "string" || !data ) {
-                       return null;
-               }
-               var xml, tmp;
-               try {
-                       if ( window.DOMParser ) { // Standard
-                               tmp = new DOMParser();
-                               xml = tmp.parseFromString( data , "text/xml" );
-                       } else { // IE
-                               xml = new ActiveXObject( "Microsoft.XMLDOM" );
-                               xml.async = "false";
-                               xml.loadXML( data );
-                       }
-               } catch( e ) {
-                       xml = undefined;
-               }
-               if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
-                       jQuery.error( "Invalid XML: " + data );
-               }
-               return xml;
-       },
-
-       noop: function() {},
-
-       // Evaluates a script in a global context
-       // Workarounds based on findings by Jim Driscoll
-       // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
-       globalEval: function( data ) {
-               if ( data && rnotwhite.test( data ) ) {
-                       // We use execScript on Internet Explorer
-                       // We use an anonymous function so that context is window
-                       // rather than jQuery in Firefox
-                       ( window.execScript || function( data ) {
-                               window[ "eval" ].call( window, data );
-                       } )( data );
-               }
-       },
-
-       // Convert dashed to camelCase; used by the css and data modules
-       // Microsoft forgot to hump their vendor prefix (#9572)
-       camelCase: function( string ) {
-               return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
-       },
-
-       nodeName: function( elem, name ) {
-               return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
-       },
-
-       // args is for internal usage only
-       each: function( object, callback, args ) {
-               var name, i = 0,
-                       length = object.length,
-                       isObj = length === undefined || jQuery.isFunction( object );
-
-               if ( args ) {
-                       if ( isObj ) {
-                               for ( name in object ) {
-                                       if ( callback.apply( object[ name ], args ) === false ) {
-                                               break;
-                                       }
-                               }
-                       } else {
-                               for ( ; i < length; ) {
-                                       if ( callback.apply( object[ i++ ], args ) === false ) {
-                                               break;
-                                       }
-                               }
-                       }
-
-               // A special, fast, case for the most common use of each
-               } else {
-                       if ( isObj ) {
-                               for ( name in object ) {
-                                       if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
-                                               break;
-                                       }
-                               }
-                       } else {
-                               for ( ; i < length; ) {
-                                       if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
-                                               break;
-                                       }
-                               }
-                       }
-               }
-
-               return object;
-       },
-
-       // Use native String.trim function wherever possible
-       trim: trim ?
-               function( text ) {
-                       return text == null ?
-                               "" :
-                               trim.call( text );
-               } :
-
-               // Otherwise use our own trimming functionality
-               function( text ) {
-                       return text == null ?
-                               "" :
-                               text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
-               },
-
-       // results is for internal usage only
-       makeArray: function( array, results ) {
-               var ret = results || [];
-
-               if ( array != null ) {
-                       // The window, strings (and functions) also have 'length'
-                       // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
-                       var type = jQuery.type( array );
-
-                       if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
-                               push.call( ret, array );
-                       } else {
-                               jQuery.merge( ret, array );
-                       }
-               }
-
-               return ret;
-       },
-
-       inArray: function( elem, array, i ) {
-               var len;
-
-               if ( array ) {
-                       if ( indexOf ) {
-                               return indexOf.call( array, elem, i );
-                       }
-
-                       len = array.length;
-                       i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
-
-                       for ( ; i < len; i++ ) {
-                               // Skip accessing in sparse arrays
-                               if ( i in array && array[ i ] === elem ) {
-                                       return i;
-                               }
-                       }
-               }
-
-               return -1;
-       },
-
-       merge: function( first, second ) {
-               var i = first.length,
-                       j = 0;
-
-               if ( typeof second.length === "number" ) {
-                       for ( var l = second.length; j < l; j++ ) {
-                               first[ i++ ] = second[ j ];
-                       }
-
-               } else {
-                       while ( second[j] !== undefined ) {
-                               first[ i++ ] = second[ j++ ];
-                       }
-               }
-
-               first.length = i;
-
-               return first;
-       },
-
-       grep: function( elems, callback, inv ) {
-               var ret = [], retVal;
-               inv = !!inv;
-
-               // Go through the array, only saving the items
-               // that pass the validator function
-               for ( var i = 0, length = elems.length; i < length; i++ ) {
-                       retVal = !!callback( elems[ i ], i );
-                       if ( inv !== retVal ) {
-                               ret.push( elems[ i ] );
-                       }
-               }
-
-               return ret;
-       },
-
-       // arg is for internal usage only
-       map: function( elems, callback, arg ) {
-               var value, key, ret = [],
-                       i = 0,
-                       length = elems.length,
-                       // jquery objects are treated as arrays
-                       isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
-
-               // Go through the array, translating each of the items to their
-               if ( isArray ) {
-                       for ( ; i < length; i++ ) {
-                               value = callback( elems[ i ], i, arg );
-
-                               if ( value != null ) {
-                                       ret[ ret.length ] = value;
-                               }
-                       }
-
-               // Go through every key on the object,
-               } else {
-                       for ( key in elems ) {
-                               value = callback( elems[ key ], key, arg );
-
-                               if ( value != null ) {
-                                       ret[ ret.length ] = value;
-                               }
-                       }
-               }
-
-               // Flatten any nested arrays
-               return ret.concat.apply( [], ret );
-       },
-
-       // A global GUID counter for objects
-       guid: 1,
-
-       // Bind a function to a context, optionally partially applying any
-       // arguments.
-       proxy: function( fn, context ) {
-               if ( typeof context === "string" ) {
-                       var tmp = fn[ context ];
-                       context = fn;
-                       fn = tmp;
-               }
-
-               // Quick check to determine if target is callable, in the spec
-               // this throws a TypeError, but we will just return undefined.
-               if ( !jQuery.isFunction( fn ) ) {
-                       return undefined;
-               }
-
-               // Simulated bind
-               var args = slice.call( arguments, 2 ),
-                       proxy = function() {
-                               return fn.apply( context, args.concat( slice.call( arguments ) ) );
-                       };
-
-               // Set the guid of unique handler to the same of original handler, so it can be removed
-               proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
-
-               return proxy;
-       },
-
-       // Mutifunctional method to get and set values to a collection
-       // The value/s can optionally be executed if it's a function
-       access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
-               var exec,
-                       bulk = key == null,
-                       i = 0,
-                       length = elems.length;
-
-               // Sets many values
-               if ( key && typeof key === "object" ) {
-                       for ( i in key ) {
-                               jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );
-                       }
-                       chainable = 1;
-
-               // Sets one value
-               } else if ( value !== undefined ) {
-                       // Optionally, function values get executed if exec is true
-                       exec = pass === undefined && jQuery.isFunction( value );
-
-                       if ( bulk ) {
-                               // Bulk operations only iterate when executing function values
-                               if ( exec ) {
-                                       exec = fn;
-                                       fn = function( elem, key, value ) {
-                                               return exec.call( jQuery( elem ), value );
-                                       };
-
-                               // Otherwise they run against the entire set
-                               } else {
-                                       fn.call( elems, value );
-                                       fn = null;
-                               }
-                       }
-
-                       if ( fn ) {
-                               for (; i < length; i++ ) {
-                                       fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
-                               }
-                       }
-
-                       chainable = 1;
-               }
-
-               return chainable ?
-                       elems :
-
-                       // Gets
-                       bulk ?
-                               fn.call( elems ) :
-                               length ? fn( elems[0], key ) : emptyGet;
-       },
-
-       now: function() {
-               return ( new Date() ).getTime();
-       },
-
-       // Use of jQuery.browser is frowned upon.
-       // More details: http://docs.jquery.com/Utilities/jQuery.browser
-       uaMatch: function( ua ) {
-               ua = ua.toLowerCase();
-
-               var match = rwebkit.exec( ua ) ||
-                       ropera.exec( ua ) ||
-                       rmsie.exec( ua ) ||
-                       ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
-                       [];
-
-               return { browser: match[1] || "", version: match[2] || "0" };
-       },
-
-       sub: function() {
-               function jQuerySub( selector, context ) {
-                       return new jQuerySub.fn.init( selector, context );
-               }
-               jQuery.extend( true, jQuerySub, this );
-               jQuerySub.superclass = this;
-               jQuerySub.fn = jQuerySub.prototype = this();
-               jQuerySub.fn.constructor = jQuerySub;
-               jQuerySub.sub = this.sub;
-               jQuerySub.fn.init = function init( selector, context ) {
-                       if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
-                               context = jQuerySub( context );
-                       }
-
-                       return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
-               };
-               jQuerySub.fn.init.prototype = jQuerySub.fn;
-               var rootjQuerySub = jQuerySub(document);
-               return jQuerySub;
-       },
-
-       browser: {}
-});
-
-// Populate the class2type map
-jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
-       class2type[ "[object " + name + "]" ] = name.toLowerCase();
-});
-
-browserMatch = jQuery.uaMatch( userAgent );
-if ( browserMatch.browser ) {
-       jQuery.browser[ browserMatch.browser ] = true;
-       jQuery.browser.version = browserMatch.version;
-}
-
-// Deprecated, use jQuery.browser.webkit instead
-if ( jQuery.browser.webkit ) {
-       jQuery.browser.safari = true;
-}
-
-// IE doesn't match non-breaking spaces with \s
-if ( rnotwhite.test( "\xA0" ) ) {
-       trimLeft = /^[\s\xA0]+/;
-       trimRight = /[\s\xA0]+$/;
-}
-
-// All jQuery objects should point back to these
-rootjQuery = jQuery(document);
-
-// Cleanup functions for the document ready method
-if ( document.addEventListener ) {
-       DOMContentLoaded = function() {
-               document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
-               jQuery.ready();
-       };
-
-} else if ( document.attachEvent ) {
-       DOMContentLoaded = function() {
-               // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
-               if ( document.readyState === "complete" ) {
-                       document.detachEvent( "onreadystatechange", DOMContentLoaded );
-                       jQuery.ready();
-               }
-       };
-}
-
-// The DOM ready check for Internet Explorer
-function doScrollCheck() {
-       if ( jQuery.isReady ) {
-               return;
-       }
-
-       try {
-               // If IE is used, use the trick by Diego Perini
-               // http://javascript.nwbox.com/IEContentLoaded/
-               document.documentElement.doScroll("left");
-       } catch(e) {
-               setTimeout( doScrollCheck, 1 );
-               return;
-       }
-
-       // and execute any waiting functions
-       jQuery.ready();
-}
-
-return jQuery;
-
-})();
-
-
-// String to Object flags format cache
-var flagsCache = {};
-
-// Convert String-formatted flags into Object-formatted ones and store in cache
-function createFlags( flags ) {
-       var object = flagsCache[ flags ] = {},
-               i, length;
-       flags = flags.split( /\s+/ );
-       for ( i = 0, length = flags.length; i < length; i++ ) {
-               object[ flags[i] ] = true;
-       }
-       return object;
-}
-
-/*
- * Create a callback list using the following parameters:
- *
- *     flags:  an optional list of space-separated flags that will change how
- *                     the callback list behaves
- *
- * By default a callback list will act like an event callback list and can be
- * "fired" multiple times.
- *
- * Possible flags:
- *
- *     once:                   will ensure the callback list can only be fired once (like a Deferred)
- *
- *     memory:                 will keep track of previous values and will call any callback added
- *                                     after the list has been fired right away with the latest "memorized"
- *                                     values (like a Deferred)
- *
- *     unique:                 will ensure a callback can only be added once (no duplicate in the list)
- *
- *     stopOnFalse:    interrupt callings when a callback returns false
- *
- */
-jQuery.Callbacks = function( flags ) {
-
-       // Convert flags from String-formatted to Object-formatted
-       // (we check in cache first)
-       flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
-
-       var // Actual callback list
-               list = [],
-               // Stack of fire calls for repeatable lists
-               stack = [],
-               // Last fire value (for non-forgettable lists)
-               memory,
-               // Flag to know if list was already fired
-               fired,
-               // Flag to know if list is currently firing
-               firing,
-               // First callback to fire (used internally by add and fireWith)
-               firingStart,
-               // End of the loop when firing
-               firingLength,
-               // Index of currently firing callback (modified by remove if needed)
-               firingIndex,
-               // Add one or several callbacks to the list
-               add = function( args ) {
-                       var i,
-                               length,
-                               elem,
-                               type,
-                               actual;
-                       for ( i = 0, length = args.length; i < length; i++ ) {
-                               elem = args[ i ];
-                               type = jQuery.type( elem );
-                               if ( type === "array" ) {
-                                       // Inspect recursively
-                                       add( elem );
-                               } else if ( type === "function" ) {
-                                       // Add if not in unique mode and callback is not in
-                                       if ( !flags.unique || !self.has( elem ) ) {
-                                               list.push( elem );
-                                       }
-                               }
-                       }
-               },
-               // Fire callbacks
-               fire = function( context, args ) {
-                       args = args || [];
-                       memory = !flags.memory || [ context, args ];
-                       fired = true;
-                       firing = true;
-                       firingIndex = firingStart || 0;
-                       firingStart = 0;
-                       firingLength = list.length;
-                       for ( ; list && firingIndex < firingLength; firingIndex++ ) {
-                               if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
-                                       memory = true; // Mark as halted
-                                       break;
-                               }
-                       }
-                       firing = false;
-                       if ( list ) {
-                               if ( !flags.once ) {
-                                       if ( stack && stack.length ) {
-                                               memory = stack.shift();
-                                               self.fireWith( memory[ 0 ], memory[ 1 ] );
-                                       }
-                               } else if ( memory === true ) {
-                                       self.disable();
-                               } else {
-                                       list = [];
-                               }
-                       }
-               },
-               // Actual Callbacks object
-               self = {
-                       // Add a callback or a collection of callbacks to the list
-                       add: function() {
-                               if ( list ) {
-                                       var length = list.length;
-                                       add( arguments );
-                                       // Do we need to add the callbacks to the
-                                       // current firing batch?
-                                       if ( firing ) {
-                                               firingLength = list.length;
-                                       // With memory, if we're not firing then
-                                       // we should call right away, unless previous
-                                       // firing was halted (stopOnFalse)
-                                       } else if ( memory && memory !== true ) {
-                                               firingStart = length;
-                                               fire( memory[ 0 ], memory[ 1 ] );
-                                       }
-                               }
-                               return this;
-                       },
-                       // Remove a callback from the list
-                       remove: function() {
-                               if ( list ) {
-                                       var args = arguments,
-                                               argIndex = 0,
-                                               argLength = args.length;
-                                       for ( ; argIndex < argLength ; argIndex++ ) {
-                                               for ( var i = 0; i < list.length; i++ ) {
-                                                       if ( args[ argIndex ] === list[ i ] ) {
-                                                               // Handle firingIndex and firingLength
-                                                               if ( firing ) {
-                                                                       if ( i <= firingLength ) {
-                                                                               firingLength--;
-                                                                               if ( i <= firingIndex ) {
-                                                                                       firingIndex--;
-                                                                               }
-                                                                       }
-                                                               }
-                                                               // Remove the element
-                                                               list.splice( i--, 1 );
-                                                               // If we have some unicity property then
-                                                               // we only need to do this once
-                                                               if ( flags.unique ) {
-                                                                       break;
-                                                               }
-                                                       }
-                                               }
-                                       }
-                               }
-                               return this;
-                       },
-                       // Control if a given callback is in the list
-                       has: function( fn ) {
-                               if ( list ) {
-                                       var i = 0,
-                                               length = list.length;
-                                       for ( ; i < length; i++ ) {
-                                               if ( fn === list[ i ] ) {
-                                                       return true;
-                                               }
-                                       }
-                               }
-                               return false;
-                       },
-                       // Remove all callbacks from the list
-                       empty: function() {
-                               list = [];
-                               return this;
-                       },
-                       // Have the list do nothing anymore
-                       disable: function() {
-                               list = stack = memory = undefined;
-                               return this;
-                       },
-                       // Is it disabled?
-                       disabled: function() {
-                               return !list;
-                       },
-                       // Lock the list in its current state
-                       lock: function() {
-                               stack = undefined;
-                               if ( !memory || memory === true ) {
-                                       self.disable();
-                               }
-                               return this;
-                       },
-                       // Is it locked?
-                       locked: function() {
-                               return !stack;
-                       },
-                       // Call all callbacks with the given context and arguments
-                       fireWith: function( context, args ) {
-                               if ( stack ) {
-                                       if ( firing ) {
-                                               if ( !flags.once ) {
-                                                       stack.push( [ context, args ] );
-                                               }
-                                       } else if ( !( flags.once && memory ) ) {
-                                               fire( context, args );
-                                       }
-                               }
-                               return this;
-                       },
-                       // Call all the callbacks with the given arguments
-                       fire: function() {
-                               self.fireWith( this, arguments );
-                               return this;
-                       },
-                       // To know if the callbacks have already been called at least once
-                       fired: function() {
-                               return !!fired;
-                       }
-               };
-
-       return self;
-};
-
-
-
-
-var // Static reference to slice
-       sliceDeferred = [].slice;
-
-jQuery.extend({
-
-       Deferred: function( func ) {
-               var doneList = jQuery.Callbacks( "once memory" ),
-                       failList = jQuery.Callbacks( "once memory" ),
-                       progressList = jQuery.Callbacks( "memory" ),
-                       state = "pending",
-                       lists = {
-                               resolve: doneList,
-                               reject: failList,
-                               notify: progressList
-                       },
-                       promise = {
-                               done: doneList.add,
-                               fail: failList.add,
-                               progress: progressList.add,
-
-                               state: function() {
-                                       return state;
-                               },
-
-                               // Deprecated
-                               isResolved: doneList.fired,
-                               isRejected: failList.fired,
-
-                               then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
-                                       deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
-                                       return this;
-                               },
-                               always: function() {
-                                       deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
-                                       return this;
-                               },
-                               pipe: function( fnDone, fnFail, fnProgress ) {
-                                       return jQuery.Deferred(function( newDefer ) {
-                                               jQuery.each( {
-                                                       done: [ fnDone, "resolve" ],
-                                                       fail: [ fnFail, "reject" ],
-                                                       progress: [ fnProgress, "notify" ]
-                                               }, function( handler, data ) {
-                                                       var fn = data[ 0 ],
-                                                               action = data[ 1 ],
-                                                               returned;
-                                                       if ( jQuery.isFunction( fn ) ) {
-                                                               deferred[ handler ](function() {
-                                                                       returned = fn.apply( this, arguments );
-                                                                       if ( returned && jQuery.isFunction( returned.promise ) ) {
-                                                                               returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
-                                                                       } else {
-                                                                               newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
-                                                                       }
-                                                               });
-                                                       } else {
-                                                               deferred[ handler ]( newDefer[ action ] );
-                                                       }
-                                               });
-                                       }).promise();
-                               },
-                               // Get a promise for this deferred
-                               // If obj is provided, the promise aspect is added to the object
-                               promise: function( obj ) {
-                                       if ( obj == null ) {
-                                               obj = promise;
-                                       } else {
-                                               for ( var key in promise ) {
-                                                       obj[ key ] = promise[ key ];
-                                               }
-                                       }
-                                       return obj;
-                               }
-                       },
-                       deferred = promise.promise({}),
-                       key;
-
-               for ( key in lists ) {
-                       deferred[ key ] = lists[ key ].fire;
-                       deferred[ key + "With" ] = lists[ key ].fireWith;
-               }
-
-               // Handle state
-               deferred.done( function() {
-                       state = "resolved";
-               }, failList.disable, progressList.lock ).fail( function() {
-                       state = "rejected";
-               }, doneList.disable, progressList.lock );
-
-               // Call given func if any
-               if ( func ) {
-                       func.call( deferred, deferred );
-               }
-
-               // All done!
-               return deferred;
-       },
-
-       // Deferred helper
-       when: function( firstParam ) {
-               var args = sliceDeferred.call( arguments, 0 ),
-                       i = 0,
-                       length = args.length,
-                       pValues = new Array( length ),
-                       count = length,
-                       pCount = length,
-                       deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
-                               firstParam :
-                               jQuery.Deferred(),
-                       promise = deferred.promise();
-               function resolveFunc( i ) {
-                       return function( value ) {
-                               args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
-                               if ( !( --count ) ) {
-                                       deferred.resolveWith( deferred, args );
-                               }
-                       };
-               }
-               function progressFunc( i ) {
-                       return function( value ) {
-                               pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
-                               deferred.notifyWith( promise, pValues );
-                       };
-               }
-               if ( length > 1 ) {
-                       for ( ; i < length; i++ ) {
-                               if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
-                                       args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
-                               } else {
-                                       --count;
-                               }
-                       }
-                       if ( !count ) {
-                               deferred.resolveWith( deferred, args );
-                       }
-               } else if ( deferred !== firstParam ) {
-                       deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
-               }
-               return promise;
-       }
-});
-
-
-
-
-jQuery.support = (function() {
-
-       var support,
-               all,
-               a,
-               select,
-               opt,
-               input,
-               fragment,
-               tds,
-               events,
-               eventName,
-               i,
-               isSupported,
-               div = document.createElement( "div" ),
-               documentElement = document.documentElement;
-
-       // Preliminary tests
-       div.setAttribute("className", "t");
-       div.innerHTML = "   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
-
-       all = div.getElementsByTagName( "*" );
-       a = div.getElementsByTagName( "a" )[ 0 ];
-
-       // Can't get basic test support
-       if ( !all || !all.length || !a ) {
-               return {};
-       }
-
-       // First batch of supports tests
-       select = document.createElement( "select" );
-       opt = select.appendChild( document.createElement("option") );
-       input = div.getElementsByTagName( "input" )[ 0 ];
-
-       support = {
-               // IE strips leading whitespace when .innerHTML is used
-               leadingWhitespace: ( div.firstChild.nodeType === 3 ),
-
-               // Make sure that tbody elements aren't automatically inserted
-               // IE will insert them into empty tables
-               tbody: !div.getElementsByTagName("tbody").length,
-
-               // Make sure that link elements get serialized correctly by innerHTML
-               // This requires a wrapper element in IE
-               htmlSerialize: !!div.getElementsByTagName("link").length,
-
-               // Get the style information from getAttribute
-               // (IE uses .cssText instead)
-               style: /top/.test( a.getAttribute("style") ),
-
-               // Make sure that URLs aren't manipulated
-               // (IE normalizes it by default)
-               hrefNormalized: ( a.getAttribute("href") === "/a" ),
-
-               // Make sure that element opacity exists
-               // (IE uses filter instead)
-               // Use a regex to work around a WebKit issue. See #5145
-               opacity: /^0.55/.test( a.style.opacity ),
-
-               // Verify style float existence
-               // (IE uses styleFloat instead of cssFloat)
-               cssFloat: !!a.style.cssFloat,
-
-               // Make sure that if no value is specified for a checkbox
-               // that it defaults to "on".
-               // (WebKit defaults to "" instead)
-               checkOn: ( input.value === "on" ),
-
-               // Make sure that a selected-by-default option has a working selected property.
-               // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
-               optSelected: opt.selected,
-
-               // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
-               getSetAttribute: div.className !== "t",
-
-               // Tests for enctype support on a form(#6743)
-               enctype: !!document.createElement("form").enctype,
-
-               // Makes sure cloning an html5 element does not cause problems
-               // Where outerHTML is undefined, this still works
-               html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
-
-               // Will be defined later
-               submitBubbles: true,
-               changeBubbles: true,
-               focusinBubbles: false,
-               deleteExpando: true,
-               noCloneEvent: true,
-               inlineBlockNeedsLayout: false,
-               shrinkWrapBlocks: false,
-               reliableMarginRight: true,
-               pixelMargin: true
-       };
-
-       // jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead
-       jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat");
-
-       // Make sure checked status is properly cloned
-       input.checked = true;
-       support.noCloneChecked = input.cloneNode( true ).checked;
-
-       // Make sure that the options inside disabled selects aren't marked as disabled
-       // (WebKit marks them as disabled)
-       select.disabled = true;
-       support.optDisabled = !opt.disabled;
-
-       // Test to see if it's possible to delete an expando from an element
-       // Fails in Internet Explorer
-       try {
-               delete div.test;
-       } catch( e ) {
-               support.deleteExpando = false;
-       }
-
-       if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
-               div.attachEvent( "onclick", function() {
-                       // Cloning a node shouldn't copy over any
-                       // bound event handlers (IE does this)
-                       support.noCloneEvent = false;
-               });
-               div.cloneNode( true ).fireEvent( "onclick" );
-       }
-
-       // Check if a radio maintains its value
-       // after being appended to the DOM
-       input = document.createElement("input");
-       input.value = "t";
-       input.setAttribute("type", "radio");
-       support.radioValue = input.value === "t";
-
-       input.setAttribute("checked", "checked");
-
-       // #11217 - WebKit loses check when the name is after the checked attribute
-       input.setAttribute( "name", "t" );
-
-       div.appendChild( input );
-       fragment = document.createDocumentFragment();
-       fragment.appendChild( div.lastChild );
-
-       // WebKit doesn't clone checked state correctly in fragments
-       support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
-       // Check if a disconnected checkbox will retain its checked
-       // value of true after appended to the DOM (IE6/7)
-       support.appendChecked = input.checked;
-
-       fragment.removeChild( input );
-       fragment.appendChild( div );
-
-       // Technique from Juriy Zaytsev
-       // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
-       // We only care about the case where non-standard event systems
-       // are used, namely in IE. Short-circuiting here helps us to
-       // avoid an eval call (in setAttribute) which can cause CSP
-       // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
-       if ( div.attachEvent ) {
-               for ( i in {
-                       submit: 1,
-                       change: 1,
-                       focusin: 1
-               }) {
-                       eventName = "on" + i;
-                       isSupported = ( eventName in div );
-                       if ( !isSupported ) {
-                               div.setAttribute( eventName, "return;" );
-                               isSupported = ( typeof div[ eventName ] === "function" );
-                       }
-                       support[ i + "Bubbles" ] = isSupported;
-               }
-       }
-
-       fragment.removeChild( div );
-
-       // Null elements to avoid leaks in IE
-       fragment = select = opt = div = input = null;
-
-       // Run tests that need a body at doc ready
-       jQuery(function() {
-               var container, outer, inner, table, td, offsetSupport,
-                       marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight,
-                       paddingMarginBorderVisibility, paddingMarginBorder,
-                       body = document.getElementsByTagName("body")[0];
-
-               if ( !body ) {
-                       // Return for frameset docs that don't have a body
-                       return;
-               }
-
-               conMarginTop = 1;
-               paddingMarginBorder = "padding:0;margin:0;border:";
-               positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;";
-               paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;";
-               style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;";
-               html = "<div " + style + "display:block;'><div style='" + paddingMarginBorder + "0;display:block;overflow:hidden;'></div></div>" +
-                       "<table " + style + "' cellpadding='0' cellspacing='0'>" +
-                       "<tr><td></td></tr></table>";
-
-               container = document.createElement("div");
-               container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
-               body.insertBefore( container, body.firstChild );
-
-               // Construct the test element
-               div = document.createElement("div");
-               container.appendChild( div );
-
-               // Check if table cells still have offsetWidth/Height when they are set
-               // to display:none and there are still other visible table cells in a
-               // table row; if so, offsetWidth/Height are not reliable for use when
-               // determining if an element has been hidden directly using
-               // display:none (it is still safe to use offsets if a parent element is
-               // hidden; don safety goggles and see bug #4512 for more information).
-               // (only IE 8 fails this test)
-               div.innerHTML = "<table><tr><td style='" + paddingMarginBorder + "0;display:none'></td><td>t</td></tr></table>";
-               tds = div.getElementsByTagName( "td" );
-               isSupported = ( tds[ 0 ].offsetHeight === 0 );
-
-               tds[ 0 ].style.display = "";
-               tds[ 1 ].style.display = "none";
-
-               // Check if empty table cells still have offsetWidth/Height
-               // (IE <= 8 fail this test)
-               support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
-
-               // Check if div with explicit width and no margin-right incorrectly
-               // gets computed margin-right based on width of container. For more
-               // info see bug #3333
-               // Fails in WebKit before Feb 2011 nightlies
-               // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
-               if ( window.getComputedStyle ) {
-                       div.innerHTML = "";
-                       marginDiv = document.createElement( "div" );
-                       marginDiv.style.width = "0";
-                       marginDiv.style.marginRight = "0";
-                       div.style.width = "2px";
-                       div.appendChild( marginDiv );
-                       support.reliableMarginRight =
-                               ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
-               }
-
-               if ( typeof div.style.zoom !== "undefined" ) {
-                       // Check if natively block-level elements act like inline-block
-                       // elements when setting their display to 'inline' and giving
-                       // them layout
-                       // (IE < 8 does this)
-                       div.innerHTML = "";
-                       div.style.width = div.style.padding = "1px";
-                       div.style.border = 0;
-                       div.style.overflow = "hidden";
-                       div.style.display = "inline";
-                       div.style.zoom = 1;
-                       support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
-
-                       // Check if elements with layout shrink-wrap their children
-                       // (IE 6 does this)
-                       div.style.display = "block";
-                       div.style.overflow = "visible";
-                       div.innerHTML = "<div style='width:5px;'></div>";
-                       support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
-               }
-
-               div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility;
-               div.innerHTML = html;
-
-               outer = div.firstChild;
-               inner = outer.firstChild;
-               td = outer.nextSibling.firstChild.firstChild;
-
-               offsetSupport = {
-                       doesNotAddBorder: ( inner.offsetTop !== 5 ),
-                       doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
-               };
-
-               inner.style.position = "fixed";
-               inner.style.top = "20px";
-
-               // safari subtracts parent border width here which is 5px
-               offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
-               inner.style.position = inner.style.top = "";
-
-               outer.style.overflow = "hidden";
-               outer.style.position = "relative";
-
-               offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
-               offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
-
-               if ( window.getComputedStyle ) {
-                       div.style.marginTop = "1%";
-                       support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%";
-               }
-
-               if ( typeof container.style.zoom !== "undefined" ) {
-                       container.style.zoom = 1;
-               }
-
-               body.removeChild( container );
-               marginDiv = div = container = null;
-
-               jQuery.extend( support, offsetSupport );
-       });
-
-       return support;
-})();
-
-
-
-
-var rbrace = /^(?:\{.*\}|\[.*\])$/,
-       rmultiDash = /([A-Z])/g;
-
-jQuery.extend({
-       cache: {},
-
-       // Please use with caution
-       uuid: 0,
-
-       // Unique for each copy of jQuery on the page
-       // Non-digits removed to match rinlinejQuery
-       expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
-
-       // The following elements throw uncatchable exceptions if you
-       // attempt to add expando properties to them.
-       noData: {
-               "embed": true,
-               // Ban all objects except for Flash (which handle expandos)
-               "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
-               "applet": true
-       },
-
-       hasData: function( elem ) {
-               elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
-               return !!elem && !isEmptyDataObject( elem );
-       },
-
-       data: function( elem, name, data, pvt /* Internal Use Only */ ) {
-               if ( !jQuery.acceptData( elem ) ) {
-                       return;
-               }
-
-               var privateCache, thisCache, ret,
-                       internalKey = jQuery.expando,
-                       getByName = typeof name === "string",
-
-                       // We have to handle DOM nodes and JS objects differently because IE6-7
-                       // can't GC object references properly across the DOM-JS boundary
-                       isNode = elem.nodeType,
-
-                       // Only DOM nodes need the global jQuery cache; JS object data is
-                       // attached directly to the object so GC can occur automatically
-                       cache = isNode ? jQuery.cache : elem,
-
-                       // Only defining an ID for JS objects if its cache already exists allows
-                       // the code to shortcut on the same path as a DOM node with no cache
-                       id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,
-                       isEvents = name === "events";
-
-               // Avoid doing any more work than we need to when trying to get data on an
-               // object that has no data at all
-               if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
-                       return;
-               }
-
-               if ( !id ) {
-                       // Only DOM nodes need a new unique ID for each element since their data
-                       // ends up in the global cache
-                       if ( isNode ) {
-                               elem[ internalKey ] = id = ++jQuery.uuid;
-                       } else {
-                               id = internalKey;
-                       }
-               }
-
-               if ( !cache[ id ] ) {
-                       cache[ id ] = {};
-
-                       // Avoids exposing jQuery metadata on plain JS objects when the object
-                       // is serialized using JSON.stringify
-                       if ( !isNode ) {
-                               cache[ id ].toJSON = jQuery.noop;
-                       }
-               }
-
-               // An object can be passed to jQuery.data instead of a key/value pair; this gets
-               // shallow copied over onto the existing cache
-               if ( typeof name === "object" || typeof name === "function" ) {
-                       if ( pvt ) {
-                               cache[ id ] = jQuery.extend( cache[ id ], name );
-                       } else {
-                               cache[ id ].data = jQuery.extend( cache[ id ].data, name );
-                       }
-               }
-
-               privateCache = thisCache = cache[ id ];
-
-               // jQuery data() is stored in a separate object inside the object's internal data
-               // cache in order to avoid key collisions between internal data and user-defined
-               // data.
-               if ( !pvt ) {
-                       if ( !thisCache.data ) {
-                               thisCache.data = {};
-                       }
-
-                       thisCache = thisCache.data;
-               }
-
-               if ( data !== undefined ) {
-                       thisCache[ jQuery.camelCase( name ) ] = data;
-               }
-
-               // Users should not attempt to inspect the internal events object using jQuery.data,
-               // it is undocumented and subject to change. But does anyone listen? No.
-               if ( isEvents && !thisCache[ name ] ) {
-                       return privateCache.events;
-               }
-
-               // Check for both converted-to-camel and non-converted data property names
-               // If a data property was specified
-               if ( getByName ) {
-
-                       // First Try to find as-is property data
-                       ret = thisCache[ name ];
-
-                       // Test for null|undefined property data
-                       if ( ret == null ) {
-
-                               // Try to find the camelCased property
-                               ret = thisCache[ jQuery.camelCase( name ) ];
-                       }
-               } else {
-                       ret = thisCache;
-               }
-
-               return ret;
-       },
-
-       removeData: function( elem, name, pvt /* Internal Use Only */ ) {
-               if ( !jQuery.acceptData( elem ) ) {
-                       return;
-               }
-
-               var thisCache, i, l,
-
-                       // Reference to internal data cache key
-                       internalKey = jQuery.expando,
-
-                       isNode = elem.nodeType,
-
-                       // See jQuery.data for more information
-                       cache = isNode ? jQuery.cache : elem,
-
-                       // See jQuery.data for more information
-                       id = isNode ? elem[ internalKey ] : internalKey;
-
-               // If there is already no cache entry for this object, there is no
-               // purpose in continuing
-               if ( !cache[ id ] ) {
-                       return;
-               }
-
-               if ( name ) {
-
-                       thisCache = pvt ? cache[ id ] : cache[ id ].data;
-
-                       if ( thisCache ) {
-
-                               // Support array or space separated string names for data keys
-                               if ( !jQuery.isArray( name ) ) {
-
-                                       // try the string as a key before any manipulation
-                                       if ( name in thisCache ) {
-                                               name = [ name ];
-                                       } else {
-
-                                               // split the camel cased version by spaces unless a key with the spaces exists
-                                               name = jQuery.camelCase( name );
-                                               if ( name in thisCache ) {
-                                                       name = [ name ];
-                                               } else {
-                                                       name = name.split( " " );
-                                               }
-                                       }
-                               }
-
-                               for ( i = 0, l = name.length; i < l; i++ ) {
-                                       delete thisCache[ name[i] ];
-                               }
-
-                               // If there is no data left in the cache, we want to continue
-                               // and let the cache object itself get destroyed
-                               if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
-                                       return;
-                               }
-                       }
-               }
-
-               // See jQuery.data for more information
-               if ( !pvt ) {
-                       delete cache[ id ].data;
-
-                       // Don't destroy the parent cache unless the internal data object
-                       // had been the only thing left in it
-                       if ( !isEmptyDataObject(cache[ id ]) ) {
-                               return;
-                       }
-               }
-
-               // Browsers that fail expando deletion also refuse to delete expandos on
-               // the window, but it will allow it on all other JS objects; other browsers
-               // don't care
-               // Ensure that `cache` is not a window object #10080
-               if ( jQuery.support.deleteExpando || !cache.setInterval ) {
-                       delete cache[ id ];
-               } else {
-                       cache[ id ] = null;
-               }
-
-               // We destroyed the cache and need to eliminate the expando on the node to avoid
-               // false lookups in the cache for entries that no longer exist
-               if ( isNode ) {
-                       // IE does not allow us to delete expando properties from nodes,
-                       // nor does it have a removeAttribute function on Document nodes;
-                       // we must handle all of these cases
-                       if ( jQuery.support.deleteExpando ) {
-                               delete elem[ internalKey ];
-                       } else if ( elem.removeAttribute ) {
-                               elem.removeAttribute( internalKey );
-                       } else {
-                               elem[ internalKey ] = null;
-                       }
-               }
-       },
-
-       // For internal use only.
-       _data: function( elem, name, data ) {
-               return jQuery.data( elem, name, data, true );
-       },
-
-       // A method for determining if a DOM node can handle the data expando
-       acceptData: function( elem ) {
-               if ( elem.nodeName ) {
-                       var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
-
-                       if ( match ) {
-                               return !(match === true || elem.getAttribute("classid") !== match);
-                       }
-               }
-
-               return true;
-       }
-});
-
-jQuery.fn.extend({
-       data: function( key, value ) {
-               var parts, part, attr, name, l,
-                       elem = this[0],
-                       i = 0,
-                       data = null;
-
-               // Gets all values
-               if ( key === undefined ) {
-                       if ( this.length ) {
-                               data = jQuery.data( elem );
-
-                               if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
-                                       attr = elem.attributes;
-                                       for ( l = attr.length; i < l; i++ ) {
-                                               name = attr[i].name;
-
-                                               if ( name.indexOf( "data-" ) === 0 ) {
-                                                       name = jQuery.camelCase( name.substring(5) );
-
-                                                       dataAttr( elem, name, data[ name ] );
-                                               }
-                                       }
-                                       jQuery._data( elem, "parsedAttrs", true );
-                               }
-                       }
-
-                       return data;
-               }
-
-               // Sets multiple values
-               if ( typeof key === "object" ) {
-                       return this.each(function() {
-                               jQuery.data( this, key );
-                       });
-               }
-
-               parts = key.split( ".", 2 );
-               parts[1] = parts[1] ? "." + parts[1] : "";
-               part = parts[1] + "!";
-
-               return jQuery.access( this, function( value ) {
-
-                       if ( value === undefined ) {
-                               data = this.triggerHandler( "getData" + part, [ parts[0] ] );
-
-                               // Try to fetch any internally stored data first
-                               if ( data === undefined && elem ) {
-                                       data = jQuery.data( elem, key );
-                                       data = dataAttr( elem, key, data );
-                               }
-
-                               return data === undefined && parts[1] ?
-                                       this.data( parts[0] ) :
-                                       data;
-                       }
-
-                       parts[1] = value;
-                       this.each(function() {
-                               var self = jQuery( this );
-
-                               self.triggerHandler( "setData" + part, parts );
-                               jQuery.data( this, key, value );
-                               self.triggerHandler( "changeData" + part, parts );
-                       });
-               }, null, value, arguments.length > 1, null, false );
-       },
-
-       removeData: function( key ) {
-               return this.each(function() {
-                       jQuery.removeData( this, key );
-               });
-       }
-});
-
-function dataAttr( elem, key, data ) {
-       // If nothing was found internally, try to fetch any
-       // data from the HTML5 data-* attribute
-       if ( data === undefined && elem.nodeType === 1 ) {
-
-               var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
-
-               data = elem.getAttribute( name );
-
-               if ( typeof data === "string" ) {
-                       try {
-                               data = data === "true" ? true :
-                               data === "false" ? false :
-                               data === "null" ? null :
-                               jQuery.isNumeric( data ) ? +data :
-                                       rbrace.test( data ) ? jQuery.parseJSON( data ) :
-                                       data;
-                       } catch( e ) {}
-
-                       // Make sure we set the data so it isn't changed later
-                       jQuery.data( elem, key, data );
-
-               } else {
-                       data = undefined;
-               }
-       }
-
-       return data;
-}
-
-// checks a cache object for emptiness
-function isEmptyDataObject( obj ) {
-       for ( var name in obj ) {
-
-               // if the public data object is empty, the private is still empty
-               if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
-                       continue;
-               }
-               if ( name !== "toJSON" ) {
-                       return false;
-               }
-       }
-
-       return true;
-}
-
-
-
-
-function handleQueueMarkDefer( elem, type, src ) {
-       var deferDataKey = type + "defer",
-               queueDataKey = type + "queue",
-               markDataKey = type + "mark",
-               defer = jQuery._data( elem, deferDataKey );
-       if ( defer &&
-               ( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
-               ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
-               // Give room for hard-coded callbacks to fire first
-               // and eventually mark/queue something else on the element
-               setTimeout( function() {
-                       if ( !jQuery._data( elem, queueDataKey ) &&
-                               !jQuery._data( elem, markDataKey ) ) {
-                               jQuery.removeData( elem, deferDataKey, true );
-                               defer.fire();
-                       }
-               }, 0 );
-       }
-}
-
-jQuery.extend({
-
-       _mark: function( elem, type ) {
-               if ( elem ) {
-                       type = ( type || "fx" ) + "mark";
-                       jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
-               }
-       },
-
-       _unmark: function( force, elem, type ) {
-               if ( force !== true ) {
-                       type = elem;
-                       elem = force;
-                       force = false;
-               }
-               if ( elem ) {
-                       type = type || "fx";
-                       var key = type + "mark",
-                               count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
-                       if ( count ) {
-                               jQuery._data( elem, key, count );
-                       } else {
-                               jQuery.removeData( elem, key, true );
-                               handleQueueMarkDefer( elem, type, "mark" );
-                       }
-               }
-       },
-
-       queue: function( elem, type, data ) {
-               var q;
-               if ( elem ) {
-                       type = ( type || "fx" ) + "queue";
-                       q = jQuery._data( elem, type );
-
-                       // Speed up dequeue by getting out quickly if this is just a lookup
-                       if ( data ) {
-                               if ( !q || jQuery.isArray(data) ) {
-                                       q = jQuery._data( elem, type, jQuery.makeArray(data) );
-                               } else {
-                                       q.push( data );
-                               }
-                       }
-                       return q || [];
-               }
-       },
-
-       dequeue: function( elem, type ) {
-               type = type || "fx";
-
-               var queue = jQuery.queue( elem, type ),
-                       fn = queue.shift(),
-                       hooks = {};
-
-               // If the fx queue is dequeued, always remove the progress sentinel
-               if ( fn === "inprogress" ) {
-                       fn = queue.shift();
-               }
-
-               if ( fn ) {
-                       // Add a progress sentinel to prevent the fx queue from being
-                       // automatically dequeued
-                       if ( type === "fx" ) {
-                               queue.unshift( "inprogress" );
-                       }
-
-                       jQuery._data( elem, type + ".run", hooks );
-                       fn.call( elem, function() {
-                               jQuery.dequeue( elem, type );
-                       }, hooks );
-               }
-
-               if ( !queue.length ) {
-                       jQuery.removeData( elem, type + "queue " + type + ".run", true );
-                       handleQueueMarkDefer( elem, type, "queue" );
-               }
-       }
-});
-
-jQuery.fn.extend({
-       queue: function( type, data ) {
-               var setter = 2;
-
-               if ( typeof type !== "string" ) {
-                       data = type;
-                       type = "fx";
-                       setter--;
-               }
-
-               if ( arguments.length < setter ) {
-                       return jQuery.queue( this[0], type );
-               }
-
-               return data === undefined ?
-                       this :
-                       this.each(function() {
-                               var queue = jQuery.queue( this, type, data );
-
-                               if ( type === "fx" && queue[0] !== "inprogress" ) {
-                                       jQuery.dequeue( this, type );
-                               }
-                       });
-       },
-       dequeue: function( type ) {
-               return this.each(function() {
-                       jQuery.dequeue( this, type );
-               });
-       },
-       // Based off of the plugin by Clint Helfers, with permission.
-       // http://blindsignals.com/index.php/2009/07/jquery-delay/
-       delay: function( time, type ) {
-               time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
-               type = type || "fx";
-
-               return this.queue( type, function( next, hooks ) {
-                       var timeout = setTimeout( next, time );
-                       hooks.stop = function() {
-                               clearTimeout( timeout );
-                       };
-               });
-       },
-       clearQueue: function( type ) {
-               return this.queue( type || "fx", [] );
-       },
-       // Get a promise resolved when queues of a certain type
-       // are emptied (fx is the type by default)
-       promise: function( type, object ) {
-               if ( typeof type !== "string" ) {
-                       object = type;
-                       type = undefined;
-               }
-               type = type || "fx";
-               var defer = jQuery.Deferred(),
-                       elements = this,
-                       i = elements.length,
-                       count = 1,
-                       deferDataKey = type + "defer",
-                       queueDataKey = type + "queue",
-                       markDataKey = type + "mark",
-                       tmp;
-               function resolve() {
-                       if ( !( --count ) ) {
-                               defer.resolveWith( elements, [ elements ] );
-                       }
-               }
-               while( i-- ) {
-                       if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
-                                       ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
-                                               jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
-                                       jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
-                               count++;
-                               tmp.add( resolve );
-                       }
-               }
-               resolve();
-               return defer.promise( object );
-       }
-});
-
-
-
-
-var rclass = /[\n\t\r]/g,
-       rspace = /\s+/,
-       rreturn = /\r/g,
-       rtype = /^(?:button|input)$/i,
-       rfocusable = /^(?:button|input|object|select|textarea)$/i,
-       rclickable = /^a(?:rea)?$/i,
-       rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
-       getSetAttribute = jQuery.support.getSetAttribute,
-       nodeHook, boolHook, fixSpecified;
-
-jQuery.fn.extend({
-       attr: function( name, value ) {
-               return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
-       },
-
-       removeAttr: function( name ) {
-               return this.each(function() {
-                       jQuery.removeAttr( this, name );
-               });
-       },
-
-       prop: function( name, value ) {
-               return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
-       },
-
-       removeProp: function( name ) {
-               name = jQuery.propFix[ name ] || name;
-               return this.each(function() {
-                       // try/catch handles cases where IE balks (such as removing a property on window)
-                       try {
-                               this[ name ] = undefined;
-                               delete this[ name ];
-                       } catch( e ) {}
-               });
-       },
-
-       addClass: function( value ) {
-               var classNames, i, l, elem,
-                       setClass, c, cl;
-
-               if ( jQuery.isFunction( value ) ) {
-                       return this.each(function( j ) {
-                               jQuery( this ).addClass( value.call(this, j, this.className) );
-                       });
-               }
-
-               if ( value && typeof value === "string" ) {
-                       classNames = value.split( rspace );
-
-                       for ( i = 0, l = this.length; i < l; i++ ) {
-                               elem = this[ i ];
-
-                               if ( elem.nodeType === 1 ) {
-                                       if ( !elem.className && classNames.length === 1 ) {
-                                               elem.className = value;
-
-                                       } else {
-                                               setClass = " " + elem.className + " ";
-
-                                               for ( c = 0, cl = classNames.length; c < cl; c++ ) {
-                                                       if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
-                                                               setClass += classNames[ c ] + " ";
-                                                       }
-                                               }
-                                               elem.className = jQuery.trim( setClass );
-                                       }
-                               }
-                       }
-               }
-
-               return this;
-       },
-
-       removeClass: function( value ) {
-               var classNames, i, l, elem, className, c, cl;
-
-               if ( jQuery.isFunction( value ) ) {
-                       return this.each(function( j ) {
-                               jQuery( this ).removeClass( value.call(this, j, this.className) );
-                       });
-               }
-
-               if ( (value && typeof value === "string") || value === undefined ) {
-                       classNames = ( value || "" ).split( rspace );
-
-                       for ( i = 0, l = this.length; i < l; i++ ) {
-                               elem = this[ i ];
-
-                               if ( elem.nodeType === 1 && elem.className ) {
-                                       if ( value ) {
-                                               className = (" " + elem.className + " ").replace( rclass, " " );
-                                               for ( c = 0, cl = classNames.length; c < cl; c++ ) {
-                                                       className = className.replace(" " + classNames[ c ] + " ", " ");
-                                               }
-                                               elem.className = jQuery.trim( className );
-
-                                       } else {
-                                               elem.className = "";
-                                       }
-                               }
-                       }
-               }
-
-               return this;
-       },
-
-       toggleClass: function( value, stateVal ) {
-               var type = typeof value,
-                       isBool = typeof stateVal === "boolean";
-
-               if ( jQuery.isFunction( value ) ) {
-                       return this.each(function( i ) {
-                               jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
-                       });
-               }
-
-               return this.each(function() {
-                       if ( type === "string" ) {
-                               // toggle individual class names
-                               var className,
-                                       i = 0,
-                                       self = jQuery( this ),
-                                       state = stateVal,
-                                       classNames = value.split( rspace );
-
-                               while ( (className = classNames[ i++ ]) ) {
-                                       // check each className given, space seperated list
-                                       state = isBool ? state : !self.hasClass( className );
-                                       self[ state ? "addClass" : "removeClass" ]( className );
-                               }
-
-                       } else if ( type === "undefined" || type === "boolean" ) {
-                               if ( this.className ) {
-                                       // store className if set
-                                       jQuery._data( this, "__className__", this.className );
-                               }
-
-                               // toggle whole className
-                               this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
-                       }
-               });
-       },
-
-       hasClass: function( selector ) {
-               var className = " " + selector + " ",
-                       i = 0,
-                       l = this.length;
-               for ( ; i < l; i++ ) {
-                       if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
-                               return true;
-                       }
-               }
-
-               return false;
-       },
-
-       val: function( value ) {
-               var hooks, ret, isFunction,
-                       elem = this[0];
-
-               if ( !arguments.length ) {
-                       if ( elem ) {
-                               hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
-
-                               if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
-                                       return ret;
-                               }
-
-                               ret = elem.value;
-
-                               return typeof ret === "string" ?
-                                       // handle most common string cases
-                                       ret.replace(rreturn, "") :
-                                       // handle cases where value is null/undef or number
-                                       ret == null ? "" : ret;
-                       }
-
-                       return;
-               }
-
-               isFunction = jQuery.isFunction( value );
-
-               return this.each(function( i ) {
-                       var self = jQuery(this), val;
-
-                       if ( this.nodeType !== 1 ) {
-                               return;
-                       }
-
-                       if ( isFunction ) {
-                               val = value.call( this, i, self.val() );
-                       } else {
-                               val = value;
-                       }
-
-                       // Treat null/undefined as ""; convert numbers to string
-                       if ( val == null ) {
-                               val = "";
-                       } else if ( typeof val === "number" ) {
-                               val += "";
-                       } else if ( jQuery.isArray( val ) ) {
-                               val = jQuery.map(val, function ( value ) {
-                                       return value == null ? "" : value + "";
-                               });
-                       }
-
-                       hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
-
-                       // If set returns undefined, fall back to normal setting
-                       if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
-                               this.value = val;
-                       }
-               });
-       }
-});
-
-jQuery.extend({
-       valHooks: {
-               option: {
-                       get: function( elem ) {
-                               // attributes.value is undefined in Blackberry 4.7 but
-                               // uses .value. See #6932
-                               var val = elem.attributes.value;
-                               return !val || val.specified ? elem.value : elem.text;
-                       }
-               },
-               select: {
-                       get: function( elem ) {
-                               var value, i, max, option,
-                                       index = elem.selectedIndex,
-                                       values = [],
-                                       options = elem.options,
-                                       one = elem.type === "select-one";
-
-                               // Nothing was selected
-                               if ( index < 0 ) {
-                                       return null;
-                               }
-
-                               // Loop through all the selected options
-                               i = one ? index : 0;
-                               max = one ? index + 1 : options.length;
-                               for ( ; i < max; i++ ) {
-                                       option = options[ i ];
-
-                                       // Don't return options that are disabled or in a disabled optgroup
-                                       if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
-                                                       (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
-
-                                               // Get the specific value for the option
-                                               value = jQuery( option ).val();
-
-                                               // We don't need an array for one selects
-                                               if ( one ) {
-                                                       return value;
-                                               }
-
-                                               // Multi-Selects return an array
-                                               values.push( value );
-                                       }
-                               }
-
-                               // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
-                               if ( one && !values.length && options.length ) {
-                                       return jQuery( options[ index ] ).val();
-                               }
-
-                               return values;
-                       },
-
-                       set: function( elem, value ) {
-                               var values = jQuery.makeArray( value );
-
-                               jQuery(elem).find("option").each(function() {
-                                       this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
-                               });
-
-                               if ( !values.length ) {
-                                       elem.selectedIndex = -1;
-                               }
-                               return values;
-                       }
-               }
-       },
-
-       attrFn: {
-               val: true,
-               css: true,
-               html: true,
-               text: true,
-               data: true,
-               width: true,
-               height: true,
-               offset: true
-       },
-
-       attr: function( elem, name, value, pass ) {
-               var ret, hooks, notxml,
-                       nType = elem.nodeType;
-
-               // don't get/set attributes on text, comment and attribute nodes
-               if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-                       return;
-               }
-
-               if ( pass && name in jQuery.attrFn ) {
-                       return jQuery( elem )[ name ]( value );
-               }
-
-               // Fallback to prop when attributes are not supported
-               if ( typeof elem.getAttribute === "undefined" ) {
-                       return jQuery.prop( elem, name, value );
-               }
-
-               notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
-               // All attributes are lowercase
-               // Grab necessary hook if one is defined
-               if ( notxml ) {
-                       name = name.toLowerCase();
-                       hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
-               }
-
-               if ( value !== undefined ) {
-
-                       if ( value === null ) {
-                               jQuery.removeAttr( elem, name );
-                               return;
-
-                       } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
-                               return ret;
-
-                       } else {
-                               elem.setAttribute( name, "" + value );
-                               return value;
-                       }
-
-               } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
-                       return ret;
-
-               } else {
-
-                       ret = elem.getAttribute( name );
-
-                       // Non-existent attributes return null, we normalize to undefined
-                       return ret === null ?
-                               undefined :
-                               ret;
-               }
-       },
-
-       removeAttr: function( elem, value ) {
-               var propName, attrNames, name, l, isBool,
-                       i = 0;
-
-               if ( value && elem.nodeType === 1 ) {
-                       attrNames = value.toLowerCase().split( rspace );
-                       l = attrNames.length;
-
-                       for ( ; i < l; i++ ) {
-                               name = attrNames[ i ];
-
-                               if ( name ) {
-                                       propName = jQuery.propFix[ name ] || name;
-                                       isBool = rboolean.test( name );
-
-                                       // See #9699 for explanation of this approach (setting first, then removal)
-                                       // Do not do this for boolean attributes (see #10870)
-                                       if ( !isBool ) {
-                                               jQuery.attr( elem, name, "" );
-                                       }
-                                       elem.removeAttribute( getSetAttribute ? name : propName );
-
-                                       // Set corresponding property to false for boolean attributes
-                                       if ( isBool && propName in elem ) {
-                                               elem[ propName ] = false;
-                                       }
-                               }
-                       }
-               }
-       },
-
-       attrHooks: {
-               type: {
-                       set: function( elem, value ) {
-                               // We can't allow the type property to be changed (since it causes problems in IE)
-                               if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
-                                       jQuery.error( "type property can't be changed" );
-                               } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
-                                       // Setting the type on a radio button after the value resets the value in IE6-9
-                                       // Reset value to it's default in case type is set after value
-                                       // This is for element creation
-                                       var val = elem.value;
-                                       elem.setAttribute( "type", value );
-                                       if ( val ) {
-                                               elem.value = val;
-                                       }
-                                       return value;
-                               }
-                       }
-               },
-               // Use the value property for back compat
-               // Use the nodeHook for button elements in IE6/7 (#1954)
-               value: {
-                       get: function( elem, name ) {
-                               if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
-                                       return nodeHook.get( elem, name );
-                               }
-                               return name in elem ?
-                                       elem.value :
-                                       null;
-                       },
-                       set: function( elem, value, name ) {
-                               if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
-                                       return nodeHook.set( elem, value, name );
-                               }
-                               // Does not return so that setAttribute is also used
-                               elem.value = value;
-                       }
-               }
-       },
-
-       propFix: {
-               tabindex: "tabIndex",
-               readonly: "readOnly",
-               "for": "htmlFor",
-               "class": "className",
-               maxlength: "maxLength",
-               cellspacing: "cellSpacing",
-               cellpadding: "cellPadding",
-               rowspan: "rowSpan",
-               colspan: "colSpan",
-               usemap: "useMap",
-               frameborder: "frameBorder",
-               contenteditable: "contentEditable"
-       },
-
-       prop: function( elem, name, value ) {
-               var ret, hooks, notxml,
-                       nType = elem.nodeType;
-
-               // don't get/set properties on text, comment and attribute nodes
-               if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-                       return;
-               }
-
-               notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
-               if ( notxml ) {
-                       // Fix name and attach hooks
-                       name = jQuery.propFix[ name ] || name;
-                       hooks = jQuery.propHooks[ name ];
-               }
-
-               if ( value !== undefined ) {
-                       if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
-                               return ret;
-
-                       } else {
-                               return ( elem[ name ] = value );
-                       }
-
-               } else {
-                       if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
-                               return ret;
-
-                       } else {
-                               return elem[ name ];
-                       }
-               }
-       },
-
-       propHooks: {
-               tabIndex: {
-                       get: function( elem ) {
-                               // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
-                               // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
-                               var attributeNode = elem.getAttributeNode("tabindex");
-
-                               return attributeNode && attributeNode.specified ?
-                                       parseInt( attributeNode.value, 10 ) :
-                                       rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
-                                               0 :
-                                               undefined;
-                       }
-               }
-       }
-});
-
-// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
-jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
-
-// Hook for boolean attributes
-boolHook = {
-       get: function( elem, name ) {
-               // Align boolean attributes with corresponding properties
-               // Fall back to attribute presence where some booleans are not supported
-               var attrNode,
-                       property = jQuery.prop( elem, name );
-               return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
-                       name.toLowerCase() :
-                       undefined;
-       },
-       set: function( elem, value, name ) {
-               var propName;
-               if ( value === false ) {
-                       // Remove boolean attributes when set to false
-                       jQuery.removeAttr( elem, name );
-               } else {
-                       // value is true since we know at this point it's type boolean and not false
-                       // Set boolean attributes to the same name and set the DOM property
-                       propName = jQuery.propFix[ name ] || name;
-                       if ( propName in elem ) {
-                               // Only set the IDL specifically if it already exists on the element
-                               elem[ propName ] = true;
-                       }
-
-                       elem.setAttribute( name, name.toLowerCase() );
-               }
-               return name;
-       }
-};
-
-// IE6/7 do not support getting/setting some attributes with get/setAttribute
-if ( !getSetAttribute ) {
-
-       fixSpecified = {
-               name: true,
-               id: true,
-               coords: true
-       };
-
-       // Use this for any attribute in IE6/7
-       // This fixes almost every IE6/7 issue
-       nodeHook = jQuery.valHooks.button = {
-               get: function( elem, name ) {
-                       var ret;
-                       ret = elem.getAttributeNode( name );
-                       return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
-                               ret.nodeValue :
-                               undefined;
-               },
-               set: function( elem, value, name ) {
-                       // Set the existing or create a new attribute node
-                       var ret = elem.getAttributeNode( name );
-                       if ( !ret ) {
-                               ret = document.createAttribute( name );
-                               elem.setAttributeNode( ret );
-                       }
-                       return ( ret.nodeValue = value + "" );
-               }
-       };
-
-       // Apply the nodeHook to tabindex
-       jQuery.attrHooks.tabindex.set = nodeHook.set;
-
-       // Set width and height to auto instead of 0 on empty string( Bug #8150 )
-       // This is for removals
-       jQuery.each([ "width", "height" ], function( i, name ) {
-               jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
-                       set: function( elem, value ) {
-                               if ( value === "" ) {
-                                       elem.setAttribute( name, "auto" );
-                                       return value;
-                               }
-                       }
-               });
-       });
-
-       // Set contenteditable to false on removals(#10429)
-       // Setting to empty string throws an error as an invalid value
-       jQuery.attrHooks.contenteditable = {
-               get: nodeHook.get,
-               set: function( elem, value, name ) {
-                       if ( value === "" ) {
-                               value = "false";
-                       }
-                       nodeHook.set( elem, value, name );
-               }
-       };
-}
-
-
-// Some attributes require a special call on IE
-if ( !jQuery.support.hrefNormalized ) {
-       jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
-               jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
-                       get: function( elem ) {
-                               var ret = elem.getAttribute( name, 2 );
-                               return ret === null ? undefined : ret;
-                       }
-               });
-       });
-}
-
-if ( !jQuery.support.style ) {
-       jQuery.attrHooks.style = {
-               get: function( elem ) {
-                       // Return undefined in the case of empty string
-                       // Normalize to lowercase since IE uppercases css property names
-                       return elem.style.cssText.toLowerCase() || undefined;
-               },
-               set: function( elem, value ) {
-                       return ( elem.style.cssText = "" + value );
-               }
-       };
-}
-
-// Safari mis-reports the default selected property of an option
-// Accessing the parent's selectedIndex property fixes it
-if ( !jQuery.support.optSelected ) {
-       jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
-               get: function( elem ) {
-                       var parent = elem.parentNode;
-
-                       if ( parent ) {
-                               parent.selectedIndex;
-
-                               // Make sure that it also works with optgroups, see #5701
-                               if ( parent.parentNode ) {
-                                       parent.parentNode.selectedIndex;
-                               }
-                       }
-                       return null;
-               }
-       });
-}
-
-// IE6/7 call enctype encoding
-if ( !jQuery.support.enctype ) {
-       jQuery.propFix.enctype = "encoding";
-}
-
-// Radios and checkboxes getter/setter
-if ( !jQuery.support.checkOn ) {
-       jQuery.each([ "radio", "checkbox" ], function() {
-               jQuery.valHooks[ this ] = {
-                       get: function( elem ) {
-                               // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
-                               return elem.getAttribute("value") === null ? "on" : elem.value;
-                       }
-               };
-       });
-}
-jQuery.each([ "radio", "checkbox" ], function() {
-       jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
-               set: function( elem, value ) {
-                       if ( jQuery.isArray( value ) ) {
-                               return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
-                       }
-               }
-       });
-});
-
-
-
-
-var rformElems = /^(?:textarea|input|select)$/i,
-       rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
-       rhoverHack = /(?:^|\s)hover(\.\S+)?\b/,
-       rkeyEvent = /^key/,
-       rmouseEvent = /^(?:mouse|contextmenu)|click/,
-       rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
-       rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
-       quickParse = function( selector ) {
-               var quick = rquickIs.exec( selector );
-               if ( quick ) {
-                       //   0  1    2   3
-                       // [ _, tag, id, class ]
-                       quick[1] = ( quick[1] || "" ).toLowerCase();
-                       quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
-               }
-               return quick;
-       },
-       quickIs = function( elem, m ) {
-               var attrs = elem.attributes || {};
-               return (
-                       (!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
-                       (!m[2] || (attrs.id || {}).value === m[2]) &&
-                       (!m[3] || m[3].test( (attrs[ "class" ] || {}).value ))
-               );
-       },
-       hoverHack = function( events ) {
-               return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
-       };
-
-/*
- * Helper functions for managing events -- not part of the public interface.
- * Props to Dean Edwards' addEvent library for many of the ideas.
- */
-jQuery.event = {
-
-       add: function( elem, types, handler, data, selector ) {
-
-               var elemData, eventHandle, events,
-                       t, tns, type, namespaces, handleObj,
-                       handleObjIn, quick, handlers, special;
-
-               // Don't attach events to noData or text/comment nodes (allow plain objects tho)
-               if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
-                       return;
-               }
-
-               // Caller can pass in an object of custom data in lieu of the handler
-               if ( handler.handler ) {
-                       handleObjIn = handler;
-                       handler = handleObjIn.handler;
-                       selector = handleObjIn.selector;
-               }
-
-               // Make sure that the handler has a unique ID, used to find/remove it later
-               if ( !handler.guid ) {
-                       handler.guid = jQuery.guid++;
-               }
-
-               // Init the element's event structure and main handler, if this is the first
-               events = elemData.events;
-               if ( !events ) {
-                       elemData.events = events = {};
-               }
-               eventHandle = elemData.handle;
-               if ( !eventHandle ) {
-                       elemData.handle = eventHandle = function( e ) {
-                               // Discard the second event of a jQuery.event.trigger() and
-                               // when an event is called after a page has unloaded
-                               return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
-                                       jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
-                                       undefined;
-                       };
-                       // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
-                       eventHandle.elem = elem;
-               }
-
-               // Handle multiple events separated by a space
-               // jQuery(...).bind("mouseover mouseout", fn);
-               types = jQuery.trim( hoverHack(types) ).split( " " );
-               for ( t = 0; t < types.length; t++ ) {
-
-                       tns = rtypenamespace.exec( types[t] ) || [];
-                       type = tns[1];
-                       namespaces = ( tns[2] || "" ).split( "." ).sort();
-
-                       // If event changes its type, use the special event handlers for the changed type
-                       special = jQuery.event.special[ type ] || {};
-
-                       // If selector defined, determine special event api type, otherwise given type
-                       type = ( selector ? special.delegateType : special.bindType ) || type;
-
-                       // Update special based on newly reset type
-                       special = jQuery.event.special[ type ] || {};
-
-                       // handleObj is passed to all event handlers
-                       handleObj = jQuery.extend({
-                               type: type,
-                               origType: tns[1],
-                               data: data,
-                               handler: handler,
-                               guid: handler.guid,
-                               selector: selector,
-                               quick: selector && quickParse( selector ),
-                               namespace: namespaces.join(".")
-                       }, handleObjIn );
-
-                       // Init the event handler queue if we're the first
-                       handlers = events[ type ];
-                       if ( !handlers ) {
-                               handlers = events[ type ] = [];
-                               handlers.delegateCount = 0;
-
-                               // Only use addEventListener/attachEvent if the special events handler returns false
-                               if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
-                                       // Bind the global event handler to the element
-                                       if ( elem.addEventListener ) {
-                                               elem.addEventListener( type, eventHandle, false );
-
-                                       } else if ( elem.attachEvent ) {
-                                               elem.attachEvent( "on" + type, eventHandle );
-                                       }
-                               }
-                       }
-
-                       if ( special.add ) {
-                               special.add.call( elem, handleObj );
-
-                               if ( !handleObj.handler.guid ) {
-                                       handleObj.handler.guid = handler.guid;
-                               }
-                       }
-
-                       // Add to the element's handler list, delegates in front
-                       if ( selector ) {
-                               handlers.splice( handlers.delegateCount++, 0, handleObj );
-                       } else {
-                               handlers.push( handleObj );
-                       }
-
-                       // Keep track of which events have ever been used, for event optimization
-                       jQuery.event.global[ type ] = true;
-               }
-
-               // Nullify elem to prevent memory leaks in IE
-               elem = null;
-       },
-
-       global: {},
-
-       // Detach an event or set of events from an element
-       remove: function( elem, types, handler, selector, mappedTypes ) {
-
-               var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
-                       t, tns, type, origType, namespaces, origCount,
-                       j, events, special, handle, eventType, handleObj;
-
-               if ( !elemData || !(events = elemData.events) ) {
-                       return;
-               }
-
-               // Once for each type.namespace in types; type may be omitted
-               types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
-               for ( t = 0; t < types.length; t++ ) {
-                       tns = rtypenamespace.exec( types[t] ) || [];
-                       type = origType = tns[1];
-                       namespaces = tns[2];
-
-                       // Unbind all events (on this namespace, if provided) for the element
-                       if ( !type ) {
-                               for ( type in events ) {
-                                       jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
-                               }
-                               continue;
-                       }
-
-                       special = jQuery.event.special[ type ] || {};
-                       type = ( selector? special.delegateType : special.bindType ) || type;
-                       eventType = events[ type ] || [];
-                       origCount = eventType.length;
-                       namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
-
-                       // Remove matching events
-                       for ( j = 0; j < eventType.length; j++ ) {
-                               handleObj = eventType[ j ];
-
-                               if ( ( mappedTypes || origType === handleObj.origType ) &&
-                                        ( !handler || handler.guid === handleObj.guid ) &&
-                                        ( !namespaces || namespaces.test( handleObj.namespace ) ) &&
-                                        ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
-                                       eventType.splice( j--, 1 );
-
-                                       if ( handleObj.selector ) {
-                                               eventType.delegateCount--;
-                                       }
-                                       if ( special.remove ) {
-                                               special.remove.call( elem, handleObj );
-                                       }
-                               }
-                       }
-
-                       // Remove generic event handler if we removed something and no more handlers exist
-                       // (avoids potential for endless recursion during removal of special event handlers)
-                       if ( eventType.length === 0 && origCount !== eventType.length ) {
-                               if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
-                                       jQuery.removeEvent( elem, type, elemData.handle );
-                               }
-
-                               delete events[ type ];
-                       }
-               }
-
-               // Remove the expando if it's no longer used
-               if ( jQuery.isEmptyObject( events ) ) {
-                       handle = elemData.handle;
-                       if ( handle ) {
-                               handle.elem = null;
-                       }
-
-                       // removeData also checks for emptiness and clears the expando if empty
-                       // so use it instead of delete
-                       jQuery.removeData( elem, [ "events", "handle" ], true );
-               }
-       },
-
-       // Events that are safe to short-circuit if no handlers are attached.
-       // Native DOM events should not be added, they may have inline handlers.
-       customEvent: {
-               "getData": true,
-               "setData": true,
-               "changeData": true
-       },
-
-       trigger: function( event, data, elem, onlyHandlers ) {
-               // Don't do events on text and comment nodes
-               if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
-                       return;
-               }
-
-               // Event object or event type
-               var type = event.type || event,
-                       namespaces = [],
-                       cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
-
-               // focus/blur morphs to focusin/out; ensure we're not firing them right now
-               if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
-                       return;
-               }
-
-               if ( type.indexOf( "!" ) >= 0 ) {
-                       // Exclusive events trigger only for the exact event (no namespaces)
-                       type = type.slice(0, -1);
-                       exclusive = true;
-               }
-
-               if ( type.indexOf( "." ) >= 0 ) {
-                       // Namespaced trigger; create a regexp to match event type in handle()
-                       namespaces = type.split(".");
-                       type = namespaces.shift();
-                       namespaces.sort();
-               }
-
-               if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
-                       // No jQuery handlers for this event type, and it can't have inline handlers
-                       return;
-               }
-
-               // Caller can pass in an Event, Object, or just an event type string
-               event = typeof event === "object" ?
-                       // jQuery.Event object
-                       event[ jQuery.expando ] ? event :
-                       // Object literal
-                       new jQuery.Event( type, event ) :
-                       // Just the event type (string)
-                       new jQuery.Event( type );
-
-               event.type = type;
-               event.isTrigger = true;
-               event.exclusive = exclusive;
-               event.namespace = namespaces.join( "." );
-               event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
-               ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
-
-               // Handle a global trigger
-               if ( !elem ) {
-
-                       // TODO: Stop taunting the data cache; remove global events and always attach to document
-                       cache = jQuery.cache;
-                       for ( i in cache ) {
-                               if ( cache[ i ].events && cache[ i ].events[ type ] ) {
-                                       jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
-                               }
-                       }
-                       return;
-               }
-
-               // Clean up the event in case it is being reused
-               event.result = undefined;
-               if ( !event.target ) {
-                       event.target = elem;
-               }
-
-               // Clone any incoming data and prepend the event, creating the handler arg list
-               data = data != null ? jQuery.makeArray( data ) : [];
-               data.unshift( event );
-
-               // Allow special events to draw outside the lines
-               special = jQuery.event.special[ type ] || {};
-               if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
-                       return;
-               }
-
-               // Determine event propagation path in advance, per W3C events spec (#9951)
-               // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
-               eventPath = [[ elem, special.bindType || type ]];
-               if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
-
-                       bubbleType = special.delegateType || type;
-                       cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
-                       old = null;
-                       for ( ; cur; cur = cur.parentNode ) {
-                               eventPath.push([ cur, bubbleType ]);
-                               old = cur;
-                       }
-
-                       // Only add window if we got to document (e.g., not plain obj or detached DOM)
-                       if ( old && old === elem.ownerDocument ) {
-                               eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
-                       }
-               }
-
-               // Fire handlers on the event path
-               for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
-
-                       cur = eventPath[i][0];
-                       event.type = eventPath[i][1];
-
-                       handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
-                       if ( handle ) {
-                               handle.apply( cur, data );
-                       }
-                       // Note that this is a bare JS function and not a jQuery handler
-                       handle = ontype && cur[ ontype ];
-                       if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) {
-                               event.preventDefault();
-                       }
-               }
-               event.type = type;
-
-               // If nobody prevented the default action, do it now
-               if ( !onlyHandlers && !event.isDefaultPrevented() ) {
-
-                       if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
-                               !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
-
-                               // Call a native DOM method on the target with the same name name as the event.
-                               // Can't use an .isFunction() check here because IE6/7 fails that test.
-                               // Don't do default actions on window, that's where global variables be (#6170)
-                               // IE<9 dies on focus/blur to hidden element (#1486)
-                               if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
-
-                                       // Don't re-trigger an onFOO event when we call its FOO() method
-                                       old = elem[ ontype ];
-
-                                       if ( old ) {
-                                               elem[ ontype ] = null;
-                                       }
-
-                                       // Prevent re-triggering of the same event, since we already bubbled it above
-                                       jQuery.event.triggered = type;
-                                       elem[ type ]();
-                                       jQuery.event.triggered = undefined;
-
-                                       if ( old ) {
-                                               elem[ ontype ] = old;
-                                       }
-                               }
-                       }
-               }
-
-               return event.result;
-       },
-
-       dispatch: function( event ) {
-
-               // Make a writable jQuery.Event from the native event object
-               event = jQuery.event.fix( event || window.event );
-
-               var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
-                       delegateCount = handlers.delegateCount,
-                       args = [].slice.call( arguments, 0 ),
-                       run_all = !event.exclusive && !event.namespace,
-                       special = jQuery.event.special[ event.type ] || {},
-                       handlerQueue = [],
-                       i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related;
-
-               // Use the fix-ed jQuery.Event rather than the (read-only) native event
-               args[0] = event;
-               event.delegateTarget = this;
-
-               // Call the preDispatch hook for the mapped type, and let it bail if desired
-               if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
-                       return;
-               }
-
-               // Determine handlers that should run if there are delegated events
-               // Avoid non-left-click bubbling in Firefox (#3861)
-               if ( delegateCount && !(event.button && event.type === "click") ) {
-
-                       // Pregenerate a single jQuery object for reuse with .is()
-                       jqcur = jQuery(this);
-                       jqcur.context = this.ownerDocument || this;
-
-                       for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
-
-                               // Don't process events on disabled elements (#6911, #8165)
-                               if ( cur.disabled !== true ) {
-                                       selMatch = {};
-                                       matches = [];
-                                       jqcur[0] = cur;
-                                       for ( i = 0; i < delegateCount; i++ ) {
-                                               handleObj = handlers[ i ];
-                                               sel = handleObj.selector;
-
-                                               if ( selMatch[ sel ] === undefined ) {
-                                                       selMatch[ sel ] = (
-                                                               handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel )
-                                                       );
-                                               }
-                                               if ( selMatch[ sel ] ) {
-                                                       matches.push( handleObj );
-                                               }
-                                       }
-                                       if ( matches.length ) {
-                                               handlerQueue.push({ elem: cur, matches: matches });
-                                       }
-                               }
-                       }
-               }
-
-               // Add the remaining (directly-bound) handlers
-               if ( handlers.length > delegateCount ) {
-                       handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
-               }
-
-               // Run delegates first; they may want to stop propagation beneath us
-               for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
-                       matched = handlerQueue[ i ];
-                       event.currentTarget = matched.elem;
-
-                       for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
-                               handleObj = matched.matches[ j ];
-
-                               // Triggered event must either 1) be non-exclusive and have no namespace, or
-                               // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
-                               if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
-
-                                       event.data = handleObj.data;
-                                       event.handleObj = handleObj;
-
-                                       ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
-                                                       .apply( matched.elem, args );
-
-                                       if ( ret !== undefined ) {
-                                               event.result = ret;
-                                               if ( ret === false ) {
-                                                       event.preventDefault();
-                                                       event.stopPropagation();
-                                               }
-                                       }
-                               }
-                       }
-               }
-
-               // Call the postDispatch hook for the mapped type
-               if ( special.postDispatch ) {
-                       special.postDispatch.call( this, event );
-               }
-
-               return event.result;
-       },
-
-       // Includes some event props shared by KeyEvent and MouseEvent
-       // *** attrChange attrName relatedNode srcElement  are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
-       props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
-
-       fixHooks: {},
-
-       keyHooks: {
-               props: "char charCode key keyCode".split(" "),
-               filter: function( event, original ) {
-
-                       // Add which for key events
-                       if ( event.which == null ) {
-                               event.which = original.charCode != null ? original.charCode : original.keyCode;
-                       }
-
-                       return event;
-               }
-       },
-
-       mouseHooks: {
-               props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
-               filter: function( event, original ) {
-                       var eventDoc, doc, body,
-                               button = original.button,
-                               fromElement = original.fromElement;
-
-                       // Calculate pageX/Y if missing and clientX/Y available
-                       if ( event.pageX == null && original.clientX != null ) {
-                               eventDoc = event.target.ownerDocument || document;
-                               doc = eventDoc.documentElement;
-                               body = eventDoc.body;
-
-                               event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
-                               event.pageY = original.clientY + ( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) - ( doc && doc.clientTop  || body && body.clientTop  || 0 );
-                       }
-
-                       // Add relatedTarget, if necessary
-                       if ( !event.relatedTarget && fromElement ) {
-                               event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
-                       }
-
-                       // Add which for click: 1 === left; 2 === middle; 3 === right
-                       // Note: button is not normalized, so don't use it
-                       if ( !event.which && button !== undefined ) {
-                               event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
-                       }
-
-                       return event;
-               }
-       },
-
-       fix: function( event ) {
-               if ( event[ jQuery.expando ] ) {
-                       return event;
-               }
-
-               // Create a writable copy of the event object and normalize some properties
-               var i, prop,
-                       originalEvent = event,
-                       fixHook = jQuery.event.fixHooks[ event.type ] || {},
-                       copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
-
-               event = jQuery.Event( originalEvent );
-
-               for ( i = copy.length; i; ) {
-                       prop = copy[ --i ];
-                       event[ prop ] = originalEvent[ prop ];
-               }
-
-               // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
-               if ( !event.target ) {
-                       event.target = originalEvent.srcElement || document;
-               }
-
-               // Target should not be a text node (#504, Safari)
-               if ( event.target.nodeType === 3 ) {
-                       event.target = event.target.parentNode;
-               }
-
-               // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)
-               if ( event.metaKey === undefined ) {
-                       event.metaKey = event.ctrlKey;
-               }
-
-               return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
-       },
-
-       special: {
-               ready: {
-                       // Make sure the ready event is setup
-                       setup: jQuery.bindReady
-               },
-
-               load: {
-                       // Prevent triggered image.load events from bubbling to window.load
-                       noBubble: true
-               },
-
-               focus: {
-                       delegateType: "focusin"
-               },
-               blur: {
-                       delegateType: "focusout"
-               },
-
-               beforeunload: {
-                       setup: function( data, namespaces, eventHandle ) {
-                               // We only want to do this special case on windows
-                               if ( jQuery.isWindow( this ) ) {
-                                       this.onbeforeunload = eventHandle;
-                               }
-                       },
-
-                       teardown: function( namespaces, eventHandle ) {
-                               if ( this.onbeforeunload === eventHandle ) {
-                                       this.onbeforeunload = null;
-                               }
-                       }
-               }
-       },
-
-       simulate: function( type, elem, event, bubble ) {
-               // Piggyback on a donor event to simulate a different one.
-               // Fake originalEvent to avoid donor's stopPropagation, but if the
-               // simulated event prevents default then we do the same on the donor.
-               var e = jQuery.extend(
-                       new jQuery.Event(),
-                       event,
-                       { type: type,
-                               isSimulated: true,
-                               originalEvent: {}
-                       }
-               );
-               if ( bubble ) {
-                       jQuery.event.trigger( e, null, elem );
-               } else {
-                       jQuery.event.dispatch.call( elem, e );
-               }
-               if ( e.isDefaultPrevented() ) {
-                       event.preventDefault();
-               }
-       }
-};
-
-// Some plugins are using, but it's undocumented/deprecated and will be removed.
-// The 1.7 special event interface should provide all the hooks needed now.
-jQuery.event.handle = jQuery.event.dispatch;
-
-jQuery.removeEvent = document.removeEventListener ?
-       function( elem, type, handle ) {
-               if ( elem.removeEventListener ) {
-                       elem.removeEventListener( type, handle, false );
-               }
-       } :
-       function( elem, type, handle ) {
-               if ( elem.detachEvent ) {
-                       elem.detachEvent( "on" + type, handle );
-               }
-       };
-
-jQuery.Event = function( src, props ) {
-       // Allow instantiation without the 'new' keyword
-       if ( !(this instanceof jQuery.Event) ) {
-               return new jQuery.Event( src, props );
-       }
-
-       // Event object
-       if ( src && src.type ) {
-               this.originalEvent = src;
-               this.type = src.type;
-
-               // Events bubbling up the document may have been marked as prevented
-               // by a handler lower down the tree; reflect the correct value.
-               this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
-                       src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
-
-       // Event type
-       } else {
-               this.type = src;
-       }
-
-       // Put explicitly provided properties onto the event object
-       if ( props ) {
-               jQuery.extend( this, props );
-       }
-
-       // Create a timestamp if incoming event doesn't have one
-       this.timeStamp = src && src.timeStamp || jQuery.now();
-
-       // Mark it as fixed
-       this[ jQuery.expando ] = true;
-};
-
-function returnFalse() {
-       return false;
-}
-function returnTrue() {
-       return true;
-}
-
-// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
-// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
-jQuery.Event.prototype = {
-       preventDefault: function() {
-               this.isDefaultPrevented = returnTrue;
-
-               var e = this.originalEvent;
-               if ( !e ) {
-                       return;
-               }
-
-               // if preventDefault exists run it on the original event
-               if ( e.preventDefault ) {
-                       e.preventDefault();
-
-               // otherwise set the returnValue property of the original event to false (IE)
-               } else {
-                       e.returnValue = false;
-               }
-       },
-       stopPropagation: function() {
-               this.isPropagationStopped = returnTrue;
-
-               var e = this.originalEvent;
-               if ( !e ) {
-                       return;
-               }
-               // if stopPropagation exists run it on the original event
-               if ( e.stopPropagation ) {
-                       e.stopPropagation();
-               }
-               // otherwise set the cancelBubble property of the original event to true (IE)
-               e.cancelBubble = true;
-       },
-       stopImmediatePropagation: function() {
-               this.isImmediatePropagationStopped = returnTrue;
-               this.stopPropagation();
-       },
-       isDefaultPrevented: returnFalse,
-       isPropagationStopped: returnFalse,
-       isImmediatePropagationStopped: returnFalse
-};
-
-// Create mouseenter/leave events using mouseover/out and event-time checks
-jQuery.each({
-       mouseenter: "mouseover",
-       mouseleave: "mouseout"
-}, function( orig, fix ) {
-       jQuery.event.special[ orig ] = {
-               delegateType: fix,
-               bindType: fix,
-
-               handle: function( event ) {
-                       var target = this,
-                               related = event.relatedTarget,
-                               handleObj = event.handleObj,
-                               selector = handleObj.selector,
-                               ret;
-
-                       // For mousenter/leave call the handler if related is outside the target.
-                       // NB: No relatedTarget if the mouse left/entered the browser window
-                       if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
-                               event.type = handleObj.origType;
-                               ret = handleObj.handler.apply( this, arguments );
-                               event.type = fix;
-                       }
-                       return ret;
-               }
-       };
-});
-
-// IE submit delegation
-if ( !jQuery.support.submitBubbles ) {
-
-       jQuery.event.special.submit = {
-               setup: function() {
-                       // Only need this for delegated form submit events
-                       if ( jQuery.nodeName( this, "form" ) ) {
-                               return false;
-                       }
-
-                       // Lazy-add a submit handler when a descendant form may potentially be submitted
-                       jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
-                               // Node name check avoids a VML-related crash in IE (#9807)
-                               var elem = e.target,
-                                       form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
-                               if ( form && !form._submit_attached ) {
-                                       jQuery.event.add( form, "submit._submit", function( event ) {
-                                               event._submit_bubble = true;
-                                       });
-                                       form._submit_attached = true;
-                               }
-                       });
-                       // return undefined since we don't need an event listener
-               },
-               
-               postDispatch: function( event ) {
-                       // If form was submitted by the user, bubble the event up the tree
-                       if ( event._submit_bubble ) {
-                               delete event._submit_bubble;
-                               if ( this.parentNode && !event.isTrigger ) {
-                                       jQuery.event.simulate( "submit", this.parentNode, event, true );
-                               }
-                       }
-               },
-
-               teardown: function() {
-                       // Only need this for delegated form submit events
-                       if ( jQuery.nodeName( this, "form" ) ) {
-                               return false;
-                       }
-
-                       // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
-                       jQuery.event.remove( this, "._submit" );
-               }
-       };
-}
-
-// IE change delegation and checkbox/radio fix
-if ( !jQuery.support.changeBubbles ) {
-
-       jQuery.event.special.change = {
-
-               setup: function() {
-
-                       if ( rformElems.test( this.nodeName ) ) {
-                               // IE doesn't fire change on a check/radio until blur; trigger it on click
-                               // after a propertychange. Eat the blur-change in special.change.handle.
-                               // This still fires onchange a second time for check/radio after blur.
-                               if ( this.type === "checkbox" || this.type === "radio" ) {
-                                       jQuery.event.add( this, "propertychange._change", function( event ) {
-                                               if ( event.originalEvent.propertyName === "checked" ) {
-                                                       this._just_changed = true;
-                                               }
-                                       });
-                                       jQuery.event.add( this, "click._change", function( event ) {
-                                               if ( this._just_changed && !event.isTrigger ) {
-                                                       this._just_changed = false;
-                                                       jQuery.event.simulate( "change", this, event, true );
-                                               }
-                                       });
-                               }
-                               return false;
-                       }
-                       // Delegated event; lazy-add a change handler on descendant inputs
-                       jQuery.event.add( this, "beforeactivate._change", function( e ) {
-                               var elem = e.target;
-
-                               if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) {
-                                       jQuery.event.add( elem, "change._change", function( event ) {
-                                               if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
-                                                       jQuery.event.simulate( "change", this.parentNode, event, true );
-                                               }
-                                       });
-                                       elem._change_attached = true;
-                               }
-                       });
-               },
-
-               handle: function( event ) {
-                       var elem = event.target;
-
-                       // Swallow native change events from checkbox/radio, we already triggered them above
-                       if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
-                               return event.handleObj.handler.apply( this, arguments );
-                       }
-               },
-
-               teardown: function() {
-                       jQuery.event.remove( this, "._change" );
-
-                       return rformElems.test( this.nodeName );
-               }
-       };
-}
-
-// Create "bubbling" focus and blur events
-if ( !jQuery.support.focusinBubbles ) {
-       jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
-
-               // Attach a single capturing handler while someone wants focusin/focusout
-               var attaches = 0,
-                       handler = function( event ) {
-                               jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
-                       };
-
-               jQuery.event.special[ fix ] = {
-                       setup: function() {
-                               if ( attaches++ === 0 ) {
-                                       document.addEventListener( orig, handler, true );
-                               }
-                       },
-                       teardown: function() {
-                               if ( --attaches === 0 ) {
-                                       document.removeEventListener( orig, handler, true );
-                               }
-                       }
-               };
-       });
-}
-
-jQuery.fn.extend({
-
-       on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
-               var origFn, type;
-
-               // Types can be a map of types/handlers
-               if ( typeof types === "object" ) {
-                       // ( types-Object, selector, data )
-                       if ( typeof selector !== "string" ) { // && selector != null
-                               // ( types-Object, data )
-                               data = data || selector;
-                               selector = undefined;
-                       }
-                       for ( type in types ) {
-                               this.on( type, selector, data, types[ type ], one );
-                       }
-                       return this;
-               }
-
-               if ( data == null && fn == null ) {
-                       // ( types, fn )
-                       fn = selector;
-                       data = selector = undefined;
-               } else if ( fn == null ) {
-                       if ( typeof selector === "string" ) {
-                               // ( types, selector, fn )
-                               fn = data;
-                               data = undefined;
-                       } else {
-                               // ( types, data, fn )
-                               fn = data;
-                               data = selector;
-                               selector = undefined;
-                       }
-               }
-               if ( fn === false ) {
-                       fn = returnFalse;
-               } else if ( !fn ) {
-                       return this;
-               }
-
-               if ( one === 1 ) {
-                       origFn = fn;
-                       fn = function( event ) {
-                               // Can use an empty set, since event contains the info
-                               jQuery().off( event );
-                               return origFn.apply( this, arguments );
-                       };
-                       // Use same guid so caller can remove using origFn
-                       fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
-               }
-               return this.each( function() {
-                       jQuery.event.add( this, types, fn, data, selector );
-               });
-       },
-       one: function( types, selector, data, fn ) {
-               return this.on( types, selector, data, fn, 1 );
-       },
-       off: function( types, selector, fn ) {
-               if ( types && types.preventDefault && types.handleObj ) {
-                       // ( event )  dispatched jQuery.Event
-                       var handleObj = types.handleObj;
-                       jQuery( types.delegateTarget ).off(
-                               handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
-                               handleObj.selector,
-                               handleObj.handler
-                       );
-                       return this;
-               }
-               if ( typeof types === "object" ) {
-                       // ( types-object [, selector] )
-                       for ( var type in types ) {
-                               this.off( type, selector, types[ type ] );
-                       }
-                       return this;
-               }
-               if ( selector === false || typeof selector === "function" ) {
-                       // ( types [, fn] )
-                       fn = selector;
-                       selector = undefined;
-               }
-               if ( fn === false ) {
-                       fn = returnFalse;
-               }
-               return this.each(function() {
-                       jQuery.event.remove( this, types, fn, selector );
-               });
-       },
-
-       bind: function( types, data, fn ) {
-               return this.on( types, null, data, fn );
-       },
-       unbind: function( types, fn ) {
-               return this.off( types, null, fn );
-       },
-
-       live: function( types, data, fn ) {
-               jQuery( this.context ).on( types, this.selector, data, fn );
-               return this;
-       },
-       die: function( types, fn ) {
-               jQuery( this.context ).off( types, this.selector || "**", fn );
-               return this;
-       },
-
-       delegate: function( selector, types, data, fn ) {
-               return this.on( types, selector, data, fn );
-       },
-       undelegate: function( selector, types, fn ) {
-               // ( namespace ) or ( selector, types [, fn] )
-               return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn );
-       },
-
-       trigger: function( type, data ) {
-               return this.each(function() {
-                       jQuery.event.trigger( type, data, this );
-               });
-       },
-       triggerHandler: function( type, data ) {
-               if ( this[0] ) {
-                       return jQuery.event.trigger( type, data, this[0], true );
-               }
-       },
-
-       toggle: function( fn ) {
-               // Save reference to arguments for access in closure
-               var args = arguments,
-                       guid = fn.guid || jQuery.guid++,
-                       i = 0,
-                       toggler = function( event ) {
-                               // Figure out which function to execute
-                               var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
-                               jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
-
-                               // Make sure that clicks stop
-                               event.preventDefault();
-
-                               // and execute the function
-                               return args[ lastToggle ].apply( this, arguments ) || false;
-                       };
-
-               // link all the functions, so any of them can unbind this click handler
-               toggler.guid = guid;
-               while ( i < args.length ) {
-                       args[ i++ ].guid = guid;
-               }
-
-               return this.click( toggler );
-       },
-
-       hover: function( fnOver, fnOut ) {
-               return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
-       }
-});
-
-jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
-       "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
-       "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
-
-       // Handle event binding
-       jQuery.fn[ name ] = function( data, fn ) {
-               if ( fn == null ) {
-                       fn = data;
-                       data = null;
-               }
-
-               return arguments.length > 0 ?
-                       this.on( name, null, data, fn ) :
-                       this.trigger( name );
-       };
-
-       if ( jQuery.attrFn ) {
-               jQuery.attrFn[ name ] = true;
-       }
-
-       if ( rkeyEvent.test( name ) ) {
-               jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
-       }
-
-       if ( rmouseEvent.test( name ) ) {
-               jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
-       }
-});
-
-
-
-/*!
- * Sizzle CSS Selector Engine
- *  Copyright 2011, The Dojo Foundation
- *  Released under the MIT, BSD, and GPL Licenses.
- *  More information: http://sizzlejs.com/
- */
-(function(){
-
-var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
-       expando = "sizcache" + (Math.random() + '').replace('.', ''),
-       done = 0,
-       toString = Object.prototype.toString,
-       hasDuplicate = false,
-       baseHasDuplicate = true,
-       rBackslash = /\\/g,
-       rReturn = /\r\n/g,
-       rNonWord = /\W/;
-
-// Here we check if the JavaScript engine is using some sort of
-// optimization where it does not always call our comparision
-// function. If that is the case, discard the hasDuplicate value.
-//   Thus far that includes Google Chrome.
-[0, 0].sort(function() {
-       baseHasDuplicate = false;
-       return 0;
-});
-
-var Sizzle = function( selector, context, results, seed ) {
-       results = results || [];
-       context = context || document;
-
-       var origContext = context;
-
-       if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
-               return [];
-       }
-
-       if ( !selector || typeof selector !== "string" ) {
-               return results;
-       }
-
-       var m, set, checkSet, extra, ret, cur, pop, i,
-               prune = true,
-               contextXML = Sizzle.isXML( context ),
-               parts = [],
-               soFar = selector;
-
-       // Reset the position of the chunker regexp (start from head)
-       do {
-               chunker.exec( "" );
-               m = chunker.exec( soFar );
-
-               if ( m ) {
-                       soFar = m[3];
-
-                       parts.push( m[1] );
-
-                       if ( m[2] ) {
-                               extra = m[3];
-                               break;
-                       }
-               }
-       } while ( m );
-
-       if ( parts.length > 1 && origPOS.exec( selector ) ) {
-
-               if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
-                       set = posProcess( parts[0] + parts[1], context, seed );
-
-               } else {
-                       set = Expr.relative[ parts[0] ] ?
-                               [ context ] :
-                               Sizzle( parts.shift(), context );
-
-                       while ( parts.length ) {
-                               selector = parts.shift();
-
-                               if ( Expr.relative[ selector ] ) {
-                                       selector += parts.shift();
-                               }
-
-                               set = posProcess( selector, set, seed );
-                       }
-               }
-
-       } else {
-               // Take a shortcut and set the context if the root selector is an ID
-               // (but not if it'll be faster if the inner selector is an ID)
-               if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
-                               Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
-
-                       ret = Sizzle.find( parts.shift(), context, contextXML );
-                       context = ret.expr ?
-                               Sizzle.filter( ret.expr, ret.set )[0] :
-                               ret.set[0];
-               }
-
-               if ( context ) {
-                       ret = seed ?
-                               { expr: parts.pop(), set: makeArray(seed) } :
-                               Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
-
-                       set = ret.expr ?
-                               Sizzle.filter( ret.expr, ret.set ) :
-                               ret.set;
-
-                       if ( parts.length > 0 ) {
-                               checkSet = makeArray( set );
-
-                       } else {
-                               prune = false;
-                       }
-
-                       while ( parts.length ) {
-                               cur = parts.pop();
-                               pop = cur;
-
-                               if ( !Expr.relative[ cur ] ) {
-                                       cur = "";
-                               } else {
-                                       pop = parts.pop();
-                               }
-
-                               if ( pop == null ) {
-                                       pop = context;
-                               }
-
-                               Expr.relative[ cur ]( checkSet, pop, contextXML );
-                       }
-
-               } else {
-                       checkSet = parts = [];
-               }
-       }
-
-       if ( !checkSet ) {
-               checkSet = set;
-       }
-
-       if ( !checkSet ) {
-               Sizzle.error( cur || selector );
-       }
-
-       if ( toString.call(checkSet) === "[object Array]" ) {
-               if ( !prune ) {
-                       results.push.apply( results, checkSet );
-
-               } else if ( context && context.nodeType === 1 ) {
-                       for ( i = 0; checkSet[i] != null; i++ ) {
-                               if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
-                                       results.push( set[i] );
-                               }
-                       }
-
-               } else {
-                       for ( i = 0; checkSet[i] != null; i++ ) {
-                               if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
-                                       results.push( set[i] );
-                               }
-                       }
-               }
-
-       } else {
-               makeArray( checkSet, results );
-       }
-
-       if ( extra ) {
-               Sizzle( extra, origContext, results, seed );
-               Sizzle.uniqueSort( results );
-       }
-
-       return results;
-};
-
-Sizzle.uniqueSort = function( results ) {
-       if ( sortOrder ) {
-               hasDuplicate = baseHasDuplicate;
-               results.sort( sortOrder );
-
-               if ( hasDuplicate ) {
-                       for ( var i = 1; i < results.length; i++ ) {
-                               if ( results[i] === results[ i - 1 ] ) {
-                                       results.splice( i--, 1 );
-                               }
-                       }
-               }
-       }
-
-       return results;
-};
-
-Sizzle.matches = function( expr, set ) {
-       return Sizzle( expr, null, null, set );
-};
-
-Sizzle.matchesSelector = function( node, expr ) {
-       return Sizzle( expr, null, null, [node] ).length > 0;
-};
-
-Sizzle.find = function( expr, context, isXML ) {
-       var set, i, len, match, type, left;
-
-       if ( !expr ) {
-               return [];
-       }
-
-       for ( i = 0, len = Expr.order.length; i < len; i++ ) {
-               type = Expr.order[i];
-
-               if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
-                       left = match[1];
-                       match.splice( 1, 1 );
-
-                       if ( left.substr( left.length - 1 ) !== "\\" ) {
-                               match[1] = (match[1] || "").replace( rBackslash, "" );
-                               set = Expr.find[ type ]( match, context, isXML );
-
-                               if ( set != null ) {
-                                       expr = expr.replace( Expr.match[ type ], "" );
-                                       break;
-                               }
-                       }
-               }
-       }
-
-       if ( !set ) {
-               set = typeof context.getElementsByTagName !== "undefined" ?
-                       context.getElementsByTagName( "*" ) :
-                       [];
-       }
-
-       return { set: set, expr: expr };
-};
-
-Sizzle.filter = function( expr, set, inplace, not ) {
-       var match, anyFound,
-               type, found, item, filter, left,
-               i, pass,
-               old = expr,
-               result = [],
-               curLoop = set,
-               isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
-
-       while ( expr && set.length ) {
-               for ( type in Expr.filter ) {
-                       if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
-                               filter = Expr.filter[ type ];
-                               left = match[1];
-
-                               anyFound = false;
-
-                               match.splice(1,1);
-
-                               if ( left.substr( left.length - 1 ) === "\\" ) {
-                                       continue;
-                               }
-
-                               if ( curLoop === result ) {
-                                       result = [];
-                               }
-
-                               if ( Expr.preFilter[ type ] ) {
-                                       match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
-
-                                       if ( !match ) {
-                                               anyFound = found = true;
-
-                                       } else if ( match === true ) {
-                                               continue;
-                                       }
-                               }
-
-                               if ( match ) {
-                                       for ( i = 0; (item = curLoop[i]) != null; i++ ) {
-                                               if ( item ) {
-                                                       found = filter( item, match, i, curLoop );
-                                                       pass = not ^ found;
-
-                                                       if ( inplace && found != null ) {
-                                                               if ( pass ) {
-                                                                       anyFound = true;
-
-                                                               } else {
-                                                                       curLoop[i] = false;
-                                                               }
-
-                                                       } else if ( pass ) {
-                                                               result.push( item );
-                                                               anyFound = true;
-                                                       }
-                                               }
-                                       }
-                               }
-
-                               if ( found !== undefined ) {
-                                       if ( !inplace ) {
-                                               curLoop = result;
-                                       }
-
-                                       expr = expr.replace( Expr.match[ type ], "" );
-
-                                       if ( !anyFound ) {
-                                               return [];
-                                       }
-
-                                       break;
-                               }
-                       }
-               }
-
-               // Improper expression
-               if ( expr === old ) {
-                       if ( anyFound == null ) {
-                               Sizzle.error( expr );
-
-                       } else {
-                               break;
-                       }
-               }
-
-               old = expr;
-       }
-
-       return curLoop;
-};
-
-Sizzle.error = function( msg ) {
-       throw new Error( "Syntax error, unrecognized expression: " + msg );
-};
-
-/**
- * Utility function for retreiving the text value of an array of DOM nodes
- * @param {Array|Element} elem
- */
-var getText = Sizzle.getText = function( elem ) {
-    var i, node,
-               nodeType = elem.nodeType,
-               ret = "";
-
-       if ( nodeType ) {
-               if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
-                       // Use textContent || innerText for elements
-                       if ( typeof elem.textContent === 'string' ) {
-                               return elem.textContent;
-                       } else if ( typeof elem.innerText === 'string' ) {
-                               // Replace IE's carriage returns
-                               return elem.innerText.replace( rReturn, '' );
-                       } else {
-                               // Traverse it's children
-                               for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
-                                       ret += getText( elem );
-                               }
-                       }
-               } else if ( nodeType === 3 || nodeType === 4 ) {
-                       return elem.nodeValue;
-               }
-       } else {
-
-               // If no nodeType, this is expected to be an array
-               for ( i = 0; (node = elem[i]); i++ ) {
-                       // Do not traverse comment nodes
-                       if ( node.nodeType !== 8 ) {
-                               ret += getText( node );
-                       }
-               }
-       }
-       return ret;
-};
-
-var Expr = Sizzle.selectors = {
-       order: [ "ID", "NAME", "TAG" ],
-
-       match: {
-               ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
-               CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
-               NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
-               ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
-               TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
-               CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
-               POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
-               PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
-       },
-
-       leftMatch: {},
-
-       attrMap: {
-               "class": "className",
-               "for": "htmlFor"
-       },
-
-       attrHandle: {
-               href: function( elem ) {
-                       return elem.getAttribute( "href" );
-               },
-               type: function( elem ) {
-                       return elem.getAttribute( "type" );
-               }
-       },
-
-       relative: {
-               "+": function(checkSet, part){
-                       var isPartStr = typeof part === "string",
-                               isTag = isPartStr && !rNonWord.test( part ),
-                               isPartStrNotTag = isPartStr && !isTag;
-
-                       if ( isTag ) {
-                               part = part.toLowerCase();
-                       }
-
-                       for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
-                               if ( (elem = checkSet[i]) ) {
-                                       while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
-
-                                       checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
-                                               elem || false :
-                                               elem === part;
-                               }
-                       }
-
-                       if ( isPartStrNotTag ) {
-                               Sizzle.filter( part, checkSet, true );
-                       }
-               },
-
-               ">": function( checkSet, part ) {
-                       var elem,
-                               isPartStr = typeof part === "string",
-                               i = 0,
-                               l = checkSet.length;
-
-                       if ( isPartStr && !rNonWord.test( part ) ) {
-                               part = part.toLowerCase();
-
-                               for ( ; i < l; i++ ) {
-                                       elem = checkSet[i];
-
-                                       if ( elem ) {
-                                               var parent = elem.parentNode;
-                                               checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
-                                       }
-                               }
-
-                       } else {
-                               for ( ; i < l; i++ ) {
-                                       elem = checkSet[i];
-
-                                       if ( elem ) {
-                                               checkSet[i] = isPartStr ?
-                                                       elem.parentNode :
-                                                       elem.parentNode === part;
-                                       }
-                               }
-
-                               if ( isPartStr ) {
-                                       Sizzle.filter( part, checkSet, true );
-                               }
-                       }
-               },
-
-               "": function(checkSet, part, isXML){
-                       var nodeCheck,
-                               doneName = done++,
-                               checkFn = dirCheck;
-
-                       if ( typeof part === "string" && !rNonWord.test( part ) ) {
-                               part = part.toLowerCase();
-                               nodeCheck = part;
-                               checkFn = dirNodeCheck;
-                       }
-
-                       checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
-               },
-
-               "~": function( checkSet, part, isXML ) {
-                       var nodeCheck,
-                               doneName = done++,
-                               checkFn = dirCheck;
-
-                       if ( typeof part === "string" && !rNonWord.test( part ) ) {
-                               part = part.toLowerCase();
-                               nodeCheck = part;
-                               checkFn = dirNodeCheck;
-                       }
-
-                       checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
-               }
-       },
-
-       find: {
-               ID: function( match, context, isXML ) {
-                       if ( typeof context.getElementById !== "undefined" && !isXML ) {
-                               var m = context.getElementById(match[1]);
-                               // Check parentNode to catch when Blackberry 4.6 returns
-                               // nodes that are no longer in the document #6963
-                               return m && m.parentNode ? [m] : [];
-                       }
-               },
-
-               NAME: function( match, context ) {
-                       if ( typeof context.getElementsByName !== "undefined" ) {
-                               var ret = [],
-                                       results = context.getElementsByName( match[1] );
-
-                               for ( var i = 0, l = results.length; i < l; i++ ) {
-                                       if ( results[i].getAttribute("name") === match[1] ) {
-                                               ret.push( results[i] );
-                                       }
-                               }
-
-                               return ret.length === 0 ? null : ret;
-                       }
-               },
-
-               TAG: function( match, context ) {
-                       if ( typeof context.getElementsByTagName !== "undefined" ) {
-                               return context.getElementsByTagName( match[1] );
-                       }
-               }
-       },
-       preFilter: {
-               CLASS: function( match, curLoop, inplace, result, not, isXML ) {
-                       match = " " + match[1].replace( rBackslash, "" ) + " ";
-
-                       if ( isXML ) {
-                               return match;
-                       }
-
-                       for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
-                               if ( elem ) {
-                                       if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
-                                               if ( !inplace ) {
-                                                       result.push( elem );
-                                               }
-
-                                       } else if ( inplace ) {
-                                               curLoop[i] = false;
-                                       }
-                               }
-                       }
-
-                       return false;
-               },
-
-               ID: function( match ) {
-                       return match[1].replace( rBackslash, "" );
-               },
-
-               TAG: function( match, curLoop ) {
-                       return match[1].replace( rBackslash, "" ).toLowerCase();
-               },
-
-               CHILD: function( match ) {
-                       if ( match[1] === "nth" ) {
-                               if ( !match[2] ) {
-                                       Sizzle.error( match[0] );
-                               }
-
-                               match[2] = match[2].replace(/^\+|\s*/g, '');
-
-                               // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
-                               var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
-                                       match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
-                                       !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
-
-                               // calculate the numbers (first)n+(last) including if they are negative
-                               match[2] = (test[1] + (test[2] || 1)) - 0;
-                               match[3] = test[3] - 0;
-                       }
-                       else if ( match[2] ) {
-                               Sizzle.error( match[0] );
-                       }
-
-                       // TODO: Move to normal caching system
-                       match[0] = done++;
-
-                       return match;
-               },
-
-               ATTR: function( match, curLoop, inplace, result, not, isXML ) {
-                       var name = match[1] = match[1].replace( rBackslash, "" );
-
-                       if ( !isXML && Expr.attrMap[name] ) {
-                               match[1] = Expr.attrMap[name];
-                       }
-
-                       // Handle if an un-quoted value was used
-                       match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
-
-                       if ( match[2] === "~=" ) {
-                               match[4] = " " + match[4] + " ";
-                       }
-
-                       return match;
-               },
-
-               PSEUDO: function( match, curLoop, inplace, result, not ) {
-                       if ( match[1] === "not" ) {
-                               // If we're dealing with a complex expression, or a simple one
-                               if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
-                                       match[3] = Sizzle(match[3], null, null, curLoop);
-
-                               } else {
-                                       var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
-
-                                       if ( !inplace ) {
-                                               result.push.apply( result, ret );
-                                       }
-
-                                       return false;
-                               }
-
-                       } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
-                               return true;
-                       }
-
-                       return match;
-               },
-
-               POS: function( match ) {
-                       match.unshift( true );
-
-                       return match;
-               }
-       },
-
-       filters: {
-               enabled: function( elem ) {
-                       return elem.disabled === false && elem.type !== "hidden";
-               },
-
-               disabled: function( elem ) {
-                       return elem.disabled === true;
-               },
-
-               checked: function( elem ) {
-                       return elem.checked === true;
-               },
-
-               selected: function( elem ) {
-                       // Accessing this property makes selected-by-default
-                       // options in Safari work properly
-                       if ( elem.parentNode ) {
-                               elem.parentNode.selectedIndex;
-                       }
-
-                       return elem.selected === true;
-               },
-
-               parent: function( elem ) {
-                       return !!elem.firstChild;
-               },
-
-               empty: function( elem ) {
-                       return !elem.firstChild;
-               },
-
-               has: function( elem, i, match ) {
-                       return !!Sizzle( match[3], elem ).length;
-               },
-
-               header: function( elem ) {
-                       return (/h\d/i).test( elem.nodeName );
-               },
-
-               text: function( elem ) {
-                       var attr = elem.getAttribute( "type" ), type = elem.type;
-                       // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
-                       // use getAttribute instead to test this case
-                       return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
-               },
-
-               radio: function( elem ) {
-                       return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
-               },
-
-               checkbox: function( elem ) {
-                       return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
-               },
-
-               file: function( elem ) {
-                       return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
-               },
-
-               password: function( elem ) {
-                       return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
-               },
-
-               submit: function( elem ) {
-                       var name = elem.nodeName.toLowerCase();
-                       return (name === "input" || name === "button") && "submit" === elem.type;
-               },
-
-               image: function( elem ) {
-                       return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
-               },
-
-               reset: function( elem ) {
-                       var name = elem.nodeName.toLowerCase();
-                       return (name === "input" || name === "button") && "reset" === elem.type;
-               },
-
-               button: function( elem ) {
-                       var name = elem.nodeName.toLowerCase();
-                       return name === "input" && "button" === elem.type || name === "button";
-               },
-
-               input: function( elem ) {
-                       return (/input|select|textarea|button/i).test( elem.nodeName );
-               },
-
-               focus: function( elem ) {
-                       return elem === elem.ownerDocument.activeElement;
-               }
-       },
-       setFilters: {
-               first: function( elem, i ) {
-                       return i === 0;
-               },
-
-               last: function( elem, i, match, array ) {
-                       return i === array.length - 1;
-               },
-
-               even: function( elem, i ) {
-                       return i % 2 === 0;
-               },
-
-               odd: function( elem, i ) {
-                       return i % 2 === 1;
-               },
-
-               lt: function( elem, i, match ) {
-                       return i < match[3] - 0;
-               },
-
-               gt: function( elem, i, match ) {
-                       return i > match[3] - 0;
-               },
-
-               nth: function( elem, i, match ) {
-                       return match[3] - 0 === i;
-               },
-
-               eq: function( elem, i, match ) {
-                       return match[3] - 0 === i;
-               }
-       },
-       filter: {
-               PSEUDO: function( elem, match, i, array ) {
-                       var name = match[1],
-                               filter = Expr.filters[ name ];
-
-                       if ( filter ) {
-                               return filter( elem, i, match, array );
-
-                       } else if ( name === "contains" ) {
-                               return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
-
-                       } else if ( name === "not" ) {
-                               var not = match[3];
-
-                               for ( var j = 0, l = not.length; j < l; j++ ) {
-                                       if ( not[j] === elem ) {
-                                               return false;
-                                       }
-                               }
-
-                               return true;
-
-                       } else {
-                               Sizzle.error( name );
-                       }
-               },
-
-               CHILD: function( elem, match ) {
-                       var first, last,
-                               doneName, parent, cache,
-                               count, diff,
-                               type = match[1],
-                               node = elem;
-
-                       switch ( type ) {
-                               case "only":
-                               case "first":
-                                       while ( (node = node.previousSibling) ) {
-                                               if ( node.nodeType === 1 ) {
-                                                       return false;
-                                               }
-                                       }
-
-                                       if ( type === "first" ) {
-                                               return true;
-                                       }
-
-                                       node = elem;
-
-                                       /* falls through */
-                               case "last":
-                                       while ( (node = node.nextSibling) ) {
-                                               if ( node.nodeType === 1 ) {
-                                                       return false;
-                                               }
-                                       }
-
-                                       return true;
-
-                               case "nth":
-                                       first = match[2];
-                                       last = match[3];
-
-                                       if ( first === 1 && last === 0 ) {
-                                               return true;
-                                       }
-
-                                       doneName = match[0];
-                                       parent = elem.parentNode;
-
-                                       if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
-                                               count = 0;
-
-                                               for ( node = parent.firstChild; node; node = node.nextSibling ) {
-                                                       if ( node.nodeType === 1 ) {
-                                                               node.nodeIndex = ++count;
-                                                       }
-                                               }
-
-                                               parent[ expando ] = doneName;
-                                       }
-
-                                       diff = elem.nodeIndex - last;
-
-                                       if ( first === 0 ) {
-                                               return diff === 0;
-
-                                       } else {
-                                               return ( diff % first === 0 && diff / first >= 0 );
-                                       }
-                       }
-               },
-
-               ID: function( elem, match ) {
-                       return elem.nodeType === 1 && elem.getAttribute("id") === match;
-               },
-
-               TAG: function( elem, match ) {
-                       return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
-               },
-
-               CLASS: function( elem, match ) {
-                       return (" " + (elem.className || elem.getAttribute("class")) + " ")
-                               .indexOf( match ) > -1;
-               },
-
-               ATTR: function( elem, match ) {
-                       var name = match[1],
-                               result = Sizzle.attr ?
-                                       Sizzle.attr( elem, name ) :
-                                       Expr.attrHandle[ name ] ?
-                                       Expr.attrHandle[ name ]( elem ) :
-                                       elem[ name ] != null ?
-                                               elem[ name ] :
-                                               elem.getAttribute( name ),
-                               value = result + "",
-                               type = match[2],
-                               check = match[4];
-
-                       return result == null ?
-                               type === "!=" :
-                               !type && Sizzle.attr ?
-                               result != null :
-                               type === "=" ?
-                               value === check :
-                               type === "*=" ?
-                               value.indexOf(check) >= 0 :
-                               type === "~=" ?
-                               (" " + value + " ").indexOf(check) >= 0 :
-                               !check ?
-                               value && result !== false :
-                               type === "!=" ?
-                               value !== check :
-                               type === "^=" ?
-                               value.indexOf(check) === 0 :
-                               type === "$=" ?
-                               value.substr(value.length - check.length) === check :
-                               type === "|=" ?
-                               value === check || value.substr(0, check.length + 1) === check + "-" :
-                               false;
-               },
-
-               POS: function( elem, match, i, array ) {
-                       var name = match[2],
-                               filter = Expr.setFilters[ name ];
-
-                       if ( filter ) {
-                               return filter( elem, i, match, array );
-                       }
-               }
-       }
-};
-
-var origPOS = Expr.match.POS,
-       fescape = function(all, num){
-               return "\\" + (num - 0 + 1);
-       };
-
-for ( var type in Expr.match ) {
-       Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
-       Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
-}
-// Expose origPOS
-// "global" as in regardless of relation to brackets/parens
-Expr.match.globalPOS = origPOS;
-
-var makeArray = function( array, results ) {
-       array = Array.prototype.slice.call( array, 0 );
-
-       if ( results ) {
-               results.push.apply( results, array );
-               return results;
-       }
-
-       return array;
-};
-
-// Perform a simple check to determine if the browser is capable of
-// converting a NodeList to an array using builtin methods.
-// Also verifies that the returned array holds DOM nodes
-// (which is not the case in the Blackberry browser)
-try {
-       Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
-
-// Provide a fallback method if it does not work
-} catch( e ) {
-       makeArray = function( array, results ) {
-               var i = 0,
-                       ret = results || [];
-
-               if ( toString.call(array) === "[object Array]" ) {
-                       Array.prototype.push.apply( ret, array );
-
-               } else {
-                       if ( typeof array.length === "number" ) {
-                               for ( var l = array.length; i < l; i++ ) {
-                                       ret.push( array[i] );
-                               }
-
-                       } else {
-                               for ( ; array[i]; i++ ) {
-                                       ret.push( array[i] );
-                               }
-                       }
-               }
-
-               return ret;
-       };
-}
-
-var sortOrder, siblingCheck;
-
-if ( document.documentElement.compareDocumentPosition ) {
-       sortOrder = function( a, b ) {
-               if ( a === b ) {
-                       hasDuplicate = true;
-                       return 0;
-               }
-
-               if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
-                       return a.compareDocumentPosition ? -1 : 1;
-               }
-
-               return a.compareDocumentPosition(b) & 4 ? -1 : 1;
-       };
-
-} else {
-       sortOrder = function( a, b ) {
-               // The nodes are identical, we can exit early
-               if ( a === b ) {
-                       hasDuplicate = true;
-                       return 0;
-
-               // Fallback to using sourceIndex (in IE) if it's available on both nodes
-               } else if ( a.sourceIndex && b.sourceIndex ) {
-                       return a.sourceIndex - b.sourceIndex;
-               }
-
-               var al, bl,
-                       ap = [],
-                       bp = [],
-                       aup = a.parentNode,
-                       bup = b.parentNode,
-                       cur = aup;
-
-               // If the nodes are siblings (or identical) we can do a quick check
-               if ( aup === bup ) {
-                       return siblingCheck( a, b );
-
-               // If no parents were found then the nodes are disconnected
-               } else if ( !aup ) {
-                       return -1;
-
-               } else if ( !bup ) {
-                       return 1;
-               }
-
-               // Otherwise they're somewhere else in the tree so we need
-               // to build up a full list of the parentNodes for comparison
-               while ( cur ) {
-                       ap.unshift( cur );
-                       cur = cur.parentNode;
-               }
-
-               cur = bup;
-
-               while ( cur ) {
-                       bp.unshift( cur );
-                       cur = cur.parentNode;
-               }
-
-               al = ap.length;
-               bl = bp.length;
-
-               // Start walking down the tree looking for a discrepancy
-               for ( var i = 0; i < al && i < bl; i++ ) {
-                       if ( ap[i] !== bp[i] ) {
-                               return siblingCheck( ap[i], bp[i] );
-                       }
-               }
-
-               // We ended someplace up the tree so do a sibling check
-               return i === al ?
-                       siblingCheck( a, bp[i], -1 ) :
-                       siblingCheck( ap[i], b, 1 );
-       };
-
-       siblingCheck = function( a, b, ret ) {
-               if ( a === b ) {
-                       return ret;
-               }
-
-               var cur = a.nextSibling;
-
-               while ( cur ) {
-                       if ( cur === b ) {
-                               return -1;
-                       }
-
-                       cur = cur.nextSibling;
-               }
-
-               return 1;
-       };
-}
-
-// Check to see if the browser returns elements by name when
-// querying by getElementById (and provide a workaround)
-(function(){
-       // We're going to inject a fake input element with a specified name
-       var form = document.createElement("div"),
-               id = "script" + (new Date()).getTime(),
-               root = document.documentElement;
-
-       form.innerHTML = "<a name='" + id + "'/>";
-
-       // Inject it into the root element, check its status, and remove it quickly
-       root.insertBefore( form, root.firstChild );
-
-       // The workaround has to do additional checks after a getElementById
-       // Which slows things down for other browsers (hence the branching)
-       if ( document.getElementById( id ) ) {
-               Expr.find.ID = function( match, context, isXML ) {
-                       if ( typeof context.getElementById !== "undefined" && !isXML ) {
-                               var m = context.getElementById(match[1]);
-
-                               return m ?
-                                       m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
-                                               [m] :
-                                               undefined :
-                                       [];
-                       }
-               };
-
-               Expr.filter.ID = function( elem, match ) {
-                       var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
-
-                       return elem.nodeType === 1 && node && node.nodeValue === match;
-               };
-       }
-
-       root.removeChild( form );
-
-       // release memory in IE
-       root = form = null;
-})();
-
-(function(){
-       // Check to see if the browser returns only elements
-       // when doing getElementsByTagName("*")
-
-       // Create a fake element
-       var div = document.createElement("div");
-       div.appendChild( document.createComment("") );
-
-       // Make sure no comments are found
-       if ( div.getElementsByTagName("*").length > 0 ) {
-               Expr.find.TAG = function( match, context ) {
-                       var results = context.getElementsByTagName( match[1] );
-
-                       // Filter out possible comments
-                       if ( match[1] === "*" ) {
-                               var tmp = [];
-
-                               for ( var i = 0; results[i]; i++ ) {
-                                       if ( results[i].nodeType === 1 ) {
-                                               tmp.push( results[i] );
-                                       }
-                               }
-
-                               results = tmp;
-                       }
-
-                       return results;
-               };
-       }
-
-       // Check to see if an attribute returns normalized href attributes
-       div.innerHTML = "<a href='#'></a>";
-
-       if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
-                       div.firstChild.getAttribute("href") !== "#" ) {
-
-               Expr.attrHandle.href = function( elem ) {
-                       return elem.getAttribute( "href", 2 );
-               };
-       }
-
-       // release memory in IE
-       div = null;
-})();
-
-if ( document.querySelectorAll ) {
-       (function(){
-               var oldSizzle = Sizzle,
-                       div = document.createElement("div"),
-                       id = "__sizzle__";
-
-               div.innerHTML = "<p class='TEST'></p>";
-
-               // Safari can't handle uppercase or unicode characters when
-               // in quirks mode.
-               if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
-                       return;
-               }
-
-               Sizzle = function( query, context, extra, seed ) {
-                       context = context || document;
-
-                       // Only use querySelectorAll on non-XML documents
-                       // (ID selectors don't work in non-HTML documents)
-                       if ( !seed && !Sizzle.isXML(context) ) {
-                               // See if we find a selector to speed up
-                               var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
-
-                               if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
-                                       // Speed-up: Sizzle("TAG")
-                                       if ( match[1] ) {
-                                               return makeArray( context.getElementsByTagName( query ), extra );
-
-                                       // Speed-up: Sizzle(".CLASS")
-                                       } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
-                                               return makeArray( context.getElementsByClassName( match[2] ), extra );
-                                       }
-                               }
-
-                               if ( context.nodeType === 9 ) {
-                                       // Speed-up: Sizzle("body")
-                                       // The body element only exists once, optimize finding it
-                                       if ( query === "body" && context.body ) {
-                                               return makeArray( [ context.body ], extra );
-
-                                       // Speed-up: Sizzle("#ID")
-                                       } else if ( match && match[3] ) {
-                                               var elem = context.getElementById( match[3] );
-
-                                               // Check parentNode to catch when Blackberry 4.6 returns
-                                               // nodes that are no longer in the document #6963
-                                               if ( elem && elem.parentNode ) {
-                                                       // Handle the case where IE and Opera return items
-                                                       // by name instead of ID
-                                                       if ( elem.id === match[3] ) {
-                                                               return makeArray( [ elem ], extra );
-                                                       }
-
-                                               } else {
-                                                       return makeArray( [], extra );
-                                               }
-                                       }
-
-                                       try {
-                                               return makeArray( context.querySelectorAll(query), extra );
-                                       } catch(qsaError) {}
-
-                               // qSA works strangely on Element-rooted queries
-                               // We can work around this by specifying an extra ID on the root
-                               // and working up from there (Thanks to Andrew Dupont for the technique)
-                               // IE 8 doesn't work on object elements
-                               } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
-                                       var oldContext = context,
-                                               old = context.getAttribute( "id" ),
-                                               nid = old || id,
-                                               hasParent = context.parentNode,
-                                               relativeHierarchySelector = /^\s*[+~]/.test( query );
-
-                                       if ( !old ) {
-                                               context.setAttribute( "id", nid );
-                                       } else {
-                                               nid = nid.replace( /'/g, "\\$&" );
-                                       }
-                                       if ( relativeHierarchySelector && hasParent ) {
-                                               context = context.parentNode;
-                                       }
-
-                                       try {
-                                               if ( !relativeHierarchySelector || hasParent ) {
-                                                       return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
-                                               }
-
-                                       } catch(pseudoError) {
-                                       } finally {
-                                               if ( !old ) {
-                                                       oldContext.removeAttribute( "id" );
-                                               }
-                                       }
-                               }
-                       }
-
-                       return oldSizzle(query, context, extra, seed);
-               };
-
-               for ( var prop in oldSizzle ) {
-                       Sizzle[ prop ] = oldSizzle[ prop ];
-               }
-
-               // release memory in IE
-               div = null;
-       })();
-}
-
-(function(){
-       var html = document.documentElement,
-               matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
-
-       if ( matches ) {
-               // Check to see if it's possible to do matchesSelector
-               // on a disconnected node (IE 9 fails this)
-               var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
-                       pseudoWorks = false;
-
-               try {
-                       // This should fail with an exception
-                       // Gecko does not error, returns false instead
-                       matches.call( document.documentElement, "[test!='']:sizzle" );
-
-               } catch( pseudoError ) {
-                       pseudoWorks = true;
-               }
-
-               Sizzle.matchesSelector = function( node, expr ) {
-                       // Make sure that attribute selectors are quoted
-                       expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
-
-                       if ( !Sizzle.isXML( node ) ) {
-                               try {
-                                       if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
-                                               var ret = matches.call( node, expr );
-
-                                               // IE 9's matchesSelector returns false on disconnected nodes
-                                               if ( ret || !disconnectedMatch ||
-                                                               // As well, disconnected nodes are said to be in a document
-                                                               // fragment in IE 9, so check for that
-                                                               node.document && node.document.nodeType !== 11 ) {
-                                                       return ret;
-                                               }
-                                       }
-                               } catch(e) {}
-                       }
-
-                       return Sizzle(expr, null, null, [node]).length > 0;
-               };
-       }
-})();
-
-(function(){
-       var div = document.createElement("div");
-
-       div.innerHTML = "<div class='test e'></div><div class='test'></div>";
-
-       // Opera can't find a second classname (in 9.6)
-       // Also, make sure that getElementsByClassName actually exists
-       if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
-               return;
-       }
-
-       // Safari caches class attributes, doesn't catch changes (in 3.2)
-       div.lastChild.className = "e";
-
-       if ( div.getElementsByClassName("e").length === 1 ) {
-               return;
-       }
-
-       Expr.order.splice(1, 0, "CLASS");
-       Expr.find.CLASS = function( match, context, isXML ) {
-               if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
-                       return context.getElementsByClassName(match[1]);
-               }
-       };
-
-       // release memory in IE
-       div = null;
-})();
-
-function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
-       for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-               var elem = checkSet[i];
-
-               if ( elem ) {
-                       var match = false;
-
-                       elem = elem[dir];
-
-                       while ( elem ) {
-                               if ( elem[ expando ] === doneName ) {
-                                       match = checkSet[elem.sizset];
-                                       break;
-                               }
-
-                               if ( elem.nodeType === 1 && !isXML ){
-                                       elem[ expando ] = doneName;
-                                       elem.sizset = i;
-                               }
-
-                               if ( elem.nodeName.toLowerCase() === cur ) {
-                                       match = elem;
-                                       break;
-                               }
-
-                               elem = elem[dir];
-                       }
-
-                       checkSet[i] = match;
-               }
-       }
-}
-
-function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
-       for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-               var elem = checkSet[i];
-
-               if ( elem ) {
-                       var match = false;
-
-                       elem = elem[dir];
-
-                       while ( elem ) {
-                               if ( elem[ expando ] === doneName ) {
-                                       match = checkSet[elem.sizset];
-                                       break;
-                               }
-
-                               if ( elem.nodeType === 1 ) {
-                                       if ( !isXML ) {
-                                               elem[ expando ] = doneName;
-                                               elem.sizset = i;
-                                       }
-
-                                       if ( typeof cur !== "string" ) {
-                                               if ( elem === cur ) {
-                                                       match = true;
-                                                       break;
-                                               }
-
-                                       } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
-                                               match = elem;
-                                               break;
-                                       }
-                               }
-
-                               elem = elem[dir];
-                       }
-
-                       checkSet[i] = match;
-               }
-       }
-}
-
-if ( document.documentElement.contains ) {
-       Sizzle.contains = function( a, b ) {
-               return a !== b && (a.contains ? a.contains(b) : true);
-       };
-
-} else if ( document.documentElement.compareDocumentPosition ) {
-       Sizzle.contains = function( a, b ) {
-               return !!(a.compareDocumentPosition(b) & 16);
-       };
-
-} else {
-       Sizzle.contains = function() {
-               return false;
-       };
-}
-
-Sizzle.isXML = function( elem ) {
-       // documentElement is verified for cases where it doesn't yet exist
-       // (such as loading iframes in IE - #4833)
-       var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
-
-       return documentElement ? documentElement.nodeName !== "HTML" : false;
-};
-
-var posProcess = function( selector, context, seed ) {
-       var match,
-               tmpSet = [],
-               later = "",
-               root = context.nodeType ? [context] : context;
-
-       // Position selectors must be done after the filter
-       // And so must :not(positional) so we move all PSEUDOs to the end
-       while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
-               later += match[0];
-               selector = selector.replace( Expr.match.PSEUDO, "" );
-       }
-
-       selector = Expr.relative[selector] ? selector + "*" : selector;
-
-       for ( var i = 0, l = root.length; i < l; i++ ) {
-               Sizzle( selector, root[i], tmpSet, seed );
-       }
-
-       return Sizzle.filter( later, tmpSet );
-};
-
-// EXPOSE
-// Override sizzle attribute retrieval
-Sizzle.attr = jQuery.attr;
-Sizzle.selectors.attrMap = {};
-jQuery.find = Sizzle;
-jQuery.expr = Sizzle.selectors;
-jQuery.expr[":"] = jQuery.expr.filters;
-jQuery.unique = Sizzle.uniqueSort;
-jQuery.text = Sizzle.getText;
-jQuery.isXMLDoc = Sizzle.isXML;
-jQuery.contains = Sizzle.contains;
-
-
-})();
-
-
-var runtil = /Until$/,
-       rparentsprev = /^(?:parents|prevUntil|prevAll)/,
-       // Note: This RegExp should be improved, or likely pulled from Sizzle
-       rmultiselector = /,/,
-       isSimple = /^.[^:#\[\.,]*$/,
-       slice = Array.prototype.slice,
-       POS = jQuery.expr.match.globalPOS,
-       // methods guaranteed to produce a unique set when starting from a unique set
-       guaranteedUnique = {
-               children: true,
-               contents: true,
-               next: true,
-               prev: true
-       };
-
-jQuery.fn.extend({
-       find: function( selector ) {
-               var self = this,
-                       i, l;
-
-               if ( typeof selector !== "string" ) {
-                       return jQuery( selector ).filter(function() {
-                               for ( i = 0, l = self.length; i < l; i++ ) {
-                                       if ( jQuery.contains( self[ i ], this ) ) {
-                                               return true;
-                                       }
-                               }
-                       });
-               }
-
-               var ret = this.pushStack( "", "find", selector ),
-                       length, n, r;
-
-               for ( i = 0, l = this.length; i < l; i++ ) {
-                       length = ret.length;
-                       jQuery.find( selector, this[i], ret );
-
-                       if ( i > 0 ) {
-                               // Make sure that the results are unique
-                               for ( n = length; n < ret.length; n++ ) {
-                                       for ( r = 0; r < length; r++ ) {
-                                               if ( ret[r] === ret[n] ) {
-                                                       ret.splice(n--, 1);
-                                                       break;
-                                               }
-                                       }
-                               }
-                       }
-               }
-
-               return ret;
-       },
-
-       has: function( target ) {
-               var targets = jQuery( target );
-               return this.filter(function() {
-                       for ( var i = 0, l = targets.length; i < l; i++ ) {
-                               if ( jQuery.contains( this, targets[i] ) ) {
-                                       return true;
-                               }
-                       }
-               });
-       },
-
-       not: function( selector ) {
-               return this.pushStack( winnow(this, selector, false), "not", selector);
-       },
-
-       filter: function( selector ) {
-               return this.pushStack( winnow(this, selector, true), "filter", selector );
-       },
-
-       is: function( selector ) {
-               return !!selector && (
-                       typeof selector === "string" ?
-                               // If this is a positional selector, check membership in the returned set
-                               // so $("p:first").is("p:last") won't return true for a doc with two "p".
-                               POS.test( selector ) ?
-                                       jQuery( selector, this.context ).index( this[0] ) >= 0 :
-                                       jQuery.filter( selector, this ).length > 0 :
-                               this.filter( selector ).length > 0 );
-       },
-
-       closest: function( selectors, context ) {
-               var ret = [], i, l, cur = this[0];
-
-               // Array (deprecated as of jQuery 1.7)
-               if ( jQuery.isArray( selectors ) ) {
-                       var level = 1;
-
-                       while ( cur && cur.ownerDocument && cur !== context ) {
-                               for ( i = 0; i < selectors.length; i++ ) {
-
-                                       if ( jQuery( cur ).is( selectors[ i ] ) ) {
-                                               ret.push({ selector: selectors[ i ], elem: cur, level: level });
-                                       }
-                               }
-
-                               cur = cur.parentNode;
-                               level++;
-                       }
-
-                       return ret;
-               }
-
-               // String
-               var pos = POS.test( selectors ) || typeof selectors !== "string" ?
-                               jQuery( selectors, context || this.context ) :
-                               0;
-
-               for ( i = 0, l = this.length; i < l; i++ ) {
-                       cur = this[i];
-
-                       while ( cur ) {
-                               if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
-                                       ret.push( cur );
-                                       break;
-
-                               } else {
-                                       cur = cur.parentNode;
-                                       if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
-                                               break;
-                                       }
-                               }
-                       }
-               }
-
-               ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
-
-               return this.pushStack( ret, "closest", selectors );
-       },
-
-       // Determine the position of an element within
-       // the matched set of elements
-       index: function( elem ) {
-
-               // No argument, return index in parent
-               if ( !elem ) {
-                       return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
-               }
-
-               // index in selector
-               if ( typeof elem === "string" ) {
-                       return jQuery.inArray( this[0], jQuery( elem ) );
-               }
-
-               // Locate the position of the desired element
-               return jQuery.inArray(
-                       // If it receives a jQuery object, the first element is used
-                       elem.jquery ? elem[0] : elem, this );
-       },
-
-       add: function( selector, context ) {
-               var set = typeof selector === "string" ?
-                               jQuery( selector, context ) :
-                               jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
-                       all = jQuery.merge( this.get(), set );
-
-               return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
-                       all :
-                       jQuery.unique( all ) );
-       },
-
-       andSelf: function() {
-               return this.add( this.prevObject );
-       }
-});
-
-// A painfully simple check to see if an element is disconnected
-// from a document (should be improved, where feasible).
-function isDisconnected( node ) {
-       return !node || !node.parentNode || node.parentNode.nodeType === 11;
-}
-
-jQuery.each({
-       parent: function( elem ) {
-               var parent = elem.parentNode;
-               return parent && parent.nodeType !== 11 ? parent : null;
-       },
-       parents: function( elem ) {
-               return jQuery.dir( elem, "parentNode" );
-       },
-       parentsUntil: function( elem, i, until ) {
-               return jQuery.dir( elem, "parentNode", until );
-       },
-       next: function( elem ) {
-               return jQuery.nth( elem, 2, "nextSibling" );
-       },
-       prev: function( elem ) {
-               return jQuery.nth( elem, 2, "previousSibling" );
-       },
-       nextAll: function( elem ) {
-               return jQuery.dir( elem, "nextSibling" );
-       },
-       prevAll: function( elem ) {
-               return jQuery.dir( elem, "previousSibling" );
-       },
-       nextUntil: function( elem, i, until ) {
-               return jQuery.dir( elem, "nextSibling", until );
-       },
-       prevUntil: function( elem, i, until ) {
-               return jQuery.dir( elem, "previousSibling", until );
-       },
-       siblings: function( elem ) {
-               return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
-       },
-       children: function( elem ) {
-               return jQuery.sibling( elem.firstChild );
-       },
-       contents: function( elem ) {
-               return jQuery.nodeName( elem, "iframe" ) ?
-                       elem.contentDocument || elem.contentWindow.document :
-                       jQuery.makeArray( elem.childNodes );
-       }
-}, function( name, fn ) {
-       jQuery.fn[ name ] = function( until, selector ) {
-               var ret = jQuery.map( this, fn, until );
-
-               if ( !runtil.test( name ) ) {
-                       selector = until;
-               }
-
-               if ( selector && typeof selector === "string" ) {
-                       ret = jQuery.filter( selector, ret );
-               }
-
-               ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
-
-               if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
-                       ret = ret.reverse();
-               }
-
-               return this.pushStack( ret, name, slice.call( arguments ).join(",") );
-       };
-});
-
-jQuery.extend({
-       filter: function( expr, elems, not ) {
-               if ( not ) {
-                       expr = ":not(" + expr + ")";
-               }
-
-               return elems.length === 1 ?
-                       jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
-                       jQuery.find.matches(expr, elems);
-       },
-
-       dir: function( elem, dir, until ) {
-               var matched = [],
-                       cur = elem[ dir ];
-
-               while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
-                       if ( cur.nodeType === 1 ) {
-                               matched.push( cur );
-                       }
-                       cur = cur[dir];
-               }
-               return matched;
-       },
-
-       nth: function( cur, result, dir, elem ) {
-               result = result || 1;
-               var num = 0;
-
-               for ( ; cur; cur = cur[dir] ) {
-                       if ( cur.nodeType === 1 && ++num === result ) {
-                               break;
-                       }
-               }
-
-               return cur;
-       },
-
-       sibling: function( n, elem ) {
-               var r = [];
-
-               for ( ; n; n = n.nextSibling ) {
-                       if ( n.nodeType === 1 && n !== elem ) {
-                               r.push( n );
-                       }
-               }
-
-               return r;
-       }
-});
-
-// Implement the identical functionality for filter and not
-function winnow( elements, qualifier, keep ) {
-
-       // Can't pass null or undefined to indexOf in Firefox 4
-       // Set to 0 to skip string check
-       qualifier = qualifier || 0;
-
-       if ( jQuery.isFunction( qualifier ) ) {
-               return jQuery.grep(elements, function( elem, i ) {
-                       var retVal = !!qualifier.call( elem, i, elem );
-                       return retVal === keep;
-               });
-
-       } else if ( qualifier.nodeType ) {
-               return jQuery.grep(elements, function( elem, i ) {
-                       return ( elem === qualifier ) === keep;
-               });
-
-       } else if ( typeof qualifier === "string" ) {
-               var filtered = jQuery.grep(elements, function( elem ) {
-                       return elem.nodeType === 1;
-               });
-
-               if ( isSimple.test( qualifier ) ) {
-                       return jQuery.filter(qualifier, filtered, !keep);
-               } else {
-                       qualifier = jQuery.filter( qualifier, filtered );
-               }
-       }
-
-       return jQuery.grep(elements, function( elem, i ) {
-               return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
-       });
-}
-
-
-
-
-function createSafeFragment( document ) {
-       var list = nodeNames.split( "|" ),
-       safeFrag = document.createDocumentFragment();
-
-       if ( safeFrag.createElement ) {
-               while ( list.length ) {
-                       safeFrag.createElement(
-                               list.pop()
-                       );
-               }
-       }
-       return safeFrag;
-}
-
-var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
-               "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
-       rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
-       rleadingWhitespace = /^\s+/,
-       rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
-       rtagName = /<([\w:]+)/,
-       rtbody = /<tbody/i,
-       rhtml = /<|&#?\w+;/,
-       rnoInnerhtml = /<(?:script|style)/i,
-       rnocache = /<(?:script|object|embed|option|style)/i,
-       rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
-       // checked="checked" or checked
-       rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
-       rscriptType = /\/(java|ecma)script/i,
-       rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
-       wrapMap = {
-               option: [ 1, "<select multiple='multiple'>", "</select>" ],
-               legend: [ 1, "<fieldset>", "</fieldset>" ],
-               thead: [ 1, "<table>", "</table>" ],
-               tr: [ 2, "<table><tbody>", "</tbody></table>" ],
-               td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
-               col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
-               area: [ 1, "<map>", "</map>" ],
-               _default: [ 0, "", "" ]
-       },
-       safeFragment = createSafeFragment( document );
-
-wrapMap.optgroup = wrapMap.option;
-wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
-wrapMap.th = wrapMap.td;
-
-// IE can't serialize <link> and <script> tags normally
-if ( !jQuery.support.htmlSerialize ) {
-       wrapMap._default = [ 1, "div<div>", "</div>" ];
-}
-
-jQuery.fn.extend({
-       text: function( value ) {
-               return jQuery.access( this, function( value ) {
-                       return value === undefined ?
-                               jQuery.text( this ) :
-                               this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
-               }, null, value, arguments.length );
-       },
-
-       wrapAll: function( html ) {
-               if ( jQuery.isFunction( html ) ) {
-                       return this.each(function(i) {
-                               jQuery(this).wrapAll( html.call(this, i) );
-                       });
-               }
-
-               if ( this[0] ) {
-                       // The elements to wrap the target around
-                       var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
-
-                       if ( this[0].parentNode ) {
-                               wrap.insertBefore( this[0] );
-                       }
-
-                       wrap.map(function() {
-                               var elem = this;
-
-                               while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
-                                       elem = elem.firstChild;
-                               }
-
-                               return elem;
-                       }).append( this );
-               }
-
-               return this;
-       },
-
-       wrapInner: function( html ) {
-               if ( jQuery.isFunction( html ) ) {
-                       return this.each(function(i) {
-                               jQuery(this).wrapInner( html.call(this, i) );
-                       });
-               }
-
-               return this.each(function() {
-                       var self = jQuery( this ),
-                               contents = self.contents();
-
-                       if ( contents.length ) {
-                               contents.wrapAll( html );
-
-                       } else {
-                               self.append( html );
-                       }
-               });
-       },
-
-       wrap: function( html ) {
-               var isFunction = jQuery.isFunction( html );
-
-               return this.each(function(i) {
-                       jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
-               });
-       },
-
-       unwrap: function() {
-               return this.parent().each(function() {
-                       if ( !jQuery.nodeName( this, "body" ) ) {
-                               jQuery( this ).replaceWith( this.childNodes );
-                       }
-               }).end();
-       },
-
-       append: function() {
-               return this.domManip(arguments, true, function( elem ) {
-                       if ( this.nodeType === 1 ) {
-                               this.appendChild( elem );
-                       }
-               });
-       },
-
-       prepend: function() {
-               return this.domManip(arguments, true, function( elem ) {
-                       if ( this.nodeType === 1 ) {
-                               this.insertBefore( elem, this.firstChild );
-                       }
-               });
-       },
-
-       before: function() {
-               if ( this[0] && this[0].parentNode ) {
-                       return this.domManip(arguments, false, function( elem ) {
-                               this.parentNode.insertBefore( elem, this );
-                       });
-               } else if ( arguments.length ) {
-                       var set = jQuery.clean( arguments );
-                       set.push.apply( set, this.toArray() );
-                       return this.pushStack( set, "before", arguments );
-               }
-       },
-
-       after: function() {
-               if ( this[0] && this[0].parentNode ) {
-                       return this.domManip(arguments, false, function( elem ) {
-                               this.parentNode.insertBefore( elem, this.nextSibling );
-                       });
-               } else if ( arguments.length ) {
-                       var set = this.pushStack( this, "after", arguments );
-                       set.push.apply( set, jQuery.clean(arguments) );
-                       return set;
-               }
-       },
-
-       // keepData is for internal use only--do not document
-       remove: function( selector, keepData ) {
-               for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
-                       if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
-                               if ( !keepData && elem.nodeType === 1 ) {
-                                       jQuery.cleanData( elem.getElementsByTagName("*") );
-                                       jQuery.cleanData( [ elem ] );
-                               }
-
-                               if ( elem.parentNode ) {
-                                       elem.parentNode.removeChild( elem );
-                               }
-                       }
-               }
-
-               return this;
-       },
-
-       empty: function() {
-               for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
-                       // Remove element nodes and prevent memory leaks
-                       if ( elem.nodeType === 1 ) {
-                               jQuery.cleanData( elem.getElementsByTagName("*") );
-                       }
-
-                       // Remove any remaining nodes
-                       while ( elem.firstChild ) {
-                               elem.removeChild( elem.firstChild );
-                       }
-               }
-
-               return this;
-       },
-
-       clone: function( dataAndEvents, deepDataAndEvents ) {
-               dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
-               deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
-
-               return this.map( function () {
-                       return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
-               });
-       },
-
-       html: function( value ) {
-               return jQuery.access( this, function( value ) {
-                       var elem = this[0] || {},
-                               i = 0,
-                               l = this.length;
-
-                       if ( value === undefined ) {
-                               return elem.nodeType === 1 ?
-                                       elem.innerHTML.replace( rinlinejQuery, "" ) :
-                                       null;
-                       }
-
-
-                       if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
-                               ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
-                               !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
-
-                               value = value.replace( rxhtmlTag, "<$1></$2>" );
-
-                               try {
-                                       for (; i < l; i++ ) {
-                                               // Remove element nodes and prevent memory leaks
-                                               elem = this[i] || {};
-                                               if ( elem.nodeType === 1 ) {
-                                                       jQuery.cleanData( elem.getElementsByTagName( "*" ) );
-                                                       elem.innerHTML = value;
-                                               }
-                                       }
-
-                                       elem = 0;
-
-                               // If using innerHTML throws an exception, use the fallback method
-                               } catch(e) {}
-                       }
-
-                       if ( elem ) {
-                               this.empty().append( value );
-                       }
-               }, null, value, arguments.length );
-       },
-
-       replaceWith: function( value ) {
-               if ( this[0] && this[0].parentNode ) {
-                       // Make sure that the elements are removed from the DOM before they are inserted
-                       // this can help fix replacing a parent with child elements
-                       if ( jQuery.isFunction( value ) ) {
-                               return this.each(function(i) {
-                                       var self = jQuery(this), old = self.html();
-                                       self.replaceWith( value.call( this, i, old ) );
-                               });
-                       }
-
-                       if ( typeof value !== "string" ) {
-                               value = jQuery( value ).detach();
-                       }
-
-                       return this.each(function() {
-                               var next = this.nextSibling,
-                                       parent = this.parentNode;
-
-                               jQuery( this ).remove();
-
-                               if ( next ) {
-                                       jQuery(next).before( value );
-                               } else {
-                                       jQuery(parent).append( value );
-                               }
-                       });
-               } else {
-                       return this.length ?
-                               this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
-                               this;
-               }
-       },
-
-       detach: function( selector ) {
-               return this.remove( selector, true );
-       },
-
-       domManip: function( args, table, callback ) {
-               var results, first, fragment, parent,
-                       value = args[0],
-                       scripts = [];
-
-               // We can't cloneNode fragments that contain checked, in WebKit
-               if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
-                       return this.each(function() {
-                               jQuery(this).domManip( args, table, callback, true );
-                       });
-               }
-
-               if ( jQuery.isFunction(value) ) {
-                       return this.each(function(i) {
-                               var self = jQuery(this);
-                               args[0] = value.call(this, i, table ? self.html() : undefined);
-                               self.domManip( args, table, callback );
-                       });
-               }
-
-               if ( this[0] ) {
-                       parent = value && value.parentNode;
-
-                       // If we're in a fragment, just use that instead of building a new one
-                       if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
-                               results = { fragment: parent };
-
-                       } else {
-                               results = jQuery.buildFragment( args, this, scripts );
-                       }
-
-                       fragment = results.fragment;
-
-                       if ( fragment.childNodes.length === 1 ) {
-                               first = fragment = fragment.firstChild;
-                       } else {
-                               first = fragment.firstChild;
-                       }
-
-                       if ( first ) {
-                               table = table && jQuery.nodeName( first, "tr" );
-
-                               for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
-                                       callback.call(
-                                               table ?
-                                                       root(this[i], first) :
-                                                       this[i],
-                                               // Make sure that we do not leak memory by inadvertently discarding
-                                               // the original fragment (which might have attached data) instead of
-                                               // using it; in addition, use the original fragment object for the last
-                                               // item instead of first because it can end up being emptied incorrectly
-                                               // in certain situations (Bug #8070).
-                                               // Fragments from the fragment cache must always be cloned and never used
-                                               // in place.
-                                               results.cacheable || ( l > 1 && i < lastIndex ) ?
-                                                       jQuery.clone( fragment, true, true ) :
-                                                       fragment
-                                       );
-                               }
-                       }
-
-                       if ( scripts.length ) {
-                               jQuery.each( scripts, function( i, elem ) {
-                                       if ( elem.src ) {
-                                               jQuery.ajax({
-                                                       type: "GET",
-                                                       global: false,
-                                                       url: elem.src,
-                                                       async: false,
-                                                       dataType: "script"
-                                               });
-                                       } else {
-                                               jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
-                                       }
-
-                                       if ( elem.parentNode ) {
-                                               elem.parentNode.removeChild( elem );
-                                       }
-                               });
-                       }
-               }
-
-               return this;
-       }
-});
-
-function root( elem, cur ) {
-       return jQuery.nodeName(elem, "table") ?
-               (elem.getElementsByTagName("tbody")[0] ||
-               elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
-               elem;
-}
-
-function cloneCopyEvent( src, dest ) {
-
-       if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
-               return;
-       }
-
-       var type, i, l,
-               oldData = jQuery._data( src ),
-               curData = jQuery._data( dest, oldData ),
-               events = oldData.events;
-
-       if ( events ) {
-               delete curData.handle;
-               curData.events = {};
-
-               for ( type in events ) {
-                       for ( i = 0, l = events[ type ].length; i < l; i++ ) {
-                               jQuery.event.add( dest, type, events[ type ][ i ] );
-                       }
-               }
-       }
-
-       // make the cloned public data object a copy from the original
-       if ( curData.data ) {
-               curData.data = jQuery.extend( {}, curData.data );
-       }
-}
-
-function cloneFixAttributes( src, dest ) {
-       var nodeName;
-
-       // We do not need to do anything for non-Elements
-       if ( dest.nodeType !== 1 ) {
-               return;
-       }
-
-       // clearAttributes removes the attributes, which we don't want,
-       // but also removes the attachEvent events, which we *do* want
-       if ( dest.clearAttributes ) {
-               dest.clearAttributes();
-       }
-
-       // mergeAttributes, in contrast, only merges back on the
-       // original attributes, not the events
-       if ( dest.mergeAttributes ) {
-               dest.mergeAttributes( src );
-       }
-
-       nodeName = dest.nodeName.toLowerCase();
-
-       // IE6-8 fail to clone children inside object elements that use
-       // the proprietary classid attribute value (rather than the type
-       // attribute) to identify the type of content to display
-       if ( nodeName === "object" ) {
-               dest.outerHTML = src.outerHTML;
-
-       } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
-               // IE6-8 fails to persist the checked state of a cloned checkbox
-               // or radio button. Worse, IE6-7 fail to give the cloned element
-               // a checked appearance if the defaultChecked value isn't also set
-               if ( src.checked ) {
-                       dest.defaultChecked = dest.checked = src.checked;
-               }
-
-               // IE6-7 get confused and end up setting the value of a cloned
-               // checkbox/radio button to an empty string instead of "on"
-               if ( dest.value !== src.value ) {
-                       dest.value = src.value;
-               }
-
-       // IE6-8 fails to return the selected option to the default selected
-       // state when cloning options
-       } else if ( nodeName === "option" ) {
-               dest.selected = src.defaultSelected;
-
-       // IE6-8 fails to set the defaultValue to the correct value when
-       // cloning other types of input fields
-       } else if ( nodeName === "input" || nodeName === "textarea" ) {
-               dest.defaultValue = src.defaultValue;
-
-       // IE blanks contents when cloning scripts
-       } else if ( nodeName === "script" && dest.text !== src.text ) {
-               dest.text = src.text;
-       }
-
-       // Event data gets referenced instead of copied if the expando
-       // gets copied too
-       dest.removeAttribute( jQuery.expando );
-
-       // Clear flags for bubbling special change/submit events, they must
-       // be reattached when the newly cloned events are first activated
-       dest.removeAttribute( "_submit_attached" );
-       dest.removeAttribute( "_change_attached" );
-}
-
-jQuery.buildFragment = function( args, nodes, scripts ) {
-       var fragment, cacheable, cacheresults, doc,
-       first = args[ 0 ];
-
-       // nodes may contain either an explicit document object,
-       // a jQuery collection or context object.
-       // If nodes[0] contains a valid object to assign to doc
-       if ( nodes && nodes[0] ) {
-               doc = nodes[0].ownerDocument || nodes[0];
-       }
-
-       // Ensure that an attr object doesn't incorrectly stand in as a document object
-       // Chrome and Firefox seem to allow this to occur and will throw exception
-       // Fixes #8950
-       if ( !doc.createDocumentFragment ) {
-               doc = document;
-       }
-
-       // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
-       // Cloning options loses the selected state, so don't cache them
-       // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
-       // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
-       // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
-       if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document &&
-               first.charAt(0) === "<" && !rnocache.test( first ) &&
-               (jQuery.support.checkClone || !rchecked.test( first )) &&
-               (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
-
-               cacheable = true;
-
-               cacheresults = jQuery.fragments[ first ];
-               if ( cacheresults && cacheresults !== 1 ) {
-                       fragment = cacheresults;
-               }
-       }
-
-       if ( !fragment ) {
-               fragment = doc.createDocumentFragment();
-               jQuery.clean( args, doc, fragment, scripts );
-       }
-
-       if ( cacheable ) {
-               jQuery.fragments[ first ] = cacheresults ? fragment : 1;
-       }
-
-       return { fragment: fragment, cacheable: cacheable };
-};
-
-jQuery.fragments = {};
-
-jQuery.each({
-       appendTo: "append",
-       prependTo: "prepend",
-       insertBefore: "before",
-       insertAfter: "after",
-       replaceAll: "replaceWith"
-}, function( name, original ) {
-       jQuery.fn[ name ] = function( selector ) {
-               var ret = [],
-                       insert = jQuery( selector ),
-                       parent = this.length === 1 && this[0].parentNode;
-
-               if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
-                       insert[ original ]( this[0] );
-                       return this;
-
-               } else {
-                       for ( var i = 0, l = insert.length; i < l; i++ ) {
-                               var elems = ( i > 0 ? this.clone(true) : this ).get();
-                               jQuery( insert[i] )[ original ]( elems );
-                               ret = ret.concat( elems );
-                       }
-
-                       return this.pushStack( ret, name, insert.selector );
-               }
-       };
-});
-
-function getAll( elem ) {
-       if ( typeof elem.getElementsByTagName !== "undefined" ) {
-               return elem.getElementsByTagName( "*" );
-
-       } else if ( typeof elem.querySelectorAll !== "undefined" ) {
-               return elem.querySelectorAll( "*" );
-
-       } else {
-               return [];
-       }
-}
-
-// Used in clean, fixes the defaultChecked property
-function fixDefaultChecked( elem ) {
-       if ( elem.type === "checkbox" || elem.type === "radio" ) {
-               elem.defaultChecked = elem.checked;
-       }
-}
-// Finds all inputs and passes them to fixDefaultChecked
-function findInputs( elem ) {
-       var nodeName = ( elem.nodeName || "" ).toLowerCase();
-       if ( nodeName === "input" ) {
-               fixDefaultChecked( elem );
-       // Skip scripts, get other children
-       } else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
-               jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
-       }
-}
-
-// Derived From: http://www.iecss.com/shimprove/javascript/shimprove.1-0-1.js
-function shimCloneNode( elem ) {
-       var div = document.createElement( "div" );
-       safeFragment.appendChild( div );
-
-       div.innerHTML = elem.outerHTML;
-       return div.firstChild;
-}
-
-jQuery.extend({
-       clone: function( elem, dataAndEvents, deepDataAndEvents ) {
-               var srcElements,
-                       destElements,
-                       i,
-                       // IE<=8 does not properly clone detached, unknown element nodes
-                       clone = jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ?
-                               elem.cloneNode( true ) :
-                               shimCloneNode( elem );
-
-               if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
-                               (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
-                       // IE copies events bound via attachEvent when using cloneNode.
-                       // Calling detachEvent on the clone will also remove the events
-                       // from the original. In order to get around this, we use some
-                       // proprietary methods to clear the events. Thanks to MooTools
-                       // guys for this hotness.
-
-                       cloneFixAttributes( elem, clone );
-
-                       // Using Sizzle here is crazy slow, so we use getElementsByTagName instead
-                       srcElements = getAll( elem );
-                       destElements = getAll( clone );
-
-                       // Weird iteration because IE will replace the length property
-                       // with an element if you are cloning the body and one of the
-                       // elements on the page has a name or id of "length"
-                       for ( i = 0; srcElements[i]; ++i ) {
-                               // Ensure that the destination node is not null; Fixes #9587
-                               if ( destElements[i] ) {
-                                       cloneFixAttributes( srcElements[i], destElements[i] );
-                               }
-                       }
-               }
-
-               // Copy the events from the original to the clone
-               if ( dataAndEvents ) {
-                       cloneCopyEvent( elem, clone );
-
-                       if ( deepDataAndEvents ) {
-                               srcElements = getAll( elem );
-                               destElements = getAll( clone );
-
-                               for ( i = 0; srcElements[i]; ++i ) {
-                                       cloneCopyEvent( srcElements[i], destElements[i] );
-                               }
-                       }
-               }
-
-               srcElements = destElements = null;
-
-               // Return the cloned set
-               return clone;
-       },
-
-       clean: function( elems, context, fragment, scripts ) {
-               var checkScriptType, script, j,
-                               ret = [];
-
-               context = context || document;
-
-               // !context.createElement fails in IE with an error but returns typeof 'object'
-               if ( typeof context.createElement === "undefined" ) {
-                       context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
-               }
-
-               for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
-                       if ( typeof elem === "number" ) {
-                               elem += "";
-                       }
-
-                       if ( !elem ) {
-                               continue;
-                       }
-
-                       // Convert html string into DOM nodes
-                       if ( typeof elem === "string" ) {
-                               if ( !rhtml.test( elem ) ) {
-                                       elem = context.createTextNode( elem );
-                               } else {
-                                       // Fix "XHTML"-style tags in all browsers
-                                       elem = elem.replace(rxhtmlTag, "<$1></$2>");
-
-                                       // Trim whitespace, otherwise indexOf won't work as expected
-                                       var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(),
-                                               wrap = wrapMap[ tag ] || wrapMap._default,
-                                               depth = wrap[0],
-                                               div = context.createElement("div"),
-                                               safeChildNodes = safeFragment.childNodes,
-                                               remove;
-
-                                       // Append wrapper element to unknown element safe doc fragment
-                                       if ( context === document ) {
-                                               // Use the fragment we've already created for this document
-                                               safeFragment.appendChild( div );
-                                       } else {
-                                               // Use a fragment created with the owner document
-                                               createSafeFragment( context ).appendChild( div );
-                                       }
-
-                                       // Go to html and back, then peel off extra wrappers
-                                       div.innerHTML = wrap[1] + elem + wrap[2];
-
-                                       // Move to the right depth
-                                       while ( depth-- ) {
-                                               div = div.lastChild;
-                                       }
-
-                                       // Remove IE's autoinserted <tbody> from table fragments
-                                       if ( !jQuery.support.tbody ) {
-
-                                               // String was a <table>, *may* have spurious <tbody>
-                                               var hasBody = rtbody.test(elem),
-                                                       tbody = tag === "table" && !hasBody ?
-                                                               div.firstChild && div.firstChild.childNodes :
-
-                                                               // String was a bare <thead> or <tfoot>
-                                                               wrap[1] === "<table>" && !hasBody ?
-                                                                       div.childNodes :
-                                                                       [];
-
-                                               for ( j = tbody.length - 1; j >= 0 ; --j ) {
-                                                       if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
-                                                               tbody[ j ].parentNode.removeChild( tbody[ j ] );
-                                                       }
-                                               }
-                                       }
-
-                                       // IE completely kills leading whitespace when innerHTML is used
-                                       if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
-                                               div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
-                                       }
-
-                                       elem = div.childNodes;
-
-                                       // Clear elements from DocumentFragment (safeFragment or otherwise)
-                                       // to avoid hoarding elements. Fixes #11356
-                                       if ( div ) {
-                                               div.parentNode.removeChild( div );
-
-                                               // Guard against -1 index exceptions in FF3.6
-                                               if ( safeChildNodes.length > 0 ) {
-                                                       remove = safeChildNodes[ safeChildNodes.length - 1 ];
-
-                                                       if ( remove && remove.parentNode ) {
-                                                               remove.parentNode.removeChild( remove );
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-
-                       // Resets defaultChecked for any radios and checkboxes
-                       // about to be appended to the DOM in IE 6/7 (#8060)
-                       var len;
-                       if ( !jQuery.support.appendChecked ) {
-                               if ( elem[0] && typeof (len = elem.length) === "number" ) {
-                                       for ( j = 0; j < len; j++ ) {
-                                               findInputs( elem[j] );
-                                       }
-                               } else {
-                                       findInputs( elem );
-                               }
-                       }
-
-                       if ( elem.nodeType ) {
-                               ret.push( elem );
-                       } else {
-                               ret = jQuery.merge( ret, elem );
-                       }
-               }
-
-               if ( fragment ) {
-                       checkScriptType = function( elem ) {
-                               return !elem.type || rscriptType.test( elem.type );
-                       };
-                       for ( i = 0; ret[i]; i++ ) {
-                               script = ret[i];
-                               if ( scripts && jQuery.nodeName( script, "script" ) && (!script.type || rscriptType.test( script.type )) ) {
-                                       scripts.push( script.parentNode ? script.parentNode.removeChild( script ) : script );
-
-                               } else {
-                                       if ( script.nodeType === 1 ) {
-                                               var jsTags = jQuery.grep( script.getElementsByTagName( "script" ), checkScriptType );
-
-                                               ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
-                                       }
-                                       fragment.appendChild( script );
-                               }
-                       }
-               }
-
-               return ret;
-       },
-
-       cleanData: function( elems ) {
-               var data, id,
-                       cache = jQuery.cache,
-                       special = jQuery.event.special,
-                       deleteExpando = jQuery.support.deleteExpando;
-
-               for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
-                       if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
-                               continue;
-                       }
-
-                       id = elem[ jQuery.expando ];
-
-                       if ( id ) {
-                               data = cache[ id ];
-
-                               if ( data && data.events ) {
-                                       for ( var type in data.events ) {
-                                               if ( special[ type ] ) {
-                                                       jQuery.event.remove( elem, type );
-
-                                               // This is a shortcut to avoid jQuery.event.remove's overhead
-                                               } else {
-                                                       jQuery.removeEvent( elem, type, data.handle );
-                                               }
-                                       }
-
-                                       // Null the DOM reference to avoid IE6/7/8 leak (#7054)
-                                       if ( data.handle ) {
-                                               data.handle.elem = null;
-                                       }
-                               }
-
-                               if ( deleteExpando ) {
-                                       delete elem[ jQuery.expando ];
-
-                               } else if ( elem.removeAttribute ) {
-                                       elem.removeAttribute( jQuery.expando );
-                               }
-
-                               delete cache[ id ];
-                       }
-               }
-       }
-});
-
-
-
-
-var ralpha = /alpha\([^)]*\)/i,
-       ropacity = /opacity=([^)]*)/,
-       // fixed for IE9, see #8346
-       rupper = /([A-Z]|^ms)/g,
-       rnum = /^[\-+]?(?:\d*\.)?\d+$/i,
-       rnumnonpx = /^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,
-       rrelNum = /^([\-+])=([\-+.\de]+)/,
-       rmargin = /^margin/,
-
-       cssShow = { position: "absolute", visibility: "hidden", display: "block" },
-
-       // order is important!
-       cssExpand = [ "Top", "Right", "Bottom", "Left" ],
-
-       curCSS,
-
-       getComputedStyle,
-       currentStyle;
-
-jQuery.fn.css = function( name, value ) {
-       return jQuery.access( this, function( elem, name, value ) {
-               return value !== undefined ?
-                       jQuery.style( elem, name, value ) :
-                       jQuery.css( elem, name );
-       }, name, value, arguments.length > 1 );
-};
-
-jQuery.extend({
-       // Add in style property hooks for overriding the default
-       // behavior of getting and setting a style property
-       cssHooks: {
-               opacity: {
-                       get: function( elem, computed ) {
-                               if ( computed ) {
-                                       // We should always get a number back from opacity
-                                       var ret = curCSS( elem, "opacity" );
-                                       return ret === "" ? "1" : ret;
-
-                               } else {
-                                       return elem.style.opacity;
-                               }
-                       }
-               }
-       },
-
-       // Exclude the following css properties to add px
-       cssNumber: {
-               "fillOpacity": true,
-               "fontWeight": true,
-               "lineHeight": true,
-               "opacity": true,
-               "orphans": true,
-               "widows": true,
-               "zIndex": true,
-               "zoom": true
-       },
-
-       // Add in properties whose names you wish to fix before
-       // setting or getting the value
-       cssProps: {
-               // normalize float css property
-               "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
-       },
-
-       // Get and set the style property on a DOM Node
-       style: function( elem, name, value, extra ) {
-               // Don't set styles on text and comment nodes
-               if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
-                       return;
-               }
-
-               // Make sure that we're working with the right name
-               var ret, type, origName = jQuery.camelCase( name ),
-                       style = elem.style, hooks = jQuery.cssHooks[ origName ];
-
-               name = jQuery.cssProps[ origName ] || origName;
-
-               // Check if we're setting a value
-               if ( value !== undefined ) {
-                       type = typeof value;
-
-                       // convert relative number strings (+= or -=) to relative numbers. #7345
-                       if ( type === "string" && (ret = rrelNum.exec( value )) ) {
-                               value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
-                               // Fixes bug #9237
-                               type = "number";
-                       }
-
-                       // Make sure that NaN and null values aren't set. See: #7116
-                       if ( value == null || type === "number" && isNaN( value ) ) {
-                               return;
-                       }
-
-                       // If a number was passed in, add 'px' to the (except for certain CSS properties)
-                       if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
-                               value += "px";
-                       }
-
-                       // If a hook was provided, use that value, otherwise just set the specified value
-                       if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
-                               // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
-                               // Fixes bug #5509
-                               try {
-                                       style[ name ] = value;
-                               } catch(e) {}
-                       }
-
-               } else {
-                       // If a hook was provided get the non-computed value from there
-                       if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
-                               return ret;
-                       }
-
-                       // Otherwise just get the value from the style object
-                       return style[ name ];
-               }
-       },
-
-       css: function( elem, name, extra ) {
-               var ret, hooks;
-
-               // Make sure that we're working with the right name
-               name = jQuery.camelCase( name );
-               hooks = jQuery.cssHooks[ name ];
-               name = jQuery.cssProps[ name ] || name;
-
-               // cssFloat needs a special treatment
-               if ( name === "cssFloat" ) {
-                       name = "float";
-               }
-
-               // If a hook was provided get the computed value from there
-               if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
-                       return ret;
-
-               // Otherwise, if a way to get the computed value exists, use that
-               } else if ( curCSS ) {
-                       return curCSS( elem, name );
-               }
-       },
-
-       // A method for quickly swapping in/out CSS properties to get correct calculations
-       swap: function( elem, options, callback ) {
-               var old = {},
-                       ret, name;
-
-               // Remember the old values, and insert the new ones
-               for ( name in options ) {
-                       old[ name ] = elem.style[ name ];
-                       elem.style[ name ] = options[ name ];
-               }
-
-               ret = callback.call( elem );
-
-               // Revert the old values
-               for ( name in options ) {
-                       elem.style[ name ] = old[ name ];
-               }
-
-               return ret;
-       }
-});
-
-// DEPRECATED in 1.3, Use jQuery.css() instead
-jQuery.curCSS = jQuery.css;
-
-if ( document.defaultView && document.defaultView.getComputedStyle ) {
-       getComputedStyle = function( elem, name ) {
-               var ret, defaultView, computedStyle, width,
-                       style = elem.style;
-
-               name = name.replace( rupper, "-$1" ).toLowerCase();
-
-               if ( (defaultView = elem.ownerDocument.defaultView) &&
-                               (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
-
-                       ret = computedStyle.getPropertyValue( name );
-                       if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
-                               ret = jQuery.style( elem, name );
-                       }
-               }
-
-               // A tribute to the "awesome hack by Dean Edwards"
-               // WebKit uses "computed value (percentage if specified)" instead of "used value" for margins
-               // which is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
-               if ( !jQuery.support.pixelMargin && computedStyle && rmargin.test( name ) && rnumnonpx.test( ret ) ) {
-                       width = style.width;
-                       style.width = ret;
-                       ret = computedStyle.width;
-                       style.width = width;
-               }
-
-               return ret;
-       };
-}
-
-if ( document.documentElement.currentStyle ) {
-       currentStyle = function( elem, name ) {
-               var left, rsLeft, uncomputed,
-                       ret = elem.currentStyle && elem.currentStyle[ name ],
-                       style = elem.style;
-
-               // Avoid setting ret to empty string here
-               // so we don't default to auto
-               if ( ret == null && style && (uncomputed = style[ name ]) ) {
-                       ret = uncomputed;
-               }
-
-               // From the awesome hack by Dean Edwards
-               // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
-
-               // If we're not dealing with a regular pixel number
-               // but a number that has a weird ending, we need to convert it to pixels
-               if ( rnumnonpx.test( ret ) ) {
-
-                       // Remember the original values
-                       left = style.left;
-                       rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
-
-                       // Put in the new values to get a computed value out
-                       if ( rsLeft ) {
-                               elem.runtimeStyle.left = elem.currentStyle.left;
-                       }
-                       style.left = name === "fontSize" ? "1em" : ret;
-                       ret = style.pixelLeft + "px";
-
-                       // Revert the changed values
-                       style.left = left;
-                       if ( rsLeft ) {
-                               elem.runtimeStyle.left = rsLeft;
-                       }
-               }
-
-               return ret === "" ? "auto" : ret;
-       };
-}
-
-curCSS = getComputedStyle || currentStyle;
-
-function getWidthOrHeight( elem, name, extra ) {
-
-       // Start with offset property
-       var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
-               i = name === "width" ? 1 : 0,
-               len = 4;
-
-       if ( val > 0 ) {
-               if ( extra !== "border" ) {
-                       for ( ; i < len; i += 2 ) {
-                               if ( !extra ) {
-                                       val -= parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0;
-                               }
-                               if ( extra === "margin" ) {
-                                       val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ] ) ) || 0;
-                               } else {
-                                       val -= parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
-                               }
-                       }
-               }
-
-               return val + "px";
-       }
-
-       // Fall back to computed then uncomputed css if necessary
-       val = curCSS( elem, name );
-       if ( val < 0 || val == null ) {
-               val = elem.style[ name ];
-       }
-
-       // Computed unit is not pixels. Stop here and return.
-       if ( rnumnonpx.test(val) ) {
-               return val;
-       }
-
-       // Normalize "", auto, and prepare for extra
-       val = parseFloat( val ) || 0;
-
-       // Add padding, border, margin
-       if ( extra ) {
-               for ( ; i < len; i += 2 ) {
-                       val += parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0;
-                       if ( extra !== "padding" ) {
-                               val += parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
-                       }
-                       if ( extra === "margin" ) {
-                               val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ]) ) || 0;
-                       }
-               }
-       }
-
-       return val + "px";
-}
-
-jQuery.each([ "height", "width" ], function( i, name ) {
-       jQuery.cssHooks[ name ] = {
-               get: function( elem, computed, extra ) {
-                       if ( computed ) {
-                               if ( elem.offsetWidth !== 0 ) {
-                                       return getWidthOrHeight( elem, name, extra );
-                               } else {
-                                       return jQuery.swap( elem, cssShow, function() {
-                                               return getWidthOrHeight( elem, name, extra );
-                                       });
-                               }
-                       }
-               },
-
-               set: function( elem, value ) {
-                       return rnum.test( value ) ?
-                               value + "px" :
-                               value;
-               }
-       };
-});
-
-if ( !jQuery.support.opacity ) {
-       jQuery.cssHooks.opacity = {
-               get: function( elem, computed ) {
-                       // IE uses filters for opacity
-                       return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
-                               ( parseFloat( RegExp.$1 ) / 100 ) + "" :
-                               computed ? "1" : "";
-               },
-
-               set: function( elem, value ) {
-                       var style = elem.style,
-                               currentStyle = elem.currentStyle,
-                               opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
-                               filter = currentStyle && currentStyle.filter || style.filter || "";
-
-                       // IE has trouble with opacity if it does not have layout
-                       // Force it by setting the zoom level
-                       style.zoom = 1;
-
-                       // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
-                       if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
-
-                               // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
-                               // if "filter:" is present at all, clearType is disabled, we want to avoid this
-                               // style.removeAttribute is IE Only, but so apparently is this code path...
-                               style.removeAttribute( "filter" );
-
-                               // if there there is no filter style applied in a css rule, we are done
-                               if ( currentStyle && !currentStyle.filter ) {
-                                       return;
-                               }
-                       }
-
-                       // otherwise, set new filter values
-                       style.filter = ralpha.test( filter ) ?
-                               filter.replace( ralpha, opacity ) :
-                               filter + " " + opacity;
-               }
-       };
-}
-
-jQuery(function() {
-       // This hook cannot be added until DOM ready because the support test
-       // for it is not run until after DOM ready
-       if ( !jQuery.support.reliableMarginRight ) {
-               jQuery.cssHooks.marginRight = {
-                       get: function( elem, computed ) {
-                               // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
-                               // Work around by temporarily setting element display to inline-block
-                               return jQuery.swap( elem, { "display": "inline-block" }, function() {
-                                       if ( computed ) {
-                                               return curCSS( elem, "margin-right" );
-                                       } else {
-                                               return elem.style.marginRight;
-                                       }
-                               });
-                       }
-               };
-       }
-});
-
-if ( jQuery.expr && jQuery.expr.filters ) {
-       jQuery.expr.filters.hidden = function( elem ) {
-               var width = elem.offsetWidth,
-                       height = elem.offsetHeight;
-
-               return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
-       };
-
-       jQuery.expr.filters.visible = function( elem ) {
-               return !jQuery.expr.filters.hidden( elem );
-       };
-}
-
-// These hooks are used by animate to expand properties
-jQuery.each({
-       margin: "",
-       padding: "",
-       border: "Width"
-}, function( prefix, suffix ) {
-
-       jQuery.cssHooks[ prefix + suffix ] = {
-               expand: function( value ) {
-                       var i,
-
-                               // assumes a single number if not a string
-                               parts = typeof value === "string" ? value.split(" ") : [ value ],
-                               expanded = {};
-
-                       for ( i = 0; i < 4; i++ ) {
-                               expanded[ prefix + cssExpand[ i ] + suffix ] =
-                                       parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
-                       }
-
-                       return expanded;
-               }
-       };
-});
-
-
-
-
-var r20 = /%20/g,
-       rbracket = /\[\]$/,
-       rCRLF = /\r?\n/g,
-       rhash = /#.*$/,
-       rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
-       rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
-       // #7653, #8125, #8152: local protocol detection
-       rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
-       rnoContent = /^(?:GET|HEAD)$/,
-       rprotocol = /^\/\//,
-       rquery = /\?/,
-       rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
-       rselectTextarea = /^(?:select|textarea)/i,
-       rspacesAjax = /\s+/,
-       rts = /([?&])_=[^&]*/,
-       rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
-
-       // Keep a copy of the old load method
-       _load = jQuery.fn.load,
-
-       /* Prefilters
-        * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
-        * 2) These are called:
-        *    - BEFORE asking for a transport
-        *    - AFTER param serialization (s.data is a string if s.processData is true)
-        * 3) key is the dataType
-        * 4) the catchall symbol "*" can be used
-        * 5) execution will start with transport dataType and THEN continue down to "*" if needed
-        */
-       prefilters = {},
-
-       /* Transports bindings
-        * 1) key is the dataType
-        * 2) the catchall symbol "*" can be used
-        * 3) selection will start with transport dataType and THEN go to "*" if needed
-        */
-       transports = {},
-
-       // Document location
-       ajaxLocation,
-
-       // Document location segments
-       ajaxLocParts,
-
-       // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
-       allTypes = ["*/"] + ["*"];
-
-// #8138, IE may throw an exception when accessing
-// a field from window.location if document.domain has been set
-try {
-       ajaxLocation = location.href;
-} catch( e ) {
-       // Use the href attribute of an A element
-       // since IE will modify it given document.location
-       ajaxLocation = document.createElement( "a" );
-       ajaxLocation.href = "";
-       ajaxLocation = ajaxLocation.href;
-}
-
-// Segment location into parts
-ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
-
-// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
-function addToPrefiltersOrTransports( structure ) {
-
-       // dataTypeExpression is optional and defaults to "*"
-       return function( dataTypeExpression, func ) {
-
-               if ( typeof dataTypeExpression !== "string" ) {
-                       func = dataTypeExpression;
-                       dataTypeExpression = "*";
-               }
-
-               if ( jQuery.isFunction( func ) ) {
-                       var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
-                               i = 0,
-                               length = dataTypes.length,
-                               dataType,
-                               list,
-                               placeBefore;
-
-                       // For each dataType in the dataTypeExpression
-                       for ( ; i < length; i++ ) {
-                               dataType = dataTypes[ i ];
-                               // We control if we're asked to add before
-                               // any existing element
-                               placeBefore = /^\+/.test( dataType );
-                               if ( placeBefore ) {
-                                       dataType = dataType.substr( 1 ) || "*";
-                               }
-                               list = structure[ dataType ] = structure[ dataType ] || [];
-                               // then we add to the structure accordingly
-                               list[ placeBefore ? "unshift" : "push" ]( func );
-                       }
-               }
-       };
-}
-
-// Base inspection function for prefilters and transports
-function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
-               dataType /* internal */, inspected /* internal */ ) {
-
-       dataType = dataType || options.dataTypes[ 0 ];
-       inspected = inspected || {};
-
-       inspected[ dataType ] = true;
-
-       var list = structure[ dataType ],
-               i = 0,
-               length = list ? list.length : 0,
-               executeOnly = ( structure === prefilters ),
-               selection;
-
-       for ( ; i < length && ( executeOnly || !selection ); i++ ) {
-               selection = list[ i ]( options, originalOptions, jqXHR );
-               // If we got redirected to another dataType
-               // we try there if executing only and not done already
-               if ( typeof selection === "string" ) {
-                       if ( !executeOnly || inspected[ selection ] ) {
-                               selection = undefined;
-                       } else {
-                               options.dataTypes.unshift( selection );
-                               selection = inspectPrefiltersOrTransports(
-                                               structure, options, originalOptions, jqXHR, selection, inspected );
-                       }
-               }
-       }
-       // If we're only executing or nothing was selected
-       // we try the catchall dataType if not done already
-       if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
-               selection = inspectPrefiltersOrTransports(
-                               structure, options, originalOptions, jqXHR, "*", inspected );
-       }
-       // unnecessary when only executing (prefilters)
-       // but it'll be ignored by the caller in that case
-       return selection;
-}
-
-// A special extend for ajax options
-// that takes "flat" options (not to be deep extended)
-// Fixes #9887
-function ajaxExtend( target, src ) {
-       var key, deep,
-               flatOptions = jQuery.ajaxSettings.flatOptions || {};
-       for ( key in src ) {
-               if ( src[ key ] !== undefined ) {
-                       ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
-               }
-       }
-       if ( deep ) {
-               jQuery.extend( true, target, deep );
-       }
-}
-
-jQuery.fn.extend({
-       load: function( url, params, callback ) {
-               if ( typeof url !== "string" && _load ) {
-                       return _load.apply( this, arguments );
-
-               // Don't do a request if no elements are being requested
-               } else if ( !this.length ) {
-                       return this;
-               }
-
-               var off = url.indexOf( " " );
-               if ( off >= 0 ) {
-                       var selector = url.slice( off, url.length );
-                       url = url.slice( 0, off );
-               }
-
-               // Default to a GET request
-               var type = "GET";
-
-               // If the second parameter was provided
-               if ( params ) {
-                       // If it's a function
-                       if ( jQuery.isFunction( params ) ) {
-                               // We assume that it's the callback
-                               callback = params;
-                               params = undefined;
-
-                       // Otherwise, build a param string
-                       } else if ( typeof params === "object" ) {
-                               params = jQuery.param( params, jQuery.ajaxSettings.traditional );
-                               type = "POST";
-                       }
-               }
-
-               var self = this;
-
-               // Request the remote document
-               jQuery.ajax({
-                       url: url,
-                       type: type,
-                       dataType: "html",
-                       data: params,
-                       // Complete callback (responseText is used internally)
-                       complete: function( jqXHR, status, responseText ) {
-                               // Store the response as specified by the jqXHR object
-                               responseText = jqXHR.responseText;
-                               // If successful, inject the HTML into all the matched elements
-                               if ( jqXHR.isResolved() ) {
-                                       // #4825: Get the actual response in case
-                                       // a dataFilter is present in ajaxSettings
-                                       jqXHR.done(function( r ) {
-                                               responseText = r;
-                                       });
-                                       // See if a selector was specified
-                                       self.html( selector ?
-                                               // Create a dummy div to hold the results
-                                               jQuery("<div>")
-                                                       // inject the contents of the document in, removing the scripts
-                                                       // to avoid any 'Permission Denied' errors in IE
-                                                       .append(responseText.replace(rscript, ""))
-
-                                                       // Locate the specified elements
-                                                       .find(selector) :
-
-                                               // If not, just inject the full result
-                                               responseText );
-                               }
-
-                               if ( callback ) {
-                                       self.each( callback, [ responseText, status, jqXHR ] );
-                               }
-                       }
-               });
-
-               return this;
-       },
-
-       serialize: function() {
-               return jQuery.param( this.serializeArray() );
-       },
-
-       serializeArray: function() {
-               return this.map(function(){
-                       return this.elements ? jQuery.makeArray( this.elements ) : this;
-               })
-               .filter(function(){
-                       return this.name && !this.disabled &&
-                               ( this.checked || rselectTextarea.test( this.nodeName ) ||
-                                       rinput.test( this.type ) );
-               })
-               .map(function( i, elem ){
-                       var val = jQuery( this ).val();
-
-                       return val == null ?
-                               null :
-                               jQuery.isArray( val ) ?
-                                       jQuery.map( val, function( val, i ){
-                                               return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
-                                       }) :
-                                       { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
-               }).get();
-       }
-});
-
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
-       jQuery.fn[ o ] = function( f ){
-               return this.on( o, f );
-       };
-});
-
-jQuery.each( [ "get", "post" ], function( i, method ) {
-       jQuery[ method ] = function( url, data, callback, type ) {
-               // shift arguments if data argument was omitted
-               if ( jQuery.isFunction( data ) ) {
-                       type = type || callback;
-                       callback = data;
-                       data = undefined;
-               }
-
-               return jQuery.ajax({
-                       type: method,
-                       url: url,
-                       data: data,
-                       success: callback,
-                       dataType: type
-               });
-       };
-});
-
-jQuery.extend({
-
-       getScript: function( url, callback ) {
-               return jQuery.get( url, undefined, callback, "script" );
-       },
-
-       getJSON: function( url, data, callback ) {
-               return jQuery.get( url, data, callback, "json" );
-       },
-
-       // Creates a full fledged settings object into target
-       // with both ajaxSettings and settings fields.
-       // If target is omitted, writes into ajaxSettings.
-       ajaxSetup: function( target, settings ) {
-               if ( settings ) {
-                       // Building a settings object
-                       ajaxExtend( target, jQuery.ajaxSettings );
-               } else {
-                       // Extending ajaxSettings
-                       settings = target;
-                       target = jQuery.ajaxSettings;
-               }
-               ajaxExtend( target, settings );
-               return target;
-       },
-
-       ajaxSettings: {
-               url: ajaxLocation,
-               isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
-               global: true,
-               type: "GET",
-               contentType: "application/x-www-form-urlencoded; charset=UTF-8",
-               processData: true,
-               async: true,
-               /*
-               timeout: 0,
-               data: null,
-               dataType: null,
-               username: null,
-               password: null,
-               cache: null,
-               traditional: false,
-               headers: {},
-               */
-
-               accepts: {
-                       xml: "application/xml, text/xml",
-                       html: "text/html",
-                       text: "text/plain",
-                       json: "application/json, text/javascript",
-                       "*": allTypes
-               },
-
-               contents: {
-                       xml: /xml/,
-                       html: /html/,
-                       json: /json/
-               },
-
-               responseFields: {
-                       xml: "responseXML",
-                       text: "responseText"
-               },
-
-               // List of data converters
-               // 1) key format is "source_type destination_type" (a single space in-between)
-               // 2) the catchall symbol "*" can be used for source_type
-               converters: {
-
-                       // Convert anything to text
-                       "* text": window.String,
-
-                       // Text to html (true = no transformation)
-                       "text html": true,
-
-                       // Evaluate text as a json expression
-                       "text json": jQuery.parseJSON,
-
-                       // Parse text as xml
-                       "text xml": jQuery.parseXML
-               },
-
-               // For options that shouldn't be deep extended:
-               // you can add your own custom options here if
-               // and when you create one that shouldn't be
-               // deep extended (see ajaxExtend)
-               flatOptions: {
-                       context: true,
-                       url: true
-               }
-       },
-
-       ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
-       ajaxTransport: addToPrefiltersOrTransports( transports ),
-
-       // Main method
-       ajax: function( url, options ) {
-
-               // If url is an object, simulate pre-1.5 signature
-               if ( typeof url === "object" ) {
-                       options = url;
-                       url = undefined;
-               }
-
-               // Force options to be an object
-               options = options || {};
-
-               var // Create the final options object
-                       s = jQuery.ajaxSetup( {}, options ),
-                       // Callbacks context
-                       callbackContext = s.context || s,
-                       // Context for global events
-                       // It's the callbackContext if one was provided in the options
-                       // and if it's a DOM node or a jQuery collection
-                       globalEventContext = callbackContext !== s &&
-                               ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
-                                               jQuery( callbackContext ) : jQuery.event,
-                       // Deferreds
-                       deferred = jQuery.Deferred(),
-                       completeDeferred = jQuery.Callbacks( "once memory" ),
-                       // Status-dependent callbacks
-                       statusCode = s.statusCode || {},
-                       // ifModified key
-                       ifModifiedKey,
-                       // Headers (they are sent all at once)
-                       requestHeaders = {},
-                       requestHeadersNames = {},
-                       // Response headers
-                       responseHeadersString,
-                       responseHeaders,
-                       // transport
-                       transport,
-                       // timeout handle
-                       timeoutTimer,
-                       // Cross-domain detection vars
-                       parts,
-                       // The jqXHR state
-                       state = 0,
-                       // To know if global events are to be dispatched
-                       fireGlobals,
-                       // Loop variable
-                       i,
-                       // Fake xhr
-                       jqXHR = {
-
-                               readyState: 0,
-
-                               // Caches the header
-                               setRequestHeader: function( name, value ) {
-                                       if ( !state ) {
-                                               var lname = name.toLowerCase();
-                                               name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
-                                               requestHeaders[ name ] = value;
-                                       }
-                                       return this;
-                               },
-
-                               // Raw string
-                               getAllResponseHeaders: function() {
-                                       return state === 2 ? responseHeadersString : null;
-                               },
-
-                               // Builds headers hashtable if needed
-                               getResponseHeader: function( key ) {
-                                       var match;
-                                       if ( state === 2 ) {
-                                               if ( !responseHeaders ) {
-                                                       responseHeaders = {};
-                                                       while( ( match = rheaders.exec( responseHeadersString ) ) ) {
-                                                               responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
-                                                       }
-                                               }
-                                               match = responseHeaders[ key.toLowerCase() ];
-                                       }
-                                       return match === undefined ? null : match;
-                               },
-
-                               // Overrides response content-type header
-                               overrideMimeType: function( type ) {
-                                       if ( !state ) {
-                                               s.mimeType = type;
-                                       }
-                                       return this;
-                               },
-
-                               // Cancel the request
-                               abort: function( statusText ) {
-                                       statusText = statusText || "abort";
-                                       if ( transport ) {
-                                               transport.abort( statusText );
-                                       }
-                                       done( 0, statusText );
-                                       return this;
-                               }
-                       };
-
-               // Callback for when everything is done
-               // It is defined here because jslint complains if it is declared
-               // at the end of the function (which would be more logical and readable)
-               function done( status, nativeStatusText, responses, headers ) {
-
-                       // Called once
-                       if ( state === 2 ) {
-                               return;
-                       }
-
-                       // State is "done" now
-                       state = 2;
-
-                       // Clear timeout if it exists
-                       if ( timeoutTimer ) {
-                               clearTimeout( timeoutTimer );
-                       }
-
-                       // Dereference transport for early garbage collection
-                       // (no matter how long the jqXHR object will be used)
-                       transport = undefined;
-
-                       // Cache response headers
-                       responseHeadersString = headers || "";
-
-                       // Set readyState
-                       jqXHR.readyState = status > 0 ? 4 : 0;
-
-                       var isSuccess,
-                               success,
-                               error,
-                               statusText = nativeStatusText,
-                               response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
-                               lastModified,
-                               etag;
-
-                       // If successful, handle type chaining
-                       if ( status >= 200 && status < 300 || status === 304 ) {
-
-                               // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
-                               if ( s.ifModified ) {
-
-                                       if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
-                                               jQuery.lastModified[ ifModifiedKey ] = lastModified;
-                                       }
-                                       if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
-                                               jQuery.etag[ ifModifiedKey ] = etag;
-                                       }
-                               }
-
-                               // If not modified
-                               if ( status === 304 ) {
-
-                                       statusText = "notmodified";
-                                       isSuccess = true;
-
-                               // If we have data
-                               } else {
-
-                                       try {
-                                               success = ajaxConvert( s, response );
-                                               statusText = "success";
-                                               isSuccess = true;
-                                       } catch(e) {
-                                               // We have a parsererror
-                                               statusText = "parsererror";
-                                               error = e;
-                                       }
-                               }
-                       } else {
-                               // We extract error from statusText
-                               // then normalize statusText and status for non-aborts
-                               error = statusText;
-                               if ( !statusText || status ) {
-                                       statusText = "error";
-                                       if ( status < 0 ) {
-                                               status = 0;
-                                       }
-                               }
-                       }
-
-                       // Set data for the fake xhr object
-                       jqXHR.status = status;
-                       jqXHR.statusText = "" + ( nativeStatusText || statusText );
-
-                       // Success/Error
-                       if ( isSuccess ) {
-                               deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
-                       } else {
-                               deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
-                       }
-
-                       // Status-dependent callbacks
-                       jqXHR.statusCode( statusCode );
-                       statusCode = undefined;
-
-                       if ( fireGlobals ) {
-                               globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
-                                               [ jqXHR, s, isSuccess ? success : error ] );
-                       }
-
-                       // Complete
-                       completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
-
-                       if ( fireGlobals ) {
-                               globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
-                               // Handle the global AJAX counter
-                               if ( !( --jQuery.active ) ) {
-                                       jQuery.event.trigger( "ajaxStop" );
-                               }
-                       }
-               }
-
-               // Attach deferreds
-               deferred.promise( jqXHR );
-               jqXHR.success = jqXHR.done;
-               jqXHR.error = jqXHR.fail;
-               jqXHR.complete = completeDeferred.add;
-
-               // Status-dependent callbacks
-               jqXHR.statusCode = function( map ) {
-                       if ( map ) {
-                               var tmp;
-                               if ( state < 2 ) {
-                                       for ( tmp in map ) {
-                                               statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
-                                       }
-                               } else {
-                                       tmp = map[ jqXHR.status ];
-                                       jqXHR.then( tmp, tmp );
-                               }
-                       }
-                       return this;
-               };
-
-               // Remove hash character (#7531: and string promotion)
-               // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
-               // We also use the url parameter if available
-               s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
-
-               // Extract dataTypes list
-               s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
-
-               // Determine if a cross-domain request is in order
-               if ( s.crossDomain == null ) {
-                       parts = rurl.exec( s.url.toLowerCase() );
-                       s.crossDomain = !!( parts &&
-                               ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
-                                       ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
-                                               ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
-                       );
-               }
-
-               // Convert data if not already a string
-               if ( s.data && s.processData && typeof s.data !== "string" ) {
-                       s.data = jQuery.param( s.data, s.traditional );
-               }
-
-               // Apply prefilters
-               inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
-
-               // If request was aborted inside a prefilter, stop there
-               if ( state === 2 ) {
-                       return false;
-               }
-
-               // We can fire global events as of now if asked to
-               fireGlobals = s.global;
-
-               // Uppercase the type
-               s.type = s.type.toUpperCase();
-
-               // Determine if request has content
-               s.hasContent = !rnoContent.test( s.type );
-
-               // Watch for a new set of requests
-               if ( fireGlobals && jQuery.active++ === 0 ) {
-                       jQuery.event.trigger( "ajaxStart" );
-               }
-
-               // More options handling for requests with no content
-               if ( !s.hasContent ) {
-
-                       // If data is available, append data to url
-                       if ( s.data ) {
-                               s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
-                               // #9682: remove data so that it's not used in an eventual retry
-                               delete s.data;
-                       }
-
-                       // Get ifModifiedKey before adding the anti-cache parameter
-                       ifModifiedKey = s.url;
-
-                       // Add anti-cache in url if needed
-                       if ( s.cache === false ) {
-
-                               var ts = jQuery.now(),
-                                       // try replacing _= if it is there
-                                       ret = s.url.replace( rts, "$1_=" + ts );
-
-                               // if nothing was replaced, add timestamp to the end
-                               s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
-                       }
-               }
-
-               // Set the correct header, if data is being sent
-               if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
-                       jqXHR.setRequestHeader( "Content-Type", s.contentType );
-               }
-
-               // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
-               if ( s.ifModified ) {
-                       ifModifiedKey = ifModifiedKey || s.url;
-                       if ( jQuery.lastModified[ ifModifiedKey ] ) {
-                               jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
-                       }
-                       if ( jQuery.etag[ ifModifiedKey ] ) {
-                               jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
-                       }
-               }
-
-               // Set the Accepts header for the server, depending on the dataType
-               jqXHR.setRequestHeader(
-                       "Accept",
-                       s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
-                               s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
-                               s.accepts[ "*" ]
-               );
-
-               // Check for headers option
-               for ( i in s.headers ) {
-                       jqXHR.setRequestHeader( i, s.headers[ i ] );
-               }
-
-               // Allow custom headers/mimetypes and early abort
-               if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
-                               // Abort if not done already
-                               jqXHR.abort();
-                               return false;
-
-               }
-
-               // Install callbacks on deferreds
-               for ( i in { success: 1, error: 1, complete: 1 } ) {
-                       jqXHR[ i ]( s[ i ] );
-               }
-
-               // Get transport
-               transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
-
-               // If no transport, we auto-abort
-               if ( !transport ) {
-                       done( -1, "No Transport" );
-               } else {
-                       jqXHR.readyState = 1;
-                       // Send global event
-                       if ( fireGlobals ) {
-                               globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
-                       }
-                       // Timeout
-                       if ( s.async && s.timeout > 0 ) {
-                               timeoutTimer = setTimeout( function(){
-                                       jqXHR.abort( "timeout" );
-                               }, s.timeout );
-                       }
-
-                       try {
-                               state = 1;
-                               transport.send( requestHeaders, done );
-                       } catch (e) {
-                               // Propagate exception as error if not done
-                               if ( state < 2 ) {
-                                       done( -1, e );
-                               // Simply rethrow otherwise
-                               } else {
-                                       throw e;
-                               }
-                       }
-               }
-
-               return jqXHR;
-       },
-
-       // Serialize an array of form elements or a set of
-       // key/values into a query string
-       param: function( a, traditional ) {
-               var s = [],
-                       add = function( key, value ) {
-                               // If value is a function, invoke it and return its value
-                               value = jQuery.isFunction( value ) ? value() : value;
-                               s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
-                       };
-
-               // Set traditional to true for jQuery <= 1.3.2 behavior.
-               if ( traditional === undefined ) {
-                       traditional = jQuery.ajaxSettings.traditional;
-               }
-
-               // If an array was passed in, assume that it is an array of form elements.
-               if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
-                       // Serialize the form elements
-                       jQuery.each( a, function() {
-                               add( this.name, this.value );
-                       });
-
-               } else {
-                       // If traditional, encode the "old" way (the way 1.3.2 or older
-                       // did it), otherwise encode params recursively.
-                       for ( var prefix in a ) {
-                               buildParams( prefix, a[ prefix ], traditional, add );
-                       }
-               }
-
-               // Return the resulting serialization
-               return s.join( "&" ).replace( r20, "+" );
-       }
-});
-
-function buildParams( prefix, obj, traditional, add ) {
-       if ( jQuery.isArray( obj ) ) {
-               // Serialize array item.
-               jQuery.each( obj, function( i, v ) {
-                       if ( traditional || rbracket.test( prefix ) ) {
-                               // Treat each array item as a scalar.
-                               add( prefix, v );
-
-                       } else {
-                               // If array item is non-scalar (array or object), encode its
-                               // numeric index to resolve deserialization ambiguity issues.
-                               // Note that rack (as of 1.0.0) can't currently deserialize
-                               // nested arrays properly, and attempting to do so may cause
-                               // a server error. Possible fixes are to modify rack's
-                               // deserialization algorithm or to provide an option or flag
-                               // to force array serialization to be shallow.
-                               buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
-                       }
-               });
-
-       } else if ( !traditional && jQuery.type( obj ) === "object" ) {
-               // Serialize object item.
-               for ( var name in obj ) {
-                       buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
-               }
-
-       } else {
-               // Serialize scalar item.
-               add( prefix, obj );
-       }
-}
-
-// This is still on the jQuery object... for now
-// Want to move this to jQuery.ajax some day
-jQuery.extend({
-
-       // Counter for holding the number of active queries
-       active: 0,
-
-       // Last-Modified header cache for next request
-       lastModified: {},
-       etag: {}
-
-});
-
-/* Handles responses to an ajax request:
- * - sets all responseXXX fields accordingly
- * - finds the right dataType (mediates between content-type and expected dataType)
- * - returns the corresponding response
- */
-function ajaxHandleResponses( s, jqXHR, responses ) {
-
-       var contents = s.contents,
-               dataTypes = s.dataTypes,
-               responseFields = s.responseFields,
-               ct,
-               type,
-               finalDataType,
-               firstDataType;
-
-       // Fill responseXXX fields
-       for ( type in responseFields ) {
-               if ( type in responses ) {
-                       jqXHR[ responseFields[type] ] = responses[ type ];
-               }
-       }
-
-       // Remove auto dataType and get content-type in the process
-       while( dataTypes[ 0 ] === "*" ) {
-               dataTypes.shift();
-               if ( ct === undefined ) {
-                       ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
-               }
-       }
-
-       // Check if we're dealing with a known content-type
-       if ( ct ) {
-               for ( type in contents ) {
-                       if ( contents[ type ] && contents[ type ].test( ct ) ) {
-                               dataTypes.unshift( type );
-                               break;
-                       }
-               }
-       }
-
-       // Check to see if we have a response for the expected dataType
-       if ( dataTypes[ 0 ] in responses ) {
-               finalDataType = dataTypes[ 0 ];
-       } else {
-               // Try convertible dataTypes
-               for ( type in responses ) {
-                       if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
-                               finalDataType = type;
-                               break;
-                       }
-                       if ( !firstDataType ) {
-                               firstDataType = type;
-                       }
-               }
-               // Or just use first one
-               finalDataType = finalDataType || firstDataType;
-       }
-
-       // If we found a dataType
-       // We add the dataType to the list if needed
-       // and return the corresponding response
-       if ( finalDataType ) {
-               if ( finalDataType !== dataTypes[ 0 ] ) {
-                       dataTypes.unshift( finalDataType );
-               }
-               return responses[ finalDataType ];
-       }
-}
-
-// Chain conversions given the request and the original response
-function ajaxConvert( s, response ) {
-
-       // Apply the dataFilter if provided
-       if ( s.dataFilter ) {
-               response = s.dataFilter( response, s.dataType );
-       }
-
-       var dataTypes = s.dataTypes,
-               converters = {},
-               i,
-               key,
-               length = dataTypes.length,
-               tmp,
-               // Current and previous dataTypes
-               current = dataTypes[ 0 ],
-               prev,
-               // Conversion expression
-               conversion,
-               // Conversion function
-               conv,
-               // Conversion functions (transitive conversion)
-               conv1,
-               conv2;
-
-       // For each dataType in the chain
-       for ( i = 1; i < length; i++ ) {
-
-               // Create converters map
-               // with lowercased keys
-               if ( i === 1 ) {
-                       for ( key in s.converters ) {
-                               if ( typeof key === "string" ) {
-                                       converters[ key.toLowerCase() ] = s.converters[ key ];
-                               }
-                       }
-               }
-
-               // Get the dataTypes
-               prev = current;
-               current = dataTypes[ i ];
-
-               // If current is auto dataType, update it to prev
-               if ( current === "*" ) {
-                       current = prev;
-               // If no auto and dataTypes are actually different
-               } else if ( prev !== "*" && prev !== current ) {
-
-                       // Get the converter
-                       conversion = prev + " " + current;
-                       conv = converters[ conversion ] || converters[ "* " + current ];
-
-                       // If there is no direct converter, search transitively
-                       if ( !conv ) {
-                               conv2 = undefined;
-                               for ( conv1 in converters ) {
-                                       tmp = conv1.split( " " );
-                                       if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
-                                               conv2 = converters[ tmp[1] + " " + current ];
-                                               if ( conv2 ) {
-                                                       conv1 = converters[ conv1 ];
-                                                       if ( conv1 === true ) {
-                                                               conv = conv2;
-                                                       } else if ( conv2 === true ) {
-                                                               conv = conv1;
-                                                       }
-                                                       break;
-                                               }
-                                       }
-                               }
-                       }
-                       // If we found no converter, dispatch an error
-                       if ( !( conv || conv2 ) ) {
-                               jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
-                       }
-                       // If found converter is not an equivalence
-                       if ( conv !== true ) {
-                               // Convert with 1 or 2 converters accordingly
-                               response = conv ? conv( response ) : conv2( conv1(response) );
-                       }
-               }
-       }
-       return response;
-}
-
-
-
-
-var jsc = jQuery.now(),
-       jsre = /(\=)\?(&|$)|\?\?/i;
-
-// Default jsonp settings
-jQuery.ajaxSetup({
-       jsonp: "callback",
-       jsonpCallback: function() {
-               return jQuery.expando + "_" + ( jsc++ );
-       }
-});
-
-// Detect, normalize options and install callbacks for jsonp requests
-jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
-
-       var inspectData = ( typeof s.data === "string" ) && /^application\/x\-www\-form\-urlencoded/.test( s.contentType );
-
-       if ( s.dataTypes[ 0 ] === "jsonp" ||
-               s.jsonp !== false && ( jsre.test( s.url ) ||
-                               inspectData && jsre.test( s.data ) ) ) {
-
-               var responseContainer,
-                       jsonpCallback = s.jsonpCallback =
-                               jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
-                       previous = window[ jsonpCallback ],
-                       url = s.url,
-                       data = s.data,
-                       replace = "$1" + jsonpCallback + "$2";
-
-               if ( s.jsonp !== false ) {
-                       url = url.replace( jsre, replace );
-                       if ( s.url === url ) {
-                               if ( inspectData ) {
-                                       data = data.replace( jsre, replace );
-                               }
-                               if ( s.data === data ) {
-                                       // Add callback manually
-                                       url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
-                               }
-                       }
-               }
-
-               s.url = url;
-               s.data = data;
-
-               // Install callback
-               window[ jsonpCallback ] = function( response ) {
-                       responseContainer = [ response ];
-               };
-
-               // Clean-up function
-               jqXHR.always(function() {
-                       // Set callback back to previous value
-                       window[ jsonpCallback ] = previous;
-                       // Call if it was a function and we have a response
-                       if ( responseContainer && jQuery.isFunction( previous ) ) {
-                               window[ jsonpCallback ]( responseContainer[ 0 ] );
-                       }
-               });
-
-               // Use data converter to retrieve json after script execution
-               s.converters["script json"] = function() {
-                       if ( !responseContainer ) {
-                               jQuery.error( jsonpCallback + " was not called" );
-                       }
-                       return responseContainer[ 0 ];
-               };
-
-               // force json dataType
-               s.dataTypes[ 0 ] = "json";
-
-               // Delegate to script
-               return "script";
-       }
-});
-
-
-
-
-// Install script dataType
-jQuery.ajaxSetup({
-       accepts: {
-               script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
-       },
-       contents: {
-               script: /javascript|ecmascript/
-       },
-       converters: {
-               "text script": function( text ) {
-                       jQuery.globalEval( text );
-                       return text;
-               }
-       }
-});
-
-// Handle cache's special case and global
-jQuery.ajaxPrefilter( "script", function( s ) {
-       if ( s.cache === undefined ) {
-               s.cache = false;
-       }
-       if ( s.crossDomain ) {
-               s.type = "GET";
-               s.global = false;
-       }
-});
-
-// Bind script tag hack transport
-jQuery.ajaxTransport( "script", function(s) {
-
-       // This transport only deals with cross domain requests
-       if ( s.crossDomain ) {
-
-               var script,
-                       head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
-
-               return {
-
-                       send: function( _, callback ) {
-
-                               script = document.createElement( "script" );
-
-                               script.async = "async";
-
-                               if ( s.scriptCharset ) {
-                                       script.charset = s.scriptCharset;
-                               }
-
-                               script.src = s.url;
-
-                               // Attach handlers for all browsers
-                               script.onload = script.onreadystatechange = function( _, isAbort ) {
-
-                                       if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
-
-                                               // Handle memory leak in IE
-                                               script.onload = script.onreadystatechange = null;
-
-                                               // Remove the script
-                                               if ( head && script.parentNode ) {
-                                                       head.removeChild( script );
-                                               }
-
-                                               // Dereference the script
-                                               script = undefined;
-
-                                               // Callback if not abort
-                                               if ( !isAbort ) {
-                                                       callback( 200, "success" );
-                                               }
-                                       }
-                               };
-                               // Use insertBefore instead of appendChild  to circumvent an IE6 bug.
-                               // This arises when a base node is used (#2709 and #4378).
-                               head.insertBefore( script, head.firstChild );
-                       },
-
-                       abort: function() {
-                               if ( script ) {
-                                       script.onload( 0, 1 );
-                               }
-                       }
-               };
-       }
-});
-
-
-
-
-var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
-       xhrOnUnloadAbort = window.ActiveXObject ? function() {
-               // Abort all pending requests
-               for ( var key in xhrCallbacks ) {
-                       xhrCallbacks[ key ]( 0, 1 );
-               }
-       } : false,
-       xhrId = 0,
-       xhrCallbacks;
-
-// Functions to create xhrs
-function createStandardXHR() {
-       try {
-               return new window.XMLHttpRequest();
-       } catch( e ) {}
-}
-
-function createActiveXHR() {
-       try {
-               return new window.ActiveXObject( "Microsoft.XMLHTTP" );
-       } catch( e ) {}
-}
-
-// Create the request object
-// (This is still attached to ajaxSettings for backward compatibility)
-jQuery.ajaxSettings.xhr = window.ActiveXObject ?
-       /* Microsoft failed to properly
-        * implement the XMLHttpRequest in IE7 (can't request local files),
-        * so we use the ActiveXObject when it is available
-        * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
-        * we need a fallback.
-        */
-       function() {
-               return !this.isLocal && createStandardXHR() || createActiveXHR();
-       } :
-       // For all other browsers, use the standard XMLHttpRequest object
-       createStandardXHR;
-
-// Determine support properties
-(function( xhr ) {
-       jQuery.extend( jQuery.support, {
-               ajax: !!xhr,
-               cors: !!xhr && ( "withCredentials" in xhr )
-       });
-})( jQuery.ajaxSettings.xhr() );
-
-// Create transport if the browser can provide an xhr
-if ( jQuery.support.ajax ) {
-
-       jQuery.ajaxTransport(function( s ) {
-               // Cross domain only allowed if supported through XMLHttpRequest
-               if ( !s.crossDomain || jQuery.support.cors ) {
-
-                       var callback;
-
-                       return {
-                               send: function( headers, complete ) {
-
-                                       // Get a new xhr
-                                       var xhr = s.xhr(),
-                                               handle,
-                                               i;
-
-                                       // Open the socket
-                                       // Passing null username, generates a login popup on Opera (#2865)
-                                       if ( s.username ) {
-                                               xhr.open( s.type, s.url, s.async, s.username, s.password );
-                                       } else {
-                                               xhr.open( s.type, s.url, s.async );
-                                       }
-
-                                       // Apply custom fields if provided
-                                       if ( s.xhrFields ) {
-                                               for ( i in s.xhrFields ) {
-                                                       xhr[ i ] = s.xhrFields[ i ];
-                                               }
-                                       }
-
-                                       // Override mime type if needed
-                                       if ( s.mimeType && xhr.overrideMimeType ) {
-                                               xhr.overrideMimeType( s.mimeType );
-                                       }
-
-                                       // X-Requested-With header
-                                       // For cross-domain requests, seeing as conditions for a preflight are
-                                       // akin to a jigsaw puzzle, we simply never set it to be sure.
-                                       // (it can always be set on a per-request basis or even using ajaxSetup)
-                                       // For same-domain requests, won't change header if already provided.
-                                       if ( !s.crossDomain && !headers["X-Requested-With"] ) {
-                                               headers[ "X-Requested-With" ] = "XMLHttpRequest";
-                                       }
-
-                                       // Need an extra try/catch for cross domain requests in Firefox 3
-                                       try {
-                                               for ( i in headers ) {
-                                                       xhr.setRequestHeader( i, headers[ i ] );
-                                               }
-                                       } catch( _ ) {}
-
-                                       // Do send the request
-                                       // This may raise an exception which is actually
-                                       // handled in jQuery.ajax (so no try/catch here)
-                                       xhr.send( ( s.hasContent && s.data ) || null );
-
-                                       // Listener
-                                       callback = function( _, isAbort ) {
-
-                                               var status,
-                                                       statusText,
-                                                       responseHeaders,
-                                                       responses,
-                                                       xml;
-
-                                               // Firefox throws exceptions when accessing properties
-                                               // of an xhr when a network error occured
-                                               // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
-                                               try {
-
-                                                       // Was never called and is aborted or complete
-                                                       if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
-
-                                                               // Only called once
-                                                               callback = undefined;
-
-                                                               // Do not keep as active anymore
-                                                               if ( handle ) {
-                                                                       xhr.onreadystatechange = jQuery.noop;
-                                                                       if ( xhrOnUnloadAbort ) {
-                                                                               delete xhrCallbacks[ handle ];
-                                                                       }
-                                                               }
-
-                                                               // If it's an abort
-                                                               if ( isAbort ) {
-                                                                       // Abort it manually if needed
-                                                                       if ( xhr.readyState !== 4 ) {
-                                                                               xhr.abort();
-                                                                       }
-                                                               } else {
-                                                                       status = xhr.status;
-                                                                       responseHeaders = xhr.getAllResponseHeaders();
-                                                                       responses = {};
-                                                                       xml = xhr.responseXML;
-
-                                                                       // Construct response list
-                                                                       if ( xml && xml.documentElement /* #4958 */ ) {
-                                                                               responses.xml = xml;
-                                                                       }
-
-                                                                       // When requesting binary data, IE6-9 will throw an exception
-                                                                       // on any attempt to access responseText (#11426)
-                                                                       try {
-                                                                               responses.text = xhr.responseText;
-                                                                       } catch( _ ) {
-                                                                       }
-
-                                                                       // Firefox throws an exception when accessing
-                                                                       // statusText for faulty cross-domain requests
-                                                                       try {
-                                                                               statusText = xhr.statusText;
-                                                                       } catch( e ) {
-                                                                               // We normalize with Webkit giving an empty statusText
-                                                                               statusText = "";
-                                                                       }
-
-                                                                       // Filter status for non standard behaviors
-
-                                                                       // If the request is local and we have data: assume a success
-                                                                       // (success with no data won't get notified, that's the best we
-                                                                       // can do given current implementations)
-                                                                       if ( !status && s.isLocal && !s.crossDomain ) {
-                                                                               status = responses.text ? 200 : 404;
-                                                                       // IE - #1450: sometimes returns 1223 when it should be 204
-                                                                       } else if ( status === 1223 ) {
-                                                                               status = 204;
-                                                                       }
-                                                               }
-                                                       }
-                                               } catch( firefoxAccessException ) {
-                                                       if ( !isAbort ) {
-                                                               complete( -1, firefoxAccessException );
-                                                       }
-                                               }
-
-                                               // Call complete if needed
-                                               if ( responses ) {
-                                                       complete( status, statusText, responses, responseHeaders );
-                                               }
-                                       };
-
-                                       // if we're in sync mode or it's in cache
-                                       // and has been retrieved directly (IE6 & IE7)
-                                       // we need to manually fire the callback
-                                       if ( !s.async || xhr.readyState === 4 ) {
-                                               callback();
-                                       } else {
-                                               handle = ++xhrId;
-                                               if ( xhrOnUnloadAbort ) {
-                                                       // Create the active xhrs callbacks list if needed
-                                                       // and attach the unload handler
-                                                       if ( !xhrCallbacks ) {
-                                                               xhrCallbacks = {};
-                                                               jQuery( window ).unload( xhrOnUnloadAbort );
-                                                       }
-                                                       // Add to list of active xhrs callbacks
-                                                       xhrCallbacks[ handle ] = callback;
-                                               }
-                                               xhr.onreadystatechange = callback;
-                                       }
-                               },
-
-                               abort: function() {
-                                       if ( callback ) {
-                                               callback(0,1);
-                                       }
-                               }
-                       };
-               }
-       });
-}
-
-
-
-
-var elemdisplay = {},
-       iframe, iframeDoc,
-       rfxtypes = /^(?:toggle|show|hide)$/,
-       rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
-       timerId,
-       fxAttrs = [
-               // height animations
-               [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
-               // width animations
-               [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
-               // opacity animations
-               [ "opacity" ]
-       ],
-       fxNow;
-
-jQuery.fn.extend({
-       show: function( speed, easing, callback ) {
-               var elem, display;
-
-               if ( speed || speed === 0 ) {
-                       return this.animate( genFx("show", 3), speed, easing, callback );
-
-               } else {
-                       for ( var i = 0, j = this.length; i < j; i++ ) {
-                               elem = this[ i ];
-
-                               if ( elem.style ) {
-                                       display = elem.style.display;
-
-                                       // Reset the inline display of this element to learn if it is
-                                       // being hidden by cascaded rules or not
-                                       if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
-                                               display = elem.style.display = "";
-                                       }
-
-                                       // Set elements which have been overridden with display: none
-                                       // in a stylesheet to whatever the default browser style is
-                                       // for such an element
-                                       if ( (display === "" && jQuery.css(elem, "display") === "none") ||
-                                               !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
-                                               jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
-                                       }
-                               }
-                       }
-
-                       // Set the display of most of the elements in a second loop
-                       // to avoid the constant reflow
-                       for ( i = 0; i < j; i++ ) {
-                               elem = this[ i ];
-
-                               if ( elem.style ) {
-                                       display = elem.style.display;
-
-                                       if ( display === "" || display === "none" ) {
-                                               elem.style.display = jQuery._data( elem, "olddisplay" ) || "";
-                                       }
-                               }
-                       }
-
-                       return this;
-               }
-       },
-
-       hide: function( speed, easing, callback ) {
-               if ( speed || speed === 0 ) {
-                       return this.animate( genFx("hide", 3), speed, easing, callback);
-
-               } else {
-                       var elem, display,
-                               i = 0,
-                               j = this.length;
-
-                       for ( ; i < j; i++ ) {
-                               elem = this[i];
-                               if ( elem.style ) {
-                                       display = jQuery.css( elem, "display" );
-
-                                       if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) {
-                                               jQuery._data( elem, "olddisplay", display );
-                                       }
-                               }
-                       }
-
-                       // Set the display of the elements in a second loop
-                       // to avoid the constant reflow
-                       for ( i = 0; i < j; i++ ) {
-                               if ( this[i].style ) {
-                                       this[i].style.display = "none";
-                               }
-                       }
-
-                       return this;
-               }
-       },
-
-       // Save the old toggle function
-       _toggle: jQuery.fn.toggle,
-
-       toggle: function( fn, fn2, callback ) {
-               var bool = typeof fn === "boolean";
-
-               if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
-                       this._toggle.apply( this, arguments );
-
-               } else if ( fn == null || bool ) {
-                       this.each(function() {
-                               var state = bool ? fn : jQuery(this).is(":hidden");
-                               jQuery(this)[ state ? "show" : "hide" ]();
-                       });
-
-               } else {
-                       this.animate(genFx("toggle", 3), fn, fn2, callback);
-               }
-
-               return this;
-       },
-
-       fadeTo: function( speed, to, easing, callback ) {
-               return this.filter(":hidden").css("opacity", 0).show().end()
-                                       .animate({opacity: to}, speed, easing, callback);
-       },
-
-       animate: function( prop, speed, easing, callback ) {
-               var optall = jQuery.speed( speed, easing, callback );
-
-               if ( jQuery.isEmptyObject( prop ) ) {
-                       return this.each( optall.complete, [ false ] );
-               }
-
-               // Do not change referenced properties as per-property easing will be lost
-               prop = jQuery.extend( {}, prop );
-
-               function doAnimation() {
-                       // XXX 'this' does not always have a nodeName when running the
-                       // test suite
-
-                       if ( optall.queue === false ) {
-                               jQuery._mark( this );
-                       }
-
-                       var opt = jQuery.extend( {}, optall ),
-                               isElement = this.nodeType === 1,
-                               hidden = isElement && jQuery(this).is(":hidden"),
-                               name, val, p, e, hooks, replace,
-                               parts, start, end, unit,
-                               method;
-
-                       // will store per property easing and be used to determine when an animation is complete
-                       opt.animatedProperties = {};
-
-                       // first pass over propertys to expand / normalize
-                       for ( p in prop ) {
-                               name = jQuery.camelCase( p );
-                               if ( p !== name ) {
-                                       prop[ name ] = prop[ p ];
-                                       delete prop[ p ];
-                               }
-
-                               if ( ( hooks = jQuery.cssHooks[ name ] ) && "expand" in hooks ) {
-                                       replace = hooks.expand( prop[ name ] );
-                                       delete prop[ name ];
-
-                                       // not quite $.extend, this wont overwrite keys already present.
-                                       // also - reusing 'p' from above because we have the correct "name"
-                                       for ( p in replace ) {
-                                               if ( ! ( p in prop ) ) {
-                                                       prop[ p ] = replace[ p ];
-                                               }
-                                       }
-                               }
-                       }
-
-                       for ( name in prop ) {
-                               val = prop[ name ];
-                               // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
-                               if ( jQuery.isArray( val ) ) {
-                                       opt.animatedProperties[ name ] = val[ 1 ];
-                                       val = prop[ name ] = val[ 0 ];
-                               } else {
-                                       opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
-                               }
-
-                               if ( val === "hide" && hidden || val === "show" && !hidden ) {
-                                       return opt.complete.call( this );
-                               }
-
-                               if ( isElement && ( name === "height" || name === "width" ) ) {
-                                       // Make sure that nothing sneaks out
-                                       // Record all 3 overflow attributes because IE does not
-                                       // change the overflow attribute when overflowX and
-                                       // overflowY are set to the same value
-                                       opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
-
-                                       // Set display property to inline-block for height/width
-                                       // animations on inline elements that are having width/height animated
-                                       if ( jQuery.css( this, "display" ) === "inline" &&
-                                                       jQuery.css( this, "float" ) === "none" ) {
-
-                                               // inline-level elements accept inline-block;
-                                               // block-level elements need to be inline with layout
-                                               if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {
-                                                       this.style.display = "inline-block";
-
-                                               } else {
-                                                       this.style.zoom = 1;
-                                               }
-                                       }
-                               }
-                       }
-
-                       if ( opt.overflow != null ) {
-                               this.style.overflow = "hidden";
-                       }
-
-                       for ( p in prop ) {
-                               e = new jQuery.fx( this, opt, p );
-                               val = prop[ p ];
-
-                               if ( rfxtypes.test( val ) ) {
-
-                                       // Tracks whether to show or hide based on private
-                                       // data attached to the element
-                                       method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 );
-                                       if ( method ) {
-                                               jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" );
-                                               e[ method ]();
-                                       } else {
-                                               e[ val ]();
-                                       }
-
-                               } else {
-                                       parts = rfxnum.exec( val );
-                                       start = e.cur();
-
-                                       if ( parts ) {
-                                               end = parseFloat( parts[2] );
-                                               unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
-
-                                               // We need to compute starting value
-                                               if ( unit !== "px" ) {
-                                                       jQuery.style( this, p, (end || 1) + unit);
-                                                       start = ( (end || 1) / e.cur() ) * start;
-                                                       jQuery.style( this, p, start + unit);
-                                               }
-
-                                               // If a +=/-= token was provided, we're doing a relative animation
-                                               if ( parts[1] ) {
-                                                       end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
-                                               }
-
-                                               e.custom( start, end, unit );
-
-                                       } else {
-                                               e.custom( start, val, "" );
-                                       }
-                               }
-                       }
-
-                       // For JS strict compliance
-                       return true;
-               }
-
-               return optall.queue === false ?
-                       this.each( doAnimation ) :
-                       this.queue( optall.queue, doAnimation );
-       },
-
-       stop: function( type, clearQueue, gotoEnd ) {
-               if ( typeof type !== "string" ) {
-                       gotoEnd = clearQueue;
-                       clearQueue = type;
-                       type = undefined;
-               }
-               if ( clearQueue && type !== false ) {
-                       this.queue( type || "fx", [] );
-               }
-
-               return this.each(function() {
-                       var index,
-                               hadTimers = false,
-                               timers = jQuery.timers,
-                               data = jQuery._data( this );
-
-                       // clear marker counters if we know they won't be
-                       if ( !gotoEnd ) {
-                               jQuery._unmark( true, this );
-                       }
-
-                       function stopQueue( elem, data, index ) {
-                               var hooks = data[ index ];
-                               jQuery.removeData( elem, index, true );
-                               hooks.stop( gotoEnd );
-                       }
-
-                       if ( type == null ) {
-                               for ( index in data ) {
-                                       if ( data[ index ] && data[ index ].stop && index.indexOf(".run") === index.length - 4 ) {
-                                               stopQueue( this, data, index );
-                                       }
-                               }
-                       } else if ( data[ index = type + ".run" ] && data[ index ].stop ){
-                               stopQueue( this, data, index );
-                       }
-
-                       for ( index = timers.length; index--; ) {
-                               if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
-                                       if ( gotoEnd ) {
-
-                                               // force the next step to be the last
-                                               timers[ index ]( true );
-                                       } else {
-                                               timers[ index ].saveState();
-                                       }
-                                       hadTimers = true;
-                                       timers.splice( index, 1 );
-                               }
-                       }
-
-                       // start the next in the queue if the last step wasn't forced
-                       // timers currently will call their complete callbacks, which will dequeue
-                       // but only if they were gotoEnd
-                       if ( !( gotoEnd && hadTimers ) ) {
-                               jQuery.dequeue( this, type );
-                       }
-               });
-       }
-
-});
-
-// Animations created synchronously will run synchronously
-function createFxNow() {
-       setTimeout( clearFxNow, 0 );
-       return ( fxNow = jQuery.now() );
-}
-
-function clearFxNow() {
-       fxNow = undefined;
-}
-
-// Generate parameters to create a standard animation
-function genFx( type, num ) {
-       var obj = {};
-
-       jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() {
-               obj[ this ] = type;
-       });
-
-       return obj;
-}
-
-// Generate shortcuts for custom animations
-jQuery.each({
-       slideDown: genFx( "show", 1 ),
-       slideUp: genFx( "hide", 1 ),
-       slideToggle: genFx( "toggle", 1 ),
-       fadeIn: { opacity: "show" },
-       fadeOut: { opacity: "hide" },
-       fadeToggle: { opacity: "toggle" }
-}, function( name, props ) {
-       jQuery.fn[ name ] = function( speed, easing, callback ) {
-               return this.animate( props, speed, easing, callback );
-       };
-});
-
-jQuery.extend({
-       speed: function( speed, easing, fn ) {
-               var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
-                       complete: fn || !fn && easing ||
-                               jQuery.isFunction( speed ) && speed,
-                       duration: speed,
-                       easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
-               };
-
-               opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
-                       opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
-
-               // normalize opt.queue - true/undefined/null -> "fx"
-               if ( opt.queue == null || opt.queue === true ) {
-                       opt.queue = "fx";
-               }
-
-               // Queueing
-               opt.old = opt.complete;
-
-               opt.complete = function( noUnmark ) {
-                       if ( jQuery.isFunction( opt.old ) ) {
-                               opt.old.call( this );
-                       }
-
-                       if ( opt.queue ) {
-                               jQuery.dequeue( this, opt.queue );
-                       } else if ( noUnmark !== false ) {
-                               jQuery._unmark( this );
-                       }
-               };
-
-               return opt;
-       },
-
-       easing: {
-               linear: function( p ) {
-                       return p;
-               },
-               swing: function( p ) {
-                       return ( -Math.cos( p*Math.PI ) / 2 ) + 0.5;
-               }
-       },
-
-       timers: [],
-
-       fx: function( elem, options, prop ) {
-               this.options = options;
-               this.elem = elem;
-               this.prop = prop;
-
-               options.orig = options.orig || {};
-       }
-
-});
-
-jQuery.fx.prototype = {
-       // Simple function for setting a style value
-       update: function() {
-               if ( this.options.step ) {
-                       this.options.step.call( this.elem, this.now, this );
-               }
-
-               ( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this );
-       },
-
-       // Get the current size
-       cur: function() {
-               if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) {
-                       return this.elem[ this.prop ];
-               }
-
-               var parsed,
-                       r = jQuery.css( this.elem, this.prop );
-               // Empty strings, null, undefined and "auto" are converted to 0,
-               // complex values such as "rotate(1rad)" are returned as is,
-               // simple values such as "10px" are parsed to Float.
-               return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
-       },
-
-       // Start an animation from one number to another
-       custom: function( from, to, unit ) {
-               var self = this,
-                       fx = jQuery.fx;
-
-               this.startTime = fxNow || createFxNow();
-               this.end = to;
-               this.now = this.start = from;
-               this.pos = this.state = 0;
-               this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
-
-               function t( gotoEnd ) {
-                       return self.step( gotoEnd );
-               }
-
-               t.queue = this.options.queue;
-               t.elem = this.elem;
-               t.saveState = function() {
-                       if ( jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) {
-                               if ( self.options.hide ) {
-                                       jQuery._data( self.elem, "fxshow" + self.prop, self.start );
-                               } else if ( self.options.show ) {
-                                       jQuery._data( self.elem, "fxshow" + self.prop, self.end );
-                               }
-                       }
-               };
-
-               if ( t() && jQuery.timers.push(t) && !timerId ) {
-                       timerId = setInterval( fx.tick, fx.interval );
-               }
-       },
-
-       // Simple 'show' function
-       show: function() {
-               var dataShow = jQuery._data( this.elem, "fxshow" + this.prop );
-
-               // Remember where we started, so that we can go back to it later
-               this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop );
-               this.options.show = true;
-
-               // Begin the animation
-               // Make sure that we start at a small width/height to avoid any flash of content
-               if ( dataShow !== undefined ) {
-                       // This show is picking up where a previous hide or show left off
-                       this.custom( this.cur(), dataShow );
-               } else {
-                       this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() );
-               }
-
-               // Start by showing the element
-               jQuery( this.elem ).show();
-       },
-
-       // Simple 'hide' function
-       hide: function() {
-               // Remember where we started, so that we can go back to it later
-               this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop );
-               this.options.hide = true;
-
-               // Begin the animation
-               this.custom( this.cur(), 0 );
-       },
-
-       // Each step of an animation
-       step: function( gotoEnd ) {
-               var p, n, complete,
-                       t = fxNow || createFxNow(),
-                       done = true,
-                       elem = this.elem,
-                       options = this.options;
-
-               if ( gotoEnd || t >= options.duration + this.startTime ) {
-                       this.now = this.end;
-                       this.pos = this.state = 1;
-                       this.update();
-
-                       options.animatedProperties[ this.prop ] = true;
-
-                       for ( p in options.animatedProperties ) {
-                               if ( options.animatedProperties[ p ] !== true ) {
-                                       done = false;
-                               }
-                       }
-
-                       if ( done ) {
-                               // Reset the overflow
-                               if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
-
-                                       jQuery.each( [ "", "X", "Y" ], function( index, value ) {
-                                               elem.style[ "overflow" + value ] = options.overflow[ index ];
-                                       });
-                               }
-
-                               // Hide the element if the "hide" operation was done
-                               if ( options.hide ) {
-                                       jQuery( elem ).hide();
-                               }
-
-                               // Reset the properties, if the item has been hidden or shown
-                               if ( options.hide || options.show ) {
-                                       for ( p in options.animatedProperties ) {
-                                               jQuery.style( elem, p, options.orig[ p ] );
-                                               jQuery.removeData( elem, "fxshow" + p, true );
-                                               // Toggle data is no longer needed
-                                               jQuery.removeData( elem, "toggle" + p, true );
-                                       }
-                               }
-
-                               // Execute the complete function
-                               // in the event that the complete function throws an exception
-                               // we must ensure it won't be called twice. #5684
-
-                               complete = options.complete;
-                               if ( complete ) {
-
-                                       options.complete = false;
-                                       complete.call( elem );
-                               }
-                       }
-
-                       return false;
-
-               } else {
-                       // classical easing cannot be used with an Infinity duration
-                       if ( options.duration == Infinity ) {
-                               this.now = t;
-                       } else {
-                               n = t - this.startTime;
-                               this.state = n / options.duration;
-
-                               // Perform the easing function, defaults to swing
-                               this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration );
-                               this.now = this.start + ( (this.end - this.start) * this.pos );
-                       }
-                       // Perform the next step of the animation
-                       this.update();
-               }
-
-               return true;
-       }
-};
-
-jQuery.extend( jQuery.fx, {
-       tick: function() {
-               var timer,
-                       timers = jQuery.timers,
-                       i = 0;
-
-               for ( ; i < timers.length; i++ ) {
-                       timer = timers[ i ];
-                       // Checks the timer has not already been removed
-                       if ( !timer() && timers[ i ] === timer ) {
-                               timers.splice( i--, 1 );
-                       }
-               }
-
-               if ( !timers.length ) {
-                       jQuery.fx.stop();
-               }
-       },
-
-       interval: 13,
-
-       stop: function() {
-               clearInterval( timerId );
-               timerId = null;
-       },
-
-       speeds: {
-               slow: 600,
-               fast: 200,
-               // Default speed
-               _default: 400
-       },
-
-       step: {
-               opacity: function( fx ) {
-                       jQuery.style( fx.elem, "opacity", fx.now );
-               },
-
-               _default: function( fx ) {
-                       if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
-                               fx.elem.style[ fx.prop ] = fx.now + fx.unit;
-                       } else {
-                               fx.elem[ fx.prop ] = fx.now;
-                       }
-               }
-       }
-});
-
-// Ensure props that can't be negative don't go there on undershoot easing
-jQuery.each( fxAttrs.concat.apply( [], fxAttrs ), function( i, prop ) {
-       // exclude marginTop, marginLeft, marginBottom and marginRight from this list
-       if ( prop.indexOf( "margin" ) ) {
-               jQuery.fx.step[ prop ] = function( fx ) {
-                       jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit );
-               };
-       }
-});
-
-if ( jQuery.expr && jQuery.expr.filters ) {
-       jQuery.expr.filters.animated = function( elem ) {
-               return jQuery.grep(jQuery.timers, function( fn ) {
-                       return elem === fn.elem;
-               }).length;
-       };
-}
-
-// Try to restore the default display value of an element
-function defaultDisplay( nodeName ) {
-
-       if ( !elemdisplay[ nodeName ] ) {
-
-               var body = document.body,
-                       elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
-                       display = elem.css( "display" );
-               elem.remove();
-
-               // If the simple way fails,
-               // get element's real default display by attaching it to a temp iframe
-               if ( display === "none" || display === "" ) {
-                       // No iframe to use yet, so create it
-                       if ( !iframe ) {
-                               iframe = document.createElement( "iframe" );
-                               iframe.frameBorder = iframe.width = iframe.height = 0;
-                       }
-
-                       body.appendChild( iframe );
-
-                       // Create a cacheable copy of the iframe document on first call.
-                       // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
-                       // document to it; WebKit & Firefox won't allow reusing the iframe document.
-                       if ( !iframeDoc || !iframe.createElement ) {
-                               iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
-                               iframeDoc.write( ( jQuery.support.boxModel ? "<!doctype html>" : "" ) + "<html><body>" );
-                               iframeDoc.close();
-                       }
-
-                       elem = iframeDoc.createElement( nodeName );
-
-                       iframeDoc.body.appendChild( elem );
-
-                       display = jQuery.css( elem, "display" );
-                       body.removeChild( iframe );
-               }
-
-               // Store the correct default display
-               elemdisplay[ nodeName ] = display;
-       }
-
-       return elemdisplay[ nodeName ];
-}
-
-
-
-
-var getOffset,
-       rtable = /^t(?:able|d|h)$/i,
-       rroot = /^(?:body|html)$/i;
-
-if ( "getBoundingClientRect" in document.documentElement ) {
-       getOffset = function( elem, doc, docElem, box ) {
-               try {
-                       box = elem.getBoundingClientRect();
-               } catch(e) {}
-
-               // Make sure we're not dealing with a disconnected DOM node
-               if ( !box || !jQuery.contains( docElem, elem ) ) {
-                       return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
-               }
-
-               var body = doc.body,
-                       win = getWindow( doc ),
-                       clientTop  = docElem.clientTop  || body.clientTop  || 0,
-                       clientLeft = docElem.clientLeft || body.clientLeft || 0,
-                       scrollTop  = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop  || body.scrollTop,
-                       scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
-                       top  = box.top  + scrollTop  - clientTop,
-                       left = box.left + scrollLeft - clientLeft;
-
-               return { top: top, left: left };
-       };
-
-} else {
-       getOffset = function( elem, doc, docElem ) {
-               var computedStyle,
-                       offsetParent = elem.offsetParent,
-                       prevOffsetParent = elem,
-                       body = doc.body,
-                       defaultView = doc.defaultView,
-                       prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
-                       top = elem.offsetTop,
-                       left = elem.offsetLeft;
-
-               while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
-                       if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
-                               break;
-                       }
-
-                       computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
-                       top  -= elem.scrollTop;
-                       left -= elem.scrollLeft;
-
-                       if ( elem === offsetParent ) {
-                               top  += elem.offsetTop;
-                               left += elem.offsetLeft;
-
-                               if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
-                                       top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
-                                       left += parseFloat( computedStyle.borderLeftWidth ) || 0;
-                               }
-
-                               prevOffsetParent = offsetParent;
-                               offsetParent = elem.offsetParent;
-                       }
-
-                       if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
-                               top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
-                               left += parseFloat( computedStyle.borderLeftWidth ) || 0;
-                       }
-
-                       prevComputedStyle = computedStyle;
-               }
-
-               if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
-                       top  += body.offsetTop;
-                       left += body.offsetLeft;
-               }
-
-               if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
-                       top  += Math.max( docElem.scrollTop, body.scrollTop );
-                       left += Math.max( docElem.scrollLeft, body.scrollLeft );
-               }
-
-               return { top: top, left: left };
-       };
-}
-
-jQuery.fn.offset = function( options ) {
-       if ( arguments.length ) {
-               return options === undefined ?
-                       this :
-                       this.each(function( i ) {
-                               jQuery.offset.setOffset( this, options, i );
-                       });
-       }
-
-       var elem = this[0],
-               doc = elem && elem.ownerDocument;
-
-       if ( !doc ) {
-               return null;
-       }
-
-       if ( elem === doc.body ) {
-               return jQuery.offset.bodyOffset( elem );
-       }
-
-       return getOffset( elem, doc, doc.documentElement );
-};
-
-jQuery.offset = {
-
-       bodyOffset: function( body ) {
-               var top = body.offsetTop,
-                       left = body.offsetLeft;
-
-               if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
-                       top  += parseFloat( jQuery.css(body, "marginTop") ) || 0;
-                       left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
-               }
-
-               return { top: top, left: left };
-       },
-
-       setOffset: function( elem, options, i ) {
-               var position = jQuery.css( elem, "position" );
-
-               // set position first, in-case top/left are set even on static elem
-               if ( position === "static" ) {
-                       elem.style.position = "relative";
-               }
-
-               var curElem = jQuery( elem ),
-                       curOffset = curElem.offset(),
-                       curCSSTop = jQuery.css( elem, "top" ),
-                       curCSSLeft = jQuery.css( elem, "left" ),
-                       calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
-                       props = {}, curPosition = {}, curTop, curLeft;
-
-               // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
-               if ( calculatePosition ) {
-                       curPosition = curElem.position();
-                       curTop = curPosition.top;
-                       curLeft = curPosition.left;
-               } else {
-                       curTop = parseFloat( curCSSTop ) || 0;
-                       curLeft = parseFloat( curCSSLeft ) || 0;
-               }
-
-               if ( jQuery.isFunction( options ) ) {
-                       options = options.call( elem, i, curOffset );
-               }
-
-               if ( options.top != null ) {
-                       props.top = ( options.top - curOffset.top ) + curTop;
-               }
-               if ( options.left != null ) {
-                       props.left = ( options.left - curOffset.left ) + curLeft;
-               }
-
-               if ( "using" in options ) {
-                       options.using.call( elem, props );
-               } else {
-                       curElem.css( props );
-               }
-       }
-};
-
-
-jQuery.fn.extend({
-
-       position: function() {
-               if ( !this[0] ) {
-                       return null;
-               }
-
-               var elem = this[0],
-
-               // Get *real* offsetParent
-               offsetParent = this.offsetParent(),
-
-               // Get correct offsets
-               offset       = this.offset(),
-               parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
-
-               // Subtract element margins
-               // note: when an element has margin: auto the offsetLeft and marginLeft
-               // are the same in Safari causing offset.left to incorrectly be 0
-               offset.top  -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
-               offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
-
-               // Add offsetParent borders
-               parentOffset.top  += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
-               parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
-
-               // Subtract the two offsets
-               return {
-                       top:  offset.top  - parentOffset.top,
-                       left: offset.left - parentOffset.left
-               };
-       },
-
-       offsetParent: function() {
-               return this.map(function() {
-                       var offsetParent = this.offsetParent || document.body;
-                       while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
-                               offsetParent = offsetParent.offsetParent;
-                       }
-                       return offsetParent;
-               });
-       }
-});
-
-
-// Create scrollLeft and scrollTop methods
-jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
-       var top = /Y/.test( prop );
-
-       jQuery.fn[ method ] = function( val ) {
-               return jQuery.access( this, function( elem, method, val ) {
-                       var win = getWindow( elem );
-
-                       if ( val === undefined ) {
-                               return win ? (prop in win) ? win[ prop ] :
-                                       jQuery.support.boxModel && win.document.documentElement[ method ] ||
-                                               win.document.body[ method ] :
-                                       elem[ method ];
-                       }
-
-                       if ( win ) {
-                               win.scrollTo(
-                                       !top ? val : jQuery( win ).scrollLeft(),
-                                        top ? val : jQuery( win ).scrollTop()
-                               );
-
-                       } else {
-                               elem[ method ] = val;
-                       }
-               }, method, val, arguments.length, null );
-       };
-});
-
-function getWindow( elem ) {
-       return jQuery.isWindow( elem ) ?
-               elem :
-               elem.nodeType === 9 ?
-                       elem.defaultView || elem.parentWindow :
-                       false;
-}
-
-
-
-
-// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
-jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
-       var clientProp = "client" + name,
-               scrollProp = "scroll" + name,
-               offsetProp = "offset" + name;
-
-       // innerHeight and innerWidth
-       jQuery.fn[ "inner" + name ] = function() {
-               var elem = this[0];
-               return elem ?
-                       elem.style ?
-                       parseFloat( jQuery.css( elem, type, "padding" ) ) :
-                       this[ type ]() :
-                       null;
-       };
-
-       // outerHeight and outerWidth
-       jQuery.fn[ "outer" + name ] = function( margin ) {
-               var elem = this[0];
-               return elem ?
-                       elem.style ?
-                       parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
-                       this[ type ]() :
-                       null;
-       };
-
-       jQuery.fn[ type ] = function( value ) {
-               return jQuery.access( this, function( elem, type, value ) {
-                       var doc, docElemProp, orig, ret;
-
-                       if ( jQuery.isWindow( elem ) ) {
-                               // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
-                               doc = elem.document;
-                               docElemProp = doc.documentElement[ clientProp ];
-                               return jQuery.support.boxModel && docElemProp ||
-                                       doc.body && doc.body[ clientProp ] || docElemProp;
-                       }
-
-                       // Get document width or height
-                       if ( elem.nodeType === 9 ) {
-                               // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
-                               doc = elem.documentElement;
-
-                               // when a window > document, IE6 reports a offset[Width/Height] > client[Width/Height]
-                               // so we can't use max, as it'll choose the incorrect offset[Width/Height]
-                               // instead we use the correct client[Width/Height]
-                               // support:IE6
-                               if ( doc[ clientProp ] >= doc[ scrollProp ] ) {
-                                       return doc[ clientProp ];
-                               }
-
-                               return Math.max(
-                                       elem.body[ scrollProp ], doc[ scrollProp ],
-                                       elem.body[ offsetProp ], doc[ offsetProp ]
-                               );
-                       }
-
-                       // Get width or height on the element
-                       if ( value === undefined ) {
-                               orig = jQuery.css( elem, type );
-                               ret = parseFloat( orig );
-                               return jQuery.isNumeric( ret ) ? ret : orig;
-                       }
-
-                       // Set the width or height on the element
-                       jQuery( elem ).css( type, value );
-               }, type, value, arguments.length, null );
-       };
-});
-
-
-
-
-// Expose jQuery to the global object
-window.jQuery = window.$ = jQuery;
-
-// Expose jQuery as an AMD module, but only for AMD loaders that
-// understand the issues with loading multiple versions of jQuery
-// in a page that all might call define(). The loader will indicate
-// they have special allowances for multiple jQuery versions by
-// specifying define.amd.jQuery = true. Register as a named module,
-// since jQuery can be concatenated with other files that may use define,
-// but not use a proper concatenation script that understands anonymous
-// AMD modules. A named AMD is safest and most robust way to register.
-// Lowercase jquery is used because AMD module names are derived from
-// file names, and jQuery is normally delivered in a lowercase file name.
-// Do this after creating the global so that if an AMD module wants to call
-// noConflict to hide this version of jQuery, it will work.
-if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
-       define( "jquery", [], function () { return jQuery; } );
-}
-
-
-
-})( window );
diff --git a/libs/js/jquery-geo-1.0b2/js/jquery.geo.core.js b/libs/js/jquery-geo-1.0b2/js/jquery.geo.core.js
deleted file mode 100755 (executable)
index 98a06fd..0000000
+++ /dev/null
@@ -1,1153 +0,0 @@
-(function ($, window, undefined) {
-  var pos_oo = Number.POSITIVE_INFINITY,
-      neg_oo = Number.NEGATIVE_INFINITY;
-
-  $.geo = {
-    //
-    // utility functions
-    //
-
-    _allCoordinates: function (geom) {
-      // return array of all positions in all geometries of geom
-      // not in JTS
-      var geometries = this._flatten(geom),
-          curGeom = 0,
-          result = [];
-
-      for (; curGeom < geometries.length; curGeom++) {
-        var coordinates = geometries[curGeom].coordinates,
-            isArray = coordinates && $.isArray(coordinates[0]),
-            isDblArray = isArray && $.isArray(coordinates[0][0]),
-            isTriArray = isDblArray && $.isArray(coordinates[0][0][0]),
-            i, j, k;
-
-        if (!isTriArray) {
-          if (!isDblArray) {
-            if (!isArray) {
-              coordinates = [coordinates];
-            }
-            coordinates = [coordinates];
-          }
-          coordinates = [coordinates];
-        }
-
-        for (i = 0; i < coordinates.length; i++) {
-          for (j = 0; j < coordinates[i].length; j++) {
-            for (k = 0; k < coordinates[i][j].length; k++) {
-              result.push(coordinates[i][j][k]);
-            }
-          }
-        }
-      }
-      return result;
-    },
-
-    _isGeodetic: function( coords ) {
-      // returns true if the first coordinate it can find is geodetic
-
-      while ( $.isArray( coords ) ) {
-        if ( coords.length > 1 && ! $.isArray( coords[ 0 ] ) ) {
-          return ( coords[ 0 ] >= -180 && coords[ 0 ] <= 180 && coords[ 1 ] >= -85 && coords[ 1 ] <= 85 );
-        } else {
-          coords = coords[ 0 ];
-        }
-      }
-
-      return false;
-    },
-
-    //
-    // bbox functions
-    //
-
-    center: function (bbox, _ignoreGeo /* Internal Use Only */) {
-      // Envelope.centre in JTS
-      // bbox only, use centroid for geom
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      var center = [(bbox[0] + bbox[2]) / 2, (bbox[1] + bbox[3]) / 2];
-      return wasGeodetic ? $.geo.proj.toGeodetic(center) : center;
-    },
-
-    expandBy: function (bbox, dx, dy, _ignoreGeo /* Internal Use Only */) {
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      bbox = [bbox[0] - dx, bbox[1] - dy, bbox[2] + dx, bbox[3] + dy];
-      return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    height: function (bbox, _ignoreGeo /* Internal Use Only */ ) {
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      return bbox[3] - bbox[1];
-    },
-
-    _in: function(bbox1, bbox2) {
-      return bbox1[0] <= bbox2[0] &&
-             bbox1[1] <= bbox2[1] &&
-             bbox1[2] >= bbox2[2] &&
-             bbox1[3] >= bbox2[3];
-    },
-
-    _bboxDisjoint: function( bbox1, bbox2 ) {
-      return bbox2[ 0 ] > bbox1[ 2 ] || 
-             bbox2[ 2 ] < bbox1[ 0 ] || 
-             bbox2[ 1 ] > bbox1[ 3 ] ||
-             bbox2[ 3 ] < bbox1[ 1 ];
-    },
-
-    include: function( bbox, value, _ignoreGeo /* Internal Use Only */ ) {
-      // similar to Envelope.expandToInclude in JTS
-      if ( !value || !$.isArray( value ) ) {
-        return bbox;
-      }
-
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox || value ) ) {
-        wasGeodetic = true;
-      }
-
-      if ( !bbox ) {
-        bbox = [ pos_oo, pos_oo, neg_oo, neg_oo ];
-      } else if ( wasGeodetic ) {
-        bbox = $.geo.proj.fromGeodetic( bbox );
-      }
-
-      if ( value.length === 2 ) {
-        value = [ value[ 0 ], value[ 1 ], value[ 0 ], value[ 1 ] ];
-      }
-
-      value = $.geo.proj.fromGeodetic( value );
-
-      bbox[0] = Math.min( value[ 0 ], bbox[ 0 ] );
-      bbox[1] = Math.min( value[ 1 ], bbox[ 1 ] );
-      bbox[2] = Math.max( value[ 2 ], bbox[ 2 ] );
-      bbox[3] = Math.max( value[ 3 ], bbox[ 3 ] );
-
-      return wasGeodetic ? $.geo.proj.toGeodetic( bbox ) : bbox;
-    },
-
-    polygonize: function( bbox, _ignoreGeo /* Internal Use Only */ ) {
-      // adaptation of Polygonizer class in JTS for use with bboxes
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      var polygon = {
-        type: "Polygon",
-        coordinates: [ [
-          [ bbox[ 0 ], bbox[ 1 ] ],
-          [ bbox[ 0 ], bbox[ 3 ] ],
-          [ bbox[ 2 ], bbox[ 3 ] ],
-          [ bbox[ 2 ], bbox[ 1 ] ],
-          [ bbox[ 0 ], bbox[ 1 ] ]
-        ] ]
-      };
-
-      if ( wasGeodetic ) {
-        polygon.coordinates = $.geo.proj.toGeodetic( polygon.coordinates );
-      }
-
-      return polygon;
-    },
-
-    reaspect: function (bbox, ratio, _ignoreGeo /* Internal Use Only */ ) {
-      // not in JTS
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      var width = this.width(bbox, true),
-          height = this.height(bbox, true),
-          center = this.center(bbox, true),
-          dx, dy;
-
-      if (width !== 0 && height !== 0 && ratio > 0) {
-        if (width / height > ratio) {
-          dx = width / 2;
-          dy = dx / ratio;
-        } else {
-          dy = height / 2;
-          dx = dy * ratio;
-        }
-
-        bbox = [center[0] - dx, center[1] - dy, center[0] + dx, center[1] + dy];
-      }
-
-      return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    recenter: function( bbox, center, _ignoreGeo /* Internal Use Only */ ) {
-      // not in JTS
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj ) {
-        if ( this._isGeodetic( bbox ) ) {
-          wasGeodetic = true;
-          bbox = $.geo.proj.fromGeodetic(bbox);
-        }
-
-        if ( this._isGeodetic( center ) ) {
-          center = $.geo.proj.fromGeodetic(center);
-        }
-      }
-
-      var halfWidth = ( bbox[ 2 ] - bbox[ 0 ] ) / 2,
-          halfHeight = ( bbox[ 3 ] - bbox[ 1 ] ) / 2;
-
-      bbox = [
-        center[ 0 ] - halfWidth,
-        center[ 1 ] - halfHeight,
-        center[ 0 ] + halfWidth,
-        center[ 1 ] + halfHeight
-      ];
-
-      return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    scaleBy: function ( bbox, scale, _ignoreGeo /* Internal Use Only */ ) {
-      // not in JTS
-      var wasGeodetic = false;
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        wasGeodetic = true;
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      var c = this.center(bbox, true),
-          dx = (bbox[2] - bbox[0]) * scale / 2,
-          dy = (bbox[3] - bbox[1]) * scale / 2;
-
-      bbox = [c[0] - dx, c[1] - dy, c[0] + dx, c[1] + dy];
-
-      return wasGeodetic ? $.geo.proj.toGeodetic(bbox) : bbox;
-    },
-
-    width: function (bbox, _ignoreGeo /* Internal Use Only */ ) {
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( bbox ) ) {
-        bbox = $.geo.proj.fromGeodetic(bbox);
-      }
-
-      return bbox[2] - bbox[0];
-    },
-
-    //
-    // geometry functions
-    //
-
-    // bbox (Geometry.getEnvelope in JTS)
-
-    bbox: function ( geom, _ignoreGeo /* Internal Use Only */ ) {
-      var result, wasGeodetic = false;
-      if ( !geom ) {
-        return undefined;
-      } else if ( geom.bbox ) {
-        result = ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom.bbox ) ) ? $.geo.proj.fromGeodetic( geom.bbox ) : geom.bbox;
-      } else {
-        result = [ pos_oo, pos_oo, neg_oo, neg_oo ];
-
-        var coordinates = this._allCoordinates( geom ),
-            curCoord = 0;
-
-        if ( coordinates.length === 0 ) {
-          return undefined;
-        }
-
-        if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( coordinates ) ) {
-          wasGeodetic = true;
-          coordinates = $.geo.proj.fromGeodetic( coordinates );
-        }
-
-        for ( ; curCoord < coordinates.length; curCoord++ ) {
-          result[0] = Math.min(coordinates[curCoord][0], result[0]);
-          result[1] = Math.min(coordinates[curCoord][1], result[1]);
-          result[2] = Math.max(coordinates[curCoord][0], result[2]);
-          result[3] = Math.max(coordinates[curCoord][1], result[3]);
-        }
-      }
-
-      return wasGeodetic ? $.geo.proj.toGeodetic(result) : result;
-    },
-
-    // centroid
-    
-    centroid: function( geom, _ignoreGeo /* Internal Use Only */ ) {
-      switch (geom.type) {
-        case "Point":
-          return $.extend({}, geom);
-
-        case "LineString":
-        case "Polygon":
-          var a = 0,
-              c = [0, 0],
-              coords = $.merge( [ ], geom.type == "Polygon" ? geom.coordinates[0] : geom.coordinates ),
-              i = 1, j, n,
-              bbox = [ pos_oo, pos_oo, neg_oo, neg_oo ];
-
-          var wasGeodetic = false;
-          if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( coords ) ) {
-            wasGeodetic = true;
-            coords = $.geo.proj.fromGeodetic(coords);
-          }
-
-          //if (coords[0][0] != coords[coords.length - 1][0] || coords[0][1] != coords[coords.length - 1][1]) {
-          //  coords.push(coords[0]);
-          //}
-
-          for (; i <= coords.length; i++) {
-            j = i % coords.length;
-
-            bbox[0] = Math.min(coords[j][0], bbox[0]);
-            bbox[1] = Math.min(coords[j][1], bbox[1]);
-            bbox[2] = Math.max(coords[j][0], bbox[2]);
-            bbox[3] = Math.max(coords[j][1], bbox[3]);
-
-            n = (coords[i - 1][0] * coords[j][1]) - (coords[j][0] * coords[i - 1][1]);
-            a += n;
-            c[0] += (coords[i - 1][0] + coords[j][0]) * n;
-            c[1] += (coords[i - 1][1] + coords[j][1]) * n;
-          }
-
-          if (a === 0) {
-            if (coords.length > 0) {
-              c[0] = Math.min( Math.max( coords[0][0], bbox[ 0 ] ), bbox[ 2 ] );
-              c[1] = Math.min( Math.max( coords[0][1], bbox[ 1 ] ), bbox[ 3 ] );
-              return { type: "Point", coordinates: wasGeodetic ? $.geo.proj.toGeodetic(c) : c };
-            } else {
-              return undefined;
-            }
-          }
-
-          a *= 3;
-          //c[0] /= a;
-          //c[1] /= a;
-
-          c[0] = Math.min( Math.max( c[0] / a, bbox[ 0 ] ), bbox[ 2 ] );
-          c[1] = Math.min( Math.max( c[1] / a, bbox[ 1 ] ), bbox[ 3 ] );
-
-          return { type: "Point", coordinates: wasGeodetic ? $.geo.proj.toGeodetic(c) : c };
-      }
-      return undefined;
-    },
-
-    // contains
-
-    contains: function (geom1, geom2) {
-      if (geom1.type != "Polygon") {
-        return false;
-      }
-
-      switch (geom2.type) {
-        case "Point":
-          return this._containsPolygonPoint(geom1.coordinates, geom2.coordinates);
-
-        case "LineString":
-          return this._containsPolygonLineString(geom1.coordinates, geom2.coordinates);
-
-        case "Polygon":
-          return this._containsPolygonLineString(geom1.coordinates, geom2.coordinates[0]);
-
-        default:
-          return false;
-      }
-    },
-
-    _containsPolygonPoint: function (polygonCoordinates, pointCoordinate) {
-      if (polygonCoordinates.length === 0 || polygonCoordinates[0].length < 4) {
-        return false;
-      }
-
-      var rayCross = 0,
-          a = polygonCoordinates[0][0],
-          i = 1,
-          b,
-          x;
-
-      for (; i < polygonCoordinates[0].length; i++) {
-        b = polygonCoordinates[0][i];
-
-        if ((a[1] <= pointCoordinate[1] && pointCoordinate[1] < b[1]) || (b[1] <= pointCoordinate[1] && pointCoordinate[1] < a[1]) && (pointCoordinate[0] < a[0] || pointCoordinate[0] < b[0])) {
-          x = a[0] + (b[0] - a[0]) * (pointCoordinate[1] - a[1]) / (b[1] - a[1]);
-
-          if (x > pointCoordinate[0]) {
-            rayCross++;
-          }
-        }
-
-        a = b;
-      }
-
-      return rayCross % 2 == 1;
-    },
-
-    _containsPolygonLineString: function (polygonCoordinates, lineStringCoordinates) {
-      for (var i = 0; i < lineStringCoordinates.length; i++) {
-        if (!this._containsPolygonPoint(polygonCoordinates, lineStringCoordinates[i])) {
-          return false;
-        }
-      }
-      return true;
-    },
-
-    // distance
-
-    distance: function ( geom1, geom2, _ignoreGeo /* Internal Use Only */ ) {
-      var geom1CoordinatesProjected = ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom1.coordinates ) ) ? $.geo.proj.fromGeodetic(geom1.coordinates) : geom1.coordinates,
-          geom2CoordinatesProjected = ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom2.coordinates ) ) ? $.geo.proj.fromGeodetic(geom2.coordinates) : geom2.coordinates;
-
-      switch (geom1.type) {
-        case "Point":
-          switch (geom2.type) {
-            case "Point":
-              return this._distancePointPoint(geom2CoordinatesProjected, geom1CoordinatesProjected);
-            case "LineString":
-              return this._distanceLineStringPoint(geom2CoordinatesProjected, geom1CoordinatesProjected);
-            case "Polygon":
-              return this._containsPolygonPoint(geom2CoordinatesProjected, geom1CoordinatesProjected) ? 0 : this._distanceLineStringPoint(geom2CoordinatesProjected[0], geom1CoordinatesProjected);
-            default:
-              return undefined;
-          }
-          break;
-
-        case "LineString":
-          switch (geom2.type) {
-            case "Point":
-              return this._distanceLineStringPoint(geom1CoordinatesProjected, geom2CoordinatesProjected);
-            case "LineString":
-              return this._distanceLineStringLineString(geom1CoordinatesProjected, geom2CoordinatesProjected);
-            case "Polygon":
-              return this._containsPolygonLineString(geom2CoordinatesProjected, geom1CoordinatesProjected) ? 0 : this._distanceLineStringLineString(geom2CoordinatesProjected[0], geom1CoordinatesProjected);
-            default:
-              return undefined;
-          }
-          break;
-
-        case "Polygon":
-          switch (geom2.type) {
-            case "Point":
-              return this._containsPolygonPoint(geom1CoordinatesProjected, geom2CoordinatesProjected) ? 0 : this._distanceLineStringPoint(geom1CoordinatesProjected[0], geom2CoordinatesProjected);
-            case "LineString":
-              return this._containsPolygonLineString(geom1CoordinatesProjected, geom2CoordinatesProjected) ? 0 : this._distanceLineStringLineString(geom1CoordinatesProjected[0], geom2CoordinatesProjected);
-            case "Polygon":
-              return this._containsPolygonLineString(geom1CoordinatesProjected, geom2CoordinatesProjected[0]) ? 0 : this._distanceLineStringLineString(geom1CoordinatesProjected[0], geom2CoordinatesProjected[0]);
-            default:
-              return undefined;
-          }
-          break;
-      }
-    },
-
-    _distancePointPoint: function (coordinate1, coordinate2) {
-      var dx = coordinate2[0] - coordinate1[0],
-          dy = coordinate2[1] - coordinate1[1];
-      return Math.sqrt((dx * dx) + (dy * dy));
-    },
-
-    _distanceLineStringPoint: function (lineStringCoordinates, pointCoordinate) {
-      var minDist = pos_oo;
-
-      if (lineStringCoordinates.length > 0) {
-        var a = lineStringCoordinates[0],
-
-            apx = pointCoordinate[0] - a[0],
-            apy = pointCoordinate[1] - a[1];
-
-        if (lineStringCoordinates.length == 1) {
-          return Math.sqrt(apx * apx + apy * apy);
-        } else {
-          for (var i = 1; i < lineStringCoordinates.length; i++) {
-            var b = lineStringCoordinates[i],
-
-                abx = b[0] - a[0],
-                aby = b[1] - a[1],
-                bpx = pointCoordinate[0] - b[0],
-                bpy = pointCoordinate[1] - b[1],
-
-                d = this._distanceSegmentPoint(abx, aby, apx, apy, bpx, bpy);
-
-            if (d === 0) {
-              return 0;
-            }
-
-            if (d < minDist) {
-              minDist = d;
-            }
-
-            a = b;
-            apx = bpx;
-            apy = bpy;
-          }
-        }
-      }
-
-      return Math.sqrt(minDist);
-    },
-
-    _distanceSegmentPoint: function (abx, aby, apx, apy, bpx, bpy) {
-      var dot1 = abx * apx + aby * apy;
-
-      if (dot1 <= 0) {
-        return apx * apx + apy * apy;
-      }
-
-      var dot2 = abx * abx + aby * aby;
-
-      if (dot1 >= dot2) {
-        return bpx * bpx + bpy * bpy;
-      }
-
-      return apx * apx + apy * apy - dot1 * dot1 / dot2;
-    },
-
-    _distanceLineStringLineString: function (lineStringCoordinates1, lineStringCoordinates2) {
-      var minDist = pos_oo;
-      for (var i = 0; i < lineStringCoordinates2.length; i++) {
-        minDist = Math.min(minDist, this._distanceLineStringPoint(lineStringCoordinates1, lineStringCoordinates2[i]));
-      }
-      return minDist;
-    },
-
-    // buffer
-
-    _buffer: function( geom, distance, _ignoreGeo /* Internal Use Only */ ) {
-      var wasGeodetic = false,
-          coords = geom.coordinates;
-
-      if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( geom.coordinates ) ) {
-        wasGeodetic = true;
-        coords = $.geo.proj.fromGeodetic( geom.coordinates );
-      }
-
-      if ( geom.type === "Point" ) {
-        var resultCoords = [],
-            slices = 180,
-            i = 0,
-            a;
-
-        for ( ; i <= slices; i++ ) {
-          a = ( i * 360 / slices ) * ( Math.PI / 180 );
-          resultCoords.push( [
-            coords[ 0 ] + Math.cos( a ) * distance,
-            coords[ 1 ] + Math.sin( a ) * distance
-          ] );
-        }
-
-        return {
-          type: "Polygon",
-          coordinates: [ ( wasGeodetic ? $.geo.proj.toGeodetic( resultCoords ) : resultCoords ) ]
-        };
-      } else {
-        return undefined;
-      }
-    },
-
-    
-    //
-    // feature
-    //
-
-    _flatten: function (geom) {
-      // return an array of all basic geometries
-      // not in JTS
-      var geometries = [],
-          curGeom = 0;
-      switch (geom.type) {
-        case "Feature":
-          $.merge(geometries, this._flatten(geom.geometry));
-          break;
-
-        case "FeatureCollection":
-          for (; curGeom < geom.features.length; curGeom++) {
-            $.merge(geometries, this._flatten(geom.features[curGeom].geometry));
-          }
-          break;
-
-        case "GeometryCollection":
-          for (; curGeom < geom.geometries.length; curGeom++) {
-            $.merge(geometries, this._flatten(geom.geometries[curGeom]));
-          }
-          break;
-
-        default:
-          geometries[0] = geom;
-          break;
-      }
-      return geometries;
-    },
-
-    length: function( geom, _ignoreGeo /* Internal Use Only */ ) {
-      var sum = 0,
-          lineStringCoordinates,
-          i = 1, dx, dy;
-
-      switch ( geom.type ) {
-        case "Point":
-          return 0;
-
-        case "LineString":
-          lineStringCoordinates = geom.coordinates;
-          break;
-
-        case "Polygon":
-          lineStringCoordinates = geom.coordinates[ 0 ];
-          break;
-      }
-
-      if ( lineStringCoordinates ) {
-        if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( lineStringCoordinates ) ) {
-          lineStringCoordinates = $.geo.proj.fromGeodetic( lineStringCoordinates );
-        }
-
-        for ( ; i < lineStringCoordinates.length; i++ ) {
-          dx = lineStringCoordinates[ i ][0] - lineStringCoordinates[ i - 1 ][0];
-          dy = lineStringCoordinates[ i ][1] - lineStringCoordinates[ i - 1 ][1];
-          sum += Math.sqrt((dx * dx) + (dy * dy));
-        }
-
-        return sum;
-      }
-
-      // return undefined;
-    },
-
-    area: function( geom, _ignoreGeo /* Internal Use Only */ ) {
-      var sum = 0,
-          polygonCoordinates,
-          i = 1, j;
-
-      switch ( geom.type ) {
-        case "Point":
-        case "LineString":
-          return 0;
-
-        case "Polygon":
-          polygonCoordinates = geom.coordinates[ 0 ];
-          break;
-      }
-
-      if ( polygonCoordinates ) {
-        if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( polygonCoordinates ) ) {
-          polygonCoordinates = $.geo.proj.fromGeodetic( polygonCoordinates );
-        }
-
-        for ( ; i <= polygonCoordinates.length; i++) {
-          j = i %  polygonCoordinates.length;
-          sum += ( polygonCoordinates[ i - 1 ][ 0 ] - polygonCoordinates[ j ][ 0 ] ) * ( polygonCoordinates[ i - 1 ][ 1 ] + polygonCoordinates[ j ][ 1 ] ) / 2;
-        }
-
-        return Math.abs( sum );
-      }
-    },
-
-    pointAlong: function( geom, percentage, _ignoreGeo /* Internal Use Only */ ) {
-      var totalLength = 0,
-          previousPercentageSum = 0,
-          percentageSum = 0,
-          remainderPercentageSum,
-          len,
-          lineStringCoordinates,
-          segmentLengths = [],
-          i = 1, dx, dy,
-          c, c0, c1,
-          wasGeodetic = false;
-
-      switch ( geom.type ) {
-        case "Point":
-          return $.extend( { }, geom );
-
-        case "LineString":
-          lineStringCoordinates = geom.coordinates;
-          break;
-
-        case "Polygon":
-          lineStringCoordinates = geom.coordinates[ 0 ];
-          break;
-      }
-
-      if ( lineStringCoordinates ) {
-        if ( percentage === 0 ) {
-          return {
-            type: "Point",
-            coordinates: [ lineStringCoordinates[ 0 ][ 0 ], lineStringCoordinates[ 0 ][ 1 ] ]
-          };
-        } else if ( percentage === 1 ) {
-          i = lineStringCoordinates.length - 1;
-          return {
-            type: "Point",
-            coordinates: [ lineStringCoordinates[ i ][ 0 ], lineStringCoordinates[ i ][ 1 ] ]
-          };
-        } else {
-          if ( !_ignoreGeo && $.geo.proj && this._isGeodetic( lineStringCoordinates ) ) {
-            wasGeodetic = true;
-            lineStringCoordinates = $.geo.proj.fromGeodetic( lineStringCoordinates );
-          }
-
-          for ( ; i < lineStringCoordinates.length; i++ ) {
-            dx = lineStringCoordinates[ i ][ 0 ] - lineStringCoordinates[ i - 1 ][ 0 ];
-            dy = lineStringCoordinates[ i ][ 1 ] - lineStringCoordinates[ i - 1 ][ 1 ];
-            len = Math.sqrt((dx * dx) + (dy * dy));
-            segmentLengths.push( len );
-            totalLength += len;
-          }
-
-          for ( i = 0; i < segmentLengths.length && percentageSum < percentage; i++ ) {
-            previousPercentageSum = percentageSum;
-            percentageSum += ( segmentLengths[ i ] / totalLength );
-          }
-
-          remainderPercentageSum = percentage - previousPercentageSum;
-
-          c0 = lineStringCoordinates[ i - 1 ];
-          c1 = lineStringCoordinates[ i ];
-
-          c = [
-            c0[ 0 ] + ( remainderPercentageSum * ( c1[ 0 ] - c0[ 0 ] ) ),
-            c0[ 1 ] + ( remainderPercentageSum * ( c1[ 1 ] - c0[ 1 ] ) )
-          ];
-
-          return {
-            type: "Point",
-            coordinates: wasGeodetic ? $.geo.proj.toGeodetic(c) : c
-          };
-        }
-      }
-    },
-
-    //
-    // WKT functions
-    //
-
-    _WKT: (function () {
-      function pointToString(value) {
-        return "POINT " + pointToUntaggedString(value.coordinates);
-      }
-
-      function pointToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMPTY";
-        } else {
-          return "(" + coordinates.join(" ") + ")";
-        }
-      }
-
-      function lineStringToString(value) {
-        return "LINESTRING " + lineStringToUntaggedString(value.coordinates);
-      }
-
-      function lineStringToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMPTY";
-        } else {
-          var points = [];
-
-          for (var i = 0; i < coordinates.length; i++) {
-            points.push(coordinates[i].join(" "));
-          }
-
-          return "(" + points + ")";
-        }
-      }
-
-      function polygonToString(value) {
-        return "POLYGON " + polygonToUntaggedString(value.coordinates);
-      }
-
-      function polygonToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMTPY";
-        } else {
-          var lineStrings = [];
-
-          for (var i = 0; i < coordinates.length; i++) {
-            lineStrings.push(lineStringToUntaggedString(coordinates[i]));
-          }
-
-          return "(" + lineStrings + ")";
-        }
-      }
-
-      function multiPointToString(value) {
-        return "MULTIPOINT " + lineStringToUntaggedString(value.coordinates);
-      }
-
-      function multiLineStringToString(value) {
-        return "MULTILINSTRING " + polygonToUntaggedString(value.coordinates);
-      }
-
-      function multiPolygonToString(value) {
-        return "MULTIPOLYGON " + multiPolygonToUntaggedString(value.coordinates);
-      }
-
-      function multiPolygonToUntaggedString(coordinates) {
-        if (!(coordinates && coordinates.length)) {
-          return "EMPTY";
-        } else {
-          var polygons = [];
-          for (var i = 0; i < coordinates.length; i++) {
-            polygons.push(polygonToUntaggedString(coordinates[i]));
-          }
-          return "(" + polygons + ")";
-        }
-      }
-
-      function geometryCollectionToString(value) {
-        return "GEOMETRYCOLLECTION " + geometryCollectionToUntaggedString(value.geometries);
-      }
-
-      function geometryCollectionToUntaggedString(geometries) {
-        if (!(geometries && geometries.length)) {
-          return "EMPTY";
-        } else {
-          var geometryText = [];
-          for (var i = 0; i < geometries.length; i++) {
-            geometryText.push(stringify(geometries[i]));
-          }
-          return "(" + geometries + ")";
-        }
-      }
-
-      function stringify(value) {
-        if (!(value && value.type)) {
-          return "";
-        } else {
-          switch (value.type) {
-            case "Point":
-              return pointToString(value);
-
-            case "LineString":
-              return lineStringToString(value);
-
-            case "Polygon":
-              return polygonToString(value);
-
-            case "MultiPoint":
-              return multiPointToString(value);
-
-            case "MultiLineString":
-              return multiLineStringToString(value);
-
-            case "MultiPolygon":
-              return multiPolygonToString(value);
-
-            case "GeometryCollection":
-              return geometryCollectionToString(value);
-
-            default:
-              return "";
-          }
-        }
-      }
-
-      function pointParseUntagged(wkt) {
-        var pointString = wkt.match( /\(\s*([\d\.\-]+)\s+([\d\.\-]+)\s*\)/ );
-        return pointString && pointString.length > 2 ? {
-          type: "Point",
-          coordinates: [
-            parseFloat(pointString[1]),
-            parseFloat(pointString[2])
-          ]
-        } : null;
-      }
-
-      function lineStringParseUntagged(wkt) {
-        var lineString = wkt.match( /\s*\((.*)\)/ ),
-            coords = [],
-            pointStrings,
-            pointParts,
-            i = 0;
-
-        if ( lineString && lineString.length > 1 ) {
-          pointStrings = lineString[ 1 ].match( /[\d\.\-]+\s+[\d\.\-]+/g );
-
-          for ( ; i < pointStrings.length; i++ ) {
-            pointParts = pointStrings[ i ].match( /\s*([\d\.\-]+)\s+([\d\.\-]+)\s*/ );
-            coords[ i ] = [ parseFloat( pointParts[ 1 ] ), parseFloat( pointParts[ 2 ] ) ];
-          }
-
-          return {
-            type: "LineString",
-            coordinates: coords
-          };
-        } else {
-          return null;
-        }
-      }
-
-      function polygonParseUntagged(wkt) {
-        var polygon = wkt.match( /\s*\(\s*\((.*)\)\s*\)/ ),
-            coords = [],
-            pointStrings,
-            pointParts,
-            i = 0;
-
-        if ( polygon && polygon.length > 1 ) {
-          pointStrings = polygon[ 1 ].match( /[\d\.\-]+\s+[\d\.\-]+/g );
-
-          for ( ; i < pointStrings.length; i++ ) {
-            pointParts = pointStrings[ i ].match( /\s*([\d\.\-]+)\s+([\d\.\-]+)\s*/ );
-            coords[ i ] = [ parseFloat( pointParts[ 1 ] ), parseFloat( pointParts[ 2 ] ) ];
-          }
-
-          return {
-            type: "Polygon",
-            coordinates: [ coords ]
-          };
-        } else {
-          return null;
-        }
-      }
-
-      function multiPointParseUntagged(wkt) {
-        var multiSomething;
-
-        if ( wkt.indexOf( "((" ) === -1 ) {
-          multiSomething = lineStringParseUntagged( wkt );
-        } else {
-          multiSomething = multiLineStringParseUntagged( wkt );
-          multiSomething.coordinates = $.geo._allCoordinates( multiSomething );
-        }
-
-        multiSomething.type = "MultiPoint";
-
-        return multiSomething;
-      }
-
-      function multiLineStringParseUntagged(wkt) {
-        var lineStringsWkt = wkt.substr( 1, wkt.length - 2 ),
-            lineStrings = lineStringsWkt.split( ")),((" ),
-            i = 0,
-            multiLineString = {
-              type: "MultiLineString",
-              coordinates: [ ]
-            };
-
-        for ( ; i < lineStrings.length; i++ ) {
-          multiLineString.coordinates.push( lineStringParseUntagged( lineStrings[ i ] ).coordinates );
-        }
-
-        return multiLineString;
-      }
-
-      function multiPolygonParseUntagged(wkt) {
-        var polygonsWkt = wkt.substr( 1, wkt.length - 2 ),
-            polygons = polygonsWkt.split( ")),((" ),
-            i = 0,
-            multiPolygon = {
-              type: "MultiPolygon",
-              coordinates: [ ]
-            };
-
-        for ( ; i < polygons.length; i++ ) {
-          multiPolygon.coordinates.push( polygonParseUntagged( polygons[ i ] ).coordinates );
-        }
-
-        return multiPolygon;
-      }
-
-      function geometryCollectionParseUntagged( wkt ) {
-        var geometriesWkt = wkt.substr( 1, wkt.length - 2 ),
-            geometries = geometriesWkt.match( /\),[a-zA-Z]/g ),
-            geometryCollection = {
-              type: "GeometryCollection",
-              geometries: [ ]
-            },
-            curGeom,
-            i = 0, curStart = 0, curLen;
-
-        if ( geometries && geometries.length > 0 ) {
-          for ( ; i < geometries.length; i++ ) {
-            curLen = geometriesWkt.indexOf( geometries[ i ], curStart ) - curStart + 1;
-            curGeom = parse( geometriesWkt.substr( curStart, curLen ) );
-            if ( curGeom ) {
-              geometryCollection.geometries.push( curGeom );
-            }
-            curStart += curLen + 1;
-          }
-
-          // one more
-          curGeom = parse( geometriesWkt.substr( curStart ) );
-          if ( curGeom ) {
-            geometryCollection.geometries.push( curGeom );
-          }
-
-          return geometryCollection;
-        } else {
-          return null;
-        }
-      }
-
-      function parse(wkt) {
-        wkt = $.trim(wkt);
-
-        var typeIndex = wkt.indexOf( "(" ),
-            untagged = wkt.substr( typeIndex  );
-
-        switch ($.trim(wkt.substr(0, typeIndex)).toUpperCase()) {
-          case "POINT":
-            return pointParseUntagged( untagged );
-
-          case "LINESTRING":
-            return lineStringParseUntagged( untagged );
-
-          case "POLYGON":
-            return polygonParseUntagged( untagged );
-
-          case "MULTIPOINT":
-            return multiPointParseUntagged( untagged );
-
-          case "MULTILINESTRING":
-            return multiLineStringParseUntagged( untagged );
-
-          case "MULTIPOLYGON":
-            return multiPolygonParseUntagged( untagged );
-
-          case "GEOMETRYCOLLECTION":
-            return geometryCollectionParseUntagged( untagged );
-
-          default:
-            return null;
-        }
-      }
-
-      return {
-        stringify: stringify,
-
-        parse: parse
-      };
-    }()),
-
-    //
-    // projection functions
-    //
-
-    proj: (function () {
-      var halfPi = 1.5707963267948966192,
-          quarterPi = 0.7853981633974483096,
-          radiansPerDegree = 0.0174532925199432958,
-          degreesPerRadian = 57.295779513082320877,
-          semiMajorAxis = 6378137;
-
-      return {
-        fromGeodeticPos: function (coordinate) {
-          return [
-            semiMajorAxis * coordinate[ 0 ] * radiansPerDegree,
-            semiMajorAxis * Math.log(Math.tan(quarterPi + coordinate[ 1 ] * radiansPerDegree / 2))
-          ];
-        },
-
-        fromGeodetic: function ( coordinates ) {
-          if ( ! $.geo._isGeodetic( coordinates ) ) {
-            return coordinates;
-          }
-
-          var isMultiPointOrLineString = $.isArray(coordinates[ 0 ]),
-              fromGeodeticPos = this.fromGeodeticPos;
-
-          if (!isMultiPointOrLineString && coordinates.length == 4) {
-            // bbox
-            var min = fromGeodeticPos([ coordinates[ 0 ], coordinates[ 1 ] ]),
-                max = fromGeodeticPos([ coordinates[ 2 ], coordinates[ 3 ] ]);
-            return [ min[ 0 ], min[ 1 ], max[ 0 ], max[ 1 ] ];
-          } else {
-            // geometry
-            var isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray(coordinates[ 0 ][ 0 ]),
-                isMultiPolygon = isMultiLineStringOrPolygon && $.isArray(coordinates[ 0 ][ 0 ][ 0 ]),
-                result = [ ],
-                i, j, k;
-
-            if (!isMultiPolygon) {
-              if (!isMultiLineStringOrPolygon) {
-                if (!isMultiPointOrLineString) {
-                  coordinates = [ coordinates ];
-                }
-                coordinates = [ coordinates ];
-              }
-              coordinates = [ coordinates ];
-            }
-
-            for ( i = 0; i < coordinates.length; i++ ) {
-              result[ i ] = [ ];
-              for ( j = 0; j < coordinates[ i ].length; j++ ) {
-                result[ i ][ j ] = [ ];
-                for ( k = 0; k < coordinates[ i ][ j ].length; k++ ) {
-                  result[ i ][ j ][ k ] = fromGeodeticPos(coordinates[ i ][ j ][ k ]);
-                }
-              }
-            }
-
-            return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-          }
-        },
-
-        toGeodeticPos: function (coordinate) {
-          return [
-            (coordinate[ 0 ] / semiMajorAxis) * degreesPerRadian,
-            (halfPi - 2 * Math.atan(1 / Math.exp(coordinate[ 1 ] / semiMajorAxis))) * degreesPerRadian
-          ];
-        },
-
-        toGeodetic: function (coordinates) {
-          if ( $.geo._isGeodetic( coordinates ) ) {
-            return coordinates;
-          }
-
-          var isMultiPointOrLineString = $.isArray(coordinates[ 0 ]),
-              toGeodeticPos = this.toGeodeticPos;
-
-          if (!isMultiPointOrLineString && coordinates.length == 4) {
-            // bbox
-            var min = toGeodeticPos([ coordinates[ 0 ], coordinates[ 1 ] ]),
-                max = toGeodeticPos([ coordinates[ 2 ], coordinates[ 3 ] ]);
-            return [ min[ 0 ], min[ 1 ], max[ 0 ], max[ 1 ] ];
-          } else {
-            // geometry
-            var isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray(coordinates[ 0 ][ 0 ]),
-                isMultiPolygon = isMultiLineStringOrPolygon && $.isArray(coordinates[ 0 ][ 0 ][ 0 ]),
-                result = [ ],
-                i, j, k;
-
-            if (!isMultiPolygon) {
-              if (!isMultiLineStringOrPolygon) {
-                if (!isMultiPointOrLineString) {
-                  coordinates = [ coordinates ];
-                }
-                coordinates = [ coordinates ];
-              }
-              coordinates = [ coordinates ];
-            }
-
-            for ( i = 0; i < coordinates.length; i++ ) {
-              result[ i ] = [ ];
-              for ( j = 0; j < coordinates[ i ].length; j++ ) {
-                result[ i ][ j ] = [ ];
-                for ( k = 0; k < coordinates[ i ][ j ].length; k++ ) {
-                  result[ i ][ j ][ k ] = toGeodeticPos(coordinates[ i ][ j ][ k ]);
-                }
-              }
-            }
-
-            return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-          }
-        }
-      };
-    }()),
-
-    //
-    // service types (defined in other files)
-    //
-
-    _serviceTypes: {}
-  };
-}(jQuery, this));
diff --git a/libs/js/jquery-geo-1.0b2/js/jquery.geo.geographics.js b/libs/js/jquery-geo-1.0b2/js/jquery.geo.geographics.js
deleted file mode 100755 (executable)
index f3ce524..0000000
+++ /dev/null
@@ -1,571 +0,0 @@
-(function ($, undefined) {
-  var _ieVersion = ( function () {
-    var v = 5, div = document.createElement("div"), a = div.all || [];
-    do {
-      div.innerHTML = "<!--[if gt IE " + (++v) + "]><br><![endif]-->";
-    } while ( a[0] );
-    return v > 6 ? v : !v;
-  }() );
-
-  $.widget("geo.geographics", {
-    _$elem: undefined,
-    _options: {},
-    _trueCanvas: true,
-    _trueDoubleBuffer: true,
-
-    _width: 0,
-    _height: 0,
-
-    _$canvas: undefined,
-    _context: undefined,
-
-    _$canvasSceneFront: undefined, //< if _trueCanvas, where canvas images get written (front buffer)
-    _$canvasSceneBack: undefined, //< if _trueCanvas, where canvas images get written (back buffer)
-    _timeoutEnd:  null,
-    _requireFlip: false,
-
-    _blitcanvas: undefined,
-    _blitcontext: undefined,
-
-    _$labelsContainerFront: undefined,
-    _$labelsContainerBack: undefined,
-    _labelsHtml: "",
-
-    options: {
-      style: {
-        borderRadius: "8px",
-        color: "#7f0000",
-        //fill: undefined,
-        fillOpacity: 0.2,
-        height: "8px",
-        opacity: 1,
-        //stroke: undefined,
-        strokeOpacity: 1,
-        strokeWidth: "2px",
-        visibility: "visible",
-        width: "8px"
-      },
-
-      doubleBuffer: true
-    },
-
-    _create: function () {
-      this._$elem = this.element;
-      this._options = this.options;
-
-      this._$elem.css( {
-        webkitTransform: "translateZ(0)",
-        display: "inline-block",
-        overflow: "hidden",
-        textAlign: "left"
-      } );
-
-      if (this._$elem.css("position") == "static") {
-        this._$elem.css("position", "relative");
-      }
-
-      this._$elem.addClass( "geo-graphics" );
-
-      this._width = this._$elem.width();
-      this._height = this._$elem.height();
-
-      if (!(this._width && this._height)) {
-        this._width = parseInt(this._$elem.css("width"), 10);
-        this._height = parseInt(this._$elem.css("height"), 10);
-      }
-
-      var posCss = 'position:absolute;left:0;top:0;margin:0;padding:0;',
-          sizeCss = 'width:' + this._width + 'px;height:' + this._height + 'px;',
-          sizeAttr = 'width="' + this._width + '" height="' + this._height + '"';
-
-      this._blitcanvas = document.createElement( "canvas" );
-
-      if ( this._blitcanvas.getContext ) {
-        //this._$elem.append('<canvas ' + sizeAttr + ' style="-webkit-transform:translateZ(0);' + posCss + '"></canvas>');
-        //this._$canvas = this._$elem.children(':last');
-        this._$canvas = $('<canvas ' + sizeAttr + ' style="-webkit-transform:translateZ(0);' + posCss + '"></canvas>');
-
-        // test _trueDoubleBuffer
-        this._blitcanvas.width = 1;
-        this._blitcanvas.height = 1;
-        this._trueDoubleBuffer = this._blitcanvas.toDataURL().length > 6;
-
-        if ( !(this._options.doubleBuffer && this._trueDoubleBuffer) ) {
-          this._$elem.append( this._$canvas );
-        }
-
-        this._context = this._$canvas[0].getContext("2d");
-
-        //this._blitcanvas = document.createElement( "canvas" );
-        this._blitcanvas.width = this._width;
-        this._blitcanvas.height = this._height;
-        this._blitcontext = this._blitcanvas.getContext("2d");
-
-        // create our front & back buffers
-        this._$canvasSceneFront = $('<img id="scene0" style="-webkit-transform:translateZ(0);' + posCss + sizeCss + '" />');
-        this._$canvasSceneBack = $('<img id="scene1" style="-webkit-transform:translateZ(0);' + posCss + sizeCss + '" />');
-
-      } else if (_ieVersion <= 8) {
-        this._trueCanvas = false;
-        this._$elem.append( '<div ' + sizeAttr + ' style="' + posCss + sizeCss + '"></div>');
-        this._$canvas = this._$elem.children(':last');
-
-        G_vmlCanvasManager.initElement(this._$canvas[0]);
-        this._context = this._$canvas[0].getContext("2d");
-        this._$canvas.children().css({ backgroundColor: "transparent", width: this._width, height: this._height });
-      }
-
-      // create our front & back label containers
-      this._$labelsContainerFront = $('<div class="geo-labels-container" style="-webkit-transform:translateZ(0);' + posCss + sizeCss + '"></div>');
-      this._$labelsContainerBack = $('<div class="geo-labels-container" style="-webkit-transform:translateZ(0);' + posCss + sizeCss + '"></div>');
-    },
-
-    _setOption: function (key, value) {
-      if (key == "style") {
-        value = $.extend({}, this._options.style, value);
-      }
-      $.Widget.prototype._setOption.apply(this, arguments);
-    },
-
-    destroy: function () {
-      $.Widget.prototype.destroy.apply(this, arguments);
-      this._$elem.html("");
-      this._$elem.removeClass( "geo-graphics" );
-    },
-
-    clear: function () {
-      this._context.clearRect(0, 0, this._width, this._height);
-      this._labelsHtml = "";
-
-          //if ( this._options.doubleBuffer ) console.log("clear:_end " + $.now());
-      this._end( );
-    },
-
-    drawArc: function (coordinates, startAngle, sweepAngle, style) {
-      style = this._getGraphicStyle(style);
-
-      if (style.visibility != "hidden" && style.opacity > 0 && style.widthValue > 0 && style.heightValue > 0) {
-        var r = Math.min(style.widthValue, style.heightValue) / 2;
-
-        startAngle = (startAngle * Math.PI / 180);
-        sweepAngle = (sweepAngle * Math.PI / 180);
-
-        this._context.save();
-        this._context.translate(coordinates[0], coordinates[1]);
-        if (style.widthValue > style.heightValue) {
-          this._context.scale(style.widthValue / style.heightValue, 1);
-        } else {
-          this._context.scale(1, style.heightValue / style.widthValue);
-        }
-
-        this._context.beginPath();
-        this._context.arc(0, 0, r, startAngle, sweepAngle, false);
-
-        if (this._trueCanvas) {
-          this._context.restore();
-        }
-
-        if (style.doFill) {
-          this._context.fillStyle = style.fill;
-          this._context.globalAlpha = style.opacity * style.fillOpacity;
-          this._context.fill();
-        }
-
-        if (style.doStroke) {
-          this._context.lineJoin = "round";
-          this._context.lineWidth = style.strokeWidthValue;
-          this._context.strokeStyle = style.stroke;
-
-          this._context.globalAlpha = style.opacity * style.strokeOpacity;
-          this._context.stroke();
-        }
-
-        if (!this._trueCanvas) {
-          this._context.restore();
-        }
-      }
-
-          //if ( this._options.doubleBuffer ) console.log("drawArc:_end " + $.now());
-      this._end( );
-    },
-
-    drawPoint: function (coordinates, style) {
-      style = this._getGraphicStyle(style);
-      if (style.widthValue == style.heightValue && style.heightValue == style.borderRadiusValue) {
-        this.drawArc(coordinates, 0, 360, style);
-      } else if (style.visibility != "hidden" && style.opacity > 0) {
-        style.borderRadiusValue = Math.min(Math.min(style.widthValue, style.heightValue) / 2, style.borderRadiusValue);
-        coordinates[0] -= style.widthValue / 2;
-        coordinates[1] -= style.heightValue / 2;
-        this._context.beginPath();
-        this._context.moveTo(coordinates[0] + style.borderRadiusValue, coordinates[1]);
-        this._context.lineTo(coordinates[0] + style.widthValue - style.borderRadiusValue, coordinates[1]);
-        this._context.quadraticCurveTo(coordinates[0] + style.widthValue, coordinates[1], coordinates[0] + style.widthValue, coordinates[1] + style.borderRadiusValue);
-        this._context.lineTo(coordinates[0] + style.widthValue, coordinates[1] + style.heightValue - style.borderRadiusValue);
-        this._context.quadraticCurveTo(coordinates[0] + style.widthValue, coordinates[1] + style.heightValue, coordinates[0] + style.widthValue - style.borderRadiusValue, coordinates[1] + style.heightValue);
-        this._context.lineTo(coordinates[0] + style.borderRadiusValue, coordinates[1] + style.heightValue);
-        this._context.quadraticCurveTo(coordinates[0], coordinates[1] + style.heightValue, coordinates[0], coordinates[1] + style.heightValue - style.borderRadiusValue);
-        this._context.lineTo(coordinates[0], coordinates[1] + style.borderRadiusValue);
-        this._context.quadraticCurveTo(coordinates[0], coordinates[1], coordinates[0] + style.borderRadiusValue, coordinates[1]);
-        this._context.closePath();
-
-        if (style.doFill) {
-          this._context.fillStyle = style.fill;
-          this._context.globalAlpha = style.opacity * style.fillOpacity;
-          this._context.fill();
-        }
-
-        if (style.doStroke) {
-          this._context.lineJoin = "round";
-          this._context.lineWidth = style.strokeWidthValue;
-          this._context.strokeStyle = style.stroke;
-
-          this._context.globalAlpha = style.opacity * style.strokeOpacity;
-
-          this._context.stroke();
-        }
-
-          //if ( this._options.doubleBuffer ) console.log("drawPoint:_end " + $.now());
-        this._end( );
-      }
-    },
-
-    drawLineString: function (coordinates, style) {
-      this._drawLines([coordinates], false, style);
-    },
-
-    drawPolygon: function (coordinates, style) {
-      if ( !this._trueCanvas || coordinates.length == 1 ) {
-        // either we don't have fancy rendering or there's no need for it (no holes)
-        this._drawLines( coordinates, true, style );
-      } else {
-        if ( !coordinates || !coordinates.length || coordinates[ 0 ].length < 3 ) {
-          // this is not a Polygon or it doesn't have a proper outer ring
-          return;
-        }
-
-        style = this._getGraphicStyle(style);
-
-        var pixelBbox, i, j;
-
-        if ( style.visibility != "hidden" && style.opacity > 0 ) {
-          this._blitcontext.clearRect(0, 0, this._width, this._height);
-
-          if ( style.doFill ) {
-            if ( coordinates.length > 1 ) {
-              // stencil inner rings
-              this._blitcontext.globalCompositeOperation = "source-out";
-              this._blitcontext.globalAlpha = 1;
-
-              for ( i = 1; i < coordinates.length; i++ ) {
-                this._blitcontext.beginPath();
-                this._blitcontext.moveTo( coordinates[ i ][ 0 ][ 0 ], coordinates[ i ][ 0 ][ 1 ] );
-                for ( j = 1; j < coordinates[ i ].length; j++ ) {
-                  this._blitcontext.lineTo( coordinates[ i ][ j ][ 0 ], coordinates[ i ][ j ][ 1 ] );
-                }
-                this._blitcontext.closePath();
-
-                this._blitcontext.fill( );
-              }
-            }
-          }
-
-          // path outer ring
-          this._blitcontext.beginPath();
-          this._blitcontext.moveTo( coordinates[ 0 ][ 0 ][ 0 ], coordinates[ 0 ][ 0 ][ 1 ] );
-
-          pixelBbox = [ coordinates[ 0 ][ 0 ][ 0 ] - style.strokeWidthValue, coordinates[ 0 ][ 0 ][ 1 ] - style.strokeWidthValue, coordinates[ 0 ][ 0 ][ 0 ] + style.strokeWidthValue, coordinates[ 0 ][ 0 ][ 1 ] + style.strokeWidthValue ];
-
-          for ( i = 1; i < coordinates[ 0 ].length - 1; i++ ) {
-            this._blitcontext.lineTo( coordinates[ 0 ][ i ][ 0 ], coordinates[ 0 ][ i ][ 1 ] );
-
-            pixelBbox[ 0 ] = Math.min( coordinates[ 0 ][ i ][ 0 ] - style.strokeWidthValue, pixelBbox[ 0 ] );
-            pixelBbox[ 1 ] = Math.min( coordinates[ 0 ][ i ][ 1 ] - style.strokeWidthValue, pixelBbox[ 1 ] );
-            pixelBbox[ 2 ] = Math.max( coordinates[ 0 ][ i ][ 0 ] + style.strokeWidthValue, pixelBbox[ 2 ] );
-            pixelBbox[ 3 ] = Math.max( coordinates[ 0 ][ i ][ 1 ] + style.strokeWidthValue, pixelBbox[ 3 ] );
-          }
-
-          this._blitcontext.closePath();
-
-          this._blitcontext.globalCompositeOperation = "source-out";
-          if ( style.doFill ) {
-            // fill outer ring
-            this._blitcontext.fillStyle = style.fill;
-            this._blitcontext.globalAlpha = style.opacity * style.fillOpacity;
-            this._blitcontext.fill( );
-          }
-
-          this._blitcontext.globalCompositeOperation = "source-over";
-          if ( style.doStroke ) {
-            // stroke outer ring
-            this._blitcontext.lineCap = this._blitcontext.lineJoin = "round";
-            this._blitcontext.lineWidth = style.strokeWidthValue;
-            this._blitcontext.strokeStyle = style.stroke;
-
-            this._blitcontext.globalAlpha = style.opacity * style.strokeOpacity;
-            this._blitcontext.stroke( );
-
-            if ( coordinates.length > 1 ) {
-              // stroke inner rings
-              for ( i = 1; i < coordinates.length; i++ ) {
-                this._blitcontext.beginPath();
-                this._blitcontext.moveTo( coordinates[ i ][ 0 ][ 0 ], coordinates[ i ][ 0 ][ 1 ] );
-                for ( j = 1; j < coordinates[ i ].length; j++ ) {
-                  this._blitcontext.lineTo( coordinates[ i ][ j ][ 0 ], coordinates[ i ][ j ][ 1 ] );
-                }
-                this._blitcontext.closePath();
-
-                this._blitcontext.stroke( );
-              }
-            }
-          }
-
-          // blit
-          pixelBbox[ 0 ] = Math.min( Math.max( pixelBbox[ 0 ], 0), this._width );
-          pixelBbox[ 1 ] = Math.min( Math.max( pixelBbox[ 1 ], 0), this._height );
-          pixelBbox[ 2 ] = Math.min( Math.max( pixelBbox[ 2 ], 0), this._width );
-          pixelBbox[ 3 ] = Math.min( Math.max( pixelBbox[ 3 ], 0), this._height );
-
-          if ( pixelBbox[ 0 ] !== pixelBbox[ 2 ] && pixelBbox[ 1 ] !== pixelBbox[ 3 ] ) {
-            this._context.drawImage(this._blitcanvas, pixelBbox[ 0 ], pixelBbox[ 1 ], pixelBbox[ 2 ] - pixelBbox[ 0 ], pixelBbox[ 3 ] - pixelBbox[ 1 ], pixelBbox[ 0 ], pixelBbox[ 1 ], pixelBbox[ 2 ] - pixelBbox[ 0 ], pixelBbox[ 3 ] - pixelBbox[ 1 ] );
-
-          //if ( this._options.doubleBuffer ) console.log("drawPolygon:_end " + $.now());
-            this._end( );
-          }
-        }
-      }
-    },
-
-    drawBbox: function (bbox, style) {
-      this._drawLines([[
-        [bbox[0], bbox[1]],
-        [bbox[0], bbox[3]],
-        [bbox[2], bbox[3]],
-        [bbox[2], bbox[1]],
-        [bbox[0], bbox[1]]
-      ]], true, style);
-    },
-
-    drawLabel: function( coordinates, label ) {
-      this._labelsHtml += '<div class="geo-label" style="-webkit-transform:translateZ(0);position:absolute; left:' + ( coordinates[ 0 ] / this._width * 100 ) + '%; top:' + ( coordinates[ 1 ] / this._height * 100 ) + '%;">' + label + '</div>';
-    },
-
-    resize: function( ) {
-      this._width = this._$elem.width();
-      this._height = this._$elem.height();
-
-      if (!(this._width && this._height)) {
-        this._width = parseInt(this._$elem.css("width"), 10);
-        this._height = parseInt(this._$elem.css("height"), 10);
-      }
-
-      if ( this._trueCanvas ) {
-        this._$canvas[0].width = this._width;
-        this._$canvas[0].height = this._height;
-
-        this._$canvasSceneFront.css( {
-          width: this._width,
-          height: this._height
-        } );
-
-        this._$canvasSceneBack.css( {
-          width: this._width,
-          height: this._height
-        } );
-      } else {
-        this._$canvas.css( {
-          width: this._width,
-          height: this._height
-        } );
-      }
-
-      this._$labelsContainerFront.css( {
-        width: this._width,
-        height: this._height
-      } );
-
-      this._$labelsContainerBack.css( {
-        width: this._width,
-        height: this._height
-      } );
-    },
-
-    interactiveTransform: function( origin, scale ) {
-      if ( this._timeoutEnd ) {
-        clearTimeout( this._timeoutEnd );
-        this._timeoutEnd = null;
-      }
-
-      // hide labels for now until they are on the interactive div 
-      //this._$labelsContainerFront.html("");
-
-      if ( this._trueCanvas ) {
-        if ( this._options.doubleBuffer && this._trueDoubleBuffer ) {
-
-
-          if ( this._requireFlip ) {
-            var geographics = this;
-
-            var oldCanvasScene = geographics._$canvasSceneFront;
-
-            geographics._$canvasSceneFront = geographics._$canvasSceneBack.css( {
-              left: 0,
-              top: 0,
-              width: geographics._width,
-              height: geographics._height
-            } ).prop( "src", geographics._$canvas[ 0 ].toDataURL( ) ).prependTo( geographics._$elem );
-
-            geographics._$canvasSceneBack = oldCanvasScene.detach();
-
-            geographics._requireFlip = false;
-          }
-
-
-          //console.log("geographics:interactiveTransform " + this._$canvasSceneFront.prop( "id" ) + ": origin: " + origin.toString() + ", scale: " + scale);
-          // transform a finished scene, can assume no drawing during these calls
-          this._$canvasSceneFront.css( {
-            left: Math.round( origin[ 0 ] ),
-            top: Math.round( origin[ 1 ] ),
-            width: this._width * scale,
-            height: this._height * scale
-          } );
-        } else {
-          this._context.clearRect(0, 0, this._width, this._height);
-        }
-      } else {
-        this._context.clearRect(0, 0, this._width, this._height);
-      }
-
-      // transform labels
-      this._$labelsContainerFront.css( {
-        left: Math.round( origin[ 0 ] ),
-        top: Math.round( origin[ 1 ] ),
-        width: this._width * scale,
-        height: this._height * scale
-      } );
-    },
-
-    _end: function( ) {
-      // end/finalize a scene
-      if ( this._timeoutEnd ) {
-        clearTimeout( this._timeoutEnd );
-        this._timeoutEnd = null;
-      }
-
-      this._requireFlip = true;
-
-      var geographics = this;
-
-      function endCallback( ) {
-        if ( !geographics._timeoutEnd ) {
-          // something has canceled the draw
-          return;
-        }
-
-        if ( geographics._trueCanvas && geographics._options.doubleBuffer && geographics._trueDoubleBuffer ) {
-          //console.log("    endCallback...");
-
-          //geographics._$canvasSceneFront = 
-          geographics._$canvasSceneBack.prop( "src", "" ).one( "load", function( e ) {
-            //console.log("    ...flip: show " + geographics._$canvasSceneBack.prop( "id" ) + ", hide " + geographics._$canvasSceneFront.prop("id"));
-            geographics._requireFlip = false;
-            var oldCanvasScene = geographics._$canvasSceneFront;
-
-            geographics._$canvasSceneFront = geographics._$canvasSceneBack.css( {
-              left: 0,
-              top: 0,
-              width: geographics._width,
-              height: geographics._height
-            } ).prependTo( geographics._$elem );
-
-            geographics._$canvasSceneBack = oldCanvasScene.detach();
-          } ).prop( "src", geographics._$canvas[ 0 ].toDataURL( ) );
-        }
-
-
-        geographics._$labelsContainerBack.html( geographics._labelsHtml );
-
-        var oldLabelsContainer = geographics._$labelsContainerFront;
-
-        geographics._$labelsContainerFront = geographics._$labelsContainerBack.css( {
-          left: 0,
-          top: 0,
-          width: geographics._width,
-          height: geographics._height
-        } ).prependTo( geographics._$elem );
-
-        geographics._$labelsContainerBack = oldLabelsContainer.detach();
-
-
-        geographics._timeoutEnd = null;
-      }
-
-      //if ( this._options.doubleBuffer ) {
-        this._timeoutEnd = setTimeout( endCallback, 20 );
-      //} else {
-        //geographics._$labelsContainerFront.html( geographics._labelsHtml );
-      //}
-    },
-
-    _getGraphicStyle: function (style) {
-      function safeParse(value) {
-        value = parseInt(value, 10);
-        return (+value + '') === value ? +value : value;
-      }
-
-      style = $.extend({}, this._options.style, style);
-      style.borderRadiusValue = safeParse(style.borderRadius);
-      style.fill = style.fill || style.color;
-      style.doFill = style.fill && style.fillOpacity > 0;
-      style.stroke = style.stroke || style.color;
-      style.strokeWidthValue = safeParse(style.strokeWidth);
-      style.doStroke = style.stroke && style.strokeOpacity > 0 && style.strokeWidthValue > 0;
-      style.widthValue = safeParse(style.width);
-      style.heightValue = safeParse(style.height);
-      return style;
-    },
-
-    _drawLines: function (coordinates, close, style) {
-      if (!coordinates || !coordinates.length || coordinates[0].length < 2) {
-        return;
-      }
-
-      var i, j;
-      style = this._getGraphicStyle(style);
-
-      if (style.visibility != "hidden" && style.opacity > 0) {
-        this._context.beginPath();
-
-        for (i = 0; i < coordinates.length; i++) {
-          this._context.moveTo(coordinates[i][0][0], coordinates[i][0][1]);
-          for (j = 1; j < coordinates[i].length; j++) {
-            this._context.lineTo(coordinates[i][j][0], coordinates[i][j][1]);
-          }
-        }
-
-        if (close) {
-          this._context.closePath();
-        }
-
-        if (close && style.doFill) {
-          this._context.fillStyle = style.fill;
-          this._context.globalAlpha = style.opacity * style.fillOpacity;
-          this._context.fill();
-        }
-
-        if (style.doStroke) {
-          this._context.lineCap = this._context.lineJoin = "round";
-          this._context.lineWidth = style.strokeWidthValue;
-          this._context.strokeStyle = style.stroke;
-
-          this._context.globalAlpha = style.opacity * style.strokeOpacity;
-          this._context.stroke();
-        }
-
-          //if ( this._options.doubleBuffer ) console.log("_drawLines:_end " + $.now());
-        this._end( );
-      }
-    }
-  });
-}(jQuery));
-
diff --git a/libs/js/jquery-geo-1.0b2/js/jquery.geo.geomap.js b/libs/js/jquery-geo-1.0b2/js/jquery.geo.geomap.js
deleted file mode 100755 (executable)
index fe2b273..0000000
+++ /dev/null
@@ -1,2299 +0,0 @@
-(function ($, undefined) {
-  var _widgetIdSeed = 0,
-      _ieVersion = ( function () {
-        var v = 5, div = document.createElement("div"), a = div.all || [];
-        do {
-          div.innerHTML = "<!--[if gt IE " + (++v) + "]><br><![endif]-->";
-        } while ( a[0] );
-        return v > 6 ? v : !v;
-      }() ),
-
-      _defaultOptions = {
-        bbox: [-180, -85, 180, 85],
-        bboxMax: [-180, -85, 180, 85],
-        center: [0, 0],
-        cursors: {
-          "static": "default",
-          pan: "url(data:image/vnd.microsoft.icon;base64,AAACAAEAICACAAgACAAwAQAAFgAAACgAAAAgAAAAQAAAAAEAAQAAAAAAAAEAAAAAAAAAAAAAAgAAAAAAAAAAAAAA////AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD8AAAA/AAAAfwAAAP+AAAH/gAAB/8AAA//AAAd/wAAGf+AAAH9gAADbYAAA2yAAAZsAAAGbAAAAGAAAAAAAAA//////////////////////////////////////////////////////////////////////////////////////gH///4B///8Af//+AD///AA///wAH//4AB//8AAf//AAD//5AA///gAP//4AD//8AF///AB///5A////5///8=), move",
-          zoom: "crosshair",
-          dragBox: "crosshair",
-          dragCircle: "crosshair",
-          drawPoint: "crosshair",
-          drawLineString: "crosshair",
-          drawPolygon: "crosshair",
-          measureLength: "crosshair",
-          measureArea: "crosshair"
-        },
-        measureLabels: {
-          length: "{{:length.toFixed( 2 )}} m",
-          area: "{{:area.toFixed( 2 )}} sq m"
-        },
-        drawStyle: {},
-        shapeStyle: {},
-        mode: "pan",
-        pannable: true,
-        scroll: "default",
-        shift: "default",
-        services: [
-            {
-              "class": "osm",
-              type: "tiled",
-              src: function (view) {
-                return "http://otile" + ((view.index % 4) + 1) + ".mqcdn.com/tiles/1.0.0/osm/" + view.zoom + "/" + view.tile.column + "/" + view.tile.row + ".png";
-              },
-              attr: "Tiles Courtesy of <a href='http://www.mapquest.com/' target='_blank'>MapQuest</a> <img src='http://developer.mapquest.com/content/osm/mq_logo.png'>"
-            }
-          ],
-        tilingScheme: {
-          tileWidth: 256,
-          tileHeight: 256,
-          levels: 18,
-          basePixelSize: 156543.03392799936,
-          origin: [-20037508.342787, 20037508.342787]
-        },
-        axisLayout: "map",
-        zoom: 0,
-        zoomMin: 0,
-        zoomMax: Number.POSITIVE_INFINITY,
-        pixelSize: 0
-      };
-
-  $.widget("geo.geomap", {
-    // private widget members
-    _$elem: undefined, //< map div for maps, service div for services
-    _map: undefined, //< only defined in services
-    _created: false,
-    _createdGraphics: false,
-    _widgetId: 0,
-    _tmplLengthId: "",
-    _tmplAreaId: "",
-
-    _contentBounds: {},
-
-    _$resizeContainer: undefined, //< all elements that should match _contentBounds' size
-
-    _$eventTarget: undefined,
-    _$contentFrame: undefined,
-    _$existingChildren: undefined,
-    _$attrList: undefined,
-    _$servicesContainer: undefined,
-    _$shapesContainers: undefined, //< all shapesContainer divs (map only)
-
-    _$panContainer: undefined, //< all non-service elements that move while panning
-    _$shapesContainer: undefined, //< just "our" shapesContainer div (map & service)
-    _$drawContainer: undefined,
-    _$measureContainer: undefined,
-    _$measureLabel: undefined,
-
-    _dpi: 96,
-
-    _currentServices: [], //< internal copy
-
-    _center: undefined,
-    _pixelSize: undefined,
-    _centerMax: undefined,
-    _pixelSizeMax: undefined,
-
-    _userGeodetic: true,
-
-    _centerInteractive: undefined,
-    _pixelSizeInteractive: undefined,
-    _timeoutInteractive: null,
-    _triggerInteractive: false,
-
-    _timeoutRefreshShapes: null,
-
-    _loadCount: 0,
-
-    _wheelTimeout: null,
-    _wheelLevel: 0,
-
-    _zoomFactor: 2, //< determines what a zoom level means
-
-    _fullZoomFactor: 2, //< interactiveScale factor needed to zoom a whole level
-    _partialZoomFactor: 1.18920711500273, //< interactiveScale factor needed to zoom a fraction of a level (the fourth root of 2)
-
-    _mouseDown: undefined,
-    _inOp: undefined,
-    _toolPan: undefined,
-    _shiftDown: undefined,
-    _anchor: undefined,
-    _current: undefined,
-    _downDate: undefined,
-    _moveDate: undefined,
-    _clickDate: undefined,
-    _lastMove: undefined,
-    _lastDrag: undefined,
-
-    _windowHandler: null,
-    _resizeTimeout: null,
-
-    _panning: undefined,
-    _velocity: undefined,
-    _friction: undefined,
-
-    _supportTouch: undefined,
-    _softDblClick: undefined,
-    _isTap: undefined,
-    _isDbltap: undefined,
-
-    _isMultiTouch: undefined,
-    _multiTouchAnchor: [], //< TouchList
-    _multiTouchAnchorBbox: undefined, //< bbox
-    _multiTouchCurrentBbox: undefined, //< bbox
-
-    _drawTimeout: null, //< used in drawPoint mode so we don't send two shape events on dbltap
-    _drawPixels: [], //< an array of coordinate arrays for drawing lines & polygons, in pixel coordinates
-    _drawCoords: [],
-
-    _graphicShapes: [], //< an array of objects containing style object refs & GeoJSON object refs
-
-    _initOptions: {},
-
-    _options: {},
-
-    options: $.extend({}, _defaultOptions),
-
-    _createWidget: function (options, element) {
-      this._$elem = $(element);
-
-      if (this._$elem.is(".geo-service")) {
-        this._graphicShapes = [];
-        $.Widget.prototype._createWidget.apply(this, arguments);
-        return;
-      }
-
-      this._widgetId = _widgetIdSeed++;
-      this._tmplLengthId = "geoMeasureLength" + this._widgetId;
-      this._tmplAreaId = "geoMeasureArea" + this._widgetId;
-
-      this._$elem.addClass("geo-map").css( {
-        webkitTransform: "translateZ(0)"
-      } );
-        
-
-      this._initOptions = options || {};
-
-      this._forcePosition(this._$elem);
-
-      this._$elem.css("text-align", "left");
-
-      var size = this._findMapSize();
-      this._contentBounds = {
-        x: parseInt(this._$elem.css("padding-left"), 10),
-        y: parseInt(this._$elem.css("padding-top"), 10),
-        width: size["width"],
-        height: size["height"]
-      };
-
-      this._createChildren();
-
-      this._center = [ 0, 0 ];
-      this._centerMax = [ 0, 0 ];
-      this._centerInteractive = [ 0, 0 ];
-
-      this.options["pixelSize"] = this._pixelSize = this._pixelSizeMax = 156543.03392799936;
-
-      this._mouseDown =
-          this._inOp =
-          this._toolPan =
-          this._shiftDown =
-          this._panning =
-          this._isTap =
-          this._isDbltap = false;
-
-      this._anchor = [ 0, 0 ];
-      this._current = [ 0, 0 ];
-      this._lastMove = [ 0, 0 ];
-      this._lastDrag = [ 0, 0 ];
-      this._velocity = [ 0, 0 ];
-
-      this._friction = [0.8, 0.8];
-
-      this._downDate =
-          this._moveDate =
-          this._clickDate = 0;
-
-      this._drawPixels = [];
-      this._drawCoords =  [];
-      this._graphicShapes = [];
-
-
-      $.Widget.prototype._createWidget.apply(this, arguments);
-    },
-
-    _create: function () {
-      this._options = this.options;
-
-      if (this._$elem.is(".geo-service")) {
-        this._map = this._$elem.data( "geoMap" );
-        this._$elem.data( "geoService", this );
-        return;
-      }
-
-      this._map = this;
-
-      this._supportTouch = "ontouchend" in document;
-      this._softDblClick = this._supportTouch || _ieVersion == 7;
-
-      var geomap = this,
-          touchStartEvent = this._supportTouch ? "touchstart" : "mousedown",
-          touchStopEvent = this._supportTouch ? "touchend touchcancel" : "mouseup",
-          touchMoveEvent = this._supportTouch ? "touchmove" : "mousemove";
-
-      $(document).keydown($.proxy(this._document_keydown, this));
-
-      this._$eventTarget.dblclick($.proxy(this._eventTarget_dblclick, this));
-
-      this._$eventTarget.bind(touchStartEvent, $.proxy(this._eventTarget_touchstart, this));
-
-      var dragTarget = (this._$eventTarget[0].setCapture) ? this._$eventTarget : $(document);
-      dragTarget.bind(touchMoveEvent, $.proxy(this._dragTarget_touchmove, this));
-      dragTarget.bind(touchStopEvent, $.proxy(this._dragTarget_touchstop, this));
-
-      this._$eventTarget.mousewheel($.proxy(this._eventTarget_mousewheel, this));
-
-      this._windowHandler = function () {
-        if (geomap._resizeTimeout) {
-          clearTimeout(geomap._resizeTimeout);
-        }
-        geomap._resizeTimeout = setTimeout(function () {
-          if (geomap._created) {
-            geomap._$elem.geomap( "resize", true );
-          }
-        }, 500);
-      };
-
-      $(window).resize(this._windowHandler);
-
-      this._$drawContainer.geographics({ style: this._initOptions.drawStyle || {}, doubleBuffer: false });
-      this._options["drawStyle"] = this._$drawContainer.geographics("option", "style");
-
-      this._$shapesContainer.geographics( { style: this._initOptions.shapeStyle || { } } );
-      this._createdGraphics = true;
-
-      this._options["shapeStyle"] = this._$shapesContainer.geographics("option", "style");
-
-      if (this._initOptions) {
-        // always init tilingScheme right away, even if it's null
-        if ( this._initOptions.tilingScheme !== undefined ) {
-          this._setOption("tilingScheme", this._initOptions.tilingScheme || null, false);
-        }
-
-        if ( this._initOptions.services ) {
-          // jQuery UI Widget Factory merges user services with our default, we want to clobber the default
-          this._options[ "services" ] = $.merge( [ ], this._initOptions.services );
-        }
-        if (this._initOptions.bboxMax) {
-          this._setOption("bboxMax", this._initOptions.bboxMax, false);
-          this._setOption("bbox", this._initOptions.bboxMax, false);
-        }
-        if (this._initOptions.zoomMin !== undefined) {
-          this._setOption("zoomMin", this._initOptions.zoomMin, false);
-        }
-        if (this._initOptions.zoomMax !== undefined) {
-          this._setOption("zoomMax", this._initOptions.zoomMax, false);
-        }
-        if (this._initOptions.bbox) {
-          this._setOption("bbox", this._initOptions.bbox, false);
-        }
-        if (this._initOptions.center) {
-          this._setOption("center", this._initOptions.center, false);
-        }
-        if (this._initOptions.zoom !== undefined) {
-          this._setOption("zoom", this._initOptions.zoom, false);
-        }
-      }
-
-      $.templates( this._tmplLengthId, this._options[ "measureLabels" ].length );
-      $.templates( this._tmplAreaId, this._options[ "measureLabels" ].area );
-
-      this._$eventTarget.css("cursor", this._options["cursors"][this._options["mode"]]);
-
-      this._createServices();
-      this._refresh();
-
-      this._created = true;
-    },
-
-    _setOption: function (key, value, refresh) {
-      if ( key == "pixelSize" ) {
-        return;
-      }
-
-      refresh = (refresh === undefined || refresh);
-
-      if ( this._$elem.is( ".geo-map" ) ) {
-        this._panFinalize();
-      }
-
-      var center, pixelSize, bbox, zoom;
-
-      switch (key) {
-        case "bbox":
-          if ( this._created ) {
-            this._clearInteractiveTimeout( );
-          }
-
-          this._userGeodetic = $.geo.proj && $.geo._isGeodetic( value );
-          if ( this._userGeodetic ) {
-            value = $.geo.proj.fromGeodetic( value );
-          }
-
-          center = [value[0] + (value[2] - value[0]) / 2, value[1] + (value[3] - value[1]) / 2];
-          pixelSize = Math.max($.geo.width(value, true) / this._contentBounds.width, $.geo.height(value, true) / this._contentBounds.height);
-
-          // clamp to zoom
-          zoom = this._getZoom( center, pixelSize );
-
-          if ( this._options[ "tilingScheme" ] ) {
-            pixelSize = this._getPixelSize( Math.min( Math.max( zoom, this._options[ "zoomMin" ] ), this._options[ "zoomMax" ] ) );
-          } else {
-            if ( zoom < this._options[ "zoomMin" ] ) {
-              pixelSize = this._getPixelSize( this._options[ "zoomMin" ] );
-            } else if ( zoom > this._options[ "zoomMax" ] ) {
-              pixelSize = this._getPixelSize( this._options[ "zoomMax" ] );
-            }
-          }
-
-          if ( this._created ) {
-            this._setInteractiveCenterAndSize( center, pixelSize );
-            this._setInteractiveTimeout( false );
-          } else {
-            this._setCenterAndSize( center, pixelSize, false, refresh );
-          }
-
-          value = this._getBbox( center, pixelSize );
-          break;
-
-        case "bboxMax":
-          this._userGeodetic = $.geo.proj && $.geo._isGeodetic( value );
-          break;
-
-        case "center":
-          if ( this._created ) {
-            this._clearInteractiveTimeout( );
-          }
-
-          this._userGeodetic = $.geo.proj && $.geo._isGeodetic( value );
-          if ( this._userGeodetic ) {
-            value = $.geo.proj.fromGeodetic( value );
-          }
-
-          if ( this._created ) {
-            this._setInteractiveCenterAndSize( value, this._pixelSizeInteractive );
-            this._interactiveTransform( );
-            this._setInteractiveTimeout( false );
-          } else {
-            this._setCenterAndSize( value, this._pixelSize, false, refresh );
-          }
-          break;
-
-        case "measureLabels":
-          value = $.extend( this._options[ "measureLabels" ], value );
-
-
-          $.templates( this._tmplLengthId, this._options[ "measureLabels" ].length );
-          $.templates( this._tmplAreaId, this._options[ "measureLabels" ].area );
-
-          break;
-
-        case "drawStyle":
-          if (this._$drawContainer) {
-            this._$drawContainer.geographics("option", "style", value);
-            value = this._$drawContainer.geographics("option", "style");
-          }
-          break;
-
-        case "shapeStyle":
-          if ( this._$elem.is( ".geo-service" ) && !this._createdGraphics ) {
-            this._createServiceGraphics( );
-          }
-
-          if ( this._createdGraphics ) {
-            this._$shapesContainer.geographics("option", "style", value);
-            value = this._$shapesContainer.geographics("option", "style");
-          }
-          break;
-
-        case "mode":
-          this._resetDrawing( );
-          this._$eventTarget.css("cursor", this._options["cursors"][value]);
-          break;
-
-        case "zoom":
-          if ( this._created ) {
-            this._setZoom(value, false, refresh);
-          } else {
-            value = Math.max( value, 0 );
-            this._setCenterAndSize( this._center, this._getPixelSize( value ), false, refresh );
-          }
-          break;
-      }
-
-      $.Widget.prototype._setOption.apply(this, arguments);
-
-      switch ( key ) {
-        case "bbox":
-        case "center":
-          if ( this._userGeodetic ) {
-            this._options[ "bbox" ] = $.geo.proj.toGeodetic( this._options[ "bbox" ] );
-            this._options[ "center" ] = $.geo.proj.toGeodetic( this._center );
-          }
-          break;
-
-        case "tilingScheme":
-          if ( value !== null ) {
-            this._pixelSizeMax = this._getPixelSize( 0 );
-            this._centerMax = [
-              value.origin[ 0 ] + this._pixelSizeMax * value.tileWidth / 2,
-              value.origin[ 1 ] + this._pixelSizeMax * value.tileHeight / 2
-            ];
-          }
-          break;
-
-        case "bboxMax":
-          if ( $.geo.proj && $.geo._isGeodetic( value ) ) {
-            bbox = $.geo.proj.fromGeodetic( value );
-          } else {
-            bbox = value;
-          }
-
-          this._centerMax = $.geo.center( bbox );
-          this._pixelSizeMax = Math.max( $.geo.width( bbox, true ) / this._contentBounds.width, $.geo.height( bbox, true ) / this._contentBounds.height );
-          break;
-
-        case "services":
-          this._createServices();
-          if (refresh) {
-            this._refresh();
-            this._refreshAllShapes();
-          }
-          break;
-
-        case "shapeStyle":
-          if ( refresh && this._createdGraphics ) {
-            this._$shapesContainer.geographics("clear");
-            this._refreshShapes( this._$shapesContainer, this._graphicShapes, this._graphicShapes, this._graphicShapes );
-          }
-          break;
-      }
-    },
-
-    destroy: function () {
-      if ( this._$elem.is(".geo-service") ) {
-        if ( this._createdGraphics ) {
-          this._$shapesContainer.geographics("destroy");
-          this._$shapesContainer = undefined;
-          this._createdGraphics = false;
-        }
-      } else {
-        clearTimeout( this._timeoutInteractive );
-        this._timeoutInteractive = null;
-
-        this._created = false;
-
-        $(window).unbind("resize", this._windowHandler);
-
-        for ( var i = 0; i < this._currentServices.length; i++ ) {
-          this._currentServices[ i ].serviceContainer.geomap("destroy");
-          $.geo["_serviceTypes"][this._currentServices[i].type].destroy(this, this._$servicesContainer, this._currentServices[i]);
-        }
-
-        this._$shapesContainer.geographics("destroy");
-        this._$shapesContainer = undefined;
-        this._createdGraphics = false;
-
-        this._$drawContainer.geographics("destroy");
-        this._$drawContainer = undefined;
-
-        this._$existingChildren.detach();
-        this._$elem.html("");
-        this._$elem.append(this._$existingChildren);
-        this._$elem.removeClass("geo-map");
-      }
-
-      $.Widget.prototype.destroy.apply(this, arguments);
-    },
-
-    toMap: function (p) {
-      p = this._toMap(p);
-      return this._userGeodetic ? $.geo.proj.toGeodetic(p) : p;
-    },
-
-    toPixel: function ( p, _center /* Internal Use Only */, _pixelSize /* Internal Use Only */ ) {
-      return this._toPixel( $.geo.proj ? $.geo.proj.fromGeodetic( p ) : p, _center, _pixelSize );
-    },
-
-    opacity: function ( value, _serviceContainer ) {
-      if ( this._$elem.is( ".geo-service" ) ) {
-        this._$elem.closest( ".geo-map" ).geomap( "opacity", value, this._$elem );
-      } else {
-        if ( value >= 0 || value <= 1 ) {
-          for ( var i = 0; i < this._currentServices.length; i++ ) {
-            var service = this._currentServices[ i ];
-            if ( !_serviceContainer || service.serviceContainer[ 0 ] == _serviceContainer[ 0 ] ) {
-              service.style.opacity = value;
-
-              // update the original service object's style property
-              service.serviceObject.style = $.extend( { }, service.serviceObject.style, service.style );
-
-              $.geo[ "_serviceTypes" ][ service.type ].opacity( this, service );
-            }
-          }
-        }
-      }
-    },
-
-    toggle: function ( value, _serviceContainer ) {
-      if ( this._$elem.is( ".geo-service" ) ) {
-        this._$elem.closest( ".geo-map" ).geomap( "toggle", value, this._$elem );
-      } else {
-
-        for ( var i = 0; i < this._currentServices.length; i++ ) {
-          var service = this._currentServices[ i ];
-
-          if ( !_serviceContainer || service.serviceContainer[ 0 ] == _serviceContainer[ 0 ] ) {
-            if ( value === undefined ) {
-              // toggle visibility
-              value = ( service.style.visibility !== "visible" );
-            }
-
-            service.style.visibility = ( value ? "visible" : "hidden" );
-
-            // update the original service object's style property
-            service.serviceObject.style = $.extend( { }, service.serviceObject.style, service.style );
-
-            service.serviceContainer.toggle( value );
-
-            if ( value ) {
-              $.geo[ "_serviceTypes" ][ service.type ].refresh( this, service );
-            }
-          }
-        }
-      }
-    },
-
-    zoom: function (numberOfLevels) {
-      if (numberOfLevels !== null) {
-        this._setZoom(this._options["zoom"] + numberOfLevels, false, true);
-      }
-    },
-
-    refresh: function ( force, _serviceContainer ) {
-      if ( this._$elem.is( ".geo-service" ) ) {
-        this._$elem.closest( ".geo-map" ).geomap( "refresh", force, this._$elem );
-      } else {
-        this._refresh( force, _serviceContainer );
-        this._refreshAllShapes( );
-      }
-    },
-
-    resize: function ( _trigger /* Internal Use Only */ ) {
-      var size = this._findMapSize(),
-          dx = size["width"]/2 - this._contentBounds.width/2,
-          dy = size["height"]/2 - this._contentBounds.height/2,
-          i;
-
-      this._contentBounds = {
-        x: parseInt(this._$elem.css("padding-left"), 10),
-        y: parseInt(this._$elem.css("padding-top"), 10),
-        width: size["width"],
-        height: size["height"]
-      };
-
-      this._$resizeContainer.css( {
-        width: size["width"],
-        height: size["height"]
-      } );
-
-      for (i = 0; i < this._currentServices.length; i++) {
-        $.geo["_serviceTypes"][this._currentServices[i].type].resize(this, this._currentServices[i]);
-      }
-
-      this._$elem.find( ".geo-graphics" ).css( {
-        width: size["width"],
-        height: size["height"]
-      }).geographics( "resize" );
-
-      for (i = 0; i < this._drawPixels.length; i++) {
-        this._drawPixels[i][0] += dx;
-        this._drawPixels[i][1] += dy;
-      }
-
-      this._setCenterAndSize(this._center, this._pixelSize, _trigger, true);
-    },
-
-    append: function ( shape, style, label, refresh ) {
-      if ( shape && ( $.isPlainObject( shape ) || ( $.isArray( shape ) && shape.length > 0 ) ) ) {
-        if ( !this._createdGraphics ) {
-          this._createServiceGraphics( );
-        }
-
-        var shapes, arg, i, realStyle, realLabel, realRefresh;
-
-        if ( $.isArray( shape ) ) {
-          shapes = shape;
-        } else if ( shape.type == "FeatureCollection" ) {
-          shapes = shape.features;
-        } else {
-          shapes = [ shape ];
-        }
-
-        for ( i = 1; i < arguments.length; i++ ) {
-          arg = arguments[ i ];
-
-          if ( typeof arg === "object" ) {
-            realStyle = arg;
-          } else if ( typeof arg === "number" || typeof arg === "string" ) {
-            realLabel = arg;
-          } else if ( typeof arg === "boolean" ) {
-            realRefresh = arg;
-          }
-        }
-
-        for ( i = 0; i < shapes.length; i++ ) {
-          if ( shapes[ i ].type != "Point" ) {
-            var bbox = $.geo.bbox( shapes[ i ] );
-            if ( $.geo.proj && $.geo._isGeodetic( bbox ) ) {
-              bbox = $.geo.proj.fromGeodetic( bbox );
-            }
-            $.data( shapes[ i ], "geoBbox", bbox );
-          }
-
-          this._graphicShapes.push( {
-            shape: shapes[ i ],
-            style: realStyle,
-            label: realLabel
-          } );
-        }
-
-        if ( realRefresh === undefined || realRefresh ) {
-          if ( this._$elem.is( ".geo-service" ) ) {
-            this._refresh( false, this._$elem );
-          } else {
-            this._refresh( );
-          }
-          this._refreshAllShapes( );
-        }
-      }
-    },
-
-    empty: function ( refresh ) {
-      for ( var i = 0; i < this._graphicShapes.length; i++ ) {
-        $.removeData( this._graphicShapes[ i ].shape, "geoBbox" );
-      }
-
-      this._graphicShapes = [];
-
-      if ( refresh === undefined || refresh ) {
-        if ( this._$elem.is( ".geo-service" ) ) {
-          this._refresh( false, this._$elem );
-        } else {
-          this._refresh( );
-        }
-        this._refreshAllShapes( );
-      }
-    },
-
-    find: function ( selector, pixelTolerance ) {
-      var isPoint = $.isPlainObject( selector ),
-          searchPixel = isPoint ? this._map.toPixel( selector.coordinates ) : undefined,
-          mapTol = this._map._pixelSize * pixelTolerance,
-          result = [],
-          graphicShape,
-          geometries,
-          curGeom,
-          i = 0;
-
-      for ( ; i < this._graphicShapes.length; i++ ) {
-        graphicShape = this._graphicShapes[ i ];
-
-        if ( isPoint ) {
-          if ( graphicShape.shape.type == "Point" ) {
-            if ( $.geo.distance( graphicShape.shape, selector ) <= mapTol ) {
-              result.push( graphicShape.shape );
-            }
-          } else {
-            var bbox = $.data( graphicShape.shape, "geoBbox" ),
-                bboxPolygon = {
-                  type: "Polygon",
-                  coordinates: [ [
-                    [bbox[0], bbox[1]],
-                    [bbox[0], bbox[3]],
-                    [bbox[2], bbox[3]],
-                    [bbox[2], bbox[1]],
-                    [bbox[0], bbox[1]]
-                  ] ]
-                },
-                projectedPoint = {
-                  type: "Point",
-                  coordinates: $.geo.proj && $.geo._isGeodetic( selector.coordinates ) ? $.geo.proj.fromGeodetic( selector.coordinates ) : selector.coordinates
-                };
-
-            if ( $.geo.distance( bboxPolygon, projectedPoint, true ) <= mapTol ) {
-              geometries = $.geo._flatten( graphicShape.shape );
-              for ( curGeom = 0; curGeom < geometries.length; curGeom++ ) {
-                if ( $.geo.distance( geometries[ curGeom ], selector ) <= mapTol ) {
-                  result.push( graphicShape.shape );
-                  break;
-                }
-              }
-            }
-          }
-        } else {
-          result.push( graphicShape.shape );
-        }
-      }
-
-      if ( this._$elem.is( ".geo-map" ) ) {
-        this._$elem.find( ".geo-service" ).each( function( ) {
-          result = $.merge( result, $( this ).geomap( "find", selector, pixelTolerance ) );
-        } );
-      }
-
-      return result;
-    },
-
-    remove: function ( shape, refresh ) {
-      if ( shape && ( $.isPlainObject( shape ) || ( $.isArray( shape ) && shape.length > 0 ) ) ) {
-        var shapes = $.isArray( shape ) ? shape : [ shape ],
-            rest;
-
-        for ( var i = 0; i < this._graphicShapes.length; i++ ) {
-          if ( $.inArray( this._graphicShapes[ i ].shape, shapes ) >= 0 ) {
-            $.removeData( shape, "geoBbox" );
-            rest = this._graphicShapes.slice( i + 1 );
-            this._graphicShapes.length = i;
-            this._graphicShapes.push.apply( this._graphicShapes, rest );
-            i--;
-          }
-        }
-
-        if ( refresh === undefined || refresh ) {
-          if ( this._$elem.is( ".geo-service" ) ) {
-            this._refresh( false, this._$elem );
-          } else {
-            this._refresh( );
-          }
-          this._refreshAllShapes( );
-        }
-      }
-    },
-
-    _getBbox: function (center, pixelSize) {
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      // calculate the internal bbox
-      var halfWidth = this._contentBounds[ "width" ] / 2 * pixelSize,
-          halfHeight = this._contentBounds[ "height" ] / 2 * pixelSize;
-      return [ center[ 0 ] - halfWidth, center[ 1 ] - halfHeight, center[ 0 ] + halfWidth, center[ 1 ] + halfHeight ];
-    },
-
-    _setBbox: function (value, trigger, refresh) {
-      var center = [value[0] + (value[2] - value[0]) / 2, value[1] + (value[3] - value[1]) / 2],
-          pixelSize = Math.max($.geo.width(value, true) / this._contentBounds.width, $.geo.height(value, true) / this._contentBounds.height),
-          zoom = this._getZoom( center, pixelSize );
-
-      // clamp to zoom
-      if ( this._options[ "tilingScheme" ] ) {
-        pixelSize = this._getPixelSize( Math.min( Math.max( zoom, this._options[ "zoomMin" ] ), this._options[ "zoomMax" ] ) );
-      } else {
-        if ( zoom < this._options[ "zoomMin" ] ) {
-          pixelSize = this._getPixelSize( this._options[ "zoomMin" ] );
-        } else if ( zoom > this._options[ "zoomMax" ] ) {
-          pixelSize = this._getPixelSize( this._options[ "zoomMax" ] );
-        }
-      }
-
-      this._setInteractiveCenterAndSize( center, pixelSize );
-      this._interactiveTransform( );
-    },
-
-    _getBboxMax: function () {
-      // calculate the internal bboxMax
-      var halfWidth = this._contentBounds["width"] / 2 * this._pixelSizeMax,
-        halfHeight = this._contentBounds["height"] / 2 * this._pixelSizeMax;
-      return [this._centerMax[0] - halfWidth, this._centerMax[1] - halfHeight, this._centerMax[0] + halfWidth, this._centerMax[1] + halfHeight];
-    },
-
-    _getCenter: function () {
-      return this._center;
-    },
-
-    _getContentBounds: function () {
-      return this._contentBounds;
-    },
-
-    _getServicesContainer: function () {
-      return this._$servicesContainer;
-    },
-
-    _getZoom: function ( center, pixelSize ) {
-      // calculate the internal zoom level, vs. public zoom property
-      // this does not take zoomMin or zoomMax into account
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      var tilingScheme = this._options["tilingScheme"];
-      if ( tilingScheme ) {
-        if ( tilingScheme.pixelSizes ) {
-          var roundedPixelSize = Math.floor(pixelSize * 1000),
-              levels = tilingScheme.pixelSizes.length,
-              i = levels - 1;
-
-          for ( ; i >= 0; i-- ) {
-            if ( Math.floor( tilingScheme.pixelSizes[ i ] * 1000 ) >= roundedPixelSize ) {
-              return i;
-            }
-          }
-
-          return 0;
-        } else {
-          return Math.round( Math.log( tilingScheme.basePixelSize / pixelSize) / Math.log( 2 ) );
-        }
-      } else {
-        var ratio = this._contentBounds["width"] / this._contentBounds["height"],
-            bbox = $.geo.reaspect( this._getBbox( center, pixelSize ), ratio, true ),
-            bboxMax = $.geo.reaspect(this._getBboxMax(), ratio, true);
-
-        return Math.round( Math.log($.geo.width(bboxMax, true) / $.geo.width(bbox, true)) / Math.log(this._zoomFactor) );
-      }
-    },
-
-    _setZoom: function ( value, trigger, refresh ) {
-      // set the map widget's zoom, taking zoomMin and zoomMax into account
-      this._clearInteractiveTimeout( );
-
-      value = Math.min( Math.max( value, this._options[ "zoomMin" ] ), this._options[ "zoomMax" ] );
-
-      this._setInteractiveCenterAndSize( this._centerInteractive, this._getPixelSize( value ) );
-      this._interactiveTransform( );
-      this._setInteractiveTimeout( trigger );
-    },
-
-    _createChildren: function () {
-      this._$existingChildren = this._$elem.children();
-
-      this._forcePosition(this._$existingChildren);
-
-      this._$existingChildren.detach().css( {
-        mozUserSelect: "none"
-      } );
-
-
-      var contentSizeCss = "width:" + this._contentBounds["width"] + "px; height:" + this._contentBounds["height"] + "px; margin:0; padding:0;",
-          contentPosCss = "position:absolute; left:0; top:0;";
-
-      this._$elem.prepend('<div class="geo-event-target geo-content-frame" style="position:absolute; left:' + this._contentBounds.x + 'px; top:' + this._contentBounds.y + 'px;' + contentSizeCss + 'overflow:hidden; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none;" unselectable="on"></div>');
-      this._$eventTarget = this._$contentFrame = this._$elem.children(':first');
-
-      this._$contentFrame.append('<div class="geo-services-container" style="' + contentPosCss + contentSizeCss + '"></div>');
-      this._$servicesContainer = this._$contentFrame.children(':last');
-
-      this._$contentFrame.append('<div class="geo-shapes-container" style="' + contentPosCss + contentSizeCss + '"></div>');
-      this._$shapesContainer = this._$contentFrame.children(':last');
-
-      this._$contentFrame.append( '<ul style="position: absolute; bottom: 8px; left: 8px; list-style-type: none; max-width: 50%; padding: 0; margin: 0;"></ul>' );
-      this._$attrList = this._$contentFrame.children( ":last" );
-
-      this._$contentFrame.append('<div class="geo-draw-container" style="' + contentPosCss + contentSizeCss + '"></div>');
-      this._$drawContainer = this._$contentFrame.children(':last');
-
-      this._$contentFrame.append('<div class="geo-measure-container" style="' + contentPosCss + contentSizeCss + '"><span class="geo-measure-label" style="' + contentPosCss + '; display: none;"></span></div>');
-      this._$measureContainer = this._$contentFrame.children(':last');
-      this._$measureLabel = this._$measureContainer.children();
-
-      this._$panContainer = $( [ this._$shapesContainer[ 0 ], this._$drawContainer[ 0 ], this._$measureContainer[ 0 ] ] );
-
-      this._$resizeContainer = $( [ this._$contentFrame[ 0 ], this._$servicesContainer[ 0 ], this._$eventTarget[ 0 ], this._$measureContainer[ 0 ] ] ); 
-
-      this._$contentFrame.append(this._$existingChildren);
-
-      if ( ! $("#geo-measure-style").length ) {
-        $("head").prepend( '<style type="text/css" id="geo-measure-style">.geo-measure-label { margin: 4px 0 0 6px; font-family: sans-serif;' + ( _ieVersion ? 'letter-spacing: 2px; color: #444; filter:progid:DXImageTransform.Microsoft.DropShadow(Color=white, OffX=1, OffY=2, Positive=true);' : 'color: #000; text-shadow: #fff 1px 2px; font-weight: bold;' ) + ' }</style>' );
-      }
-    },
-
-    _createServices: function () {
-      var service, i;
-
-      for ( i = 0; i < this._currentServices.length; i++ ) {
-        this._currentServices[ i ].serviceContainer.geomap( "destroy" );
-        $.geo[ "_serviceTypes" ][ this._currentServices[ i ].type ].destroy( this, this._$servicesContainer, this._currentServices[ i ] );
-      }
-
-      this._currentServices = [ ];
-      this._$servicesContainer.html( "" );
-      this._$attrList.html( "" );
-
-      for ( i = 0; i < this._options[ "services" ].length; i++ ) {
-        service = this._currentServices[ i ] = $.extend( { }, this._options[ "services" ][ i ] );
-
-        // keep a reference to the original
-        service.serviceObject = this._options[ "services" ][ i ];
-
-        // default the service style property on our copy
-        service.style = $.extend( {
-                          visibility: "visible",
-                          opacity: 1
-                        }, service.style );
-
-        var idString = service.id ? ' id="' + service.id + '"' : "",
-            classString = 'class="geo-service ' + ( service["class"] ? service["class"] : '' ) + '"',
-            scHtml = '<div ' + idString + classString + ' style="-webkit-transform:translateZ(0);position:absolute; left:0; top:0; width:32px; height:32px; margin:0; padding:0; display:' + ( service.style.visibility === "visible" ? "block" : "none" ) + ';"></div>',
-            servicesContainer;
-
-        this._$servicesContainer.append( scHtml );
-        serviceContainer = this._$servicesContainer.children( ":last" );
-        service.serviceContainer = serviceContainer;
-        
-        $.geo[ "_serviceTypes" ][ service.type ].create( this, serviceContainer, service, i );
-
-        serviceContainer.data( "geoMap", this ).geomap();
-
-        if ( service.attr ) {
-          this._$attrList.append( '<li>' + service.attr + '</li>' );
-        }
-      }
-
-      // start with our map-level shapesContainer
-      this._$shapesContainers = this._$shapesContainer;
-
-      this._$attrList.find( "a" ).css( {
-        position: "relative",
-        zIndex: 100
-      } );
-    },
-
-    _createServiceGraphics: function( ) { 
-      // only called in the context of a service-level geomap
-      var $contentFrame = this._$elem.closest( ".geo-content-frame" );
-      this._$elem.append('<div class="geo-shapes-container" style="position:absolute; left:0; top:0; width:' + $contentFrame.css( "width" ) + '; height:' + $contentFrame.css( "height" ) + '; margin:0; padding:0;"></div>');
-      this._$shapesContainer = this._$elem.children(':last');
-
-      this._map._$shapesContainers = this._map._$shapesContainers.add( this._$shapesContainer );
-
-      this._$shapesContainer.geographics( );
-      this._createdGraphics = true;
-
-      this._options["shapeStyle"] = this._$shapesContainer.geographics("option", "style");
-    },
-
-    _refreshDrawing: function ( ) {
-      this._$drawContainer.geographics("clear");
-
-      if ( this._drawPixels.length > 0 ) {
-        var mode = this._options[ "mode" ],
-            pixels = this._drawPixels,
-            coords = this._drawCoords,
-            label,
-            labelShape,
-            labelPixel,
-            widthOver,
-            heightOver;
-
-        switch ( mode ) {
-          case "measureLength":
-            mode = "drawLineString";
-            labelShape = {
-              type: "LineString",
-              coordinates: coords
-            };
-            label = $.render[ this._tmplLengthId ]( { length: $.geo.length( labelShape, true ) } );
-            labelPixel = $.merge( [], pixels[ pixels.length - 1 ] );
-            break;
-
-          case "measureArea":
-            mode = "drawPolygon";
-
-            labelShape = {
-              type: "Polygon",
-              coordinates: [ $.merge( [ ], coords ) ]
-            };
-            labelShape.coordinates[ 0 ].push( coords[ 0 ] );
-
-            label = $.render[ this._tmplAreaId ]( { area: $.geo.area( labelShape, true ) } );
-            labelPixel = this._toPixel( $.geo.centroid( labelShape ).coordinates );
-            pixels = [ pixels ];
-            break;
-
-          case "drawPolygon":
-            pixels = [ pixels ];
-            break;
-        }
-
-        this._$drawContainer.geographics( mode, pixels );
-        
-        if ( label ) {
-          this._$measureLabel.html( label );
-
-          widthOver = this._contentBounds.width - ( this._$measureLabel.outerWidth( true ) + labelPixel[ 0 ] );
-          heightOver = this._contentBounds.height - ( this._$measureLabel.outerHeight( true ) + labelPixel[ 1 ] );
-
-          if ( widthOver < 0 ) {
-            labelPixel[ 0 ] += widthOver;
-          }
-
-          if ( heightOver < 0 ) {
-            labelPixel[ 1 ] += heightOver;
-          }
-
-          this._$measureLabel.css( {
-            left: Math.max( labelPixel[ 0 ], 0 ),
-            top: Math.max( labelPixel[ 1 ], 0 )
-          } ).show();
-        }
-      }
-    },
-
-    _resetDrawing: function () {
-      this._drawPixels = [];
-      this._drawCoords = [];
-      this._$drawContainer.geographics("clear");
-      this._$measureLabel.hide();
-    },
-
-    _refreshAllShapes: function ( ) {
-      this._timeoutRefreshShapes = null;
-
-      var service,
-          geoService,
-          i = 0;
-
-      for ( ; i < this._currentServices.length; i++ ) {
-        service = this._currentServices[ i ];
-        geoService = service.serviceContainer.data( "geoService" );
-
-        if ( geoService._createdGraphics ) {
-          geoService._$shapesContainer.geographics( "clear" );
-          if ( geoService._graphicShapes.length > 0 ) {
-            geoService._refreshShapes( geoService._$shapesContainer, geoService._graphicShapes, geoService._graphicShapes, geoService._graphicShapes );
-          }
-        }
-      }
-
-      if ( this._createdGraphics ) {
-        this._$shapesContainer.geographics( "clear" );
-        if ( this._graphicShapes.length > 0 ) {
-          this._refreshShapes( this._$shapesContainer, this._graphicShapes, this._graphicShapes, this._graphicShapes );
-        }
-      }
-    },
-
-
-    _refreshShapes: function (geographics, shapes, styles, labels, center, pixelSize) {
-      var i, mgi,
-          shape,
-          shapeBbox,
-          style,
-          label,
-          hasLabel,
-          labelPixel,
-          bbox = this._map._getBbox(center, pixelSize);
-
-      /*
-      if ( shapes.length > 0 ) {
-        console.log( "_refreshShapes " + $.now() );
-      }
-      */
-      for (i = 0; i < shapes.length; i++) {
-        shape = shapes[i].shape || shapes[i];
-        shape = shape.geometry || shape;
-        shapeBbox = $.data(shape, "geoBbox");
-
-        if ( shapeBbox && $.geo._bboxDisjoint( bbox, shapeBbox ) ) {
-          continue;
-        }
-
-        style = $.isArray(styles) ? styles[i].style : styles;
-        label = $.isArray(labels) ? labels[i].label : labels;
-        hasLabel = ( label !== undefined );
-        labelPixel = undefined;
-
-        switch (shape.type) {
-          case "Point":
-            labelPixel = this._map.toPixel( shape.coordinates, center, pixelSize );
-            this._$shapesContainer.geographics("drawPoint", labelPixel, style);
-            break;
-          case "LineString":
-            this._$shapesContainer.geographics("drawLineString", this._map.toPixel(shape.coordinates, center, pixelSize), style);
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.pointAlong( shape, 0.5 ).coordinates, center, pixelSize );
-            }
-            break;
-          case "Polygon":
-            this._$shapesContainer.geographics("drawPolygon", this._map.toPixel(shape.coordinates, center, pixelSize), style);
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize );
-            }
-            break;
-          case "MultiPoint":
-            for (mgi = 0; mgi < shape.coordinates.length; mgi++) {
-              this._$shapesContainer.geographics("drawPoint", this._map.toPixel(shape.coordinates[mgi], center, pixelSize), style);
-            }
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize );
-            }
-            break;
-          case "MultiLineString":
-            for (mgi = 0; mgi < shape.coordinates.length; mgi++) {
-              this._$shapesContainer.geographics("drawLineString", this._map.toPixel(shape.coordinates[mgi], center, pixelSize), style);
-            }
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize );
-            }
-            break;
-          case "MultiPolygon":
-            for (mgi = 0; mgi < shape.coordinates.length; mgi++) {
-              this._$shapesContainer.geographics("drawPolygon", this._map.toPixel(shape.coordinates[mgi], center, pixelSize), style);
-            }
-            if ( hasLabel ) {
-              labelPixel = this._map.toPixel( $.geo.centroid( shape ).coordinates, center, pixelSize );
-            }
-            break;
-
-          case "GeometryCollection":
-            this._refreshShapes(geographics, shape.geometries, style, label, center, pixelSize);
-            break;
-        }
-
-        if ( hasLabel && labelPixel ) {
-          this._$shapesContainer.geographics( "drawLabel", labelPixel, label );
-        }
-      }
-    },
-
-    _findMapSize: function () {
-      // really, really attempt to find a size for this thing
-      // even if it's hidden (look at parents)
-      var size = { width: 0, height: 0 },
-        sizeContainer = this._$elem;
-
-      while (sizeContainer.size() && !(size["width"] > 0 && size["height"] > 0)) {
-        size = { width: sizeContainer.width(), height: sizeContainer.height() };
-        if (size["width"] <= 0 || size["height"] <= 0) {
-          size = { width: parseInt(sizeContainer.css("width"), 10), height: parseInt(sizeContainer.css("height"), 10) };
-        }
-        sizeContainer = sizeContainer.parent();
-      }
-      return size;
-    },
-
-    _forcePosition: function (elem) {
-      var cssPosition = elem.css("position");
-      if (cssPosition != "relative" && cssPosition != "absolute" && cssPosition != "fixed") {
-        elem.css("position", "relative");
-      }
-    },
-
-    _getPixelSize: function ( zoom ) {
-      var tilingScheme = this._options["tilingScheme"];
-      if (tilingScheme !== null) {
-        if (zoom === 0) {
-          return tilingScheme.pixelSizes ? tilingScheme.pixelSizes[0] : tilingScheme.basePixelSize;
-        }
-
-        zoom = Math.round(zoom);
-        zoom = Math.max(zoom, 0);
-        var levels = tilingScheme.pixelSizes ? tilingScheme.pixelSizes.length : tilingScheme.levels;
-        zoom = Math.min(zoom, levels - 1);
-
-        if ( tilingScheme.pixelSizes ) {
-          return tilingScheme.pixelSizes[zoom];
-        } else {
-          return tilingScheme.basePixelSize / Math.pow(2, zoom);
-        }
-      } else {
-        var bbox = $.geo.scaleBy( this._getBboxMax(), 1 / Math.pow( this._zoomFactor, zoom ), true );
-        return Math.max( $.geo.width( bbox, true ) / this._contentBounds.width, $.geo.height( bbox, true ) / this._contentBounds.height );
-      }
-    },
-
-    _getZoomCenterAndSize: function ( anchor, zoomDelta, full ) {
-      var zoomFactor = ( full ? this._fullZoomFactor : this._partialZoomFactor ),
-          scale = Math.pow( zoomFactor, -zoomDelta ),
-          pixelSize = this._pixelSizeInteractive * scale,
-          zoom = this._getZoom(this._centerInteractive, pixelSize);
-
-      // clamp to zoom
-      if ( full && this._options[ "tilingScheme" ] ) {
-        pixelSize = this._getPixelSize( Math.min( Math.max( zoom, this._options[ "zoomMin" ] ), this._options[ "zoomMax" ] ) );
-      } else {
-        if ( zoomDelta < 0 && zoom < this._options[ "zoomMin" ] ) {
-          pixelSize = this._pixelSizeInteractive;
-        } else if ( zoomDelta > 0 && zoom > this._options[ "zoomMax" ] ) {
-          pixelSize = this._pixelSizeInteractive;
-        }
-      }
-
-      var ratio = pixelSize / this._pixelSizeInteractive,
-          anchorMapCoord = this._toMap( anchor, this._centerInteractive, this._pixelSizeInteractive ),
-          centerDelta = [(this._centerInteractive[0] - anchorMapCoord[0]) * ratio, (this._centerInteractive[1] - anchorMapCoord[1]) * ratio],
-          scaleCenter = [anchorMapCoord[0] + centerDelta[0], anchorMapCoord[1] + centerDelta[1]];
-
-      return { pixelSize: pixelSize, center: scaleCenter };
-    },
-
-    _mouseWheelFinish: function ( refresh ) {
-      this._wheelTimeout = null;
-
-      if (this._wheelLevel !== 0) {
-        var wheelCenterAndSize = this._getZoomCenterAndSize( this._anchor, this._wheelLevel, this._options[ "tilingScheme" ] !== null );
-
-        this._wheelLevel = 0;
-      } else if ( refresh ) {
-        this._refresh();
-        this._refreshAllShapes( );
-      }
-    },
-
-    _panFinalize: function () {
-      if (this._panning) {
-        this._velocity = [0, 0];
-
-        var dx = this._current[0] - this._anchor[0],
-            dy = this._current[1] - this._anchor[1],
-            image = this._options[ "axisLayout" ] === "image",
-            dxMap = -dx * this._pixelSize,
-            dyMap = ( image ? -1 : 1 ) * dy * this._pixelSize;
-
-        this._$eventTarget.css("cursor", this._options["cursors"][this._options["mode"]]);
-
-        this._inOp = false;
-        this._anchor = this._current;
-        this._mouseDown = this._toolPan = this._panning = false;
-      }
-    },
-
-    _panMove: function () {
-      if ( ! this._options[ "pannable" ] ) {
-        return;
-      }
-
-      var dx = this._current[0] - this._lastDrag[0],
-          dy = this._current[1] - this._lastDrag[1],
-          i = 0,
-          service,
-          translateObj;
-
-      if (this._toolPan || dx > 3 || dx < -3 || dy > 3 || dy < -3) {
-        if (!this._toolPan) {
-          this._toolPan = true;
-          this._$eventTarget.css("cursor", this._options["cursors"]["pan"]);
-        }
-
-        if (this._mouseDown) {
-          this._velocity = [dx, dy];
-        }
-
-        if (dx !== 0 || dy !== 0) {
-          this._panning = true;
-          this._lastDrag = this._current;
-
-          this._centerInteractive[ 0 ] -= ( dx * this._pixelSizeInteractive );
-          this._centerInteractive[ 1 ] += ( ( this._options[ "axisLayout" ] === "image" ? -1 : 1 ) * dy * this._pixelSizeInteractive );
-          this._setInteractiveCenterAndSize( this._centerInteractive, this._pixelSizeInteractive );
-          this._interactiveTransform( );
-        }
-      }
-    },
-
-    _clearInteractiveTimeout: function() {
-      if ( this._timeoutRefreshShapes ) {
-        clearTimeout( this._timeoutRefreshShapes );
-        this._timeoutRefreshShapes = null;
-      }
-
-      if ( this._timeoutInteractive ) {
-        clearTimeout( this._timeoutInteractive );
-        this._timeoutInteractive = null;
-        return true;
-      } else {
-        this._centerInteractive[ 0 ] = this._center[ 0 ];
-        this._centerInteractive[ 1 ] = this._center[ 1 ];
-        this._pixelSizeInteractive = this._pixelSize;
-        return false;
-      }
-    },
-
-    _interactiveTransform: function( ) {
-      var mapWidth = this._contentBounds[ "width" ],
-          mapHeight = this._contentBounds[ "height" ],
-
-          halfWidth = mapWidth / 2,
-          halfHeight = mapHeight / 2,
-
-          bbox = [ this._centerInteractive[ 0 ] - halfWidth, this._centerInteractive[ 1 ] - halfHeight, this._centerInteractive[ 0 ] + halfWidth, this._centerInteractive[ 1 ] + halfHeight ];
-
-      var scalePixelSize = this._pixelSize,
-          scaleRatio = scalePixelSize / this._pixelSizeInteractive;
-          
-      if ( scalePixelSize > 0 ) {
-        scaleRatio = Math.round(scaleRatio * 1000) / 1000;
-
-        var oldMapOrigin = this._toMap( [ 0, 0 ] ),
-            newPixelPoint = this._toPixel( oldMapOrigin, this._centerInteractive, this._pixelSizeInteractive );
-
-
-        this._$shapesContainers.geographics("interactiveTransform", newPixelPoint, scaleRatio);
-
-        /*
-        $scaleContainer.css( {
-          left: Math.round( newPixelPoint[ 0 ] ),
-          top: Math.round( newPixelPoint[ 1 ] ),
-          width: mapWidth * scaleRatio,
-          height: mapHeight * scaleRatio
-        } );
-        */
-        
-      }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-      for ( var i = 0; i < this._currentServices.length; i++ ) {
-        service = this._currentServices[ i ];
-        $.geo[ "_serviceTypes" ][ service.type ].interactiveTransform( this, service, this._centerInteractive, this._pixelSizeInteractive );
-      }
-
-      if (this._drawCoords.length > 0) {
-        this._drawPixels = this._toPixel( this._drawCoords, this._centerInteractive, this._pixelSizeInteractive );
-        this._refreshDrawing();
-      }
-    },
-
-    _interactiveTimeout: function( ) {
-      if ( this._isMultiTouch ) {
-        this._timeoutInteractive = setTimeout( $.proxy( interactiveTimeout, this ), 128 );
-      } else if ( this._created && this._timeoutInteractive ) {
-        this._setCenterAndSize( this._centerInteractive, this._pixelSizeInteractive, this._triggerInteractive, true );
-        this._timeoutInteractive = null;
-        this._triggerInteractive = false;
-
-        this._timeoutRefreshShapes = setTimeout( $.proxy( this._refreshAllShapes, this ), 128 );
-      }
-    },
-
-    _setInteractiveTimeout: function( trigger ) {
-      this._timeoutInteractive = setTimeout( $.proxy( this._interactiveTimeout, this ), 128 );
-      this._triggerInteractive |= trigger;
-    },
-
-    _refresh: function ( force, _serviceContainer ) {
-      var service,
-          i = 0;
-
-      for ( ; i < this._currentServices.length; i++ ) {
-        service = this._currentServices[ i ];
-        if ( !_serviceContainer || service.serviceContainer[ 0 ] == _serviceContainer[ 0 ] ) {
-          $.geo[ "_serviceTypes" ][ service.type ].refresh( this, service, force );
-        }
-      }
-    },
-
-    _setInteractiveCenterAndSize: function ( center, pixelSize ) {
-      // set the temporary (interactive) center & size
-      // also, update the public-facing options
-      // this does not take zoomMin or zoomMax into account
-      this._centerInteractive[ 0 ] = center[ 0 ];
-      this._centerInteractive[ 1 ] = center[ 1 ];
-      this._pixelSizeInteractive = pixelSize;
-
-      if ( this._userGeodetic ) {
-        this._options["bbox"] = $.geo.proj.toGeodetic( this._getBbox( center, pixelSize ) );
-        this._options["center"] = $.geo.proj.toGeodetic( center );
-      } else {
-        this._options["bbox"] = this._getBbox( center, pixelSize );
-        this._options["center"][ 0 ] = center[ 0 ];
-        this._options["center"][ 1 ] = center[ 1 ];
-      }
-
-      this._options["pixelSize"] = pixelSize;
-      this._options["zoom"] = this._getZoom( center, pixelSize );
-    },
-
-    _setCenterAndSize: function (center, pixelSize, trigger, refresh) {
-      if ( ! $.isArray( center ) || center.length != 2 || typeof center[ 0 ] !== "number" || typeof center[ 1 ] !== "number" ) {
-        return;
-      }
-
-      // the final call during any extent change
-      // only called by timeoutInteractive & resize
-      // clamp to zoom
-      var zoom = this._getZoom( center, pixelSize );
-
-      if ( this._options[ "tilingScheme" ] ) {
-        this._pixelSizeInteractive = pixelSize = this._getPixelSize( Math.min( Math.max( zoom, this._options[ "zoomMin" ] ), this._options[ "zoomMax" ] ) );
-      } else {
-        if ( zoom < this._options[ "zoomMin" ] ) {
-          this._pixelSizeInteractive = pixelSize = this._getPixelSize( this._options[ "zoomMin" ] );
-        } else if ( zoom > this._options[ "zoomMax" ] ) {
-          this._pixelSizeInteractive = pixelSize = this._getPixelSize( this._options[ "zoomMax" ] );
-        }
-      }
-
-      this._center[ 0 ] = center[ 0 ];
-      this._center[ 1 ] = center[ 1 ];
-      this._options["pixelSize"] = this._pixelSize = pixelSize;
-
-      if ( this._userGeodetic ) {
-        this._options["bbox"] = $.geo.proj.toGeodetic( this._getBbox() );
-        this._options["center"] = $.geo.proj.toGeodetic( this._center );
-      } else {
-        this._options["bbox"] = this._getBbox();
-        this._options["center"] = $.merge( [ ], center );
-      }
-
-      this._options["zoom"] = zoom;
-
-      if (trigger) {
-        this._trigger("bboxchange", window.event, { bbox: $.merge( [ ], this._options["bbox"] ) });
-      }
-
-      if (refresh) {
-        this._refresh();
-        this._refreshAllShapes( );
-        this._refreshDrawing();
-      }
-    },
-
-    _requestQueued: function ( ) {
-      if ( this._loadCount === 0 ) {
-        this._trigger( "loadstart", window.event );
-      }
-      this._loadCount++;
-    },
-
-    _requestComplete: function ( ) {
-      this._loadCount--;
-      if ( this._loadCount <= 0 ) {
-        this._loadCount = 0;
-        this._trigger( "loadend", window.event );
-      }
-    },
-
-    _toMap: function (p, center, pixelSize) {
-      // ignores $.geo.proj
-
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      var isMultiPointOrLineString = $.isArray( p[ 0 ] ),
-          isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray( p[ 0 ][ 0 ] ),
-          isMultiPolygon = isMultiLineStringOrPolygon && $.isArray( p[ 0 ][ 0 ][ 0 ] ),
-          width = this._contentBounds["width"],
-          height = this._contentBounds["height"],
-          halfWidth = width / 2 * pixelSize,
-          halfHeight = height / 2 * pixelSize,
-          bbox = [center[0] - halfWidth, center[1] - halfHeight, center[0] + halfWidth, center[1] + halfHeight],
-          xRatio = $.geo.width(bbox, true) / width,
-          yRatio = $.geo.height(bbox, true) / height,
-          yOffset,
-          image = this._options[ "axisLayout" ] === "image",
-          result = [],
-          i, j, k;
-
-      if ( !isMultiPolygon ) {
-        if ( !isMultiLineStringOrPolygon ) {
-          if ( !isMultiPointOrLineString ) {
-            p = [ p ];
-          }
-          p = [ p ];
-        }
-        p = [ p ];
-      }
-
-      for ( i = 0; i < p.length; i++ ) {
-        result[ i ] = [ ];
-        for ( j = 0; j < p[ i ].length; j++ ) {
-          result[ i ][ j ] = [ ];
-          for ( k = 0; k < p[ i ][ j ].length; k++ ) {
-            yOffset = (p[ i ][ j ][ k ][1] * yRatio);
-            result[ i ][ j ][ k ] = [
-              bbox[ 0 ] + ( p[ i ][ j ][ k ][ 0 ] * xRatio ),
-              image ? bbox[ 1 ] + yOffset : bbox[ 3 ] - yOffset
-            ];
-          }
-        }
-      }
-
-      return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-    },
-
-    _toPixel: function (p, center, pixelSize) {
-      // ignores $.geo.proj
-
-      center = center || this._center;
-      pixelSize = pixelSize || this._pixelSize;
-
-      var isMultiPointOrLineString = $.isArray( p[ 0 ] ),
-          isMultiLineStringOrPolygon = isMultiPointOrLineString && $.isArray( p[ 0 ][ 0 ] ),
-          isMultiPolygon = isMultiLineStringOrPolygon && $.isArray( p[ 0 ][ 0 ][ 0 ] ),
-          width = this._contentBounds["width"],
-          height = this._contentBounds["height"],
-          halfWidth = width / 2 * pixelSize,
-          halfHeight = height / 2 * pixelSize,
-          bbox = [center[0] - halfWidth, center[1] - halfHeight, center[0] + halfWidth, center[1] + halfHeight],
-          bboxWidth = $.geo.width(bbox, true),
-          bboxHeight = $.geo.height(bbox, true),
-          image = this._options[ "axisLayout" ] === "image",
-          xRatio = width / bboxWidth,
-          yRatio = height / bboxHeight,
-          result = [ ],
-          i, j, k;
-
-      if ( !isMultiPolygon ) {
-        if ( !isMultiLineStringOrPolygon ) {
-          if ( !isMultiPointOrLineString ) {
-            p = [ p ];
-          }
-          p = [ p ];
-        }
-        p = [ p ];
-      }
-
-      for ( i = 0; i < p.length; i++ ) {
-        result[ i ] = [ ];
-        for ( j = 0; j < p[ i ].length; j++ ) {
-          result[ i ][ j ] = [ ];
-          for ( k = 0; k < p[ i ][ j ].length; k++ ) {
-            result[ i ][ j ][ k ] = [
-              Math.round( ( p[ i ][ j ][ k ][ 0 ] - bbox[ 0 ] ) * xRatio ),
-              Math.round( ( image ? p[ i ][ j ][ k ][ 1 ] - bbox[ 1 ] : bbox[ 3 ] - p[ i ][ j ][ k ][ 1 ] ) * yRatio )
-            ];
-          }
-        }
-      }
-
-      return isMultiPolygon ? result : isMultiLineStringOrPolygon ? result[ 0 ] : isMultiPointOrLineString ? result[ 0 ][ 0 ] : result[ 0 ][ 0 ][ 0 ];
-    },
-
-    _document_keydown: function (e) {
-      var len = this._drawCoords.length;
-      if (len > 0 && e.which == 27) {
-        if (len <= 2) {
-          this._resetDrawing();
-          this._inOp = false;
-        } else {
-          this._drawCoords[len - 2] = $.merge( [], this._drawCoords[ len - 1 ] );
-          this._drawPixels[len - 2] = $.merge( [], this._drawPixels[ len - 1 ] );
-
-          this._drawCoords.length--;
-          this._drawPixels.length--;
-
-          this._refreshDrawing();
-        }
-      }
-    },
-
-    _eventTarget_dblclick_zoom: function(e) {
-      var doInteractiveTimeout = this._clearInteractiveTimeout( );
-
-      this._trigger("dblclick", e, { type: "Point", coordinates: this._toMap(this._current, this._centerInteractive, this._pixelSizeInteractive ) });
-
-      if (!e.isDefaultPrevented()) {
-        var centerAndSize = this._getZoomCenterAndSize(this._current, 1, true );
-
-        this._setInteractiveCenterAndSize( centerAndSize.center, centerAndSize.pixelSize );
-        this._interactiveTransform( );
-
-        doInteractiveTimeout = true;
-      }
-
-      if ( doInteractiveTimeout ) {
-        this._setInteractiveTimeout( true );
-      }
-    },
-
-    _eventTarget_dblclick: function (e) {
-      if ( this._options[ "mode" ] === "static" ) {
-        return;
-      }
-
-      if (this._drawTimeout) {
-        window.clearTimeout(this._drawTimeout);
-        this._drawTimeout = null;
-      }
-
-      var offset = $(e.currentTarget).offset();
-
-      switch (this._options["mode"]) {
-        case "drawLineString":
-        case "measureLength":
-          if ( this._drawCoords.length > 1 && ! ( this._drawCoords[0][0] == this._drawCoords[1][0] &&
-                                                  this._drawCoords[0][1] == this._drawCoords[1][1] ) ) {
-              this._drawCoords.length--;
-              this._trigger( "shape", e, {
-                type: "LineString",
-                coordinates: this._userGeodetic ? $.geo.proj.toGeodetic(this._drawCoords) : this._drawCoords
-              } );
-          } else {
-            this._eventTarget_dblclick_zoom(e);
-          }
-          this._resetDrawing();
-          break;
-
-        case "drawPolygon":
-        case "measureArea":
-          if ( this._drawCoords.length > 1 && ! ( this._drawCoords[0][0] == this._drawCoords[1][0] &&
-                                                  this._drawCoords[0][1] == this._drawCoords[1][1] ) ) {
-            var endIndex = this._drawCoords.length - 1;
-            if (endIndex > 2) {
-              this._drawCoords[endIndex] = $.merge( [], this._drawCoords[0] );
-              this._trigger( "shape", e, {
-                type: "Polygon",
-                coordinates: [ this._userGeodetic ? $.geo.proj.toGeodetic(this._drawCoords) : this._drawCoords ]
-              } );
-            }
-          } else {
-            this._eventTarget_dblclick_zoom(e);
-          }
-          this._resetDrawing();
-          break;
-
-        default:
-          this._eventTarget_dblclick_zoom(e);
-          break;
-      }
-
-      this._inOp = false;
-    },
-
-    _eventTarget_touchstart: function (e) {
-      var mode = this._options[ "mode" ],
-          shift = this._options[ "shift" ],
-          defaultShift = ( mode === "dragBox" ? "dragBox" : "zoom" );
-
-      if ( mode === "static" ) {
-        return;
-      }
-
-      if ( !this._supportTouch && e.which != 1 ) {
-        return;
-      }
-
-      var doInteractiveTimeout = this._clearInteractiveTimeout( );
-
-      var offset = $(e.currentTarget).offset(),
-          touches = e.originalEvent.changedTouches;
-
-      if ( this._supportTouch ) {
-        this._multiTouchAnchor = $.merge( [ ], touches );
-
-        this._isMultiTouch = this._multiTouchAnchor.length > 1;
-
-        if ( this._isMultiTouch ) {
-          this._multiTouchCurrentBbox = [
-            touches[0].pageX - offset.left,
-            touches[0].pageY - offset.top,
-            touches[1].pageX - offset.left,
-            touches[1].pageY - offset.top
-          ];
-
-          this._multiTouchAnchorBbox = $.merge( [ ], this._multiTouchCurrentBbox );
-
-          this._current = $.geo.center( this._multiTouchCurrentBbox, true );
-        } else {
-          this._multiTouchCurrentBbox = [
-            touches[0].pageX - offset.left,
-            touches[0].pageY - offset.top,
-            NaN,
-            NaN
-          ];
-
-          this._current = [ touches[0].pageX - offset.left, touches[0].pageY - offset.top ];
-        }
-      } else {
-        this._current = [e.pageX - offset.left, e.pageY - offset.top];
-      }
-
-      if (this._softDblClick) {
-        var downDate = $.now();
-        if (downDate - this._downDate < 750) {
-          if (this._isTap) {
-            var dx = this._current[0] - this._anchor[0],
-                dy = this._current[1] - this._anchor[1],
-                distance = Math.sqrt((dx * dx) + (dy * dy));
-            if (distance > 8) {
-              this._isTap = false;
-            } else {
-              this._current = $.merge( [ ], this._anchor );
-            }
-          }
-
-          if (this._isDbltap) {
-            this._isDbltap = false;
-          } else {
-            this._isDbltap = this._isTap;
-          }
-        } else {
-          this._isDbltap = false;
-        }
-        this._isTap = true;
-        this._downDate = downDate;
-      }
-
-      this._mouseDown = true;
-      this._anchor = $.merge( [ ], this._current );
-
-      if (!this._inOp && e.shiftKey && shift !== "off") {
-        this._shiftDown = true;
-        this._$eventTarget.css( "cursor", this._options[ "cursors" ][ shift === "default" ? defaultShift : shift ] );
-      } else if ( !this._isMultiTouch && ( this._options[ "pannable" ] || mode === "dragBox" || mode === "dragCircle" ) ) {
-        this._inOp = true;
-
-        if ( mode !== "zoom" && mode !== "dragBox" && mode !== "dragCircle" ) {
-          this._lastDrag = this._current;
-
-          if (e.currentTarget.setCapture) {
-            e.currentTarget.setCapture();
-          }
-        }
-      }
-
-      e.preventDefault();
-
-      if ( doInteractiveTimeout ) {
-        this._setInteractiveTimeout( true );
-      }
-
-      return false;
-    },
-
-    _dragTarget_touchmove: function (e) {
-      if ( this._options[ "mode" ] === "static" ) {
-        return;
-      }
-
-      var doInteractiveTimeout = false;
-      if ( this._mouseDown ) {
-        doInteractiveTimeout = this._clearInteractiveTimeout( );
-      }
-
-      var offset = this._$eventTarget.offset(),
-          drawCoordsLen = this._drawCoords.length,
-          touches = e.originalEvent.changedTouches,
-          current,
-          service,
-          i = 0;
-
-      if ( this._supportTouch ) {
-        if ( !this._isMultiTouch && this._mouseDown && this._multiTouchAnchor.length > 0 && touches[ 0 ].identifier !== this._multiTouchAnchor[ 0 ].identifier ) {
-          // switch to multitouch
-          this._mouseDown = false;
-          this._isMultiTouch = true;
-          this._wheelLevel = 0;
-
-          this._multiTouchAnchor.push( touches[ 0 ] );
-
-
-
-
-          this._multiTouchCurrentBbox = [
-            this._multiTouchCurrentBbox[ 0 ],
-            this._multiTouchCurrentBbox[ 1 ],
-            this._multiTouchAnchor[1].pageX - offset.left,
-            this._multiTouchAnchor[1].pageY - offset.top
-          ];
-
-          this._multiTouchAnchorBbox = $.merge( [ ], this._multiTouchCurrentBbox );
-
-          this._mouseDown = true;
-          this._anchor = this._current = $.geo.center( this._multiTouchCurrentBbox, true );
-
-
-          if ( doInteractiveTimeout ) {
-            this._setInteractiveTimeout( true );
-          }
-          return false;
-        }
-
-        if ( this._isMultiTouch ) {
-
-          for ( ; i < touches.length; i++ ) {
-            if ( touches[ i ].identifier === this._multiTouchAnchor[ 0 ].identifier ) {
-              this._multiTouchCurrentBbox[ 0 ] = touches[ i ].pageX - offset.left;
-              this._multiTouchCurrentBbox[ 1 ] = touches[ i ].pageY - offset.top;
-            } else if ( touches[ i ].identifier === this._multiTouchAnchor[ 1 ].identifier ) {
-              this._multiTouchCurrentBbox[ 2 ] = touches[ i ].pageX - offset.left;
-              this._multiTouchCurrentBbox[ 3 ] = touches[ i ].pageY - offset.top;
-            }
-          }
-
-          var anchorDistance = $.geo._distancePointPoint( [ this._multiTouchAnchorBbox[ 0 ], this._multiTouchAnchorBbox[ 1 ] ], [ this._multiTouchAnchorBbox[ 2 ], this._multiTouchAnchorBbox[ 3 ] ] ),
-              currentDistance = $.geo._distancePointPoint( [ this._multiTouchCurrentBbox[ 0 ], this._multiTouchCurrentBbox[ 1 ] ], [ this._multiTouchCurrentBbox[ 2 ], this._multiTouchCurrentBbox[ 3 ] ] );
-
-          current = $.geo.center( this._multiTouchCurrentBbox, true );
-
-          var wheelLevel = ( ( currentDistance - anchorDistance ) / anchorDistance );
-
-          if ( wheelLevel > 0 ) {
-            wheelLevel *= 5;
-          } else {
-            wheelLevel *= 10;
-          }
-
-          var delta = wheelLevel - this._wheelLevel;
-
-          this._wheelLevel = wheelLevel;
-
-          var pinchCenterAndSize = this._getZoomCenterAndSize( this._anchor, delta, false );
-
-          this._setInteractiveCenterAndSize( pinchCenterAndSize.center, pinchCenterAndSize.pixelSize );
-          this._interactiveTransform( );
-
-          doInteractiveTimeout = true;
-
-          current = $.geo.center( this._multiTouchCurrentBbox, true );
-        } else {
-          current = [e.originalEvent.changedTouches[0].pageX - offset.left, e.originalEvent.changedTouches[0].pageY - offset.top];
-        }
-      } else {
-        current = [e.pageX - offset.left, e.pageY - offset.top];
-      }
-
-      if (current[0] === this._lastMove[0] && current[1] === this._lastMove[1]) {
-        if ( this._inOp ) {
-          e.preventDefault();
-          if ( doInteractiveTimeout ) {
-            this._setInteractiveTimeout( true );
-          }
-          return false;
-        }
-      }
-
-      if ( _ieVersion == 7 ) {
-        this._isDbltap = this._isTap = false;
-      }
-
-      if (this._mouseDown) {
-        this._current = current;
-        this._moveDate = $.now();
-      }
-
-      if ( this._isMultiTouch ) {
-        e.preventDefault( );
-        this._isDbltap = this._isTap = false;
-        if ( doInteractiveTimeout ) {
-          this._setInteractiveTimeout( true );
-        }
-        return false;
-      }
-
-      var mode = this._options["mode"],
-          shift = this._options[ "shift" ],
-          defaultShift = ( mode === "dragBox" ? "dragBox" : "zoom" ),
-          dx, dy, circleSize;
-
-      if ( this._shiftDown ) {
-        mode = ( shift === "default" ? defaultShift : shift );
-      }
-
-      switch (mode) {
-        case "zoom":
-        case "dragBox":
-          if ( this._mouseDown ) {
-            this._$drawContainer.geographics( "clear" );
-            this._$drawContainer.geographics( "drawBbox", [
-              this._anchor[ 0 ],
-              this._anchor[ 1 ],
-              current[ 0 ],
-              current[ 1 ]
-            ] );
-          } else {
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-
-        case "dragCircle":
-          if ( this._mouseDown ) {
-            dx = current[ 0 ] - this._anchor[ 0 ];
-            dy = current[ 1 ] - this._anchor[ 1 ];
-            circleSize = Math.sqrt( ( dx * dx) + ( dy * dy ) ) * 2;
-            //circleSize = Math.max( Math.abs( current[ 0 ] - this._anchor[ 0 ] ), Math.abs( current[ 1 ] - this._anchor[ 1 ] ) ) * 2;
-
-            // not part of _refreshDrawing
-            this._$drawContainer.geographics( "clear" );
-            this._$drawContainer.geographics( "drawArc", this._anchor, 0, 360, {
-              width: circleSize,
-              height: circleSize
-            } );
-          } else {
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-
-        case "drawLineString":
-        case "drawPolygon":
-        case "measureLength":
-        case "measureArea":
-          if (this._mouseDown || this._toolPan) {
-            this._panMove();
-            doInteractiveTimeout = true;
-          } else {
-            if (drawCoordsLen > 0) {
-              this._drawCoords[drawCoordsLen - 1] = this._toMap( current, this._centerInteractive, this._pixelSizeInteractive );
-              this._drawPixels[drawCoordsLen - 1] = current;
-
-              this._refreshDrawing();
-            }
-
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-
-        default:
-          if (this._mouseDown || this._toolPan) {
-            this._panMove();
-            doInteractiveTimeout = true;
-          } else {
-            this._trigger("move", e, { type: "Point", coordinates: this.toMap(current) });
-          }
-          break;
-      }
-
-      this._lastMove = current;
-
-      if ( doInteractiveTimeout ) {
-        this._setInteractiveTimeout( true );
-      }
-
-      if ( this._inOp ) {
-        e.preventDefault();
-        return false;
-      }
-    },
-
-    _dragTarget_touchstop: function (e) {
-      if ( this._options[ "mode" ] === "static" ) {
-        return;
-      }
-
-      if ( !this._mouseDown ) {
-        if ( _ieVersion == 7 ) {
-          // ie7 doesn't appear to trigger dblclick on this._$eventTarget,
-          // we fake regular click here to cause soft dblclick
-          this._eventTarget_touchstart(e);
-        } else {
-          // Chrome & Firefox trigger a rogue mouseup event when doing a dblclick maximize in Windows(/Linux?)
-          // ignore it
-          return;
-        }
-      }
-
-      var doInteractiveTimeout = this._clearInteractiveTimeout( );
-
-      var mouseWasDown = this._mouseDown,
-          wasToolPan = this._toolPan,
-          offset = this._$eventTarget.offset(),
-          mode = this._options[ "mode" ],
-          shift = this._options[ "shift" ],
-          defaultShift = ( mode === "dragBox" ? "dragBox" : "zoom" ),
-          current, i, clickDate,
-          dx, dy,
-          coordBuffer,
-          triggerShape;
-
-      if ( this._shiftDown ) {
-        mode = ( shift === "default" ? defaultShift : shift );
-      }
-
-      if (this._supportTouch) {
-        current = [e.originalEvent.changedTouches[0].pageX - offset.left, e.originalEvent.changedTouches[0].pageY - offset.top];
-        this._multiTouchAnchor = [];
-        this._inOp = false;
-      } else {
-        current = [e.pageX - offset.left, e.pageY - offset.top];
-      }
-
-      if (this._softDblClick) {
-        if (this._isTap) {
-          dx = current[0] - this._anchor[0];
-          dy = current[1] - this._anchor[1];
-          if (Math.sqrt((dx * dx) + (dy * dy)) <= 8) {
-            current = $.merge( [ ], this._anchor );
-          }
-        }
-      }
-
-      dx = current[0] - this._anchor[0];
-      dy = current[1] - this._anchor[1];
-
-      this._$eventTarget.css("cursor", this._options["cursors"][this._options["mode"]]);
-
-      this._shiftDown = this._mouseDown = this._toolPan = false;
-
-      if ( this._isMultiTouch ) {
-        e.preventDefault( );
-        this._isMultiTouch = false;
-
-        this._wheelLevel = 0;
-
-        if ( doInteractiveTimeout ) {
-          this._setInteractiveTimeout( true );
-        }
-        return;
-      }
-
-      if (document.releaseCapture) {
-        document.releaseCapture();
-      }
-
-      if (mouseWasDown) {
-        clickDate = $.now();
-        this._current = current;
-
-        switch ( mode ) {
-          case "zoom":
-          case "dragBox":
-            if ( dx !== 0 || dy !== 0 ) {
-              var minSize = this._pixelSize * 6,
-                  bboxCoords = this._toMap( [ [
-                      Math.min( this._anchor[ 0 ], current[ 0 ] ),
-                      Math.max( this._anchor[ 1 ], current[ 1 ] )
-                    ], [
-                      Math.max( this._anchor[ 0 ], current[ 0 ] ),
-                      Math.min( this._anchor[ 1 ], current[ 1 ] )
-                    ]
-                  ] ),
-                  bbox = [
-                    bboxCoords[0][0],
-                    bboxCoords[0][1],
-                    bboxCoords[1][0],
-                    bboxCoords[1][1]
-                  ];
-
-              if ( mode === "zoom" ) {
-                if ( ( bbox[2] - bbox[0] ) < minSize && ( bbox[3] - bbox[1] ) < minSize ) {
-                  bbox = $.geo.scaleBy( this._getBbox( $.geo.center( bbox, true ) ), 0.5, true );
-                }
-
-                this._setBbox(bbox, true, true);
-                doInteractiveTimeout = true;
-              } else {
-                triggerShape = $.geo.polygonize( bbox, true );
-                triggerShape.bbox = bbox;
-
-                if ( this._userGeodetic ) {
-                  triggerShape.coordinates = $.geo.proj.toGeodetic( triggerShape.coordinates );
-                  triggerShape.bbox = $.geo.proj.toGeodetic( triggerShape.bbox );
-                }
-                this._trigger( "shape", e, triggerShape );
-              }
-            } else {
-              if ( mode === "dragBox" ) {
-                coordBuffer = this._toMap( current );
-
-                triggerShape = {
-                  type: "Point",
-                  coordinates: [ coordBuffer[ 0 ], coordBuffer[ 1 ] ],
-                  bbox: [ coordBuffer[ 0 ], coordBuffer[ 1 ], coordBuffer[ 0 ], coordBuffer[ 1 ] ]
-                };
-
-                if ( this._userGeodetic ) {
-                  triggerShape.coordinates = $.geo.proj.toGeodetic( triggerShape.coordinates );
-                  triggerShape.bbox = $.geo.proj.toGeodetic( triggerShape.bbox );
-                }
-
-                this._trigger( "shape", e, triggerShape );
-              }
-            }
-
-            this._resetDrawing();
-            break;
-
-          case "dragCircle":
-            if ( dx !== 0 || dy !== 0 ) {
-              var image = this._options[ "axisLayout" ] === "image",
-                  d = Math.sqrt( ( dx * dx) + ( dy * dy ) ),
-                  n = 180,
-                  a;
-
-              this._drawPixels.length = n + 1;
-
-              for ( i = 0; i < n; i++ ) {
-                a = ( i * 360 / n ) * ( Math.PI / 180 );
-                this._drawPixels[ i ] = [
-                  this._anchor[ 0 ] + Math.cos( a ) * d,
-                  this._anchor[ 1 ] + Math.sin( a ) * d
-                ];
-              }
-
-              this._drawPixels[ n ] = [
-                this._drawPixels[ 0 ][ 0 ],
-                this._drawPixels[ 0 ][ 1 ]
-              ];
-
-              // using coordBuffer for bbox coords
-              coordBuffer = this._toMap( [
-                [ this._anchor[ 0 ] - d, this._anchor[ 1 ] + ( image ? -d : d ) ],
-                [ this._anchor[ 0 ] + d, this._anchor[ 1 ] + ( image ? d : -d ) ]
-              ] );
-
-              triggerShape = {
-                type: "Polygon",
-                coordinates: [ this._toMap( this._drawPixels ) ],
-                bbox: [ coordBuffer[ 0 ][ 0 ], coordBuffer[ 0 ][ 1 ], coordBuffer[ 1 ][ 0 ], coordBuffer[ 1 ][ 1 ] ]
-              };
-
-              if ( this._userGeodetic ) {
-                triggerShape.coordinates = $.geo.proj.toGeodetic( triggerShape.coordinates );
-                triggerShape.bbox = $.geo.proj.toGeodetic( triggerShape.bbox );
-              }
-
-              this._trigger( "shape", e, triggerShape );
-
-              this._resetDrawing();
-            } else {
-              coordBuffer = this._toMap( current );
-
-              triggerShape = {
-                type: "Point",
-                coordinates: [ coordBuffer[ 0 ], coordBuffer[ 1 ] ],
-                bbox: [ coordBuffer[ 0 ], coordBuffer[ 1 ], coordBuffer[ 0 ], coordBuffer[ 1 ] ]
-              };
-
-              if ( this._userGeodetic ) {
-                triggerShape.coordinates = $.geo.proj.toGeodetic( triggerShape.coordinates );
-                triggerShape.bbox = $.geo.proj.toGeodetic( triggerShape.bbox );
-              }
-
-              this._trigger( "shape", e, triggerShape );
-            }
-            break;
-
-          case "drawPoint":
-            if (this._drawTimeout) {
-              window.clearTimeout(this._drawTimeout);
-              this._drawTimeout = null;
-            }
-
-            if (wasToolPan) {
-              this._panFinalize();
-            } else {
-              if (clickDate - this._clickDate > 100) {
-                var geomap = this;
-                this._drawTimeout = setTimeout(function () {
-                  if (geomap._drawTimeout) {
-                    geomap._trigger("shape", e, { type: "Point", coordinates: geomap.toMap(current) });
-                    geomap._inOp = false;
-                    geomap._drawTimeout = null;
-                  }
-                }, 250);
-              }
-            }
-            break;
-
-          case "drawLineString":
-          case "drawPolygon":
-          case "measureLength":
-          case "measureArea":
-            if (wasToolPan) {
-              this._panFinalize();
-            } else {
-              i = (this._drawCoords.length === 0 ? 0 : this._drawCoords.length - 1);
-
-              this._drawCoords[i] = this._toMap(current);
-              this._drawPixels[i] = current;
-
-              if (i < 2 || !(this._drawCoords[i][0] == this._drawCoords[i-1][0] &&
-                             this._drawCoords[i][1] == this._drawCoords[i-1][1])) {
-                this._drawCoords[i + 1] = this._toMap( current, this._centerInteractive, this._pixelSizeInteractive );
-                this._drawPixels[i + 1] = current;
-              }
-
-              this._refreshDrawing();
-            }
-            break;
-
-          default:
-            if (wasToolPan) {
-              this._panFinalize();
-            } else {
-              if (clickDate - this._clickDate > 100) {
-                this._trigger("click", e, { type: "Point", coordinates: this.toMap(current) });
-                this._inOp = false;
-              }
-            }
-            break;
-        }
-
-        this._clickDate = clickDate;
-
-        if (this._softDblClick && this._isDbltap) {
-          this._isDbltap = this._isTap = false;
-          if ( doInteractiveTimeout ) {
-            this._setInteractiveTimeout( true );
-          }
-          this._$eventTarget.trigger("dblclick", e);
-          return false;
-        }
-      }
-
-      if ( doInteractiveTimeout ) {
-        this._setInteractiveTimeout( true );
-      }
-
-      if ( this._inOp ) {
-        e.preventDefault();
-        return false;
-      }
-    },
-
-    _eventTarget_mousewheel: function (e, delta) {
-      if ( this._options[ "mode" ] === "static" || this._options[ "scroll" ] === "off" ) {
-        return;
-      }
-
-      e.preventDefault();
-
-      if ( this._mouseDown ) {
-        return false;
-      }
-
-      if (delta !== 0) {
-        this._clearInteractiveTimeout( );
-
-        if ( delta > 0 ) {
-          delta = Math.ceil( delta );
-        } else { 
-          delta = Math.floor( delta );
-        }
-
-        var offset = $(e.currentTarget).offset();
-        this._anchor = [e.pageX - offset.left, e.pageY - offset.top];
-
-        var wheelCenterAndSize = this._getZoomCenterAndSize( this._anchor, delta, this._options[ "tilingScheme" ] !== null ),
-            service,
-            i = 0;
-
-        this._setInteractiveCenterAndSize( wheelCenterAndSize.center, wheelCenterAndSize.pixelSize );
-        this._interactiveTransform( );
-
-        this._setInteractiveTimeout( true );
-      }
-
-      return false;
-    }
-  }
-  );
-}(jQuery));
-
diff --git a/libs/js/jquery-geo-1.0b2/js/jquery.geo.head.js b/libs/js/jquery-geo-1.0b2/js/jquery.geo.head.js
deleted file mode 100755 (executable)
index 9f9faaf..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// excanvas
-// Copyright 2006 Google Inc.
-//
-// 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.
-
-/* 
- * AppGeo/geo 
- * (c) 2007-2011, Applied Geographics, Inc. All rights reserved. 
- * Dual licensed under the MIT or GPL Version 2 licenses. 
- * http://jquery.org/license 
- */ 
-
diff --git a/libs/js/jquery-geo-1.0b2/js/jquery.geo.shingled.js b/libs/js/jquery-geo-1.0b2/js/jquery.geo.shingled.js
deleted file mode 100755 (executable)
index 0381566..0000000
+++ /dev/null
@@ -1,251 +0,0 @@
-(function ($, undefined) {
-  $.geo._serviceTypes.shingled = (function () {
-    return {
-      create: function (map, serviceContainer, service, index) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( !serviceState ) {
-          serviceState = {
-            loadCount: 0
-          };
-
-          var scHtml = '<div data-geo-service="shingled" style="-webkit-transform:translateZ(0);position:absolute; left:0; top:0; width:16px; height:16px; margin:0; padding:0;"></div>';
-
-          serviceContainer.append(scHtml);
-
-          serviceState.serviceContainer = serviceContainer.children(":last");
-          $.data(service, "geoServiceState", serviceState);
-        }
-
-        return serviceState.serviceContainer;
-      },
-
-      destroy: function (map, serviceContainer, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        serviceState.serviceContainer.remove();
-
-        $.removeData(service, "geoServiceState");
-      },
-
-      interactiveTransform: function ( map, service, center, pixelSize ) {
-        var serviceState = $.data( service, "geoServiceState" ),
-
-            contentBounds = map._getContentBounds(),
-            mapWidth = contentBounds[ "width" ],
-            mapHeight = contentBounds[ "height" ],
-
-            halfWidth = mapWidth / 2,
-            halfHeight = mapHeight / 2,
-
-            bbox = [ center[ 0 ] - halfWidth, center[ 1 ] - halfHeight, center[ 0 ] + halfWidth, center[ 1 ] + halfHeight ];
-
-        if ( serviceState ) {
-          this._cancelUnloaded( map, service );
-
-          serviceState.serviceContainer.children( ).each( function ( i ) {
-            var $scaleContainer = $(this),
-                scalePixelSize = $scaleContainer.data( "pixelSize" ),
-                scaleRatio = scalePixelSize / pixelSize;
-                
-            if ( scalePixelSize > 0 ) {
-              scaleRatio = Math.round(scaleRatio * 1000) / 1000;
-
-              var oldMapOrigin = $scaleContainer.data( "origin" ),
-                  newPixelPoint = map._toPixel( oldMapOrigin, center, pixelSize );
-
-              $scaleContainer.css( {
-                left: Math.round( newPixelPoint[ 0 ] ),
-                top: Math.round( newPixelPoint[ 1 ] ),
-                width: mapWidth * scaleRatio,
-                height: mapHeight * scaleRatio
-              } );
-            }
-          });
-        }
-      },
-
-      refresh: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        this._cancelUnloaded(map, service);
-
-        if ( serviceState && service && service.style.visibility === "visible" && !( serviceState.serviceContainer.is( ":hidden" ) ) ) {
-
-          var bbox = map._getBbox(),
-              pixelSize = map._pixelSize,
-
-              serviceObj = this,
-              serviceContainer = serviceState.serviceContainer,
-
-              contentBounds = map._getContentBounds(),
-              mapWidth = contentBounds["width"],
-              mapHeight = contentBounds["height"],
-
-              scaleContainer = serviceContainer.children('[data-pixel-size="' + pixelSize + '"]'),
-
-              opacity = service.style.opacity,
-
-              $img;
-
-          if (opacity < 1) {
-            serviceContainer.find("img").attr("data-keep-alive", "0");
-          }
-
-          if ( !scaleContainer.size() ) {
-            serviceContainer.append('<div style="-webkit-transform:translateZ(0);position:absolute; left:0px; top: 0px; width:' + mapWidth + 'px; height:' + mapHeight + 'px; margin:0; padding:0;" data-pixel-size="' + pixelSize + '" data-origin="[' + map._toMap( [ 0, 0 ] ) + ']"></div>');
-            scaleContainer = serviceContainer.children(":last");
-          }
-
-          var urlProp = ( service.hasOwnProperty("src") ? "src" : "getUrl" ),
-              urlArgs = {
-                bbox: bbox,
-                width: mapWidth,
-                height: mapHeight,
-                zoom: map._getZoom(),
-                tile: null,
-                index: 0
-              },
-              isFunc = $.isFunction( service[ urlProp ] ),
-              imageUrl,
-              imagePos = scaleContainer.position( );
-
-          imagePos.left = - ( imagePos.left );
-          imagePos.top = - ( imagePos.top );
-
-          if ( isFunc ) {
-            imageUrl = service[ urlProp ]( urlArgs );
-          } else {
-            $.templates( "geoSrc", service[ urlProp ] );
-            imageUrl = $.render[ "geoSrc" ]( urlArgs );
-          }
-
-          serviceState.loadCount++;
-          map._requestQueued();
-
-          scaleContainer.append('<img style="-webkit-transform:translateZ(0);position:absolute; left:' + ( imagePos.left / scaleContainer.width( ) * 100 ) + '%; top:' + ( imagePos.top / scaleContainer.height( ) * 100 ) + '%; width:100%; height:100%; margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;" unselectable="on" />');
-          $img = scaleContainer.children(":last").data("center", map._center);
-
-          if ( typeof imageUrl === "string" ) {
-            serviceObj._loadImage( $img, imageUrl, pixelSize, map, serviceState, opacity );
-          } else {
-            // assume Deferred
-            imageUrl.done( function( url ) {
-              serviceObj._loadImage( $img, url, pixelSize, map, serviceState, opacity );
-            } ).fail( function( ) {
-              $img.remove( );
-              serviceState.loadCount--;
-              map._requestComplete();
-            } );
-          }
-
-        }
-      },
-
-      resize: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( serviceState && service && service.style.visibility === "visible" ) {
-          this._cancelUnloaded(map, service);
-
-          var serviceContainer = serviceState.serviceContainer,
-
-              contentBounds = map._getContentBounds(),
-              mapWidth = contentBounds["width"],
-              mapHeight = contentBounds["height"],
-
-              scaleContainers = serviceContainer.children();
-
-          scaleContainers.attr("data-pixel-size", "0");
-
-          scaleContainers.each( function ( i ) {
-            var $scaleContainer = $(this),
-                position = $scaleContainer.position( );
-
-            var oldMapOrigin = $scaleContainer.data( "origin" ),
-                newPixelPoint = map._toPixel( oldMapOrigin );
-
-            $scaleContainer.css( {
-              left: position.left + ( mapWidth - $scaleContainer.width( ) ) / 2,
-              top: position.top + ( mapHeight - $scaleContainer.height( ) ) / 2
-            } );
-
-          } );
-            
-
-          /*
-          scaleContainer.css({
-            left: halfWidth + 'px',
-            top: halfHeight + 'px'
-          });
-          */
-        }
-      },
-
-      opacity: function ( map, service ) {
-        var serviceState = $.data( service, "geoServiceState" );
-        serviceState.serviceContainer.find( "img" ).stop( true ).fadeTo( "fast", service.style.opacity );
-      },
-
-      toggle: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-        serviceState.serviceContainer.css("display", service.style.visibility === "visible" ? "block" : "none");
-      },
-
-      _cancelUnloaded: function (map, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if (serviceState && serviceState.loadCount > 0) {
-          serviceState.serviceContainer.find("img:hidden").remove();
-          while (serviceState.loadCount > 0) {
-            serviceState.loadCount--;
-            map._requestComplete();
-          }
-        }
-      },
-
-      _loadImage: function ( $img, url, pixelSize, map, serviceState, opacity ) {
-        var serviceContainer = serviceState.serviceContainer;
-
-        $img.load(function (e) {
-          if ( !$.contains(document.body, e.target.jquery ? e.target[0] : e.target) ) {
-            // this image has been canceled and removed from the DOM
-            return;
-          }
-
-          if (opacity < 1) {
-            $(e.target).fadeTo(0, opacity);
-          } else {
-            $(e.target).show();
-          }
-
-          serviceState.loadCount--;
-          map._requestComplete();
-
-          if (serviceState.loadCount <= 0) {
-            // #newpanzoom
-            serviceContainer.children(':not([data-pixel-size="' + pixelSize + '"])').remove();
-
-            serviceContainer.find( "img[data-keep-alive]" ).remove( );
-
-            serviceState.loadCount = 0;
-          }
-        }).error(function (e) {
-          if ( !$.contains(document.body, e.target.jquery ? e.target[0] : e.target) ) {
-            // this image has been canceled and removed from the DOM
-            return;
-          }
-
-          $(e.target).remove();
-          serviceState.loadCount--;
-          map._requestComplete();
-
-          if (serviceState.loadCount <= 0) {
-            serviceContainer.children(":not([data-pixel-size='" + pixelSize + "'])").remove();
-            serviceState.loadCount = 0;
-          }
-        }).attr("src", url);
-      }
-    };
-  }());
-}(jQuery));
diff --git a/libs/js/jquery-geo-1.0b2/js/jquery.geo.tiled.js b/libs/js/jquery-geo-1.0b2/js/jquery.geo.tiled.js
deleted file mode 100755 (executable)
index fe61cc7..0000000
+++ /dev/null
@@ -1,303 +0,0 @@
-(function ($, undefined) {
-  $.geo._serviceTypes.tiled = (function () {
-    return {
-      create: function (map, serviceContainer, service, index) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        if ( !serviceState ) {
-          serviceState = {
-            loadCount: 0,
-            reloadTiles: false
-          };
-
-          var scHtml = '<div data-geo-service="tiled" style="-webkit-transform:translateZ(0); position:absolute; left:0; top:0; width:8px; height:8px; margin:0; padding:0;"></div>';
-
-          serviceContainer.append(scHtml);
-
-          serviceState.serviceContainer = serviceContainer.children( ":last" );
-
-          $.data(service, "geoServiceState", serviceState);
-        }
-
-        return serviceState.serviceContainer;
-      },
-
-      destroy: function (map, serviceContainer, service) {
-        var serviceState = $.data(service, "geoServiceState");
-
-        serviceState.serviceContainer.remove();
-
-        $.removeData(service, "geoServiceState");
-      },
-
-      interactiveTransform: function ( map, service, center, pixelSize ) {
-        //console.log( "tiled.interactiveTransform( " + center.join( ", " ) + ", " + pixelSize + ")" );
-        var serviceState = $.data( service, "geoServiceState" ),
-            tilingScheme = map.options[ "tilingScheme" ];
-
-        if ( serviceState ) {
-          this._cancelUnloaded( map, service );
-
-          serviceState.serviceContainer.children( ).each( function ( i ) {
-            var $scaleContainer = $(this),
-                scalePixelSize = $scaleContainer.data("pixelSize"),
-                scaleRatio = scalePixelSize / pixelSize;
-
-            if ( scalePixelSize > 0 ) {
-              scaleRatio = Math.round(scaleRatio * 1000) / 1000;
-
-              var oldMapCoord = $scaleContainer.data("scaleOrigin"),
-                  newPixelPoint = map._toPixel(oldMapCoord, center, pixelSize);
-
-              $scaleContainer.css( {
-                left: Math.round(newPixelPoint[0]) + "px",
-                top: Math.round(newPixelPoint[1]) + "px",
-                width: tilingScheme.tileWidth * scaleRatio,
-                height: tilingScheme.tileHeight * scaleRatio
-              } );
-
-              /*
-              if ( $("body")[0].filters !== undefined ) {
-                $scaleContainer.children().each( function ( i ) {
-                  $( this ).css( "filter", "progid:DXImageTransform.Microsoft.Matrix(FilterType=bilinear,M11=" + scaleRatio + ",M22=" + scaleRatio + ",sizingmethod='auto expand')" );
-                } );
-              }
-              */
-            }
-          });
-        }
-      },
-
-      refresh: function (map, service, force) {
-        //console.log( "tiled.refresh( " + map._center.join( ", " ) + ", " + map._pixelSize + ")" );
-        var serviceState = $.data( service, "geoServiceState" );
-
-        this._cancelUnloaded(map, service);
-
-        if ( serviceState && force ) {
-          // if hidden atm, we want to make sure we reload this service after it becomes visible
-          serviceState.reloadTiles = true;
-        }
-
-        if ( serviceState && service && service.style.visibility === "visible" && !( serviceState.serviceContainer.is( ":hidden" ) ) ) {
-          var bbox = map._getBbox(),
-              pixelSize = map._pixelSize,
-
-              serviceObj = this,
-              $serviceContainer = serviceState.serviceContainer,
-
-              contentBounds = map._getContentBounds(),
-              mapWidth = contentBounds["width"],
-              mapHeight = contentBounds["height"],
-
-              image = map.options[ "axisLayout" ] === "image",
-              ySign = image ? +1 : -1,
-
-              tilingScheme = map.options["tilingScheme"],
-              tileWidth = tilingScheme.tileWidth,
-              tileHeight = tilingScheme.tileHeight,
-
-              tileX = Math.floor((bbox[0] - tilingScheme.origin[0]) / (pixelSize * tileWidth)),
-              tileY = Math.max( Math.floor( ( image ? bbox[1] - tilingScheme.origin[1] : tilingScheme.origin[1] - bbox[ 3 ] ) / (pixelSize * tileHeight) ), 0 ),
-              tileX2 = Math.ceil((bbox[2] - tilingScheme.origin[0]) / (pixelSize * tileWidth)),
-              tileY2 = Math.ceil( ( image ? bbox[3] - tilingScheme.origin[1] : tilingScheme.origin[1] - bbox[ 1 ] ) / (pixelSize * tileHeight) ),
-
-              bboxMax = map._getBboxMax(),
-              pixelSizeAtZero = map._getPixelSize(0),
-              ratio = pixelSizeAtZero / pixelSize,
-              fullXAtScale = Math.floor((bboxMax[0] - tilingScheme.origin[0]) / (pixelSizeAtZero * tileWidth)) * ratio,
-              fullYAtScale = Math.floor((tilingScheme.origin[1] + ySign * bboxMax[3]) / (pixelSizeAtZero * tileHeight)) * ratio,
-
-              fullXMinX = tilingScheme.origin[0] + (fullXAtScale * tileWidth) * pixelSize,
-              fullYMinOrMaxY = tilingScheme.origin[1] + ySign * (fullYAtScale * tileHeight) * pixelSize,
-
-              serviceLeft = Math.round((fullXMinX - bbox[0]) / pixelSize),
-              serviceTop = Math.round( ( image ? fullYMinOrMaxY - bbox[1] : bbox[3] - fullYMinOrMaxY ) / pixelSize),
-
-              scaleContainers = $serviceContainer.children().show(),
-              scaleContainer = scaleContainers.filter("[data-pixel-size='" + pixelSize + "']").appendTo($serviceContainer),
-
-              opacity = service.style.opacity,
-
-              x, y,
-
-              loadImageDeferredDone = function( url ) {
-                // when a Deferred call is done, add the image to the map
-                // a reference to the correct img element is on the Deferred object itself
-                serviceObj._loadImage( $.data( this, "img" ), url, pixelSize, map, serviceState, opacity );
-              },
-
-              loadImageDeferredFail = function( ) {
-                $.data( this, "img" ).remove( );
-                serviceState.loadCount--;
-                map._requestComplete();
-              };
-
-          if (serviceState.reloadTiles) {
-            scaleContainers.find("img").attr("data-dirty", "true");
-          }
-
-          if (!scaleContainer.size()) {
-            $serviceContainer.append("<div style='-webkit-transform:translateZ(0);position:absolute; left:" + serviceLeft % tileWidth + "px; top:" + serviceTop % tileHeight + "px; width:" + tileWidth + "px; height:" + tileHeight + "px; margin:0; padding:0;' data-pixel-size='" + pixelSize + "'></div>");
-            scaleContainer = $serviceContainer.children(":last").data("scaleOrigin", map._toMap( [ (serviceLeft % tileWidth), (serviceTop % tileHeight) ] ) );
-          } else {
-            scaleContainer.css({
-              left: (serviceLeft % tileWidth) + "px",
-              top: (serviceTop % tileHeight) + "px"
-            }).data("scaleOrigin", map._toMap( [ (serviceLeft % tileWidth), (serviceTop % tileHeight) ] ) );
-
-            scaleContainer.children().each(function (i) {
-              var 
-              $img = $(this),
-              tile = $img.attr("data-tile").split(",");
-
-              $img.css({
-                left: Math.round(((parseInt(tile[0], 10) - fullXAtScale) * 100) + (serviceLeft - (serviceLeft % tileWidth)) / tileWidth * 100) + "%",
-                top: Math.round(((parseInt(tile[1], 10) - fullYAtScale) * 100) + (serviceTop - (serviceTop % tileHeight)) / tileHeight * 100) + "%"
-              });
-
-              if (opacity < 1) {
-                $img.fadeTo(0, opacity);
-              }
-            });
-          }
-
-          for (x = tileX; x < tileX2; x++) {
-            for (y = tileY; y < tileY2; y++) {
-              var tileStr = "" + x + "," + y,
-                  $img = scaleContainer.children("[data-tile='" + tileStr + "']").removeAttr("data-dirty");
-
-              if ($img.size() === 0 || serviceState.reloadTiles) {
-                var bottomLeft = [
-                      tilingScheme.origin[0] + (x * tileWidth) * pixelSize,
-                      tilingScheme.origin[1] + ySign * (y * tileHeight) * pixelSize
-                    ],
-
-                    topRight = [
-                      tilingScheme.origin[0] + ((x + 1) * tileWidth - 1) * pixelSize,
-                      tilingScheme.origin[1] + ySign * ((y + 1) * tileHeight - 1) * pixelSize
-                    ],
-
-                    tileBbox = [bottomLeft[0], bottomLeft[1], topRight[0], topRight[1]],
-
-                    urlProp = ( service.hasOwnProperty( "src" ) ? "src" : "getUrl" ),
-                    urlArgs = {
-                      bbox: tileBbox,
-                      width: tileWidth,
-                      height: tileHeight,
-                      zoom: map._getZoom(),
-                      tile: {
-                        row: y,
-                        column: x
-                      },
-                      index: Math.abs(y + x)
-                    },
-                    isFunc = $.isFunction( service[ urlProp ] ),
-                    imageUrl;
-
-                if ( isFunc ) {
-                  imageUrl = service[ urlProp ]( urlArgs );
-                } else {
-                  $.templates( "geoSrc", service[ urlProp ] );
-                  imageUrl = $.render[ "geoSrc" ]( urlArgs );
-                }
-
-                serviceState.loadCount++;
-                map._requestQueued();
-
-                if (serviceState.reloadTiles && $img.size() > 0) {
-                  $img.attr("src", imageUrl);
-                } else {
-                  var imgMarkup = "<img style='-webkit-transform:translateZ(0);position:absolute; " +
-                    "left:" + (((x - fullXAtScale) * 100) + (serviceLeft - (serviceLeft % tileWidth)) / tileWidth * 100) + "%; " +
-                    "top:" + (((y - fullYAtScale) * 100) + (serviceTop - (serviceTop % tileHeight)) / tileHeight * 100) + "%; ";
-
-                  imgMarkup += "width: 100%; height: 100%;";
-
-                  // #newpanzoom
-                  /*
-                  if ($("body")[0].filters === undefined) {
-                    imgMarkup += "width: 100%; height: 100%;";
-                  }
-                  */
-
-                  imgMarkup += "margin:0; padding:0; -khtml-user-select:none; -moz-user-select:none; -webkit-user-select:none; user-select:none; display:none;' unselectable='on' data-tile='" + tileStr + "' />";
-
-                  scaleContainer.append(imgMarkup);
-                  $img = scaleContainer.children(":last");
-                }
-
-                if ( typeof imageUrl === "string" ) {
-                  serviceObj._loadImage( $img, imageUrl, pixelSize, map, serviceState, opacity );
-                } else if ( imageUrl ) {
-                  // assume Deferred
-                  $.data( imageUrl, "img", $img );
-                  imageUrl.done( loadImageDeferredDone ).fail( loadImageDeferredFail );
-                } else {
-                  $img.remove( );
-                }
-              }
-            }
-          }
-
-          scaleContainers.find("[data-dirty]").remove();
-          serviceState.reloadTiles = false;
-        }
-      },
-
-      resize: function (map, service) {
-      },
-
-      opacity: function ( map, service ) {
-        var serviceState = $.data( service, "geoServiceState" );
-        serviceState.serviceContainer.find( "img" ).stop( true ).fadeTo( "fast", service.style.opacity );
-      },
-
-      toggle: function ( map, service ) {
-        var serviceState = $.data( service, "geoServiceState" );
-        serviceState.serviceContainer.css( "display", service.style.visibility === "visible" ? "block" : "none" );
-      },
-
-      _cancelUnloaded: function (map, service) {
-        var serviceState = $.data( service, "geoServiceState" );
-
-        if (serviceState && serviceState.loadCount > 0) {
-          serviceState.serviceContainer.find("img:hidden").remove();
-          while (serviceState.loadCount > 0) {
-            serviceState.loadCount--;
-            map._requestComplete();
-          }
-        }
-      },
-
-      _loadImage: function ( $img, url, pixelSize, map, serviceState, opacity ) {
-        var serviceContainer = serviceState.serviceContainer;
-
-        $img.load(function (e) {
-          if (opacity < 1) {
-            $(e.target).fadeTo(0, opacity);
-          } else {
-            $(e.target).show();
-          }
-
-          serviceState.loadCount--;
-          map._requestComplete();
-
-          if (serviceState.loadCount <= 0) {
-            serviceContainer.children(":not([data-pixel-size='" + pixelSize + "'])").remove();
-            serviceState.loadCount = 0;
-          }
-        }).error(function (e) {
-          $(e.target).remove();
-          serviceState.loadCount--;
-          map._requestComplete();
-
-          if (serviceState.loadCount <= 0) {
-            serviceContainer.children(":not([data-pixel-size='" + pixelSize + "'])").remove();
-            serviceState.loadCount = 0;
-          }
-        }).attr("src", url);
-      }
-    };
-  }());
-}(jQuery));
diff --git a/libs/js/jquery-geo-1.0b2/js/jquery.mousewheel.js b/libs/js/jquery-geo-1.0b2/js/jquery.mousewheel.js
deleted file mode 100755 (executable)
index 38b6095..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
- * Licensed under the MIT License (LICENSE.txt).
- *
- * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
- * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
- * Thanks to: Seamus Leahy for adding deltaX and deltaY
- *
- * Version: 3.0.6
- * 
- * Requires: 1.2.2+
- */
-
-(function($) {
-
-var types = ['DOMMouseScroll', 'mousewheel'];
-
-if ($.event.fixHooks) {
-    for ( var i=types.length; i; ) {
-        $.event.fixHooks[ types[--i] ] = $.event.mouseHooks;
-    }
-}
-
-$.event.special.mousewheel = {
-    setup: function() {
-        if ( this.addEventListener ) {
-            for ( var i=types.length; i; ) {
-                this.addEventListener( types[--i], handler, false );
-            }
-        } else {
-            this.onmousewheel = handler;
-        }
-    },
-    
-    teardown: function() {
-        if ( this.removeEventListener ) {
-            for ( var i=types.length; i; ) {
-                this.removeEventListener( types[--i], handler, false );
-            }
-        } else {
-            this.onmousewheel = null;
-        }
-    }
-};
-
-$.fn.extend({
-    mousewheel: function(fn) {
-        return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
-    },
-    
-    unmousewheel: function(fn) {
-        return this.unbind("mousewheel", fn);
-    }
-});
-
-
-function handler(event) {
-    var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
-    event = $.event.fix(orgEvent);
-    event.type = "mousewheel";
-    
-    // Old school scrollwheel delta
-    if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; }
-    if ( orgEvent.detail     ) { delta = -orgEvent.detail/3; }
-    
-    // New school multidimensional scroll (touchpads) deltas
-    deltaY = delta;
-    
-    // Gecko
-    if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
-        deltaY = 0;
-        deltaX = -1*delta;
-    }
-    
-    // Webkit
-    if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }
-    if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
-    
-    // Add event and delta to the front of the arguments
-    args.unshift(event, delta, deltaX, deltaY);
-    
-    return ($.event.dispatch || $.event.handle).apply(this, args);
-}
-
-})(jQuery);
diff --git a/libs/js/jquery-geo-1.0b2/js/jquery.mousewheel.min.js b/libs/js/jquery-geo-1.0b2/js/jquery.mousewheel.min.js
deleted file mode 100755 (executable)
index fc07ba5..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-/*! Copyright (c) 2011 Brandon Aaron (http://brandonaaron.net)
- * Licensed under the MIT License (LICENSE.txt).
- *
- * Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers.
- * Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix.
- * Thanks to: Seamus Leahy for adding deltaX and deltaY
- *
- * Version: 3.0.6
- * 
- * Requires: 1.2.2+
- */
-(function(a){function d(b){var c=b||window.event,d=[].slice.call(arguments,1),e=0,f=!0,g=0,h=0;return b=a.event.fix(c),b.type="mousewheel",c.wheelDelta&&(e=c.wheelDelta/120),c.detail&&(e=-c.detail/3),h=e,c.axis!==undefined&&c.axis===c.HORIZONTAL_AXIS&&(h=0,g=-1*e),c.wheelDeltaY!==undefined&&(h=c.wheelDeltaY/120),c.wheelDeltaX!==undefined&&(g=-1*c.wheelDeltaX/120),d.unshift(b,e,g,h),(a.event.dispatch||a.event.handle).apply(this,d)}var b=["DOMMouseScroll","mousewheel"];if(a.event.fixHooks)for(var c=b.length;c;)a.event.fixHooks[b[--c]]=a.event.mouseHooks;a.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a=b.length;a;)this.addEventListener(b[--a],d,!1);else this.onmousewheel=d},teardown:function(){if(this.removeEventListener)for(var a=b.length;a;)this.removeEventListener(b[--a],d,!1);else this.onmousewheel=null}},a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery);
diff --git a/libs/js/jquery-geo-1.0b2/js/jquery.ui.widget.js b/libs/js/jquery-geo-1.0b2/js/jquery.ui.widget.js
deleted file mode 100755 (executable)
index e13580f..0000000
+++ /dev/null
@@ -1,278 +0,0 @@
-/*!
- * jQuery UI Widget 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Widget
- */
-
-if ( ! $.widget ) {
-
-(function( $, undefined ) {
-
-// jQuery 1.4+
-if ( $.cleanData ) {
-       var _cleanData = $.cleanData;
-       $.cleanData = function( elems ) {
-               for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
-                       try {
-                               $( elem ).triggerHandler( "remove" );
-                       // http://bugs.jquery.com/ticket/8235
-                       } catch( e ) {}
-               }
-               _cleanData( elems );
-       };
-} else {
-       var _remove = $.fn.remove;
-       $.fn.remove = function( selector, keepData ) {
-               return this.each(function() {
-                       if ( !keepData ) {
-                               if ( !selector || $.filter( selector, [ this ] ).length ) {
-                                       $( "*", this ).add( [ this ] ).each(function() {
-                                               try {
-                                                       $( this ).triggerHandler( "remove" );
-                                               // http://bugs.jquery.com/ticket/8235
-                                               } catch( e ) {}
-                                       });
-                               }
-                       }
-                       return _remove.call( $(this), selector, keepData );
-               });
-       };
-}
-
-$.widget = function( name, base, prototype ) {
-       var namespace = name.split( "." )[ 0 ],
-               fullName;
-       name = name.split( "." )[ 1 ];
-       fullName = namespace + "-" + name;
-
-       if ( !prototype ) {
-               prototype = base;
-               base = $.Widget;
-       }
-
-       // create selector for plugin
-       $.expr[ ":" ][ fullName ] = function( elem ) {
-               return !!$.data( elem, name );
-       };
-
-       $[ namespace ] = $[ namespace ] || {};
-       $[ namespace ][ name ] = function( options, element ) {
-               // allow instantiation without initializing for simple inheritance
-               if ( arguments.length ) {
-                       this._createWidget( options, element );
-               }
-       };
-
-       var basePrototype = new base();
-       // we need to make the options hash a property directly on the new instance
-       // otherwise we'll modify the options hash on the prototype that we're
-       // inheriting from
-//     $.each( basePrototype, function( key, val ) {
-//             if ( $.isPlainObject(val) ) {
-//                     basePrototype[ key ] = $.extend( {}, val );
-//             }
-//     });
-       basePrototype.options = $.extend( true, {}, basePrototype.options );
-       $[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
-               namespace: namespace,
-               widgetName: name,
-               widgetEventPrefix: $[ namespace ][ name ].prototype.widgetEventPrefix || name,
-               widgetBaseClass: fullName
-       }, prototype );
-
-       $.widget.bridge( name, $[ namespace ][ name ] );
-};
-
-$.widget.bridge = function( name, object ) {
-       $.fn[ name ] = function( options ) {
-               var isMethodCall = typeof options === "string",
-                       args = Array.prototype.slice.call( arguments, 1 ),
-                       returnValue = this;
-
-               // allow multiple hashes to be passed on init
-               options = !isMethodCall && args.length ?
-                       $.extend.apply( null, [ true, options ].concat(args) ) :
-                       options;
-
-               // prevent calls to internal methods
-               if ( isMethodCall && options.charAt( 0 ) === "_" ) {
-                       return returnValue;
-               }
-
-               if ( isMethodCall ) {
-                       this.each(function() {
-                               var instance = $.data( this, name ),
-                                       methodValue = instance && $.isFunction( instance[options] ) ?
-                                               instance[ options ].apply( instance, args ) :
-                                               instance;
-                               // TODO: add this back in 1.9 and use $.error() (see #5972)
-//                             if ( !instance ) {
-//                                     throw "cannot call methods on " + name + " prior to initialization; " +
-//                                             "attempted to call method '" + options + "'";
-//                             }
-//                             if ( !$.isFunction( instance[options] ) ) {
-//                                     throw "no such method '" + options + "' for " + name + " widget instance";
-//                             }
-//                             var methodValue = instance[ options ].apply( instance, args );
-                               if ( methodValue !== instance && methodValue !== undefined ) {
-                                       returnValue = methodValue;
-                                       return false;
-                               }
-                       });
-               } else {
-                       this.each(function() {
-                               var instance = $.data( this, name );
-                               if ( instance ) {
-                                       instance.option( options || {} )._init();
-                               } else {
-                                       $.data( this, name, new object( options, this ) );
-                               }
-                       });
-               }
-
-               return returnValue;
-       };
-};
-
-$.Widget = function( options, element ) {
-       // allow instantiation without initializing for simple inheritance
-       if ( arguments.length ) {
-               this._createWidget( options, element );
-       }
-};
-
-$.Widget.prototype = {
-       widgetName: "widget",
-       widgetEventPrefix: "",
-       options: {
-               disabled: false
-       },
-       _createWidget: function( options, element ) {
-               // $.widget.bridge stores the plugin instance, but we do it anyway
-               // so that it's stored even before the _create function runs
-               $.data( element, this.widgetName, this );
-               this.element = $( element );
-               this.options = $.extend( true, {},
-                       this.options,
-                       this._getCreateOptions(),
-                       options );
-
-               var self = this;
-               this.element.bind( "remove." + this.widgetName, function() {
-                       self.destroy();
-               });
-
-               this._create();
-               this._trigger( "create" );
-               this._init();
-       },
-       _getCreateOptions: function() {
-               return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];
-       },
-       _create: function() {},
-       _init: function() {},
-
-       destroy: function() {
-               this.element
-                       .unbind( "." + this.widgetName )
-                       .removeData( this.widgetName );
-               this.widget()
-                       .unbind( "." + this.widgetName )
-                       .removeAttr( "aria-disabled" )
-                       .removeClass(
-                               this.widgetBaseClass + "-disabled " +
-                               "ui-state-disabled" );
-       },
-
-       widget: function() {
-               return this.element;
-       },
-
-       option: function( key, value ) {
-               var options = key;
-
-               if ( arguments.length === 0 ) {
-                       // don't return a reference to the internal hash
-                       return $.extend( {}, this.options );
-               }
-
-               if  (typeof key === "string" ) {
-                       if ( value === undefined ) {
-                               return this.options[ key ];
-                       }
-                       options = {};
-                       options[ key ] = value;
-               }
-
-               this._setOptions( options );
-
-               return this;
-       },
-       _setOptions: function( options ) {
-               var self = this;
-               $.each( options, function( key, value ) {
-                       self._setOption( key, value );
-               });
-
-               return this;
-       },
-       _setOption: function( key, value ) {
-               this.options[ key ] = value;
-
-               if ( key === "disabled" ) {
-                       this.widget()
-                               [ value ? "addClass" : "removeClass"](
-                                       this.widgetBaseClass + "-disabled" + " " +
-                                       "ui-state-disabled" )
-                               .attr( "aria-disabled", value );
-               }
-
-               return this;
-       },
-
-       enable: function() {
-               return this._setOption( "disabled", false );
-       },
-       disable: function() {
-               return this._setOption( "disabled", true );
-       },
-
-       _trigger: function( type, event, data ) {
-               var prop, orig,
-                       callback = this.options[ type ];
-
-               data = data || {};
-               event = $.Event( event );
-               event.type = ( type === this.widgetEventPrefix ?
-                       type :
-                       this.widgetEventPrefix + type ).toLowerCase();
-               // the original event may come from any element
-               // so we need to reset the target on the new event
-               event.target = this.element[ 0 ];
-
-               // copy original event properties over to the new event
-               orig = event.originalEvent;
-               if ( orig ) {
-                       for ( prop in orig ) {
-                               if ( !( prop in event ) ) {
-                                       event[ prop ] = orig[ prop ];
-                               }
-                       }
-               }
-
-               this.element.trigger( event, data );
-
-               return !( $.isFunction(callback) &&
-                       callback.call( this.element[0], event, data ) === false ||
-                       event.isDefaultPrevented() );
-       }
-};
-
-})( jQuery );
-
-};
-
diff --git a/libs/js/jquery-geo-1.0b2/js/jquery.ui.widget.min.js b/libs/js/jquery-geo-1.0b2/js/jquery.ui.widget.min.js
deleted file mode 100755 (executable)
index 8141910..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-/*!
- * jQuery UI Widget 1.8.18
- *
- * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * http://docs.jquery.com/UI/Widget
- */
-$.widget||function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){return c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}}),d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;return e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e,f&&e.charAt(0)==="_"?h:(f?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b)return h=f,!1}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))}),h)}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0)return a.extend({},this.options);if(typeof c=="string"){if(d===b)return this.options[c];e={},e[c]=d}return this._setOptions(e),this},_setOptions:function(b){var c=this;return a.each(b,function(a,b){c._setOption(a,b)}),this},_setOption:function(a,b){return this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e in f)e in c||(c[e]=f[e]);return this.element.trigger(c,d),!(a.isFunction(g)&&g.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}}(jQuery)
diff --git a/libs/js/jquery-geo-1.0b2/js/jsrender.js b/libs/js/jquery-geo-1.0b2/js/jsrender.js
deleted file mode 100755 (executable)
index 419fa45..0000000
+++ /dev/null
@@ -1,847 +0,0 @@
-/*! JsRender v1.0pre: http://github.com/BorisMoore/jsrender */
-/*
- * Optimized version of jQuery Templates, for rendering to string.
- * Does not require jQuery, or HTML DOM
- * Integrates with JsViews (http://github.com/BorisMoore/jsviews)
- * Copyright 2012, Boris Moore
- * Released under the MIT License.
- */
-// informal pre beta commit counter: 3
-
-this.jsviews || this.jQuery && jQuery.views || (function( window, undefined ) {
-
-//========================== Top-level vars ==========================
-
-var versionNumber = "v1.0pre",
-
-       $, rTag, rTmplString, extend,
-       sub = {},
-       FALSE = false, TRUE = true,
-       jQuery = window.jQuery,
-
-       rPath = /^(?:null|true|false|\d[\d.]*|([\w$]+|~([\w$]+)|#(view|([\w$]+))?)([\w$.]*?)(?:[.[]([\w$]+)\]?)?|(['"]).*\8)$/g,
-       //                                 nil    object   helper    view  viewProperty pathTokens   leafToken     string
-
-       rParams = /(\()(?=|\s*\()|(?:([([])\s*)?(?:([#~]?[\w$.]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*!:?\/]|(=))\s*|([#~]?[\w$.]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*([)\]])([([]?))|(\s+)/g,
-       //          lftPrn        lftPrn2                path    operator err                                                eq         path2       prn    comma   lftPrn2   apos quot        rtPrn   prn2   space
-       // (left paren? followed by (path? followed by operator) or (path followed by paren?)) or comma or apos or quot or right paren or space
-
-    rNewLine = /\r?\n/g,
-       rUnescapeQuotes = /\\(['"])/g,
-       rEscapeQuotes = /\\?(['"])/g,
-       rBuildHash = /\x08(~)?([^\x08]+)\x08/g,
-
-       autoViewKey = 0,
-       autoTmplName = 0,
-       escapeMapForHtml = {
-               "&": "&amp;",
-               "<": "&lt;",
-               ">": "&gt;"
-       },
-       tmplAttr = "data-jsv-tmpl",
-       fnDeclStr = "var j=j||" + (jQuery ? "jQuery." : "js") + "views,",
-       htmlSpecialChar = /[\x00"&'<>]/g,
-       slice = Array.prototype.slice,
-
-       render = {},
-
-       // jsviews object ($.views if jQuery is loaded)
-       jsv = {
-               jsviews: versionNumber,
-               sub: sub, // subscription, e.g. JsViews integration
-               debugMode: TRUE,
-               err: function( e ) {
-                       return jsv.debugMode ? ("<br/><b>Error:</b> <em> " + (e.message || e) + ". </em>") : '""';
-               },
-               tmplFn: tmplFn,
-               render: render,
-               templates: templates,
-               tags: tags,
-               helpers: helpers,
-               converters: converters,
-               View: View,
-               convert: convert,
-               delimiters: setDelimiters,
-               tag: renderTag
-       };
-
-//========================== Top-level functions ==========================
-
-//===================
-// jsviews.delimiters
-//===================
-
-function setDelimiters( openChars, closeChars ) {
-       // Set the tag opening and closing delimiters. Default is "{{" and "}}"
-       // openChar, closeChars: opening and closing strings, each with two characters
-       var firstOpenChar = "\\" + openChars.charAt( 0 ), // Escape the characters - since they could be regex special characters
-               secondOpenChar = "\\" + openChars.charAt( 1 ),
-               firstCloseChar = "\\" + closeChars.charAt( 0 ),
-               secondCloseChar = "\\" + closeChars.charAt( 1 );
-       // Build regex with new delimiters
-       jsv.rTag = rTag // make rTag available to JsViews (or other components) for parsing binding expressions
-               = secondOpenChar
-                       //          tag    (followed by / space or })   or  colon     or  html or code
-               + "(?:(?:(\\w+(?=[\\/\\s" + firstCloseChar + "]))|(?:(\\w+)?(:)|(>)|(\\*)))"
-               //     params
-               + "\\s*((?:[^" + firstCloseChar + "]|" + firstCloseChar + "(?!" + secondCloseChar + "))*?)"
-               //  slash or closeBlock
-               + "(\\/)?|(?:\\/(\\w+)))"
-       //  }}
-       + firstCloseChar;
-
-       // Default rTag:    tag          converter colon  html  code     params         slash   closeBlock
-       //          /{{(?:(?:(\w+(?=[\/\s\}]))|(?:(\w+)?(:)|(>)|(\*)))\s*((?:[^}]|}(?!\}))*?)(\/)?|(?:\/(\w+)))}}
-
-       //      /{{(?:(?:(\w+(?=[\/!\s\}!]))|(?:(\w+)?(:)|(>)|(\*)))((?:[^\}]|}(?!}))*?)(\/)?|(?:\/(\w+)))}}/g;
-       rTag = new RegExp( firstOpenChar + rTag + secondCloseChar, "g" );
-       rTmplString = new RegExp( "<.*>|" + openChars + ".*" + closeChars );
-       return this;
-}
-
-//=================
-// View.hlp
-//=================
-
-function getHelper( helper ) {
-       // Helper method called as view.hlp() from compiled template, for helper functions or template parameters ~foo
-       var view = this,
-       tmplHelpers = view.tmpl.helpers || {};
-       helper = (view.ctx[ helper ] !== undefined ? view.ctx : tmplHelpers[ helper ] !== undefined ? tmplHelpers : helpers[ helper ] !== undefined ? helpers : {})[ helper ];
-       return typeof helper !== "function" ? helper : function() {
-               return helper.apply(view, arguments);
-       };
-}
-
-//=================
-// jsviews.convert
-//=================
-
-function convert( converter, view, text ) {
-       var tmplConverters = view.tmpl.converters;
-       converter = tmplConverters && tmplConverters[ converter ] || converters[ converter ];
-       return converter ? converter.call( view, text ) : text;
-}
-
-//=================
-// jsviews.tag
-//=================
-
-function renderTag( tag, parentView, converter, content, tagObject ) {
-       // Called from within compiled template function, to render a nested tag
-       // Returns the rendered tag
-       tagObject.props = tagObject.props || {};
-       var ret,
-               tmpl = tagObject.props.tmpl,
-               tmplTags = parentView.tmpl.tags,
-               nestedTemplates = parentView.tmpl.templates,
-               args = arguments,
-               tagFn = tmplTags && tmplTags[ tag ] || tags[ tag ];
-
-       if ( !tagFn ) {
-               return "";
-       }
-       // Set the tmpl property to the content of the block tag, unless set as an override property on the tag
-       content = content && parentView.tmpl.tmpls[ content - 1 ];
-       tmpl = tmpl || content || undefined;
-       tagObject.tmpl =
-               "" + tmpl === tmpl // if a string
-                       ? nestedTemplates && nestedTemplates[ tmpl ] || templates[ tmpl ] || templates( tmpl )
-                       : tmpl;
-
-       tagObject.isTag = TRUE;
-       tagObject.converter = converter;
-       tagObject.view = parentView;
-       tagObject.renderContent = renderContent;
-       if ( parentView.ctx ) {
-               extend( tagObject.ctx, parentView.ctx);
-       }
-
-       ret = tagFn.apply( tagObject, args.length > 5 ? slice.call( args, 5 ) : [] );
-       return ret || ( ret == undefined ? "" : ret.toString()); // (If ret is the value 0 or false, will render to string)
-}
-
-//=================
-// View constructor
-//=================
-
-function View( context, path, parentView, data, template, index ) {
-       // Constructor for view object in view hierarchy. (Augmented by JsViews if JsViews is loaded)
-       var views = parentView.views,
-//     TODO: add this, as part of smart re-linking on existing content ($.link method), or remove completely
-//                     self = parentView.views[ index ];
-//                     if ( !self ) { ... }
-               self = {
-                       tmpl: template,
-                       path: path,
-                       parent: parentView,
-                       data: data,
-                       ctx: context,
-                       views: $.isArray( data ) ? [] : {},
-                       hlp: getHelper
-               };
-
-       if ( $.isArray( views ))  {
-               views.splice(
-                       self.index = index !== undefined
-                               ? index
-                               : views.length, 0, self
-               );
-       } else {
-               views[ self.index = "_" + autoViewKey++ ] = self;
-       }
-       return self;
-}
-
-//=================
-// Registration
-//=================
-
-function addToStore( self, store, name, item, process ) {
-       // Add item to named store such as templates, helpers, converters...
-       var key, onStore;
-       if ( name && typeof name === "object" && !name.nodeType ) {
-               // If name is a map, iterate over map and call store for key
-               for ( key in name ) {
-                       store( key, name[ key ]);
-               }
-               return self;
-       }
-       if ( !name || item === undefined ) {
-               if ( process ) {
-                       item = process( undefined, item || name );
-               }
-       } else if ( "" + name === name ) { // name must be a string
-               if ( item === null ) {
-                       // If item is null, delete this entry
-                       delete store[name];
-               } else if ( item = process ? process( name, item ) : item ) {
-                       store[ name ] = item;
-               }
-       }
-       if ( onStore = sub.onStoreItem ) {
-               // e.g. JsViews integration
-               onStore( store, name, item, process );
-       }
-       return item;
-}
-
-function templates( name, tmpl ) {
-       // Register templates
-       // Setter: Use $.view.tags( name, tagFn ) or $.view.tags({ name: tagFn, ... }) to add additional tags to the registered tags collection.
-       // Getter: Use var tagFn = $.views.tags( name ) or $.views.tags[name] or $.views.tags.name to return the function for the registered tag.
-       // Remove: Use $.view.tags( name, null ) to remove a registered tag from $.view.tags.
-
-       // When registering for {{foo a b c==d e=f}}, tagFn should be a function with the signature:
-       // function(a,b). The 'this' pointer will be a hash with properties c and e.
-       return addToStore( this, templates, name, tmpl, compile );
-}
-
-function tags( name, tagFn ) {
-       // Register template tags
-       // Setter: Use $.view.tags( name, tagFn ) or $.view.tags({ name: tagFn, ... }) to add additional tags to the registered tags collection.
-       // Getter: Use var tagFn = $.views.tags( name ) or $.views.tags[name] or $.views.tags.name to return the function for the registered tag.
-       // Remove: Use $.view.tags( name, null ) to remove a registered tag from $.view.tags.
-
-       // When registering for {{foo a b c==d e=f}}, tagFn should be a function with the signature:
-       // function(a,b). The 'this' pointer will be a hash with properties c and e.
-       return addToStore( this, tags, name, tagFn );
-}
-
-function helpers( name, helperFn ) {
-       // Register helper functions for use in templates (or in data-link expressions if JsViews is loaded)
-       // Setter: Use $.view.helpers( name, helperFn ) or $.view.helpers({ name: helperFn, ... }) to add additional helpers to the registered helpers collection.
-       // Getter: Use var helperFn = $.views.helpers( name ) or $.views.helpers[name] or $.views.helpers.name to return the function.
-       // Remove: Use $.view.helpers( name, null ) to remove a registered helper function from $.view.helpers.
-       // Within a template, access the helper using the syntax: {{... ~myHelper(...) ...}}.
-       return addToStore( this, helpers, name, helperFn );
-}
-
-function converters( name, converterFn ) {
-       // Register converter functions for use in templates (or in data-link expressions if JsViews is loaded)
-       // Setter: Use $.view.converters( name, converterFn ) or $.view.converters({ name: converterFn, ... }) to add additional converters to the registered converters collection.
-       // Getter: Use var converterFn = $.views.converters( name ) or $.views.converters[name] or $.views.converters.name to return the converter function.
-       // Remove: Use $.view.converters( name, null ) to remove a registered converter from $.view.converters.
-       // Within a template, access the converter using the syntax: {{myConverter:...}}.
-       return addToStore( this, converters, name, converterFn );
-}
-
-//=================
-// renderContent
-//=================
-
-function renderContent( data, context, parentView, path, index ) {
-       // Render template against data as a tree of subviews (nested template), or as a string (top-level template).
-       // tagName parameter for internal use only. Used for rendering templates registered as tags (which may have associated presenter objects)
-       var i, l, dataItem, newView, itemWrap, itemsWrap, itemResult, parentContext, tmpl, layout,
-               props = {},
-               swapContent = index === TRUE,
-               self = this,
-               result = "";
-
-       if ( self.isTag ) {
-               // This is a call from renderTag
-               tmpl = self.tmpl;
-               context = context || self.ctx;
-               parentView = parentView || self.view;
-               path = path || self.path;
-               index = index || self.index;
-               props = self.props;
-       } else {
-               tmpl = self.jquery && self[0] // This is a call $.fn.render
-                       || self; // This is a call from tmpl.render
-       }
-       parentView = parentView || jsv.topView;
-       parentContext = parentView.ctx;
-       layout = tmpl.layout;
-       if ( data === parentView ) {
-               // Inherit the data from the parent view.
-               // This may be the contents of an {{if}} block
-               data = parentView.data;
-               layout = TRUE;
-       }
-
-       // Set additional context on views created here, (as modified context inherited from the parent, and be inherited by child views)
-       // Note: If no jQuery, extend does not support chained copies - so limit extend() to two parameters
-       context = (context && context === parentContext)
-               ? parentContext
-               : (parentContext
-                       // if parentContext, make copy
-                       ? ((parentContext = extend( {}, parentContext ), context)
-                               // If context, merge context with copied parentContext
-                               ? extend( parentContext, context )
-                               : parentContext)
-                       // if no parentContext, use context, or default to {}
-                       : context || {});
-
-       if ( props.link === FALSE ) {
-               // Override inherited value of link by an explicit setting in props: link=false
-               // The child views of an unlinked view are also unlinked. So setting child back to true will not have any effect.
-               context.link = FALSE;
-       }
-       if ( !tmpl.fn ) {
-               tmpl = templates[ tmpl ] || templates( tmpl );
-       }
-       itemWrap = context.link && sub.onRenderItem;
-       itemsWrap = context.link && sub.onRenderItems;
-
-       if ( tmpl ) {
-               if ( $.isArray( data ) && !layout ) {
-                       // Create a view for the array, whose child views correspond to each data item.
-                       // (Note: if index and parentView are passed in along with parent view, treat as
-                       // insert -e.g. from view.addViews - so parentView is already the view item for array)
-                       newView = swapContent ? parentView : (index !== undefined && parentView) || View( context, path, parentView, data, tmpl, index );
-
-                       for ( i = 0, l = data.length; i < l; i++ ) {
-                               // Create a view for each data item.
-                               dataItem = data[ i ];
-                               itemResult = tmpl.fn( dataItem, View( context, path, newView, dataItem, tmpl, (index||0) + i ), jsv );
-                               result += itemWrap ? itemWrap( itemResult, props ) : itemResult;
-                       }
-               } else {
-                       // Create a view for singleton data object.
-                       newView = swapContent ? parentView : View( context, path, parentView, data, tmpl, index );
-                       result += (data || layout) ? tmpl.fn( data, newView, jsv ) : "";
-               }
-               parentView.topKey = newView.index;
-               return itemsWrap ? itemsWrap( result, path, newView.index, tmpl, props ) : result;
-       }
-       return ""; // No tmpl. Could throw...
-}
-
-//===========================
-// Build and compile template
-//===========================
-
-// Generate a reusable function that will serve to render a template against data
-// (Compile AST then build template function)
-
-function syntaxError() {
-       throw "Syntax error";
-}
-
-function tmplFn( markup, tmpl, bind ) {
-       // Compile markup to AST (abtract syntax tree) then build the template function code from the AST nodes
-       // Used for compiling templates, and also by JsViews to build functions for data link expressions
-       var newNode, node, i, l, code, hasTag, hasEncoder, getsValue, hasConverter, hasViewPath, tag, converter, params, hash, nestedTmpl, allowCode,
-               tmplOptions = tmpl ? {
-                       allowCode: allowCode = tmpl.allowCode,
-                       debug: tmpl.debug
-               } : {},
-               nested = tmpl && tmpl.tmpls,
-               astTop = [],
-               loc = 0,
-               stack = [],
-               content = astTop,
-               current = [,,,astTop],
-               nestedIndex = 0;
-
-       //==== nested functions ====
-       function pushPreceedingContent( shift ) {
-               shift -= loc;
-               if ( shift ) {
-                       content.push( markup.substr( loc, shift ).replace( rNewLine, "\\n" ));
-               }
-       }
-
-       function parseTag( all, tagName, converter, colon, html, code, params, slash, closeBlock, index ) {
-               //                  tag           converter colon  html  code     params         slash   closeBlock
-               //      /{{(?:(?:(\w+(?=[\/!\s\}!]))|(?:(\w+)?(:)|(?:(>)|(\*)))((?:[^\}]|}(?!}))*?)(\/)?|(?:\/(\w+)))}}/g;
-               // Build abstract syntax tree (AST): [ tagName, converter, params, content, hash, contentMarkup ]
-               if ( html ) {
-                       colon = ":";
-                       converter = "html";
-               }
-               var hash = "",
-                       passedCtx = "",
-                       block = !slash && !colon; // Block tag if not self-closing and not {{:}} or {{>}} (special case)
-
-               //==== nested helper function ====
-
-               tagName = tagName || colon;
-               pushPreceedingContent( index );
-               loc = index + all.length; // location marker - parsed up to here
-               if ( code ) {
-                       if ( allowCode ) {
-                               content.push([ "*", params.replace( rUnescapeQuotes, "$1" ) ]);
-                       }
-               } else if ( tagName ) {
-                       if ( tagName === "else" ) {
-                               current[ 5 ] = markup.substring( current[ 5 ], index ); // contentMarkup for block tag
-                               current = stack.pop();
-                               content = current[ 3 ];
-                               block = TRUE;
-                       }
-                       params = (params
-                               ? parseParams( params, bind )
-                                       .replace( rBuildHash, function( all, isCtx, keyValue ) {
-                                               if ( isCtx ) {
-                                                       passedCtx += keyValue + ",";
-                                               } else {
-                                                       hash += keyValue + ",";
-                                               }
-                                               return "";
-                                       })
-                               : "");
-                       hash = hash.slice( 0, -1 );
-                       params = params.slice( 0, -1 );
-                       newNode = [
-                               tagName,
-                               converter || "",
-                               params,
-                               block && [],
-                               "{" + (hash ? ("props:{" + hash + "},"): "") + "path:'" + params + "'" + (passedCtx ? ",ctx:{" + passedCtx.slice( 0, -1 ) + "}" : "") + "}"
-                       ];
-                       if ( block ) {
-                               stack.push( current );
-                               current = newNode;
-                               current[ 5 ] = loc; // Store current location of open tag, to be able to add contentMarkup when we reach closing tag
-                       }
-                       content.push( newNode );
-               } else if ( closeBlock ) {
-                       //if ( closeBlock !== current[ 0 ]) {
-                       //      throw "unmatched close tag: /" + closeBlock + ". Expected /" + current[ 0 ];
-                       //}
-                       current[ 5 ] = markup.substring( current[ 5 ], index ); // contentMarkup for block tag
-                       current = stack.pop();
-               }
-               if ( !current ) {
-                       throw "Expected block tag";
-               }
-               content = current[ 3 ];
-       }
-       //==== /end of nested functions ====
-
-       markup = markup.replace( rEscapeQuotes, "\\$1" );
-
-       // Build the AST (abstract syntax tree) under astTop
-       markup.replace( rTag, parseTag );
-
-       pushPreceedingContent( markup.length );
-
-       // Use the AST (astTop) to build the template function
-       l = astTop.length;
-       code = (l ? "" : '"";');
-
-       for ( i = 0; i < l; i++ ) {
-               // AST nodes: [ tagName, converter, params, content, hash, contentMarkup ]
-               node = astTop[ i ];
-               if ( node[ 0 ] === "*" ) {
-                       code = code.slice( 0, i ? -1 : -3 ) + ";" + node[ 1 ] + (i + 1 < l ? "ret+=" : "");
-               } else if ( "" + node === node ) { // type string
-                       code += '"' + node + '"+';
-               } else {
-                       tag = node[ 0 ];
-                       converter = node[ 1 ];
-                       params = node[ 2 ];
-                       content = node[ 3 ];
-                       hash = node[ 4 ];
-                       markup = node[ 5 ];
-                       if ( content ) {
-                               // Create template object for nested template
-                               nestedTmpl = TmplObject( markup, tmplOptions, tmpl, nestedIndex++ );
-                               // Compile to AST and then to compiled function
-                               tmplFn( markup, nestedTmpl);
-                               nested.push( nestedTmpl );
-                       }
-                       hasViewPath = hasViewPath || hash.indexOf( "view" ) > -1;
-                       code += (tag === ":"
-                               ? (converter === "html"
-                                       ? (hasEncoder = TRUE, "e(" + params)
-                                       : converter
-                                               ? (hasConverter = TRUE, 'c("' + converter + '",view,' + params)
-                                               : (getsValue = TRUE, "((v=" + params + ')!=u?v:""')
-                               )
-                               : (hasTag = TRUE, 't("' + tag + '",view,"' + (converter || "") + '",'
-                                       + (content ? nested.length : '""') // For block tags, pass in the key (nested.length) to the nested content template
-                                       + "," + hash + (params ? "," : "") + params))
-                                       + ")+";
-               }
-       }
-       code =  new Function( "data, view, j, b, u", fnDeclStr
-               + (getsValue ? "v," : "")
-               + (hasTag ? "t=j.tag," : "")
-               + (hasConverter ? "c=j.convert," : "")
-               + (hasEncoder ? "e=j.converters.html," : "")
-               + "ret; try{\n\n"
-               + (tmplOptions.debug ? "debugger;" : "")
-               + (allowCode ? 'ret=' : 'return ')
-               + code.slice( 0, -1 ) + ";\n\n"
-               + (allowCode ? "return ret;" : "")
-               + "}catch(e){return j.err(e);}"
-       );
-
-       // Include only the var references that are needed in the code
-       if ( tmpl ) {
-               tmpl.fn = code;
-               tmpl.useVw = hasConverter || hasViewPath || hasTag;
-       }
-       return code;
-}
-
-function parseParams( params, bind ) {
-       var named,
-               fnCall = {},
-               parenDepth = 0,
-               quoted = FALSE, // boolean for string content in double quotes
-               aposed = FALSE; // or in single quotes
-
-       function parseTokens( all, lftPrn0, lftPrn, path, operator, err, eq, path2, prn, comma, lftPrn2, apos, quot, rtPrn, prn2, space ) {
-               // rParams = /(?:([([])\s*)?(?:([#~]?[\w$.]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*!:?\/]|(=))\s*|([#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*([)\]])([([]?))|(\s+)/g,
-               //            lftPrn                  path    operator err                                                eq         path2       prn    comma   lftPrn3   apos quot        rtPrn   prn2   space
-               // (left paren? followed by (path? followed by operator) or (path followed by paren?)) or comma or apos or quot or right paren or space
-               operator = operator || "";
-               lftPrn = lftPrn || lftPrn0 || lftPrn2;
-               path = path || path2;
-               prn = prn || prn2 || "";
-               operator = operator || "";
-
-               function parsePath( all, object, helper, view, viewProperty, pathTokens, leafToken ) {
-               // rPath = /^(?:null|true|false|\d[\d.]*|([\w$]+|~([\w$]+)|#(view|([\w$]+))?)([\w$.]*?)(?:[.[]([\w$]+)\]?)?|(['"]).*\8)$/g,
-               //                                        object   helper    view  viewProperty pathTokens   leafToken     string
-                       if ( object ) {
-                               var ret = (helper
-                                       ? 'view.hlp("' + helper + '")'
-                                       : view
-                                               ? "view"
-                                               : "data")
-                               + (leafToken
-                                       ? (viewProperty
-                                               ? "." + viewProperty
-                                               : helper
-                                                       ? ""
-                                                       : (view ? "" : "." + object)
-                                               ) + (pathTokens || "")
-                                       : (leafToken = helper ? "" : view ? viewProperty || "" : object, ""));
-
-                               if ( bind && prn !== "(" ) {
-                                       ret = "b(" + ret + ',"' + leafToken + '")';
-                               }
-                               return ret + (leafToken ? "." + leafToken : "");
-                       }
-                       return all;
-               }
-
-               if ( err ) {
-                       syntaxError();
-               } else {
-                       return (aposed
-                               // within single-quoted string
-                               ? (aposed = !apos, (aposed ? all : '"'))
-                               : quoted
-                                       // within double-quoted string
-                                       ? (quoted = !quot, (quoted ? all : '"'))
-                                       :
-                               (
-                                       (lftPrn
-                                                       ? (parenDepth++, lftPrn)
-                                                       : "")
-                                       + (space
-                                               ? (parenDepth
-                                                       ? ""
-                                                       : named
-                                                               ? (named = FALSE, "\b")
-                                                               : ","
-                                               )
-                                               : eq
-                                                       // named param
-                                                       ? (parenDepth && syntaxError(), named = TRUE, '\b' + path + ':')
-                                                       : path
-                                                               // path
-                                                               ? (path.replace( rPath, parsePath )
-                                                                       + (prn
-                                                                               ? (fnCall[ ++parenDepth ] = TRUE, prn)
-                                                                               : operator)
-                                                               )
-                                                               : operator
-                                                                       ? all
-                                                                       : rtPrn
-                                                                               // function
-                                                                               ? ((fnCall[ parenDepth-- ] = FALSE, rtPrn)
-                                                                                       + (prn
-                                                                                               ? (fnCall[ ++parenDepth ] = TRUE, prn)
-                                                                                               : "")
-                                                                               )
-                                                                               : comma
-                                                                                       ? (fnCall[ parenDepth ] || syntaxError(), ",") // We don't allow top-level literal arrays or objects
-                                                                                       : lftPrn0
-                                                                                               ? ""
-                                                                                               : (aposed = apos, quoted = quot, '"')
-                               ))
-                       );
-               }
-       }
-       params = (params + " " ).replace( rParams, parseTokens );
-       return params;
-}
-
-function compile( name, tmpl, parent, options ) {
-       // tmpl is either a template object, a selector for a template script block, the name of a compiled template, or a template object
-       // options is the set of template properties, c
-       var tmplOrMarkup, elem, key, nested, nestedItem;
-
-       //==== nested functions ====
-       function tmplOrMarkupFromStr( value ) {
-               // If value is of type string - treat as selector, or name of compiled template
-               // Return the template object, if already compiled, or the markup string
-
-               if ( ("" + value === value) || value.nodeType > 0 ) {
-                       // If selector is valid and returns at least one element, get first element
-                       elem = value.nodeType > 0 ? value : !rTmplString.test( value ) && jQuery && jQuery( value )[0];
-                       if ( elem && elem.type ) {
-                               // It is a script element
-                               // Create a name for data linking if none provided
-                               value = templates[ elem.getAttribute( tmplAttr )];
-                               if ( !value ) {
-                                       // Not already compiled and cached, so compile and cache the name
-                                       name = name || "_" + autoTmplName++;
-                                       elem.setAttribute( tmplAttr, name );
-                                       value = compile( name, elem.innerHTML, parent, options ); // Use tmpl as options
-                                       templates[ name ] = value;
-                               }
-                       }
-                       return value;
-               }
-               // If value is not a string or dom element, return undefined
-       }
-
-       //==== Compile the template ====
-       tmplOrMarkup = tmplOrMarkupFromStr( tmpl );
-
-       // If tmpl is a template object, use it for options
-       options = options || (tmpl.markup ? tmpl : {});
-       options.name = name;
-       nested = options.templates;
-
-       // If tmpl is not a markup string or a selector string, then it must be a template object
-       // In that case, get it from the markup property of the object
-       if ( !tmplOrMarkup && tmpl.markup && (tmplOrMarkup = tmplOrMarkupFromStr( tmpl.markup ))) {
-               if ( tmplOrMarkup.fn && (tmplOrMarkup.debug !== tmpl.debug || tmplOrMarkup.allowCode !== tmpl.allowCode )) {
-                       // if the string references a compiled template object, but the debug or allowCode props are different, need to recompile
-                       tmplOrMarkup = tmplOrMarkup.markup;
-               }
-       }
-       if ( tmplOrMarkup !== undefined ) {
-               if ( name && !parent ) {
-                       render[ name ] = function() {
-                               return tmpl.render.apply( tmpl, arguments );
-                       };
-               }
-               if ( tmplOrMarkup.fn || tmpl.fn ) {
-                       // tmpl is already compiled, so use it, or if different name is provided, clone it
-                       if ( tmplOrMarkup.fn ) {
-                               if ( name && name !== tmplOrMarkup.name ) {
-                                       tmpl = extend( extend( {}, tmplOrMarkup ), options);
-                               } else {
-                                       tmpl = tmplOrMarkup;
-                               }
-                       }
-               } else {
-                       // tmplOrMarkup is a markup string, not a compiled template
-                       // Create template object
-                       tmpl = TmplObject( tmplOrMarkup, options, parent, 0 );
-                       // Compile to AST and then to compiled function
-                       tmplFn( tmplOrMarkup, tmpl );
-               }
-               for ( key in nested ) {
-                       // compile nested template declarations
-                       nestedItem = nested[ key ];
-                       if ( nestedItem.name !== key ) {
-                               nested[ key ] = compile( key, nestedItem, tmpl );
-                       }
-               }
-               return tmpl;
-       }
-}
-//==== /end of function compile ====
-
-function TmplObject( markup, options, parent, index ) {
-       // Template object constructor
-
-       // nested helper function
-       function extendStore( storeName ) {
-               if ( parent[ storeName ]) {
-                       // Include parent items except if overridden by item of same name in options
-                       tmpl[ storeName ] = extend( extend( {}, parent[ storeName ] ), options[ storeName ] );
-               }
-       }
-
-       options = options || {};
-       var tmpl = {
-                       markup: markup,
-                       tmpls: [],
-                       links: [],
-                       render: renderContent
-               };
-       if ( parent ) {
-               if ( parent.templates ) {
-                       tmpl.templates = extend( extend( {}, parent.templates ), options.templates );
-               }
-               tmpl.parent = parent;
-               tmpl.name = parent.name + "[" + index + "]";
-               tmpl.index = index;
-       }
-
-       extend( tmpl, options );
-       if ( parent ) {
-               extendStore( "templates" );
-               extendStore( "tags" );
-               extendStore( "helpers" );
-               extendStore( "converters" );
-       }
-       return tmpl;
-}
-
-//========================== Initialize ==========================
-
-if ( jQuery ) {
-       ////////////////////////////////////////////////////////////////////////////////////////////////
-       // jQuery is loaded, so make $ the jQuery object
-       $ = jQuery;
-       $.templates = templates;
-       $.render = render;
-       $.views = jsv;
-       $.fn.render = renderContent;
-
-} else {
-       ////////////////////////////////////////////////////////////////////////////////////////////////
-       // jQuery is not loaded.
-
-       $ = window.jsviews = jsv;
-       $.extend = function( target, source ) {
-               var name;
-               target =  target || {};
-               for ( name in source ) {
-                       target[ name ] = source[ name ];
-               }
-               return target;
-       };
-
-       $.isArray = Array && Array.isArray || function( obj ) {
-               return Object.prototype.toString.call( obj ) === "[object Array]";
-       };
-}
-
-extend = $.extend;
-
-jsv.topView = { views: {}, tmpl: {}, hlp: getHelper, ctx: jsv.helpers };
-
-function replacerForHtml( ch ) {
-       // Original code from Mike Samuel <msamuel@google.com>
-       return escapeMapForHtml[ ch ]
-               // Intentional assignment that caches the result of encoding ch.
-               || (escapeMapForHtml[ ch ] = "&#" + ch.charCodeAt( 0 ) + ";");
-}
-
-//========================== Register tags ==========================
-
-tags({
-       "if": function() {
-               var ifTag = this,
-                       view = ifTag.view;
-
-               view.onElse = function( tagObject, args ) {
-                       var i = 0,
-                               l = args.length;
-
-                       while ( l && !args[ i++ ]) {
-                               // Only render content if args.length === 0 (i.e. this is an else with no condition) or if a condition argument is truey
-                               if ( i === l ) {
-                                       return "";
-                               }
-                       }
-                       view.onElse = undefined; // If condition satisfied, so won't run 'else'.
-                       tagObject.path = "";
-                       return tagObject.renderContent( view );
-                       // Test is satisfied, so render content, while remaining in current data context
-                       // By passing the view, we inherit data context from the parent view, and the content is treated as a layout template
-                       // (so if the data is an array, it will not iterate over the data
-               };
-               return view.onElse( this, arguments );
-       },
-       "else": function() {
-               var view = this.view;
-               return view.onElse ? view.onElse( this, arguments ) : "";
-       },
-       "for": function() {
-               var i,
-                       self = this,
-                       result = "",
-                       args = arguments,
-                       l = args.length;
-               if ( self.props.layout ) {
-                       self.tmpl.layout = TRUE;
-               }
-               for ( i = 0; i < l; i++ ) {
-                       result += self.renderContent( args[ i ]);
-               }
-               return result;
-       },
-       "=": function( value ) {
-               return value;
-       },
-       "*": function( value ) {
-               return value;
-       }
-});
-
-//========================== Register global helpers ==========================
-
-//     helpers({ // Global helper functions
-//             // TODO add any useful built-in helper functions
-//     });
-
-//========================== Register converters ==========================
-
-converters({
-       html: function( text ) {
-               // HTML encoding helper: Replace < > & and ' and " by corresponding entities.
-               // inspired by Mike Samuel <msamuel@google.com>
-               return text != undefined ? String( text ).replace( htmlSpecialChar, replacerForHtml ) : "";
-       }
-});
-
-//========================== Define default delimiters ==========================
-setDelimiters( "{{", "}}" );
-
-})( this );
diff --git a/libs/js/jquery-geo-1.0b2/js/jsrender.min.js b/libs/js/jquery-geo-1.0b2/js/jsrender.min.js
deleted file mode 100755 (executable)
index 7c5987c..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/*! JsRender v1.0pre: http://github.com/BorisMoore/jsrender */
-/*
- * Optimized version of jQuery Templates, for rendering to string.
- * Does not require jQuery, or HTML DOM
- * Integrates with JsViews (http://github.com/BorisMoore/jsviews)
- * Copyright 2012, Boris Moore
- * Released under the MIT License.
- */
-this.jsviews||this.jQuery&&jQuery.views||function(a,b){function A(a,b){var c="\\"+a.charAt(0),d="\\"+a.charAt(1),g="\\"+b.charAt(0),h="\\"+b.charAt(1);return z.rTag=e=d+"(?:(?:(\\w+(?=[\\/\\s"+g+"]))|(?:(\\w+)?(:)|(>)|(\\*)))"+"\\s*((?:[^"+g+"]|"+g+"(?!"+h+"))*?)"+"(\\/)?|(?:\\/(\\w+)))"+g,e=new RegExp(c+e+h,"g"),f=new RegExp("<.*>|"+a+".*"+b),this}function B(a){var c=this,d=c.tmpl.helpers||{};return a=(c.ctx[a]!==b?c.ctx:d[a]!==b?d:I[a]!==b?I:{})[a],typeof a!="function"?a:function(){return a.apply(c,arguments)}}function C(a,b,c){var d=b.tmpl.converters;return a=d&&d[a]||J[a],a?a.call(b,c):c}function D(a,c,d,e,f){f.props=f.props||{};var h,i=f.props.tmpl,k=c.tmpl.tags,l=c.tmpl.templates,m=arguments,n=k&&k[a]||H[a];return n?(e=e&&c.tmpl.tmpls[e-1],i=i||e||b,f.tmpl=""+i===i?l&&l[i]||G[i]||G(i):i,f.isTag=j,f.converter=d,f.view=c,f.renderContent=K,c.ctx&&g(f.ctx,c.ctx),h=n.apply(f,m.length>5?x.call(m,5):[]),h||(h==b?"":h.toString())):""}function E(a,c,e,f,g,h){var i=e.views,j={tmpl:g,path:c,parent:e,data:f,ctx:a,views:d.isArray(f)?[]:{},hlp:B};return d.isArray(i)?i.splice(j.index=h!==b?h:i.length,0,j):i[j.index="_"+r++]=j,j}function F(a,c,d,e,f){var g,i;if(d&&typeof d=="object"&&!d.nodeType){for(g in d)c(g,d[g]);return a}if(!d||e===b)f&&(e=f(b,e||d));else if(""+d===d)if(e===null)delete c[d];else if(e=f?f(d,e):e)c[d]=e;return(i=h.onStoreItem)&&i(c,d,e,f),e}function G(a,b){return F(this,G,a,b,O)}function H(a,b){return F(this,H,a,b)}function I(a,b){return F(this,I,a,b)}function J(a,b){return F(this,J,a,b)}function K(a,c,e,f,k){var l,m,n,o,p,q,r,s,t,u,v={},w=k===j,x=this,y="";x.isTag?(t=x.tmpl,c=c||x.ctx,e=e||x.view,f=f||x.path,k=k||x.index,v=x.props):t=x.jquery&&x[0]||x,e=e||z.topView,s=e.ctx,u=t.layout,a===e&&(a=e.data,u=j),c=c&&c===s?s:s?(s=g({},s),c)?g(s,c):s:c||{},v.link===i&&(c.link=i),t.fn||(t=G[t]||G(t)),p=c.link&&h.onRenderItem,q=c.link&&h.onRenderItems;if(t){if(d.isArray(a)&&!u){o=w?e:k!==b&&e||E(c,f,e,a,t,k);for(l=0,m=a.length;l<m;l++)n=a[l],r=t.fn(n,E(c,f,o,n,t,(k||0)+l),z),y+=p?p(r,v):r}else o=w?e:E(c,f,e,a,t,k),y+=a||u?t.fn(a,o,z):"";return e.topKey=o.index,q?q(y,f,o.index,t,v):y}return""}function L(){throw"Syntax error"}function M(a,b,c){function I(b){b-=D,b&&F.push(a.substr(D,b).replace(n,"\\n"))}function J(b,e,f,g,h,i,k,l,m,n){h&&(g=":",f="html");var p="",r="",s=!l&&!g;e=e||g,I(n),D=n+b.length,i?z&&F.push(["*",k.replace(o,"$1")]):e?(e==="else"&&(G[5]=a.substring(G[5],n),G=E.pop(),F=G[3],s=j),k=k?N(k,c).replace(q,function(a,b,c){return b?r+=c+",":p+=c+",",""}):"",p=p.slice(0,-1),k=k.slice(0,-1),d=[e,f||"",k,s&&[],"{"+(p?"props:{"+p+"},":"")+"path:'"+k+"'"+(r?",ctx:{"+r.slice(0,-1)+"}":"")+"}"],s&&(E.push(G),G=d,G[5]=D),F.push(d)):m&&(G[5]=a.substring(G[5],n),G=E.pop());if(!G)throw"Expected block tag";F=G[3]}var d,f,g,h,i,k,l,m,r,s,t,u,w,x,y,z,A=b?{allowCode:z=b.allowCode,debug:b.debug}:{},B=b&&b.tmpls,C=[],D=0,E=[],F=C,G=[,,,C],H=0;a=a.replace(p,"\\$1"),a.replace(e,J),I(a.length),h=C.length,i=h?"":'"";';for(g=0;g<h;g++)f=C[g],f[0]==="*"?i=i.slice(0,g?-1:-3)+";"+f[1]+(g+1<h?"ret+=":""):""+f===f?i+='"'+f+'"+':(t=f[0],u=f[1],w=f[2],F=f[3],x=f[4],a=f[5],F&&(y=P(a,A,b,H++),M(a,y),B.push(y)),s=s||x.indexOf("view")>-1,i+=(t===":"?u==="html"?(l=j,"e("+w):u?(r=j,'c("'+u+'",view,'+w):(m=j,"((v="+w+')!=u?v:""'):(k=j,'t("'+t+'",view,"'+(u||"")+'",'+(F?B.length:'""')+","+x+(w?",":"")+w))+")+");return i=new Function("data, view, j, b, u",v+(m?"v,":"")+(k?"t=j.tag,":"")+(r?"c=j.convert,":"")+(l?"e=j.converters.html,":"")+"ret; try{\n\n"+(A.debug?"debugger;":"")+(z?"ret=":"return ")+i.slice(0,-1)+";\n\n"+(z?"return ret;":"")+"}catch(e){return j.err(e);}"),b&&(b.fn=i,b.useVw=r||s||k),i}function N(a,b){function h(a,h,k,m,n,o,p,q,r,s,t,u,v,w,x,y){function z(a,c,d,e,f,g,h){if(c){var i=(d?'view.hlp("'+d+'")':e?"view":"data")+(h?(f?"."+f:d?"":e?"":"."+c)+(g||""):(h=d?"":e?f||"":c,""));return b&&r!=="("&&(i="b("+i+',"'+h+'")'),i+(h?"."+h:"")}return a}n=n||"",k=k||h||t,m=m||q,r=r||x||"",n=n||"";if(o)L();else return g?(g=!u,g?a:'"'):f?(f=!v,f?a:'"'):(k?(e++,k):"")+(y?e?"":c?(c=i,"\b"):",":p?(e&&L(),c=j,"\b"+m+":"):m?m.replace(l,z)+(r?(d[++e]=j,r):n):n?a:w?(d[e--]=i,w)+(r?(d[++e]=j,r):""):s?(d[e]||L(),","):h?"":(g=u,f=v,'"'))}var c,d={},e=0,f=i,g=i;return a=(a+" ").replace(m,h),a}function O(a,c,d,e){function n(b){if(""+b===b||b.nodeType>0)return i=b.nodeType>0?b:!f.test(b)&&k&&k(b)[0],i&&i.type&&(b=G[i.getAttribute(u)],b||(a=a||"_"+s++,i.setAttribute(u,a),b=O(a,i.innerHTML,d,e),G[a]=b)),b}var h,i,j,l,m;h=n(c),e=e||(c.markup?c:{}),e.name=a,l=e.templates,!h&&c.markup&&(h=n(c.markup))&&h.fn&&(h.debug!==c.debug||h.allowCode!==c.allowCode)&&(h=h.markup);if(h!==b){a&&!d&&(y[a]=function(){return c.render.apply(c,arguments)}),h.fn||c.fn?h.fn&&(a&&a!==h.name?c=g(g({},h),e):c=h):(c=P(h,e,d,0),M(h,c));for(j in l)m=l[j],m.name!==j&&(l[j]=O(j,m,c));return c}}function P(a,b,c,d){function e(a){c[a]&&(f[a]=g(g({},c[a]),b[a]))}b=b||{};var f={markup:a,tmpls:[],links:[],render:K};return c&&(c.templates&&(f.templates=g(g({},c.templates),b.templates)),f.parent=c,f.name=c.name+"["+d+"]",f.index=d),g(f,b),c&&(e("templates"),e("tags"),e("helpers"),e("converters")),f}function Q(a){return t[a]||(t[a]="&#"+a.charCodeAt(0)+";")}var c="v1.0pre",d,e,f,g,h={},i=!1,j=!0,k=a.jQuery,l=/^(?:null|true|false|\d[\d.]*|([\w$]+|~([\w$]+)|#(view|([\w$]+))?)([\w$.]*?)(?:[.[]([\w$]+)\]?)?|(['"]).*\8)$/g,m=/(\()(?=|\s*\()|(?:([([])\s*)?(?:([#~]?[\w$.]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*!:?\/]|(=))\s*|([#~]?[\w$.]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*([)\]])([([]?))|(\s+)/g,n=/\r?\n/g,o=/\\(['"])/g,p=/\\?(['"])/g,q=/\x08(~)?([^\x08]+)\x08/g,r=0,s=0,t={"&":"&amp;","<":"&lt;",">":"&gt;"},u="data-jsv-tmpl",v="var j=j||"+(k?"jQuery.":"js")+"views,",w=/[\x00"&'<>]/g,x=Array.prototype.slice,y={},z={jsviews:c,sub:h,debugMode:j,err:function(a){return z.debugMode?"<br/><b>Error:</b> <em> "+(a.message||a)+". </em>":'""'},tmplFn:M,render:y,templates:G,tags:H,helpers:I,converters:J,View:E,convert:C,delimiters:A,tag:D};k?(d=k,d.templates=G,d.render=y,d.views=z,d.fn.render=K):(d=a.jsviews=z,d.extend=function(a,b){var c;a=a||{};for(c in b)a[c]=b[c];return a},d.isArray=Array&&Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"}),g=d.extend,z.topView={views:{},tmpl:{},hlp:B,ctx:z.helpers},H({"if":function(){var a=this,c=a.view;return c.onElse=function(a,d){var e=0,f=d.length;while(f&&!d[e++])if(e===f)return"";return c.onElse=b,a.path="",a.renderContent(c)},c.onElse(this,arguments)},"else":function(){var a=this.view;return a.onElse?a.onElse(this,arguments):""},"for":function(){var a,b=this,c="",d=arguments,e=d.length;b.props.layout&&(b.tmpl.layout=j);for(a=0;a<e;a++)c+=b.renderContent(d[a]);return c},"=":function(a){return a},"*":function(a){return a}}),J({html:function(a){return a!=b?String(a).replace(w,Q):""}}),A("{{","}}")}(this)
diff --git a/libs/js/jquery-geo-1.0b2/libs/jquery/jquery.js b/libs/js/jquery-geo-1.0b2/libs/jquery/jquery.js
deleted file mode 100755 (executable)
index 3774ff9..0000000
+++ /dev/null
@@ -1,9404 +0,0 @@
-/*!
- * jQuery JavaScript Library v1.7.2
- * http://jquery.com/
- *
- * Copyright 2011, John Resig
- * Dual licensed under the MIT or GPL Version 2 licenses.
- * http://jquery.org/license
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- * Copyright 2011, The Dojo Foundation
- * Released under the MIT, BSD, and GPL Licenses.
- *
- * Date: Wed Mar 21 12:46:34 2012 -0700
- */
-(function( window, undefined ) {
-
-// Use the correct document accordingly with window argument (sandbox)
-var document = window.document,
-       navigator = window.navigator,
-       location = window.location;
-var jQuery = (function() {
-
-// Define a local copy of jQuery
-var jQuery = function( selector, context ) {
-               // The jQuery object is actually just the init constructor 'enhanced'
-               return new jQuery.fn.init( selector, context, rootjQuery );
-       },
-
-       // Map over jQuery in case of overwrite
-       _jQuery = window.jQuery,
-
-       // Map over the $ in case of overwrite
-       _$ = window.$,
-
-       // A central reference to the root jQuery(document)
-       rootjQuery,
-
-       // A simple way to check for HTML strings or ID strings
-       // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
-       quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
-
-       // Check if a string has a non-whitespace character in it
-       rnotwhite = /\S/,
-
-       // Used for trimming whitespace
-       trimLeft = /^\s+/,
-       trimRight = /\s+$/,
-
-       // Match a standalone tag
-       rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
-
-       // JSON RegExp
-       rvalidchars = /^[\],:{}\s]*$/,
-       rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
-       rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
-       rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
-
-       // Useragent RegExp
-       rwebkit = /(webkit)[ \/]([\w.]+)/,
-       ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
-       rmsie = /(msie) ([\w.]+)/,
-       rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
-
-       // Matches dashed string for camelizing
-       rdashAlpha = /-([a-z]|[0-9])/ig,
-       rmsPrefix = /^-ms-/,
-
-       // Used by jQuery.camelCase as callback to replace()
-       fcamelCase = function( all, letter ) {
-               return ( letter + "" ).toUpperCase();
-       },
-
-       // Keep a UserAgent string for use with jQuery.browser
-       userAgent = navigator.userAgent,
-
-       // For matching the engine and version of the browser
-       browserMatch,
-
-       // The deferred used on DOM ready
-       readyList,
-
-       // The ready event handler
-       DOMContentLoaded,
-
-       // Save a reference to some core methods
-       toString = Object.prototype.toString,
-       hasOwn = Object.prototype.hasOwnProperty,
-       push = Array.prototype.push,
-       slice = Array.prototype.slice,
-       trim = String.prototype.trim,
-       indexOf = Array.prototype.indexOf,
-
-       // [[Class]] -> type pairs
-       class2type = {};
-
-jQuery.fn = jQuery.prototype = {
-       constructor: jQuery,
-       init: function( selector, context, rootjQuery ) {
-               var match, elem, ret, doc;
-
-               // Handle $(""), $(null), or $(undefined)
-               if ( !selector ) {
-                       return this;
-               }
-
-               // Handle $(DOMElement)
-               if ( selector.nodeType ) {
-                       this.context = this[0] = selector;
-                       this.length = 1;
-                       return this;
-               }
-
-               // The body element only exists once, optimize finding it
-               if ( selector === "body" && !context && document.body ) {
-                       this.context = document;
-                       this[0] = document.body;
-                       this.selector = selector;
-                       this.length = 1;
-                       return this;
-               }
-
-               // Handle HTML strings
-               if ( typeof selector === "string" ) {
-                       // Are we dealing with HTML string or an ID?
-                       if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
-                               // Assume that strings that start and end with <> are HTML and skip the regex check
-                               match = [ null, selector, null ];
-
-                       } else {
-                               match = quickExpr.exec( selector );
-                       }
-
-                       // Verify a match, and that no context was specified for #id
-                       if ( match && (match[1] || !context) ) {
-
-                               // HANDLE: $(html) -> $(array)
-                               if ( match[1] ) {
-                                       context = context instanceof jQuery ? context[0] : context;
-                                       doc = ( context ? context.ownerDocument || context : document );
-
-                                       // If a single string is passed in and it's a single tag
-                                       // just do a createElement and skip the rest
-                                       ret = rsingleTag.exec( selector );
-
-                                       if ( ret ) {
-                                               if ( jQuery.isPlainObject( context ) ) {
-                                                       selector = [ document.createElement( ret[1] ) ];
-                                                       jQuery.fn.attr.call( selector, context, true );
-
-                                               } else {
-                                                       selector = [ doc.createElement( ret[1] ) ];
-                                               }
-
-                                       } else {
-                                               ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
-                                               selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
-                                       }
-
-                                       return jQuery.merge( this, selector );
-
-                               // HANDLE: $("#id")
-                               } else {
-                                       elem = document.getElementById( match[2] );
-
-                                       // Check parentNode to catch when Blackberry 4.6 returns
-                                       // nodes that are no longer in the document #6963
-                                       if ( elem && elem.parentNode ) {
-                                               // Handle the case where IE and Opera return items
-                                               // by name instead of ID
-                                               if ( elem.id !== match[2] ) {
-                                                       return rootjQuery.find( selector );
-                                               }
-
-                                               // Otherwise, we inject the element directly into the jQuery object
-                                               this.length = 1;
-                                               this[0] = elem;
-                                       }
-
-                                       this.context = document;
-                                       this.selector = selector;
-                                       return this;
-                               }
-
-                       // HANDLE: $(expr, $(...))
-                       } else if ( !context || context.jquery ) {
-                               return ( context || rootjQuery ).find( selector );
-
-                       // HANDLE: $(expr, context)
-                       // (which is just equivalent to: $(context).find(expr)
-                       } else {
-                               return this.constructor( context ).find( selector );
-                       }
-
-               // HANDLE: $(function)
-               // Shortcut for document ready
-               } else if ( jQuery.isFunction( selector ) ) {
-                       return rootjQuery.ready( selector );
-               }
-
-               if ( selector.selector !== undefined ) {
-                       this.selector = selector.selector;
-                       this.context = selector.context;
-               }
-
-               return jQuery.makeArray( selector, this );
-       },
-
-       // Start with an empty selector
-       selector: "",
-
-       // The current version of jQuery being used
-       jquery: "1.7.2",
-
-       // The default length of a jQuery object is 0
-       length: 0,
-
-       // The number of elements contained in the matched element set
-       size: function() {
-               return this.length;
-       },
-
-       toArray: function() {
-               return slice.call( this, 0 );
-       },
-
-       // Get the Nth element in the matched element set OR
-       // Get the whole matched element set as a clean array
-       get: function( num ) {
-               return num == null ?
-
-                       // Return a 'clean' array
-                       this.toArray() :
-
-                       // Return just the object
-                       ( num < 0 ? this[ this.length + num ] : this[ num ] );
-       },
-
-       // Take an array of elements and push it onto the stack
-       // (returning the new matched element set)
-       pushStack: function( elems, name, selector ) {
-               // Build a new jQuery matched element set
-               var ret = this.constructor();
-
-               if ( jQuery.isArray( elems ) ) {
-                       push.apply( ret, elems );
-
-               } else {
-                       jQuery.merge( ret, elems );
-               }
-
-               // Add the old object onto the stack (as a reference)
-               ret.prevObject = this;
-
-               ret.context = this.context;
-
-               if ( name === "find" ) {
-                       ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
-               } else if ( name ) {
-                       ret.selector = this.selector + "." + name + "(" + selector + ")";
-               }
-
-               // Return the newly-formed element set
-               return ret;
-       },
-
-       // Execute a callback for every element in the matched set.
-       // (You can seed the arguments with an array of args, but this is
-       // only used internally.)
-       each: function( callback, args ) {
-               return jQuery.each( this, callback, args );
-       },
-
-       ready: function( fn ) {
-               // Attach the listeners
-               jQuery.bindReady();
-
-               // Add the callback
-               readyList.add( fn );
-
-               return this;
-       },
-
-       eq: function( i ) {
-               i = +i;
-               return i === -1 ?
-                       this.slice( i ) :
-                       this.slice( i, i + 1 );
-       },
-
-       first: function() {
-               return this.eq( 0 );
-       },
-
-       last: function() {
-               return this.eq( -1 );
-       },
-
-       slice: function() {
-               return this.pushStack( slice.apply( this, arguments ),
-                       "slice", slice.call(arguments).join(",") );
-       },
-
-       map: function( callback ) {
-               return this.pushStack( jQuery.map(this, function( elem, i ) {
-                       return callback.call( elem, i, elem );
-               }));
-       },
-
-       end: function() {
-               return this.prevObject || this.constructor(null);
-       },
-
-       // For internal use only.
-       // Behaves like an Array's method, not like a jQuery method.
-       push: push,
-       sort: [].sort,
-       splice: [].splice
-};
-
-// Give the init function the jQuery prototype for later instantiation
-jQuery.fn.init.prototype = jQuery.fn;
-
-jQuery.extend = jQuery.fn.extend = function() {
-       var options, name, src, copy, copyIsArray, clone,
-               target = arguments[0] || {},
-               i = 1,
-               length = arguments.length,
-               deep = false;
-
-       // Handle a deep copy situation
-       if ( typeof target === "boolean" ) {
-               deep = target;
-               target = arguments[1] || {};
-               // skip the boolean and the target
-               i = 2;
-       }
-
-       // Handle case when target is a string or something (possible in deep copy)
-       if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
-               target = {};
-       }
-
-       // extend jQuery itself if only one argument is passed
-       if ( length === i ) {
-               target = this;
-               --i;
-       }
-
-       for ( ; i < length; i++ ) {
-               // Only deal with non-null/undefined values
-               if ( (options = arguments[ i ]) != null ) {
-                       // Extend the base object
-                       for ( name in options ) {
-                               src = target[ name ];
-                               copy = options[ name ];
-
-                               // Prevent never-ending loop
-                               if ( target === copy ) {
-                                       continue;
-                               }
-
-                               // Recurse if we're merging plain objects or arrays
-                               if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
-                                       if ( copyIsArray ) {
-                                               copyIsArray = false;
-                                               clone = src && jQuery.isArray(src) ? src : [];
-
-                                       } else {
-                                               clone = src && jQuery.isPlainObject(src) ? src : {};
-                                       }
-
-                                       // Never move original objects, clone them
-                                       target[ name ] = jQuery.extend( deep, clone, copy );
-
-                               // Don't bring in undefined values
-                               } else if ( copy !== undefined ) {
-                                       target[ name ] = copy;
-                               }
-                       }
-               }
-       }
-
-       // Return the modified object
-       return target;
-};
-
-jQuery.extend({
-       noConflict: function( deep ) {
-               if ( window.$ === jQuery ) {
-                       window.$ = _$;
-               }
-
-               if ( deep && window.jQuery === jQuery ) {
-                       window.jQuery = _jQuery;
-               }
-
-               return jQuery;
-       },
-
-       // Is the DOM ready to be used? Set to true once it occurs.
-       isReady: false,
-
-       // A counter to track how many items to wait for before
-       // the ready event fires. See #6781
-       readyWait: 1,
-
-       // Hold (or release) the ready event
-       holdReady: function( hold ) {
-               if ( hold ) {
-                       jQuery.readyWait++;
-               } else {
-                       jQuery.ready( true );
-               }
-       },
-
-       // Handle when the DOM is ready
-       ready: function( wait ) {
-               // Either a released hold or an DOMready/load event and not yet ready
-               if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
-                       // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
-                       if ( !document.body ) {
-                               return setTimeout( jQuery.ready, 1 );
-                       }
-
-                       // Remember that the DOM is ready
-                       jQuery.isReady = true;
-
-                       // If a normal DOM Ready event fired, decrement, and wait if need be
-                       if ( wait !== true && --jQuery.readyWait > 0 ) {
-                               return;
-                       }
-
-                       // If there are functions bound, to execute
-                       readyList.fireWith( document, [ jQuery ] );
-
-                       // Trigger any bound ready events
-                       if ( jQuery.fn.trigger ) {
-                               jQuery( document ).trigger( "ready" ).off( "ready" );
-                       }
-               }
-       },
-
-       bindReady: function() {
-               if ( readyList ) {
-                       return;
-               }
-
-               readyList = jQuery.Callbacks( "once memory" );
-
-               // Catch cases where $(document).ready() is called after the
-               // browser event has already occurred.
-               if ( document.readyState === "complete" ) {
-                       // Handle it asynchronously to allow scripts the opportunity to delay ready
-                       return setTimeout( jQuery.ready, 1 );
-               }
-
-               // Mozilla, Opera and webkit nightlies currently support this event
-               if ( document.addEventListener ) {
-                       // Use the handy event callback
-                       document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
-
-                       // A fallback to window.onload, that will always work
-                       window.addEventListener( "load", jQuery.ready, false );
-
-               // If IE event model is used
-               } else if ( document.attachEvent ) {
-                       // ensure firing before onload,
-                       // maybe late but safe also for iframes
-                       document.attachEvent( "onreadystatechange", DOMContentLoaded );
-
-                       // A fallback to window.onload, that will always work
-                       window.attachEvent( "onload", jQuery.ready );
-
-                       // If IE and not a frame
-                       // continually check to see if the document is ready
-                       var toplevel = false;
-
-                       try {
-                               toplevel = window.frameElement == null;
-                       } catch(e) {}
-
-                       if ( document.documentElement.doScroll && toplevel ) {
-                               doScrollCheck();
-                       }
-               }
-       },
-
-       // See test/unit/core.js for details concerning isFunction.
-       // Since version 1.3, DOM methods and functions like alert
-       // aren't supported. They return false on IE (#2968).
-       isFunction: function( obj ) {
-               return jQuery.type(obj) === "function";
-       },
-
-       isArray: Array.isArray || function( obj ) {
-               return jQuery.type(obj) === "array";
-       },
-
-       isWindow: function( obj ) {
-               return obj != null && obj == obj.window;
-       },
-
-       isNumeric: function( obj ) {
-               return !isNaN( parseFloat(obj) ) && isFinite( obj );
-       },
-
-       type: function( obj ) {
-               return obj == null ?
-                       String( obj ) :
-                       class2type[ toString.call(obj) ] || "object";
-       },
-
-       isPlainObject: function( obj ) {
-               // Must be an Object.
-               // Because of IE, we also have to check the presence of the constructor property.
-               // Make sure that DOM nodes and window objects don't pass through, as well
-               if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
-                       return false;
-               }
-
-               try {
-                       // Not own constructor property must be Object
-                       if ( obj.constructor &&
-                               !hasOwn.call(obj, "constructor") &&
-                               !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
-                               return false;
-                       }
-               } catch ( e ) {
-                       // IE8,9 Will throw exceptions on certain host objects #9897
-                       return false;
-               }
-
-               // Own properties are enumerated firstly, so to speed up,
-               // if last one is own, then all properties are own.
-
-               var key;
-               for ( key in obj ) {}
-
-               return key === undefined || hasOwn.call( obj, key );
-       },
-
-       isEmptyObject: function( obj ) {
-               for ( var name in obj ) {
-                       return false;
-               }
-               return true;
-       },
-
-       error: function( msg ) {
-               throw new Error( msg );
-       },
-
-       parseJSON: function( data ) {
-               if ( typeof data !== "string" || !data ) {
-                       return null;
-               }
-
-               // Make sure leading/trailing whitespace is removed (IE can't handle it)
-               data = jQuery.trim( data );
-
-               // Attempt to parse using the native JSON parser first
-               if ( window.JSON && window.JSON.parse ) {
-                       return window.JSON.parse( data );
-               }
-
-               // Make sure the incoming data is actual JSON
-               // Logic borrowed from http://json.org/json2.js
-               if ( rvalidchars.test( data.replace( rvalidescape, "@" )
-                       .replace( rvalidtokens, "]" )
-                       .replace( rvalidbraces, "")) ) {
-
-                       return ( new Function( "return " + data ) )();
-
-               }
-               jQuery.error( "Invalid JSON: " + data );
-       },
-
-       // Cross-browser xml parsing
-       parseXML: function( data ) {
-               if ( typeof data !== "string" || !data ) {
-                       return null;
-               }
-               var xml, tmp;
-               try {
-                       if ( window.DOMParser ) { // Standard
-                               tmp = new DOMParser();
-                               xml = tmp.parseFromString( data , "text/xml" );
-                       } else { // IE
-                               xml = new ActiveXObject( "Microsoft.XMLDOM" );
-                               xml.async = "false";
-                               xml.loadXML( data );
-                       }
-               } catch( e ) {
-                       xml = undefined;
-               }
-               if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
-                       jQuery.error( "Invalid XML: " + data );
-               }
-               return xml;
-       },
-
-       noop: function() {},
-
-       // Evaluates a script in a global context
-       // Workarounds based on findings by Jim Driscoll
-       // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
-       globalEval: function( data ) {
-               if ( data && rnotwhite.test( data ) ) {
-                       // We use execScript on Internet Explorer
-                       // We use an anonymous function so that context is window
-                       // rather than jQuery in Firefox
-                       ( window.execScript || function( data ) {
-                               window[ "eval" ].call( window, data );
-                       } )( data );
-               }
-       },
-
-       // Convert dashed to camelCase; used by the css and data modules
-       // Microsoft forgot to hump their vendor prefix (#9572)
-       camelCase: function( string ) {
-               return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
-       },
-
-       nodeName: function( elem, name ) {
-               return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
-       },
-
-       // args is for internal usage only
-       each: function( object, callback, args ) {
-               var name, i = 0,
-                       length = object.length,
-                       isObj = length === undefined || jQuery.isFunction( object );
-
-               if ( args ) {
-                       if ( isObj ) {
-                               for ( name in object ) {
-                                       if ( callback.apply( object[ name ], args ) === false ) {
-                                               break;
-                                       }
-                               }
-                       } else {
-                               for ( ; i < length; ) {
-                                       if ( callback.apply( object[ i++ ], args ) === false ) {
-                                               break;
-                                       }
-                               }
-                       }
-
-               // A special, fast, case for the most common use of each
-               } else {
-                       if ( isObj ) {
-                               for ( name in object ) {
-                                       if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
-                                               break;
-                                       }
-                               }
-                       } else {
-                               for ( ; i < length; ) {
-                                       if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
-                                               break;
-                                       }
-                               }
-                       }
-               }
-
-               return object;
-       },
-
-       // Use native String.trim function wherever possible
-       trim: trim ?
-               function( text ) {
-                       return text == null ?
-                               "" :
-                               trim.call( text );
-               } :
-
-               // Otherwise use our own trimming functionality
-               function( text ) {
-                       return text == null ?
-                               "" :
-                               text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
-               },
-
-       // results is for internal usage only
-       makeArray: function( array, results ) {
-               var ret = results || [];
-
-               if ( array != null ) {
-                       // The window, strings (and functions) also have 'length'
-                       // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
-                       var type = jQuery.type( array );
-
-                       if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
-                               push.call( ret, array );
-                       } else {
-                               jQuery.merge( ret, array );
-                       }
-               }
-
-               return ret;
-       },
-
-       inArray: function( elem, array, i ) {
-               var len;
-
-               if ( array ) {
-                       if ( indexOf ) {
-                               return indexOf.call( array, elem, i );
-                       }
-
-                       len = array.length;
-                       i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
-
-                       for ( ; i < len; i++ ) {
-                               // Skip accessing in sparse arrays
-                               if ( i in array && array[ i ] === elem ) {
-                                       return i;
-                               }
-                       }
-               }
-
-               return -1;
-       },
-
-       merge: function( first, second ) {
-               var i = first.length,
-                       j = 0;
-
-               if ( typeof second.length === "number" ) {
-                       for ( var l = second.length; j < l; j++ ) {
-                               first[ i++ ] = second[ j ];
-                       }
-
-               } else {
-                       while ( second[j] !== undefined ) {
-                               first[ i++ ] = second[ j++ ];
-                       }
-               }
-
-               first.length = i;
-
-               return first;
-       },
-
-       grep: function( elems, callback, inv ) {
-               var ret = [], retVal;
-               inv = !!inv;
-
-               // Go through the array, only saving the items
-               // that pass the validator function
-               for ( var i = 0, length = elems.length; i < length; i++ ) {
-                       retVal = !!callback( elems[ i ], i );
-                       if ( inv !== retVal ) {
-                               ret.push( elems[ i ] );
-                       }
-               }
-
-               return ret;
-       },
-
-       // arg is for internal usage only
-       map: function( elems, callback, arg ) {
-               var value, key, ret = [],
-                       i = 0,
-                       length = elems.length,
-                       // jquery objects are treated as arrays
-                       isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
-
-               // Go through the array, translating each of the items to their
-               if ( isArray ) {
-                       for ( ; i < length; i++ ) {
-                               value = callback( elems[ i ], i, arg );
-
-                               if ( value != null ) {
-                                       ret[ ret.length ] = value;
-                               }
-                       }
-
-               // Go through every key on the object,
-               } else {
-                       for ( key in elems ) {
-                               value = callback( elems[ key ], key, arg );
-
-                               if ( value != null ) {
-                                       ret[ ret.length ] = value;
-                               }
-                       }
-               }
-
-               // Flatten any nested arrays
-               return ret.concat.apply( [], ret );
-       },
-
-       // A global GUID counter for objects
-       guid: 1,
-
-       // Bind a function to a context, optionally partially applying any
-       // arguments.
-       proxy: function( fn, context ) {
-               if ( typeof context === "string" ) {
-                       var tmp = fn[ context ];
-                       context = fn;
-                       fn = tmp;
-               }
-
-               // Quick check to determine if target is callable, in the spec
-               // this throws a TypeError, but we will just return undefined.
-               if ( !jQuery.isFunction( fn ) ) {
-                       return undefined;
-               }
-
-               // Simulated bind
-               var args = slice.call( arguments, 2 ),
-                       proxy = function() {
-                               return fn.apply( context, args.concat( slice.call( arguments ) ) );
-                       };
-
-               // Set the guid of unique handler to the same of original handler, so it can be removed
-               proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
-
-               return proxy;
-       },
-
-       // Mutifunctional method to get and set values to a collection
-       // The value/s can optionally be executed if it's a function
-       access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
-               var exec,
-                       bulk = key == null,
-                       i = 0,
-                       length = elems.length;
-
-               // Sets many values
-               if ( key && typeof key === "object" ) {
-                       for ( i in key ) {
-                               jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );
-                       }
-                       chainable = 1;
-
-               // Sets one value
-               } else if ( value !== undefined ) {
-                       // Optionally, function values get executed if exec is true
-                       exec = pass === undefined && jQuery.isFunction( value );
-
-                       if ( bulk ) {
-                               // Bulk operations only iterate when executing function values
-                               if ( exec ) {
-                                       exec = fn;
-                                       fn = function( elem, key, value ) {
-                                               return exec.call( jQuery( elem ), value );
-                                       };
-
-                               // Otherwise they run against the entire set
-                               } else {
-                                       fn.call( elems, value );
-                                       fn = null;
-                               }
-                       }
-
-                       if ( fn ) {
-                               for (; i < length; i++ ) {
-                                       fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
-                               }
-                       }
-
-                       chainable = 1;
-               }
-
-               return chainable ?
-                       elems :
-
-                       // Gets
-                       bulk ?
-                               fn.call( elems ) :
-                               length ? fn( elems[0], key ) : emptyGet;
-       },
-
-       now: function() {
-               return ( new Date() ).getTime();
-       },
-
-       // Use of jQuery.browser is frowned upon.
-       // More details: http://docs.jquery.com/Utilities/jQuery.browser
-       uaMatch: function( ua ) {
-               ua = ua.toLowerCase();
-
-               var match = rwebkit.exec( ua ) ||
-                       ropera.exec( ua ) ||
-                       rmsie.exec( ua ) ||
-                       ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
-                       [];
-
-               return { browser: match[1] || "", version: match[2] || "0" };
-       },
-
-       sub: function() {
-               function jQuerySub( selector, context ) {
-                       return new jQuerySub.fn.init( selector, context );
-               }
-               jQuery.extend( true, jQuerySub, this );
-               jQuerySub.superclass = this;
-               jQuerySub.fn = jQuerySub.prototype = this();
-               jQuerySub.fn.constructor = jQuerySub;
-               jQuerySub.sub = this.sub;
-               jQuerySub.fn.init = function init( selector, context ) {
-                       if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
-                               context = jQuerySub( context );
-                       }
-
-                       return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
-               };
-               jQuerySub.fn.init.prototype = jQuerySub.fn;
-               var rootjQuerySub = jQuerySub(document);
-               return jQuerySub;
-       },
-
-       browser: {}
-});
-
-// Populate the class2type map
-jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
-       class2type[ "[object " + name + "]" ] = name.toLowerCase();
-});
-
-browserMatch = jQuery.uaMatch( userAgent );
-if ( browserMatch.browser ) {
-       jQuery.browser[ browserMatch.browser ] = true;
-       jQuery.browser.version = browserMatch.version;
-}
-
-// Deprecated, use jQuery.browser.webkit instead
-if ( jQuery.browser.webkit ) {
-       jQuery.browser.safari = true;
-}
-
-// IE doesn't match non-breaking spaces with \s
-if ( rnotwhite.test( "\xA0" ) ) {
-       trimLeft = /^[\s\xA0]+/;
-       trimRight = /[\s\xA0]+$/;
-}
-
-// All jQuery objects should point back to these
-rootjQuery = jQuery(document);
-
-// Cleanup functions for the document ready method
-if ( document.addEventListener ) {
-       DOMContentLoaded = function() {
-               document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
-               jQuery.ready();
-       };
-
-} else if ( document.attachEvent ) {
-       DOMContentLoaded = function() {
-               // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
-               if ( document.readyState === "complete" ) {
-                       document.detachEvent( "onreadystatechange", DOMContentLoaded );
-                       jQuery.ready();
-               }
-       };
-}
-
-// The DOM ready check for Internet Explorer
-function doScrollCheck() {
-       if ( jQuery.isReady ) {
-               return;
-       }
-
-       try {
-               // If IE is used, use the trick by Diego Perini
-               // http://javascript.nwbox.com/IEContentLoaded/
-               document.documentElement.doScroll("left");
-       } catch(e) {
-               setTimeout( doScrollCheck, 1 );
-               return;
-       }
-
-       // and execute any waiting functions
-       jQuery.ready();
-}
-
-return jQuery;
-
-})();
-
-
-// String to Object flags format cache
-var flagsCache = {};
-
-// Convert String-formatted flags into Object-formatted ones and store in cache
-function createFlags( flags ) {
-       var object = flagsCache[ flags ] = {},
-               i, length;
-       flags = flags.split( /\s+/ );
-       for ( i = 0, length = flags.length; i < length; i++ ) {
-               object[ flags[i] ] = true;
-       }
-       return object;
-}
-
-/*
- * Create a callback list using the following parameters:
- *
- *     flags:  an optional list of space-separated flags that will change how
- *                     the callback list behaves
- *
- * By default a callback list will act like an event callback list and can be
- * "fired" multiple times.
- *
- * Possible flags:
- *
- *     once:                   will ensure the callback list can only be fired once (like a Deferred)
- *
- *     memory:                 will keep track of previous values and will call any callback added
- *                                     after the list has been fired right away with the latest "memorized"
- *                                     values (like a Deferred)
- *
- *     unique:                 will ensure a callback can only be added once (no duplicate in the list)
- *
- *     stopOnFalse:    interrupt callings when a callback returns false
- *
- */
-jQuery.Callbacks = function( flags ) {
-
-       // Convert flags from String-formatted to Object-formatted
-       // (we check in cache first)
-       flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
-
-       var // Actual callback list
-               list = [],
-               // Stack of fire calls for repeatable lists
-               stack = [],
-               // Last fire value (for non-forgettable lists)
-               memory,
-               // Flag to know if list was already fired
-               fired,
-               // Flag to know if list is currently firing
-               firing,
-               // First callback to fire (used internally by add and fireWith)
-               firingStart,
-               // End of the loop when firing
-               firingLength,
-               // Index of currently firing callback (modified by remove if needed)
-               firingIndex,
-               // Add one or several callbacks to the list
-               add = function( args ) {
-                       var i,
-                               length,
-                               elem,
-                               type,
-                               actual;
-                       for ( i = 0, length = args.length; i < length; i++ ) {
-                               elem = args[ i ];
-                               type = jQuery.type( elem );
-                               if ( type === "array" ) {
-                                       // Inspect recursively
-                                       add( elem );
-                               } else if ( type === "function" ) {
-                                       // Add if not in unique mode and callback is not in
-                                       if ( !flags.unique || !self.has( elem ) ) {
-                                               list.push( elem );
-                                       }
-                               }
-                       }
-               },
-               // Fire callbacks
-               fire = function( context, args ) {
-                       args = args || [];
-                       memory = !flags.memory || [ context, args ];
-                       fired = true;
-                       firing = true;
-                       firingIndex = firingStart || 0;
-                       firingStart = 0;
-                       firingLength = list.length;
-                       for ( ; list && firingIndex < firingLength; firingIndex++ ) {
-                               if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
-                                       memory = true; // Mark as halted
-                                       break;
-                               }
-                       }
-                       firing = false;
-                       if ( list ) {
-                               if ( !flags.once ) {
-                                       if ( stack && stack.length ) {
-                                               memory = stack.shift();
-                                               self.fireWith( memory[ 0 ], memory[ 1 ] );
-                                       }
-                               } else if ( memory === true ) {
-                                       self.disable();
-                               } else {
-                                       list = [];
-                               }
-                       }
-               },
-               // Actual Callbacks object
-               self = {
-                       // Add a callback or a collection of callbacks to the list
-                       add: function() {
-                               if ( list ) {
-                                       var length = list.length;
-                                       add( arguments );
-                                       // Do we need to add the callbacks to the
-                                       // current firing batch?
-                                       if ( firing ) {
-                                               firingLength = list.length;
-                                       // With memory, if we're not firing then
-                                       // we should call right away, unless previous
-                                       // firing was halted (stopOnFalse)
-                                       } else if ( memory && memory !== true ) {
-                                               firingStart = length;
-                                               fire( memory[ 0 ], memory[ 1 ] );
-                                       }
-                               }
-                               return this;
-                       },
-                       // Remove a callback from the list
-                       remove: function() {
-                               if ( list ) {
-                                       var args = arguments,
-                                               argIndex = 0,
-                                               argLength = args.length;
-                                       for ( ; argIndex < argLength ; argIndex++ ) {
-                                               for ( var i = 0; i < list.length; i++ ) {
-                                                       if ( args[ argIndex ] === list[ i ] ) {
-                                                               // Handle firingIndex and firingLength
-                                                               if ( firing ) {
-                                                                       if ( i <= firingLength ) {
-                                                                               firingLength--;
-                                                                               if ( i <= firingIndex ) {
-                                                                                       firingIndex--;
-                                                                               }
-                                                                       }
-                                                               }
-                                                               // Remove the element
-                                                               list.splice( i--, 1 );
-                                                               // If we have some unicity property then
-                                                               // we only need to do this once
-                                                               if ( flags.unique ) {
-                                                                       break;
-                                                               }
-                                                       }
-                                               }
-                                       }
-                               }
-                               return this;
-                       },
-                       // Control if a given callback is in the list
-                       has: function( fn ) {
-                               if ( list ) {
-                                       var i = 0,
-                                               length = list.length;
-                                       for ( ; i < length; i++ ) {
-                                               if ( fn === list[ i ] ) {
-                                                       return true;
-                                               }
-                                       }
-                               }
-                               return false;
-                       },
-                       // Remove all callbacks from the list
-                       empty: function() {
-                               list = [];
-                               return this;
-                       },
-                       // Have the list do nothing anymore
-                       disable: function() {
-                               list = stack = memory = undefined;
-                               return this;
-                       },
-                       // Is it disabled?
-                       disabled: function() {
-                               return !list;
-                       },
-                       // Lock the list in its current state
-                       lock: function() {
-                               stack = undefined;
-                               if ( !memory || memory === true ) {
-                                       self.disable();
-                               }
-                               return this;
-                       },
-                       // Is it locked?
-                       locked: function() {
-                               return !stack;
-                       },
-                       // Call all callbacks with the given context and arguments
-                       fireWith: function( context, args ) {
-                               if ( stack ) {
-                                       if ( firing ) {
-                                               if ( !flags.once ) {
-                                                       stack.push( [ context, args ] );
-                                               }
-                                       } else if ( !( flags.once && memory ) ) {
-                                               fire( context, args );
-                                       }
-                               }
-                               return this;
-                       },
-                       // Call all the callbacks with the given arguments
-                       fire: function() {
-                               self.fireWith( this, arguments );
-                               return this;
-                       },
-                       // To know if the callbacks have already been called at least once
-                       fired: function() {
-                               return !!fired;
-                       }
-               };
-
-       return self;
-};
-
-
-
-
-var // Static reference to slice
-       sliceDeferred = [].slice;
-
-jQuery.extend({
-
-       Deferred: function( func ) {
-               var doneList = jQuery.Callbacks( "once memory" ),
-                       failList = jQuery.Callbacks( "once memory" ),
-                       progressList = jQuery.Callbacks( "memory" ),
-                       state = "pending",
-                       lists = {
-                               resolve: doneList,
-                               reject: failList,
-                               notify: progressList
-                       },
-                       promise = {
-                               done: doneList.add,
-                               fail: failList.add,
-                               progress: progressList.add,
-
-                               state: function() {
-                                       return state;
-                               },
-
-                               // Deprecated
-                               isResolved: doneList.fired,
-                               isRejected: failList.fired,
-
-                               then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
-                                       deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
-                                       return this;
-                               },
-                               always: function() {
-                                       deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
-                                       return this;
-                               },
-                               pipe: function( fnDone, fnFail, fnProgress ) {
-                                       return jQuery.Deferred(function( newDefer ) {
-                                               jQuery.each( {
-                                                       done: [ fnDone, "resolve" ],
-                                                       fail: [ fnFail, "reject" ],
-                                                       progress: [ fnProgress, "notify" ]
-                                               }, function( handler, data ) {
-                                                       var fn = data[ 0 ],
-                                                               action = data[ 1 ],
-                                                               returned;
-                                                       if ( jQuery.isFunction( fn ) ) {
-                                                               deferred[ handler ](function() {
-                                                                       returned = fn.apply( this, arguments );
-                                                                       if ( returned && jQuery.isFunction( returned.promise ) ) {
-                                                                               returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
-                                                                       } else {
-                                                                               newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
-                                                                       }
-                                                               });
-                                                       } else {
-                                                               deferred[ handler ]( newDefer[ action ] );
-                                                       }
-                                               });
-                                       }).promise();
-                               },
-                               // Get a promise for this deferred
-                               // If obj is provided, the promise aspect is added to the object
-                               promise: function( obj ) {
-                                       if ( obj == null ) {
-                                               obj = promise;
-                                       } else {
-                                               for ( var key in promise ) {
-                                                       obj[ key ] = promise[ key ];
-                                               }
-                                       }
-                                       return obj;
-                               }
-                       },
-                       deferred = promise.promise({}),
-                       key;
-
-               for ( key in lists ) {
-                       deferred[ key ] = lists[ key ].fire;
-                       deferred[ key + "With" ] = lists[ key ].fireWith;
-               }
-
-               // Handle state
-               deferred.done( function() {
-                       state = "resolved";
-               }, failList.disable, progressList.lock ).fail( function() {
-                       state = "rejected";
-               }, doneList.disable, progressList.lock );
-
-               // Call given func if any
-               if ( func ) {
-                       func.call( deferred, deferred );
-               }
-
-               // All done!
-               return deferred;
-       },
-
-       // Deferred helper
-       when: function( firstParam ) {
-               var args = sliceDeferred.call( arguments, 0 ),
-                       i = 0,
-                       length = args.length,
-                       pValues = new Array( length ),
-                       count = length,
-                       pCount = length,
-                       deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
-                               firstParam :
-                               jQuery.Deferred(),
-                       promise = deferred.promise();
-               function resolveFunc( i ) {
-                       return function( value ) {
-                               args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
-                               if ( !( --count ) ) {
-                                       deferred.resolveWith( deferred, args );
-                               }
-                       };
-               }
-               function progressFunc( i ) {
-                       return function( value ) {
-                               pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
-                               deferred.notifyWith( promise, pValues );
-                       };
-               }
-               if ( length > 1 ) {
-                       for ( ; i < length; i++ ) {
-                               if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
-                                       args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
-                               } else {
-                                       --count;
-                               }
-                       }
-                       if ( !count ) {
-                               deferred.resolveWith( deferred, args );
-                       }
-               } else if ( deferred !== firstParam ) {
-                       deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
-               }
-               return promise;
-       }
-});
-
-
-
-
-jQuery.support = (function() {
-
-       var support,
-               all,
-               a,
-               select,
-               opt,
-               input,
-               fragment,
-               tds,
-               events,
-               eventName,
-               i,
-               isSupported,
-               div = document.createElement( "div" ),
-               documentElement = document.documentElement;
-
-       // Preliminary tests
-       div.setAttribute("className", "t");
-       div.innerHTML = "   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
-
-       all = div.getElementsByTagName( "*" );
-       a = div.getElementsByTagName( "a" )[ 0 ];
-
-       // Can't get basic test support
-       if ( !all || !all.length || !a ) {
-               return {};
-       }
-
-       // First batch of supports tests
-       select = document.createElement( "select" );
-       opt = select.appendChild( document.createElement("option") );
-       input = div.getElementsByTagName( "input" )[ 0 ];
-
-       support = {
-               // IE strips leading whitespace when .innerHTML is used
-               leadingWhitespace: ( div.firstChild.nodeType === 3 ),
-
-               // Make sure that tbody elements aren't automatically inserted
-               // IE will insert them into empty tables
-               tbody: !div.getElementsByTagName("tbody").length,
-
-               // Make sure that link elements get serialized correctly by innerHTML
-               // This requires a wrapper element in IE
-               htmlSerialize: !!div.getElementsByTagName("link").length,
-
-               // Get the style information from getAttribute
-               // (IE uses .cssText instead)
-               style: /top/.test( a.getAttribute("style") ),
-
-               // Make sure that URLs aren't manipulated
-               // (IE normalizes it by default)
-               hrefNormalized: ( a.getAttribute("href") === "/a" ),
-
-               // Make sure that element opacity exists
-               // (IE uses filter instead)
-               // Use a regex to work around a WebKit issue. See #5145
-               opacity: /^0.55/.test( a.style.opacity ),
-
-               // Verify style float existence
-               // (IE uses styleFloat instead of cssFloat)
-               cssFloat: !!a.style.cssFloat,
-
-               // Make sure that if no value is specified for a checkbox
-               // that it defaults to "on".
-               // (WebKit defaults to "" instead)
-               checkOn: ( input.value === "on" ),
-
-               // Make sure that a selected-by-default option has a working selected property.
-               // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
-               optSelected: opt.selected,
-
-               // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
-               getSetAttribute: div.className !== "t",
-
-               // Tests for enctype support on a form(#6743)
-               enctype: !!document.createElement("form").enctype,
-
-               // Makes sure cloning an html5 element does not cause problems
-               // Where outerHTML is undefined, this still works
-               html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
-
-               // Will be defined later
-               submitBubbles: true,
-               changeBubbles: true,
-               focusinBubbles: false,
-               deleteExpando: true,
-               noCloneEvent: true,
-               inlineBlockNeedsLayout: false,
-               shrinkWrapBlocks: false,
-               reliableMarginRight: true,
-               pixelMargin: true
-       };
-
-       // jQuery.boxModel DEPRECATED in 1.3, use jQuery.support.boxModel instead
-       jQuery.boxModel = support.boxModel = (document.compatMode === "CSS1Compat");
-
-       // Make sure checked status is properly cloned
-       input.checked = true;
-       support.noCloneChecked = input.cloneNode( true ).checked;
-
-       // Make sure that the options inside disabled selects aren't marked as disabled
-       // (WebKit marks them as disabled)
-       select.disabled = true;
-       support.optDisabled = !opt.disabled;
-
-       // Test to see if it's possible to delete an expando from an element
-       // Fails in Internet Explorer
-       try {
-               delete div.test;
-       } catch( e ) {
-               support.deleteExpando = false;
-       }
-
-       if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
-               div.attachEvent( "onclick", function() {
-                       // Cloning a node shouldn't copy over any
-                       // bound event handlers (IE does this)
-                       support.noCloneEvent = false;
-               });
-               div.cloneNode( true ).fireEvent( "onclick" );
-       }
-
-       // Check if a radio maintains its value
-       // after being appended to the DOM
-       input = document.createElement("input");
-       input.value = "t";
-       input.setAttribute("type", "radio");
-       support.radioValue = input.value === "t";
-
-       input.setAttribute("checked", "checked");
-
-       // #11217 - WebKit loses check when the name is after the checked attribute
-       input.setAttribute( "name", "t" );
-
-       div.appendChild( input );
-       fragment = document.createDocumentFragment();
-       fragment.appendChild( div.lastChild );
-
-       // WebKit doesn't clone checked state correctly in fragments
-       support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
-       // Check if a disconnected checkbox will retain its checked
-       // value of true after appended to the DOM (IE6/7)
-       support.appendChecked = input.checked;
-
-       fragment.removeChild( input );
-       fragment.appendChild( div );
-
-       // Technique from Juriy Zaytsev
-       // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
-       // We only care about the case where non-standard event systems
-       // are used, namely in IE. Short-circuiting here helps us to
-       // avoid an eval call (in setAttribute) which can cause CSP
-       // to go haywire. See: https://developer.mozilla.org/en/Security/CSP
-       if ( div.attachEvent ) {
-               for ( i in {
-                       submit: 1,
-                       change: 1,
-                       focusin: 1
-               }) {
-                       eventName = "on" + i;
-                       isSupported = ( eventName in div );
-                       if ( !isSupported ) {
-                               div.setAttribute( eventName, "return;" );
-                               isSupported = ( typeof div[ eventName ] === "function" );
-                       }
-                       support[ i + "Bubbles" ] = isSupported;
-               }
-       }
-
-       fragment.removeChild( div );
-
-       // Null elements to avoid leaks in IE
-       fragment = select = opt = div = input = null;
-
-       // Run tests that need a body at doc ready
-       jQuery(function() {
-               var container, outer, inner, table, td, offsetSupport,
-                       marginDiv, conMarginTop, style, html, positionTopLeftWidthHeight,
-                       paddingMarginBorderVisibility, paddingMarginBorder,
-                       body = document.getElementsByTagName("body")[0];
-
-               if ( !body ) {
-                       // Return for frameset docs that don't have a body
-                       return;
-               }
-
-               conMarginTop = 1;
-               paddingMarginBorder = "padding:0;margin:0;border:";
-               positionTopLeftWidthHeight = "position:absolute;top:0;left:0;width:1px;height:1px;";
-               paddingMarginBorderVisibility = paddingMarginBorder + "0;visibility:hidden;";
-               style = "style='" + positionTopLeftWidthHeight + paddingMarginBorder + "5px solid #000;";
-               html = "<div " + style + "display:block;'><div style='" + paddingMarginBorder + "0;display:block;overflow:hidden;'></div></div>" +
-                       "<table " + style + "' cellpadding='0' cellspacing='0'>" +
-                       "<tr><td></td></tr></table>";
-
-               container = document.createElement("div");
-               container.style.cssText = paddingMarginBorderVisibility + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
-               body.insertBefore( container, body.firstChild );
-
-               // Construct the test element
-               div = document.createElement("div");
-               container.appendChild( div );
-
-               // Check if table cells still have offsetWidth/Height when they are set
-               // to display:none and there are still other visible table cells in a
-               // table row; if so, offsetWidth/Height are not reliable for use when
-               // determining if an element has been hidden directly using
-               // display:none (it is still safe to use offsets if a parent element is
-               // hidden; don safety goggles and see bug #4512 for more information).
-               // (only IE 8 fails this test)
-               div.innerHTML = "<table><tr><td style='" + paddingMarginBorder + "0;display:none'></td><td>t</td></tr></table>";
-               tds = div.getElementsByTagName( "td" );
-               isSupported = ( tds[ 0 ].offsetHeight === 0 );
-
-               tds[ 0 ].style.display = "";
-               tds[ 1 ].style.display = "none";
-
-               // Check if empty table cells still have offsetWidth/Height
-               // (IE <= 8 fail this test)
-               support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
-
-               // Check if div with explicit width and no margin-right incorrectly
-               // gets computed margin-right based on width of container. For more
-               // info see bug #3333
-               // Fails in WebKit before Feb 2011 nightlies
-               // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
-               if ( window.getComputedStyle ) {
-                       div.innerHTML = "";
-                       marginDiv = document.createElement( "div" );
-                       marginDiv.style.width = "0";
-                       marginDiv.style.marginRight = "0";
-                       div.style.width = "2px";
-                       div.appendChild( marginDiv );
-                       support.reliableMarginRight =
-                               ( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
-               }
-
-               if ( typeof div.style.zoom !== "undefined" ) {
-                       // Check if natively block-level elements act like inline-block
-                       // elements when setting their display to 'inline' and giving
-                       // them layout
-                       // (IE < 8 does this)
-                       div.innerHTML = "";
-                       div.style.width = div.style.padding = "1px";
-                       div.style.border = 0;
-                       div.style.overflow = "hidden";
-                       div.style.display = "inline";
-                       div.style.zoom = 1;
-                       support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
-
-                       // Check if elements with layout shrink-wrap their children
-                       // (IE 6 does this)
-                       div.style.display = "block";
-                       div.style.overflow = "visible";
-                       div.innerHTML = "<div style='width:5px;'></div>";
-                       support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
-               }
-
-               div.style.cssText = positionTopLeftWidthHeight + paddingMarginBorderVisibility;
-               div.innerHTML = html;
-
-               outer = div.firstChild;
-               inner = outer.firstChild;
-               td = outer.nextSibling.firstChild.firstChild;
-
-               offsetSupport = {
-                       doesNotAddBorder: ( inner.offsetTop !== 5 ),
-                       doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
-               };
-
-               inner.style.position = "fixed";
-               inner.style.top = "20px";
-
-               // safari subtracts parent border width here which is 5px
-               offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
-               inner.style.position = inner.style.top = "";
-
-               outer.style.overflow = "hidden";
-               outer.style.position = "relative";
-
-               offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
-               offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
-
-               if ( window.getComputedStyle ) {
-                       div.style.marginTop = "1%";
-                       support.pixelMargin = ( window.getComputedStyle( div, null ) || { marginTop: 0 } ).marginTop !== "1%";
-               }
-
-               if ( typeof container.style.zoom !== "undefined" ) {
-                       container.style.zoom = 1;
-               }
-
-               body.removeChild( container );
-               marginDiv = div = container = null;
-
-               jQuery.extend( support, offsetSupport );
-       });
-
-       return support;
-})();
-
-
-
-
-var rbrace = /^(?:\{.*\}|\[.*\])$/,
-       rmultiDash = /([A-Z])/g;
-
-jQuery.extend({
-       cache: {},
-
-       // Please use with caution
-       uuid: 0,
-
-       // Unique for each copy of jQuery on the page
-       // Non-digits removed to match rinlinejQuery
-       expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
-
-       // The following elements throw uncatchable exceptions if you
-       // attempt to add expando properties to them.
-       noData: {
-               "embed": true,
-               // Ban all objects except for Flash (which handle expandos)
-               "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
-               "applet": true
-       },
-
-       hasData: function( elem ) {
-               elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
-               return !!elem && !isEmptyDataObject( elem );
-       },
-
-       data: function( elem, name, data, pvt /* Internal Use Only */ ) {
-               if ( !jQuery.acceptData( elem ) ) {
-                       return;
-               }
-
-               var privateCache, thisCache, ret,
-                       internalKey = jQuery.expando,
-                       getByName = typeof name === "string",
-
-                       // We have to handle DOM nodes and JS objects differently because IE6-7
-                       // can't GC object references properly across the DOM-JS boundary
-                       isNode = elem.nodeType,
-
-                       // Only DOM nodes need the global jQuery cache; JS object data is
-                       // attached directly to the object so GC can occur automatically
-                       cache = isNode ? jQuery.cache : elem,
-
-                       // Only defining an ID for JS objects if its cache already exists allows
-                       // the code to shortcut on the same path as a DOM node with no cache
-                       id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,
-                       isEvents = name === "events";
-
-               // Avoid doing any more work than we need to when trying to get data on an
-               // object that has no data at all
-               if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
-                       return;
-               }
-
-               if ( !id ) {
-                       // Only DOM nodes need a new unique ID for each element since their data
-                       // ends up in the global cache
-                       if ( isNode ) {
-                               elem[ internalKey ] = id = ++jQuery.uuid;
-                       } else {
-                               id = internalKey;
-                       }
-               }
-
-               if ( !cache[ id ] ) {
-                       cache[ id ] = {};
-
-                       // Avoids exposing jQuery metadata on plain JS objects when the object
-                       // is serialized using JSON.stringify
-                       if ( !isNode ) {
-                               cache[ id ].toJSON = jQuery.noop;
-                       }
-               }
-
-               // An object can be passed to jQuery.data instead of a key/value pair; this gets
-               // shallow copied over onto the existing cache
-               if ( typeof name === "object" || typeof name === "function" ) {
-                       if ( pvt ) {
-                               cache[ id ] = jQuery.extend( cache[ id ], name );
-                       } else {
-                               cache[ id ].data = jQuery.extend( cache[ id ].data, name );
-                       }
-               }
-
-               privateCache = thisCache = cache[ id ];
-
-               // jQuery data() is stored in a separate object inside the object's internal data
-               // cache in order to avoid key collisions between internal data and user-defined
-               // data.
-               if ( !pvt ) {
-                       if ( !thisCache.data ) {
-                               thisCache.data = {};
-                       }
-
-                       thisCache = thisCache.data;
-               }
-
-               if ( data !== undefined ) {
-                       thisCache[ jQuery.camelCase( name ) ] = data;
-               }
-
-               // Users should not attempt to inspect the internal events object using jQuery.data,
-               // it is undocumented and subject to change. But does anyone listen? No.
-               if ( isEvents && !thisCache[ name ] ) {
-                       return privateCache.events;
-               }
-
-               // Check for both converted-to-camel and non-converted data property names
-               // If a data property was specified
-               if ( getByName ) {
-
-                       // First Try to find as-is property data
-                       ret = thisCache[ name ];
-
-                       // Test for null|undefined property data
-                       if ( ret == null ) {
-
-                               // Try to find the camelCased property
-                               ret = thisCache[ jQuery.camelCase( name ) ];
-                       }
-               } else {
-                       ret = thisCache;
-               }
-
-               return ret;
-       },
-
-       removeData: function( elem, name, pvt /* Internal Use Only */ ) {
-               if ( !jQuery.acceptData( elem ) ) {
-                       return;
-               }
-
-               var thisCache, i, l,
-
-                       // Reference to internal data cache key
-                       internalKey = jQuery.expando,
-
-                       isNode = elem.nodeType,
-
-                       // See jQuery.data for more information
-                       cache = isNode ? jQuery.cache : elem,
-
-                       // See jQuery.data for more information
-                       id = isNode ? elem[ internalKey ] : internalKey;
-
-               // If there is already no cache entry for this object, there is no
-               // purpose in continuing
-               if ( !cache[ id ] ) {
-                       return;
-               }
-
-               if ( name ) {
-
-                       thisCache = pvt ? cache[ id ] : cache[ id ].data;
-
-                       if ( thisCache ) {
-
-                               // Support array or space separated string names for data keys
-                               if ( !jQuery.isArray( name ) ) {
-
-                                       // try the string as a key before any manipulation
-                                       if ( name in thisCache ) {
-                                               name = [ name ];
-                                       } else {
-
-                                               // split the camel cased version by spaces unless a key with the spaces exists
-                                               name = jQuery.camelCase( name );
-                                               if ( name in thisCache ) {
-                                                       name = [ name ];
-                                               } else {
-                                                       name = name.split( " " );
-                                               }
-                                       }
-                               }
-
-                               for ( i = 0, l = name.length; i < l; i++ ) {
-                                       delete thisCache[ name[i] ];
-                               }
-
-                               // If there is no data left in the cache, we want to continue
-                               // and let the cache object itself get destroyed
-                               if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
-                                       return;
-                               }
-                       }
-               }
-
-               // See jQuery.data for more information
-               if ( !pvt ) {
-                       delete cache[ id ].data;
-
-                       // Don't destroy the parent cache unless the internal data object
-                       // had been the only thing left in it
-                       if ( !isEmptyDataObject(cache[ id ]) ) {
-                               return;
-                       }
-               }
-
-               // Browsers that fail expando deletion also refuse to delete expandos on
-               // the window, but it will allow it on all other JS objects; other browsers
-               // don't care
-               // Ensure that `cache` is not a window object #10080
-               if ( jQuery.support.deleteExpando || !cache.setInterval ) {
-                       delete cache[ id ];
-               } else {
-                       cache[ id ] = null;
-               }
-
-               // We destroyed the cache and need to eliminate the expando on the node to avoid
-               // false lookups in the cache for entries that no longer exist
-               if ( isNode ) {
-                       // IE does not allow us to delete expando properties from nodes,
-                       // nor does it have a removeAttribute function on Document nodes;
-                       // we must handle all of these cases
-                       if ( jQuery.support.deleteExpando ) {
-                               delete elem[ internalKey ];
-                       } else if ( elem.removeAttribute ) {
-                               elem.removeAttribute( internalKey );
-                       } else {
-                               elem[ internalKey ] = null;
-                       }
-               }
-       },
-
-       // For internal use only.
-       _data: function( elem, name, data ) {
-               return jQuery.data( elem, name, data, true );
-       },
-
-       // A method for determining if a DOM node can handle the data expando
-       acceptData: function( elem ) {
-               if ( elem.nodeName ) {
-                       var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
-
-                       if ( match ) {
-                               return !(match === true || elem.getAttribute("classid") !== match);
-                       }
-               }
-
-               return true;
-       }
-});
-
-jQuery.fn.extend({
-       data: function( key, value ) {
-               var parts, part, attr, name, l,
-                       elem = this[0],
-                       i = 0,
-                       data = null;
-
-               // Gets all values
-               if ( key === undefined ) {
-                       if ( this.length ) {
-                               data = jQuery.data( elem );
-
-                               if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
-                                       attr = elem.attributes;
-                                       for ( l = attr.length; i < l; i++ ) {
-                                               name = attr[i].name;
-
-                                               if ( name.indexOf( "data-" ) === 0 ) {
-                                                       name = jQuery.camelCase( name.substring(5) );
-
-                                                       dataAttr( elem, name, data[ name ] );
-                                               }
-                                       }
-                                       jQuery._data( elem, "parsedAttrs", true );
-                               }
-                       }
-
-                       return data;
-               }
-
-               // Sets multiple values
-               if ( typeof key === "object" ) {
-                       return this.each(function() {
-                               jQuery.data( this, key );
-                       });
-               }
-
-               parts = key.split( ".", 2 );
-               parts[1] = parts[1] ? "." + parts[1] : "";
-               part = parts[1] + "!";
-
-               return jQuery.access( this, function( value ) {
-
-                       if ( value === undefined ) {
-                               data = this.triggerHandler( "getData" + part, [ parts[0] ] );
-
-                               // Try to fetch any internally stored data first
-                               if ( data === undefined && elem ) {
-                                       data = jQuery.data( elem, key );
-                                       data = dataAttr( elem, key, data );
-                               }
-
-                               return data === undefined && parts[1] ?
-                                       this.data( parts[0] ) :
-                                       data;
-                       }
-
-                       parts[1] = value;
-                       this.each(function() {
-                               var self = jQuery( this );
-
-                               self.triggerHandler( "setData" + part, parts );
-                               jQuery.data( this, key, value );
-                               self.triggerHandler( "changeData" + part, parts );
-                       });
-               }, null, value, arguments.length > 1, null, false );
-       },
-
-       removeData: function( key ) {
-               return this.each(function() {
-                       jQuery.removeData( this, key );
-               });
-       }
-});
-
-function dataAttr( elem, key, data ) {
-       // If nothing was found internally, try to fetch any
-       // data from the HTML5 data-* attribute
-       if ( data === undefined && elem.nodeType === 1 ) {
-
-               var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
-
-               data = elem.getAttribute( name );
-
-               if ( typeof data === "string" ) {
-                       try {
-                               data = data === "true" ? true :
-                               data === "false" ? false :
-                               data === "null" ? null :
-                               jQuery.isNumeric( data ) ? +data :
-                                       rbrace.test( data ) ? jQuery.parseJSON( data ) :
-                                       data;
-                       } catch( e ) {}
-
-                       // Make sure we set the data so it isn't changed later
-                       jQuery.data( elem, key, data );
-
-               } else {
-                       data = undefined;
-               }
-       }
-
-       return data;
-}
-
-// checks a cache object for emptiness
-function isEmptyDataObject( obj ) {
-       for ( var name in obj ) {
-
-               // if the public data object is empty, the private is still empty
-               if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
-                       continue;
-               }
-               if ( name !== "toJSON" ) {
-                       return false;
-               }
-       }
-
-       return true;
-}
-
-
-
-
-function handleQueueMarkDefer( elem, type, src ) {
-       var deferDataKey = type + "defer",
-               queueDataKey = type + "queue",
-               markDataKey = type + "mark",
-               defer = jQuery._data( elem, deferDataKey );
-       if ( defer &&
-               ( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
-               ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
-               // Give room for hard-coded callbacks to fire first
-               // and eventually mark/queue something else on the element
-               setTimeout( function() {
-                       if ( !jQuery._data( elem, queueDataKey ) &&
-                               !jQuery._data( elem, markDataKey ) ) {
-                               jQuery.removeData( elem, deferDataKey, true );
-                               defer.fire();
-                       }
-               }, 0 );
-       }
-}
-
-jQuery.extend({
-
-       _mark: function( elem, type ) {
-               if ( elem ) {
-                       type = ( type || "fx" ) + "mark";
-                       jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
-               }
-       },
-
-       _unmark: function( force, elem, type ) {
-               if ( force !== true ) {
-                       type = elem;
-                       elem = force;
-                       force = false;
-               }
-               if ( elem ) {
-                       type = type || "fx";
-                       var key = type + "mark",
-                               count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
-                       if ( count ) {
-                               jQuery._data( elem, key, count );
-                       } else {
-                               jQuery.removeData( elem, key, true );
-                               handleQueueMarkDefer( elem, type, "mark" );
-                       }
-               }
-       },
-
-       queue: function( elem, type, data ) {
-               var q;
-               if ( elem ) {
-                       type = ( type || "fx" ) + "queue";
-                       q = jQuery._data( elem, type );
-
-                       // Speed up dequeue by getting out quickly if this is just a lookup
-                       if ( data ) {
-                               if ( !q || jQuery.isArray(data) ) {
-                                       q = jQuery._data( elem, type, jQuery.makeArray(data) );
-                               } else {
-                                       q.push( data );
-                               }
-                       }
-                       return q || [];
-               }
-       },
-
-       dequeue: function( elem, type ) {
-               type = type || "fx";
-
-               var queue = jQuery.queue( elem, type ),
-                       fn = queue.shift(),
-                       hooks = {};
-
-               // If the fx queue is dequeued, always remove the progress sentinel
-               if ( fn === "inprogress" ) {
-                       fn = queue.shift();
-               }
-
-               if ( fn ) {
-                       // Add a progress sentinel to prevent the fx queue from being
-                       // automatically dequeued
-                       if ( type === "fx" ) {
-                               queue.unshift( "inprogress" );
-                       }
-
-                       jQuery._data( elem, type + ".run", hooks );
-                       fn.call( elem, function() {
-                               jQuery.dequeue( elem, type );
-                       }, hooks );
-               }
-
-               if ( !queue.length ) {
-                       jQuery.removeData( elem, type + "queue " + type + ".run", true );
-                       handleQueueMarkDefer( elem, type, "queue" );
-               }
-       }
-});
-
-jQuery.fn.extend({
-       queue: function( type, data ) {
-               var setter = 2;
-
-               if ( typeof type !== "string" ) {
-                       data = type;
-                       type = "fx";
-                       setter--;
-               }
-
-               if ( arguments.length < setter ) {
-                       return jQuery.queue( this[0], type );
-               }
-
-               return data === undefined ?
-                       this :
-                       this.each(function() {
-                               var queue = jQuery.queue( this, type, data );
-
-                               if ( type === "fx" && queue[0] !== "inprogress" ) {
-                                       jQuery.dequeue( this, type );
-                               }
-                       });
-       },
-       dequeue: function( type ) {
-               return this.each(function() {
-                       jQuery.dequeue( this, type );
-               });
-       },
-       // Based off of the plugin by Clint Helfers, with permission.
-       // http://blindsignals.com/index.php/2009/07/jquery-delay/
-       delay: function( time, type ) {
-               time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
-               type = type || "fx";
-
-               return this.queue( type, function( next, hooks ) {
-                       var timeout = setTimeout( next, time );
-                       hooks.stop = function() {
-                               clearTimeout( timeout );
-                       };
-               });
-       },
-       clearQueue: function( type ) {
-               return this.queue( type || "fx", [] );
-       },
-       // Get a promise resolved when queues of a certain type
-       // are emptied (fx is the type by default)
-       promise: function( type, object ) {
-               if ( typeof type !== "string" ) {
-                       object = type;
-                       type = undefined;
-               }
-               type = type || "fx";
-               var defer = jQuery.Deferred(),
-                       elements = this,
-                       i = elements.length,
-                       count = 1,
-                       deferDataKey = type + "defer",
-                       queueDataKey = type + "queue",
-                       markDataKey = type + "mark",
-                       tmp;
-               function resolve() {
-                       if ( !( --count ) ) {
-                               defer.resolveWith( elements, [ elements ] );
-                       }
-               }
-               while( i-- ) {
-                       if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
-                                       ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
-                                               jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
-                                       jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
-                               count++;
-                               tmp.add( resolve );
-                       }
-               }
-               resolve();
-               return defer.promise( object );
-       }
-});
-
-
-
-
-var rclass = /[\n\t\r]/g,
-       rspace = /\s+/,
-       rreturn = /\r/g,
-       rtype = /^(?:button|input)$/i,
-       rfocusable = /^(?:button|input|object|select|textarea)$/i,
-       rclickable = /^a(?:rea)?$/i,
-       rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
-       getSetAttribute = jQuery.support.getSetAttribute,
-       nodeHook, boolHook, fixSpecified;
-
-jQuery.fn.extend({
-       attr: function( name, value ) {
-               return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
-       },
-
-       removeAttr: function( name ) {
-               return this.each(function() {
-                       jQuery.removeAttr( this, name );
-               });
-       },
-
-       prop: function( name, value ) {
-               return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
-       },
-
-       removeProp: function( name ) {
-               name = jQuery.propFix[ name ] || name;
-               return this.each(function() {
-                       // try/catch handles cases where IE balks (such as removing a property on window)
-                       try {
-                               this[ name ] = undefined;
-                               delete this[ name ];
-                       } catch( e ) {}
-               });
-       },
-
-       addClass: function( value ) {
-               var classNames, i, l, elem,
-                       setClass, c, cl;
-
-               if ( jQuery.isFunction( value ) ) {
-                       return this.each(function( j ) {
-                               jQuery( this ).addClass( value.call(this, j, this.className) );
-                       });
-               }
-
-               if ( value && typeof value === "string" ) {
-                       classNames = value.split( rspace );
-
-                       for ( i = 0, l = this.length; i < l; i++ ) {
-                               elem = this[ i ];
-
-                               if ( elem.nodeType === 1 ) {
-                                       if ( !elem.className && classNames.length === 1 ) {
-                                               elem.className = value;
-
-                                       } else {
-                                               setClass = " " + elem.className + " ";
-
-                                               for ( c = 0, cl = classNames.length; c < cl; c++ ) {
-                                                       if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
-                                                               setClass += classNames[ c ] + " ";
-                                                       }
-                                               }
-                                               elem.className = jQuery.trim( setClass );
-                                       }
-                               }
-                       }
-               }
-
-               return this;
-       },
-
-       removeClass: function( value ) {
-               var classNames, i, l, elem, className, c, cl;
-
-               if ( jQuery.isFunction( value ) ) {
-                       return this.each(function( j ) {
-                               jQuery( this ).removeClass( value.call(this, j, this.className) );
-                       });
-               }
-
-               if ( (value && typeof value === "string") || value === undefined ) {
-                       classNames = ( value || "" ).split( rspace );
-
-                       for ( i = 0, l = this.length; i < l; i++ ) {
-                               elem = this[ i ];
-
-                               if ( elem.nodeType === 1 && elem.className ) {
-                                       if ( value ) {
-                                               className = (" " + elem.className + " ").replace( rclass, " " );
-                                               for ( c = 0, cl = classNames.length; c < cl; c++ ) {
-                                                       className = className.replace(" " + classNames[ c ] + " ", " ");
-                                               }
-                                               elem.className = jQuery.trim( className );
-
-                                       } else {
-                                               elem.className = "";
-                                       }
-                               }
-                       }
-               }
-
-               return this;
-       },
-
-       toggleClass: function( value, stateVal ) {
-               var type = typeof value,
-                       isBool = typeof stateVal === "boolean";
-
-               if ( jQuery.isFunction( value ) ) {
-                       return this.each(function( i ) {
-                               jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
-                       });
-               }
-
-               return this.each(function() {
-                       if ( type === "string" ) {
-                               // toggle individual class names
-                               var className,
-                                       i = 0,
-                                       self = jQuery( this ),
-                                       state = stateVal,
-                                       classNames = value.split( rspace );
-
-                               while ( (className = classNames[ i++ ]) ) {
-                                       // check each className given, space seperated list
-                                       state = isBool ? state : !self.hasClass( className );
-                                       self[ state ? "addClass" : "removeClass" ]( className );
-                               }
-
-                       } else if ( type === "undefined" || type === "boolean" ) {
-                               if ( this.className ) {
-                                       // store className if set
-                                       jQuery._data( this, "__className__", this.className );
-                               }
-
-                               // toggle whole className
-                               this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
-                       }
-               });
-       },
-
-       hasClass: function( selector ) {
-               var className = " " + selector + " ",
-                       i = 0,
-                       l = this.length;
-               for ( ; i < l; i++ ) {
-                       if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
-                               return true;
-                       }
-               }
-
-               return false;
-       },
-
-       val: function( value ) {
-               var hooks, ret, isFunction,
-                       elem = this[0];
-
-               if ( !arguments.length ) {
-                       if ( elem ) {
-                               hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
-
-                               if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
-                                       return ret;
-                               }
-
-                               ret = elem.value;
-
-                               return typeof ret === "string" ?
-                                       // handle most common string cases
-                                       ret.replace(rreturn, "") :
-                                       // handle cases where value is null/undef or number
-                                       ret == null ? "" : ret;
-                       }
-
-                       return;
-               }
-
-               isFunction = jQuery.isFunction( value );
-
-               return this.each(function( i ) {
-                       var self = jQuery(this), val;
-
-                       if ( this.nodeType !== 1 ) {
-                               return;
-                       }
-
-                       if ( isFunction ) {
-                               val = value.call( this, i, self.val() );
-                       } else {
-                               val = value;
-                       }
-
-                       // Treat null/undefined as ""; convert numbers to string
-                       if ( val == null ) {
-                               val = "";
-                       } else if ( typeof val === "number" ) {
-                               val += "";
-                       } else if ( jQuery.isArray( val ) ) {
-                               val = jQuery.map(val, function ( value ) {
-                                       return value == null ? "" : value + "";
-                               });
-                       }
-
-                       hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
-
-                       // If set returns undefined, fall back to normal setting
-                       if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
-                               this.value = val;
-                       }
-               });
-       }
-});
-
-jQuery.extend({
-       valHooks: {
-               option: {
-                       get: function( elem ) {
-                               // attributes.value is undefined in Blackberry 4.7 but
-                               // uses .value. See #6932
-                               var val = elem.attributes.value;
-                               return !val || val.specified ? elem.value : elem.text;
-                       }
-               },
-               select: {
-                       get: function( elem ) {
-                               var value, i, max, option,
-                                       index = elem.selectedIndex,
-                                       values = [],
-                                       options = elem.options,
-                                       one = elem.type === "select-one";
-
-                               // Nothing was selected
-                               if ( index < 0 ) {
-                                       return null;
-                               }
-
-                               // Loop through all the selected options
-                               i = one ? index : 0;
-                               max = one ? index + 1 : options.length;
-                               for ( ; i < max; i++ ) {
-                                       option = options[ i ];
-
-                                       // Don't return options that are disabled or in a disabled optgroup
-                                       if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
-                                                       (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
-
-                                               // Get the specific value for the option
-                                               value = jQuery( option ).val();
-
-                                               // We don't need an array for one selects
-                                               if ( one ) {
-                                                       return value;
-                                               }
-
-                                               // Multi-Selects return an array
-                                               values.push( value );
-                                       }
-                               }
-
-                               // Fixes Bug #2551 -- select.val() broken in IE after form.reset()
-                               if ( one && !values.length && options.length ) {
-                                       return jQuery( options[ index ] ).val();
-                               }
-
-                               return values;
-                       },
-
-                       set: function( elem, value ) {
-                               var values = jQuery.makeArray( value );
-
-                               jQuery(elem).find("option").each(function() {
-                                       this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
-                               });
-
-                               if ( !values.length ) {
-                                       elem.selectedIndex = -1;
-                               }
-                               return values;
-                       }
-               }
-       },
-
-       attrFn: {
-               val: true,
-               css: true,
-               html: true,
-               text: true,
-               data: true,
-               width: true,
-               height: true,
-               offset: true
-       },
-
-       attr: function( elem, name, value, pass ) {
-               var ret, hooks, notxml,
-                       nType = elem.nodeType;
-
-               // don't get/set attributes on text, comment and attribute nodes
-               if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-                       return;
-               }
-
-               if ( pass && name in jQuery.attrFn ) {
-                       return jQuery( elem )[ name ]( value );
-               }
-
-               // Fallback to prop when attributes are not supported
-               if ( typeof elem.getAttribute === "undefined" ) {
-                       return jQuery.prop( elem, name, value );
-               }
-
-               notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
-               // All attributes are lowercase
-               // Grab necessary hook if one is defined
-               if ( notxml ) {
-                       name = name.toLowerCase();
-                       hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
-               }
-
-               if ( value !== undefined ) {
-
-                       if ( value === null ) {
-                               jQuery.removeAttr( elem, name );
-                               return;
-
-                       } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
-                               return ret;
-
-                       } else {
-                               elem.setAttribute( name, "" + value );
-                               return value;
-                       }
-
-               } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
-                       return ret;
-
-               } else {
-
-                       ret = elem.getAttribute( name );
-
-                       // Non-existent attributes return null, we normalize to undefined
-                       return ret === null ?
-                               undefined :
-                               ret;
-               }
-       },
-
-       removeAttr: function( elem, value ) {
-               var propName, attrNames, name, l, isBool,
-                       i = 0;
-
-               if ( value && elem.nodeType === 1 ) {
-                       attrNames = value.toLowerCase().split( rspace );
-                       l = attrNames.length;
-
-                       for ( ; i < l; i++ ) {
-                               name = attrNames[ i ];
-
-                               if ( name ) {
-                                       propName = jQuery.propFix[ name ] || name;
-                                       isBool = rboolean.test( name );
-
-                                       // See #9699 for explanation of this approach (setting first, then removal)
-                                       // Do not do this for boolean attributes (see #10870)
-                                       if ( !isBool ) {
-                                               jQuery.attr( elem, name, "" );
-                                       }
-                                       elem.removeAttribute( getSetAttribute ? name : propName );
-
-                                       // Set corresponding property to false for boolean attributes
-                                       if ( isBool && propName in elem ) {
-                                               elem[ propName ] = false;
-                                       }
-                               }
-                       }
-               }
-       },
-
-       attrHooks: {
-               type: {
-                       set: function( elem, value ) {
-                               // We can't allow the type property to be changed (since it causes problems in IE)
-                               if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
-                                       jQuery.error( "type property can't be changed" );
-                               } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
-                                       // Setting the type on a radio button after the value resets the value in IE6-9
-                                       // Reset value to it's default in case type is set after value
-                                       // This is for element creation
-                                       var val = elem.value;
-                                       elem.setAttribute( "type", value );
-                                       if ( val ) {
-                                               elem.value = val;
-                                       }
-                                       return value;
-                               }
-                       }
-               },
-               // Use the value property for back compat
-               // Use the nodeHook for button elements in IE6/7 (#1954)
-               value: {
-                       get: function( elem, name ) {
-                               if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
-                                       return nodeHook.get( elem, name );
-                               }
-                               return name in elem ?
-                                       elem.value :
-                                       null;
-                       },
-                       set: function( elem, value, name ) {
-                               if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
-                                       return nodeHook.set( elem, value, name );
-                               }
-                               // Does not return so that setAttribute is also used
-                               elem.value = value;
-                       }
-               }
-       },
-
-       propFix: {
-               tabindex: "tabIndex",
-               readonly: "readOnly",
-               "for": "htmlFor",
-               "class": "className",
-               maxlength: "maxLength",
-               cellspacing: "cellSpacing",
-               cellpadding: "cellPadding",
-               rowspan: "rowSpan",
-               colspan: "colSpan",
-               usemap: "useMap",
-               frameborder: "frameBorder",
-               contenteditable: "contentEditable"
-       },
-
-       prop: function( elem, name, value ) {
-               var ret, hooks, notxml,
-                       nType = elem.nodeType;
-
-               // don't get/set properties on text, comment and attribute nodes
-               if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-                       return;
-               }
-
-               notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
-               if ( notxml ) {
-                       // Fix name and attach hooks
-                       name = jQuery.propFix[ name ] || name;
-                       hooks = jQuery.propHooks[ name ];
-               }
-
-               if ( value !== undefined ) {
-                       if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
-                               return ret;
-
-                       } else {
-                               return ( elem[ name ] = value );
-                       }
-
-               } else {
-                       if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
-                               return ret;
-
-                       } else {
-                               return elem[ name ];
-                       }
-               }
-       },
-
-       propHooks: {
-               tabIndex: {
-                       get: function( elem ) {
-                               // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
-                               // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
-                               var attributeNode = elem.getAttributeNode("tabindex");
-
-                               return attributeNode && attributeNode.specified ?
-                                       parseInt( attributeNode.value, 10 ) :
-                                       rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
-                                               0 :
-                                               undefined;
-                       }
-               }
-       }
-});
-
-// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
-jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
-
-// Hook for boolean attributes
-boolHook = {
-       get: function( elem, name ) {
-               // Align boolean attributes with corresponding properties
-               // Fall back to attribute presence where some booleans are not supported
-               var attrNode,
-                       property = jQuery.prop( elem, name );
-               return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
-                       name.toLowerCase() :
-                       undefined;
-       },
-       set: function( elem, value, name ) {
-               var propName;
-               if ( value === false ) {
-                       // Remove boolean attributes when set to false
-                       jQuery.removeAttr( elem, name );
-               } else {
-                       // value is true since we know at this point it's type boolean and not false
-                       // Set boolean attributes to the same name and set the DOM property
-                       propName = jQuery.propFix[ name ] || name;
-                       if ( propName in elem ) {
-                               // Only set the IDL specifically if it already exists on the element
-                               elem[ propName ] = true;
-                       }
-
-                       elem.setAttribute( name, name.toLowerCase() );
-               }
-               return name;
-       }
-};
-
-// IE6/7 do not support getting/setting some attributes with get/setAttribute
-if ( !getSetAttribute ) {
-
-       fixSpecified = {
-               name: true,
-               id: true,
-               coords: true
-       };
-
-       // Use this for any attribute in IE6/7
-       // This fixes almost every IE6/7 issue
-       nodeHook = jQuery.valHooks.button = {
-               get: function( elem, name ) {
-                       var ret;
-                       ret = elem.getAttributeNode( name );
-                       return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
-                               ret.nodeValue :
-                               undefined;
-               },
-               set: function( elem, value, name ) {
-                       // Set the existing or create a new attribute node
-                       var ret = elem.getAttributeNode( name );
-                       if ( !ret ) {
-                               ret = document.createAttribute( name );
-                               elem.setAttributeNode( ret );
-                       }
-                       return ( ret.nodeValue = value + "" );
-               }
-       };
-
-       // Apply the nodeHook to tabindex
-       jQuery.attrHooks.tabindex.set = nodeHook.set;
-
-       // Set width and height to auto instead of 0 on empty string( Bug #8150 )
-       // This is for removals
-       jQuery.each([ "width", "height" ], function( i, name ) {
-               jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
-                       set: function( elem, value ) {
-                               if ( value === "" ) {
-                                       elem.setAttribute( name, "auto" );
-                                       return value;
-                               }
-                       }
-               });
-       });
-
-       // Set contenteditable to false on removals(#10429)
-       // Setting to empty string throws an error as an invalid value
-       jQuery.attrHooks.contenteditable = {
-               get: nodeHook.get,
-               set: function( elem, value, name ) {
-                       if ( value === "" ) {
-                               value = "false";
-                       }
-                       nodeHook.set( elem, value, name );
-               }
-       };
-}
-
-
-// Some attributes require a special call on IE
-if ( !jQuery.support.hrefNormalized ) {
-       jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
-               jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
-                       get: function( elem ) {
-                               var ret = elem.getAttribute( name, 2 );
-                               return ret === null ? undefined : ret;
-                       }
-               });
-       });
-}
-
-if ( !jQuery.support.style ) {
-       jQuery.attrHooks.style = {
-               get: function( elem ) {
-                       // Return undefined in the case of empty string
-                       // Normalize to lowercase since IE uppercases css property names
-                       return elem.style.cssText.toLowerCase() || undefined;
-               },
-               set: function( elem, value ) {
-                       return ( elem.style.cssText = "" + value );
-               }
-       };
-}
-
-// Safari mis-reports the default selected property of an option
-// Accessing the parent's selectedIndex property fixes it
-if ( !jQuery.support.optSelected ) {
-       jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
-               get: function( elem ) {
-                       var parent = elem.parentNode;
-
-                       if ( parent ) {
-                               parent.selectedIndex;
-
-                               // Make sure that it also works with optgroups, see #5701
-                               if ( parent.parentNode ) {
-                                       parent.parentNode.selectedIndex;
-                               }
-                       }
-                       return null;
-               }
-       });
-}
-
-// IE6/7 call enctype encoding
-if ( !jQuery.support.enctype ) {
-       jQuery.propFix.enctype = "encoding";
-}
-
-// Radios and checkboxes getter/setter
-if ( !jQuery.support.checkOn ) {
-       jQuery.each([ "radio", "checkbox" ], function() {
-               jQuery.valHooks[ this ] = {
-                       get: function( elem ) {
-                               // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
-                               return elem.getAttribute("value") === null ? "on" : elem.value;
-                       }
-               };
-       });
-}
-jQuery.each([ "radio", "checkbox" ], function() {
-       jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
-               set: function( elem, value ) {
-                       if ( jQuery.isArray( value ) ) {
-                               return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
-                       }
-               }
-       });
-});
-
-
-
-
-var rformElems = /^(?:textarea|input|select)$/i,
-       rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
-       rhoverHack = /(?:^|\s)hover(\.\S+)?\b/,
-       rkeyEvent = /^key/,
-       rmouseEvent = /^(?:mouse|contextmenu)|click/,
-       rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
-       rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
-       quickParse = function( selector ) {
-               var quick = rquickIs.exec( selector );
-               if ( quick ) {
-                       //   0  1    2   3
-                       // [ _, tag, id, class ]
-                       quick[1] = ( quick[1] || "" ).toLowerCase();
-                       quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
-               }
-               return quick;
-       },
-       quickIs = function( elem, m ) {
-               var attrs = elem.attributes || {};
-               return (
-                       (!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
-                       (!m[2] || (attrs.id || {}).value === m[2]) &&
-                       (!m[3] || m[3].test( (attrs[ "class" ] || {}).value ))
-               );
-       },
-       hoverHack = function( events ) {
-               return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
-       };
-
-/*
- * Helper functions for managing events -- not part of the public interface.
- * Props to Dean Edwards' addEvent library for many of the ideas.
- */
-jQuery.event = {
-
-       add: function( elem, types, handler, data, selector ) {
-
-               var elemData, eventHandle, events,
-                       t, tns, type, namespaces, handleObj,
-                       handleObjIn, quick, handlers, special;
-
-               // Don't attach events to noData or text/comment nodes (allow plain objects tho)
-               if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
-                       return;
-               }
-
-               // Caller can pass in an object of custom data in lieu of the handler
-               if ( handler.handler ) {
-                       handleObjIn = handler;
-                       handler = handleObjIn.handler;
-                       selector = handleObjIn.selector;
-               }
-
-               // Make sure that the handler has a unique ID, used to find/remove it later
-               if ( !handler.guid ) {
-                       handler.guid = jQuery.guid++;
-               }
-
-               // Init the element's event structure and main handler, if this is the first
-               events = elemData.events;
-               if ( !events ) {
-                       elemData.events = events = {};
-               }
-               eventHandle = elemData.handle;
-               if ( !eventHandle ) {
-                       elemData.handle = eventHandle = function( e ) {
-                               // Discard the second event of a jQuery.event.trigger() and
-                               // when an event is called after a page has unloaded
-                               return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
-                                       jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
-                                       undefined;
-                       };
-                       // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
-                       eventHandle.elem = elem;
-               }
-
-               // Handle multiple events separated by a space
-               // jQuery(...).bind("mouseover mouseout", fn);
-               types = jQuery.trim( hoverHack(types) ).split( " " );
-               for ( t = 0; t < types.length; t++ ) {
-
-                       tns = rtypenamespace.exec( types[t] ) || [];
-                       type = tns[1];
-                       namespaces = ( tns[2] || "" ).split( "." ).sort();
-
-                       // If event changes its type, use the special event handlers for the changed type
-                       special = jQuery.event.special[ type ] || {};
-
-                       // If selector defined, determine special event api type, otherwise given type
-                       type = ( selector ? special.delegateType : special.bindType ) || type;
-
-                       // Update special based on newly reset type
-                       special = jQuery.event.special[ type ] || {};
-
-                       // handleObj is passed to all event handlers
-                       handleObj = jQuery.extend({
-                               type: type,
-                               origType: tns[1],
-                               data: data,
-                               handler: handler,
-                               guid: handler.guid,
-                               selector: selector,
-                               quick: selector && quickParse( selector ),
-                               namespace: namespaces.join(".")
-                       }, handleObjIn );
-
-                       // Init the event handler queue if we're the first
-                       handlers = events[ type ];
-                       if ( !handlers ) {
-                               handlers = events[ type ] = [];
-                               handlers.delegateCount = 0;
-
-                               // Only use addEventListener/attachEvent if the special events handler returns false
-                               if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
-                                       // Bind the global event handler to the element
-                                       if ( elem.addEventListener ) {
-                                               elem.addEventListener( type, eventHandle, false );
-
-                                       } else if ( elem.attachEvent ) {
-                                               elem.attachEvent( "on" + type, eventHandle );
-                                       }
-                               }
-                       }
-
-                       if ( special.add ) {
-                               special.add.call( elem, handleObj );
-
-                               if ( !handleObj.handler.guid ) {
-                                       handleObj.handler.guid = handler.guid;
-                               }
-                       }
-
-                       // Add to the element's handler list, delegates in front
-                       if ( selector ) {
-                               handlers.splice( handlers.delegateCount++, 0, handleObj );
-                       } else {
-                               handlers.push( handleObj );
-                       }
-
-                       // Keep track of which events have ever been used, for event optimization
-                       jQuery.event.global[ type ] = true;
-               }
-
-               // Nullify elem to prevent memory leaks in IE
-               elem = null;
-       },
-
-       global: {},
-
-       // Detach an event or set of events from an element
-       remove: function( elem, types, handler, selector, mappedTypes ) {
-
-               var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
-                       t, tns, type, origType, namespaces, origCount,
-                       j, events, special, handle, eventType, handleObj;
-
-               if ( !elemData || !(events = elemData.events) ) {
-                       return;
-               }
-
-               // Once for each type.namespace in types; type may be omitted
-               types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
-               for ( t = 0; t < types.length; t++ ) {
-                       tns = rtypenamespace.exec( types[t] ) || [];
-                       type = origType = tns[1];
-                       namespaces = tns[2];
-
-                       // Unbind all events (on this namespace, if provided) for the element
-                       if ( !type ) {
-                               for ( type in events ) {
-                                       jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
-                               }
-                               continue;
-                       }
-
-                       special = jQuery.event.special[ type ] || {};
-                       type = ( selector? special.delegateType : special.bindType ) || type;
-                       eventType = events[ type ] || [];
-                       origCount = eventType.length;
-                       namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
-
-                       // Remove matching events
-                       for ( j = 0; j < eventType.length; j++ ) {
-                               handleObj = eventType[ j ];
-
-                               if ( ( mappedTypes || origType === handleObj.origType ) &&
-                                        ( !handler || handler.guid === handleObj.guid ) &&
-                                        ( !namespaces || namespaces.test( handleObj.namespace ) ) &&
-                                        ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
-                                       eventType.splice( j--, 1 );
-
-                                       if ( handleObj.selector ) {
-                                               eventType.delegateCount--;
-                                       }
-                                       if ( special.remove ) {
-                                               special.remove.call( elem, handleObj );
-                                       }
-                               }
-                       }
-
-                       // Remove generic event handler if we removed something and no more handlers exist
-                       // (avoids potential for endless recursion during removal of special event handlers)
-                       if ( eventType.length === 0 && origCount !== eventType.length ) {
-                               if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
-                                       jQuery.removeEvent( elem, type, elemData.handle );
-                               }
-
-                               delete events[ type ];
-                       }
-               }
-
-               // Remove the expando if it's no longer used
-               if ( jQuery.isEmptyObject( events ) ) {
-                       handle = elemData.handle;
-                       if ( handle ) {
-                               handle.elem = null;
-                       }
-
-                       // removeData also checks for emptiness and clears the expando if empty
-                       // so use it instead of delete
-                       jQuery.removeData( elem, [ "events", "handle" ], true );
-               }
-       },
-
-       // Events that are safe to short-circuit if no handlers are attached.
-       // Native DOM events should not be added, they may have inline handlers.
-       customEvent: {
-               "getData": true,
-               "setData": true,
-               "changeData": true
-       },
-
-       trigger: function( event, data, elem, onlyHandlers ) {
-               // Don't do events on text and comment nodes
-               if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
-                       return;
-               }
-
-               // Event object or event type
-               var type = event.type || event,
-                       namespaces = [],
-                       cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
-
-               // focus/blur morphs to focusin/out; ensure we're not firing them right now
-               if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
-                       return;
-               }
-
-               if ( type.indexOf( "!" ) >= 0 ) {
-                       // Exclusive events trigger only for the exact event (no namespaces)
-                       type = type.slice(0, -1);
-                       exclusive = true;
-               }
-
-               if ( type.indexOf( "." ) >= 0 ) {
-                       // Namespaced trigger; create a regexp to match event type in handle()
-                       namespaces = type.split(".");
-                       type = namespaces.shift();
-                       namespaces.sort();
-               }
-
-               if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
-                       // No jQuery handlers for this event type, and it can't have inline handlers
-                       return;
-               }
-
-               // Caller can pass in an Event, Object, or just an event type string
-               event = typeof event === "object" ?
-                       // jQuery.Event object
-                       event[ jQuery.expando ] ? event :
-                       // Object literal
-                       new jQuery.Event( type, event ) :
-                       // Just the event type (string)
-                       new jQuery.Event( type );
-
-               event.type = type;
-               event.isTrigger = true;
-               event.exclusive = exclusive;
-               event.namespace = namespaces.join( "." );
-               event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
-               ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
-
-               // Handle a global trigger
-               if ( !elem ) {
-
-                       // TODO: Stop taunting the data cache; remove global events and always attach to document
-                       cache = jQuery.cache;
-                       for ( i in cache ) {
-                               if ( cache[ i ].events && cache[ i ].events[ type ] ) {
-                                       jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
-                               }
-                       }
-                       return;
-               }
-
-               // Clean up the event in case it is being reused
-               event.result = undefined;
-               if ( !event.target ) {
-                       event.target = elem;
-               }
-
-               // Clone any incoming data and prepend the event, creating the handler arg list
-               data = data != null ? jQuery.makeArray( data ) : [];
-               data.unshift( event );
-
-               // Allow special events to draw outside the lines
-               special = jQuery.event.special[ type ] || {};
-               if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
-                       return;
-               }
-
-               // Determine event propagation path in advance, per W3C events spec (#9951)
-               // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
-               eventPath = [[ elem, special.bindType || type ]];
-               if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
-
-                       bubbleType = special.delegateType || type;
-                       cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
-                       old = null;
-                       for ( ; cur; cur = cur.parentNode ) {
-                               eventPath.push([ cur, bubbleType ]);
-                               old = cur;
-                       }
-
-                       // Only add window if we got to document (e.g., not plain obj or detached DOM)
-                       if ( old && old === elem.ownerDocument ) {
-                               eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
-                       }
-               }
-
-               // Fire handlers on the event path
-               for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
-
-                       cur = eventPath[i][0];
-                       event.type = eventPath[i][1];
-
-                       handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
-                       if ( handle ) {
-                               handle.apply( cur, data );
-                       }
-                       // Note that this is a bare JS function and not a jQuery handler
-                       handle = ontype && cur[ ontype ];
-                       if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) {
-                               event.preventDefault();
-                       }
-               }
-               event.type = type;
-
-               // If nobody prevented the default action, do it now
-               if ( !onlyHandlers && !event.isDefaultPrevented() ) {
-
-                       if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
-                               !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
-
-                               // Call a native DOM method on the target with the same name name as the event.
-                               // Can't use an .isFunction() check here because IE6/7 fails that test.
-                               // Don't do default actions on window, that's where global variables be (#6170)
-                               // IE<9 dies on focus/blur to hidden element (#1486)
-                               if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
-
-                                       // Don't re-trigger an onFOO event when we call its FOO() method
-                                       old = elem[ ontype ];
-
-                                       if ( old ) {
-                                               elem[ ontype ] = null;
-                                       }
-
-                                       // Prevent re-triggering of the same event, since we already bubbled it above
-                                       jQuery.event.triggered = type;
-                                       elem[ type ]();
-                                       jQuery.event.triggered = undefined;
-
-                                       if ( old ) {
-                                               elem[ ontype ] = old;
-                                       }
-                               }
-                       }
-               }
-
-               return event.result;
-       },
-
-       dispatch: function( event ) {
-
-               // Make a writable jQuery.Event from the native event object
-               event = jQuery.event.fix( event || window.event );
-
-               var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
-                       delegateCount = handlers.delegateCount,
-                       args = [].slice.call( arguments, 0 ),
-                       run_all = !event.exclusive && !event.namespace,
-                       special = jQuery.event.special[ event.type ] || {},
-                       handlerQueue = [],
-                       i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related;
-
-               // Use the fix-ed jQuery.Event rather than the (read-only) native event
-               args[0] = event;
-               event.delegateTarget = this;
-
-               // Call the preDispatch hook for the mapped type, and let it bail if desired
-               if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
-                       return;
-               }
-
-               // Determine handlers that should run if there are delegated events
-               // Avoid non-left-click bubbling in Firefox (#3861)
-               if ( delegateCount && !(event.button && event.type === "click") ) {
-
-                       // Pregenerate a single jQuery object for reuse with .is()
-                       jqcur = jQuery(this);
-                       jqcur.context = this.ownerDocument || this;
-
-                       for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
-
-                               // Don't process events on disabled elements (#6911, #8165)
-                               if ( cur.disabled !== true ) {
-                                       selMatch = {};
-                                       matches = [];
-                                       jqcur[0] = cur;
-                                       for ( i = 0; i < delegateCount; i++ ) {
-                                               handleObj = handlers[ i ];
-                                               sel = handleObj.selector;
-
-                                               if ( selMatch[ sel ] === undefined ) {
-                                                       selMatch[ sel ] = (
-                                                               handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel )
-                                                       );
-                                               }
-                                               if ( selMatch[ sel ] ) {
-                                                       matches.push( handleObj );
-                                               }
-                                       }
-                                       if ( matches.length ) {
-                                               handlerQueue.push({ elem: cur, matches: matches });
-                                       }
-                               }
-                       }
-               }
-
-               // Add the remaining (directly-bound) handlers
-               if ( handlers.length > delegateCount ) {
-                       handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
-               }
-
-               // Run delegates first; they may want to stop propagation beneath us
-               for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
-                       matched = handlerQueue[ i ];
-                       event.currentTarget = matched.elem;
-
-                       for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
-                               handleObj = matched.matches[ j ];
-
-                               // Triggered event must either 1) be non-exclusive and have no namespace, or
-                               // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
-                               if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
-
-                                       event.data = handleObj.data;
-                                       event.handleObj = handleObj;
-
-                                       ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
-                                                       .apply( matched.elem, args );
-
-                                       if ( ret !== undefined ) {
-                                               event.result = ret;
-                                               if ( ret === false ) {
-                                                       event.preventDefault();
-                                                       event.stopPropagation();
-                                               }
-                                       }
-                               }
-                       }
-               }
-
-               // Call the postDispatch hook for the mapped type
-               if ( special.postDispatch ) {
-                       special.postDispatch.call( this, event );
-               }
-
-               return event.result;
-       },
-
-       // Includes some event props shared by KeyEvent and MouseEvent
-       // *** attrChange attrName relatedNode srcElement  are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
-       props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
-
-       fixHooks: {},
-
-       keyHooks: {
-               props: "char charCode key keyCode".split(" "),
-               filter: function( event, original ) {
-
-                       // Add which for key events
-                       if ( event.which == null ) {
-                               event.which = original.charCode != null ? original.charCode : original.keyCode;
-                       }
-
-                       return event;
-               }
-       },
-
-       mouseHooks: {
-               props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
-               filter: function( event, original ) {
-                       var eventDoc, doc, body,
-                               button = original.button,
-                               fromElement = original.fromElement;
-
-                       // Calculate pageX/Y if missing and clientX/Y available
-                       if ( event.pageX == null && original.clientX != null ) {
-                               eventDoc = event.target.ownerDocument || document;
-                               doc = eventDoc.documentElement;
-                               body = eventDoc.body;
-
-                               event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
-                               event.pageY = original.clientY + ( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) - ( doc && doc.clientTop  || body && body.clientTop  || 0 );
-                       }
-
-                       // Add relatedTarget, if necessary
-                       if ( !event.relatedTarget && fromElement ) {
-                               event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
-                       }
-
-                       // Add which for click: 1 === left; 2 === middle; 3 === right
-                       // Note: button is not normalized, so don't use it
-                       if ( !event.which && button !== undefined ) {
-                               event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
-                       }
-
-                       return event;
-               }
-       },
-
-       fix: function( event ) {
-               if ( event[ jQuery.expando ] ) {
-                       return event;
-               }
-
-               // Create a writable copy of the event object and normalize some properties
-               var i, prop,
-                       originalEvent = event,
-                       fixHook = jQuery.event.fixHooks[ event.type ] || {},
-                       copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
-
-               event = jQuery.Event( originalEvent );
-
-               for ( i = copy.length; i; ) {
-                       prop = copy[ --i ];
-                       event[ prop ] = originalEvent[ prop ];
-               }
-
-               // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
-               if ( !event.target ) {
-                       event.target = originalEvent.srcElement || document;
-               }
-
-               // Target should not be a text node (#504, Safari)
-               if ( event.target.nodeType === 3 ) {
-                       event.target = event.target.parentNode;
-               }
-
-               // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)
-               if ( event.metaKey === undefined ) {
-                       event.metaKey = event.ctrlKey;
-               }
-
-               return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
-       },
-
-       special: {
-               ready: {
-                       // Make sure the ready event is setup
-                       setup: jQuery.bindReady
-               },
-
-               load: {
-                       // Prevent triggered image.load events from bubbling to window.load
-                       noBubble: true
-               },
-
-               focus: {
-                       delegateType: "focusin"
-               },
-               blur: {
-                       delegateType: "focusout"
-               },
-
-               beforeunload: {
-                       setup: function( data, namespaces, eventHandle ) {
-                               // We only want to do this special case on windows
-                               if ( jQuery.isWindow( this ) ) {
-                                       this.onbeforeunload = eventHandle;
-                               }
-                       },
-
-                       teardown: function( namespaces, eventHandle ) {
-                               if ( this.onbeforeunload === eventHandle ) {
-                                       this.onbeforeunload = null;
-                               }
-                       }
-               }
-       },
-
-       simulate: function( type, elem, event, bubble ) {
-               // Piggyback on a donor event to simulate a different one.
-               // Fake originalEvent to avoid donor's stopPropagation, but if the
-               // simulated event prevents default then we do the same on the donor.
-               var e = jQuery.extend(
-                       new jQuery.Event(),
-                       event,
-                       { type: type,
-                               isSimulated: true,
-                               originalEvent: {}
-                       }
-               );
-               if ( bubble ) {
-                       jQuery.event.trigger( e, null, elem );
-               } else {
-                       jQuery.event.dispatch.call( elem, e );
-               }
-               if ( e.isDefaultPrevented() ) {
-                       event.preventDefault();
-               }
-       }
-};
-
-// Some plugins are using, but it's undocumented/deprecated and will be removed.
-// The 1.7 special event interface should provide all the hooks needed now.
-jQuery.event.handle = jQuery.event.dispatch;
-
-jQuery.removeEvent = document.removeEventListener ?
-       function( elem, type, handle ) {
-               if ( elem.removeEventListener ) {
-                       elem.removeEventListener( type, handle, false );
-               }
-       } :
-       function( elem, type, handle ) {
-               if ( elem.detachEvent ) {
-                       elem.detachEvent( "on" + type, handle );
-               }
-       };
-
-jQuery.Event = function( src, props ) {
-       // Allow instantiation without the 'new' keyword
-       if ( !(this instanceof jQuery.Event) ) {
-               return new jQuery.Event( src, props );
-       }
-
-       // Event object
-       if ( src && src.type ) {
-               this.originalEvent = src;
-               this.type = src.type;
-
-               // Events bubbling up the document may have been marked as prevented
-               // by a handler lower down the tree; reflect the correct value.
-               this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
-                       src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
-
-       // Event type
-       } else {
-               this.type = src;
-       }
-
-       // Put explicitly provided properties onto the event object
-       if ( props ) {
-               jQuery.extend( this, props );
-       }
-
-       // Create a timestamp if incoming event doesn't have one
-       this.timeStamp = src && src.timeStamp || jQuery.now();
-
-       // Mark it as fixed
-       this[ jQuery.expando ] = true;
-};
-
-function returnFalse() {
-       return false;
-}
-function returnTrue() {
-       return true;
-}
-
-// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
-// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
-jQuery.Event.prototype = {
-       preventDefault: function() {
-               this.isDefaultPrevented = returnTrue;
-
-               var e = this.originalEvent;
-               if ( !e ) {
-                       return;
-               }
-
-               // if preventDefault exists run it on the original event
-               if ( e.preventDefault ) {
-                       e.preventDefault();
-
-               // otherwise set the returnValue property of the original event to false (IE)
-               } else {
-                       e.returnValue = false;
-               }
-       },
-       stopPropagation: function() {
-               this.isPropagationStopped = returnTrue;
-
-               var e = this.originalEvent;
-               if ( !e ) {
-                       return;
-               }
-               // if stopPropagation exists run it on the original event
-               if ( e.stopPropagation ) {
-                       e.stopPropagation();
-               }
-               // otherwise set the cancelBubble property of the original event to true (IE)
-               e.cancelBubble = true;
-       },
-       stopImmediatePropagation: function() {
-               this.isImmediatePropagationStopped = returnTrue;
-               this.stopPropagation();
-       },
-       isDefaultPrevented: returnFalse,
-       isPropagationStopped: returnFalse,
-       isImmediatePropagationStopped: returnFalse
-};
-
-// Create mouseenter/leave events using mouseover/out and event-time checks
-jQuery.each({
-       mouseenter: "mouseover",
-       mouseleave: "mouseout"
-}, function( orig, fix ) {
-       jQuery.event.special[ orig ] = {
-               delegateType: fix,
-               bindType: fix,
-
-               handle: function( event ) {
-                       var target = this,
-                               related = event.relatedTarget,
-                               handleObj = event.handleObj,
-                               selector = handleObj.selector,
-                               ret;
-
-                       // For mousenter/leave call the handler if related is outside the target.
-                       // NB: No relatedTarget if the mouse left/entered the browser window
-                       if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
-                               event.type = handleObj.origType;
-                               ret = handleObj.handler.apply( this, arguments );
-                               event.type = fix;
-                       }
-                       return ret;
-               }
-       };
-});
-
-// IE submit delegation
-if ( !jQuery.support.submitBubbles ) {
-
-       jQuery.event.special.submit = {
-               setup: function() {
-                       // Only need this for delegated form submit events
-                       if ( jQuery.nodeName( this, "form" ) ) {
-                               return false;
-                       }
-
-                       // Lazy-add a submit handler when a descendant form may potentially be submitted
-                       jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
-                               // Node name check avoids a VML-related crash in IE (#9807)
-                               var elem = e.target,
-                                       form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
-                               if ( form && !form._submit_attached ) {
-                                       jQuery.event.add( form, "submit._submit", function( event ) {
-                                               event._submit_bubble = true;
-                                       });
-                                       form._submit_attached = true;
-                               }
-                       });
-                       // return undefined since we don't need an event listener
-               },
-               
-               postDispatch: function( event ) {
-                       // If form was submitted by the user, bubble the event up the tree
-                       if ( event._submit_bubble ) {
-                               delete event._submit_bubble;
-                               if ( this.parentNode && !event.isTrigger ) {
-                                       jQuery.event.simulate( "submit", this.parentNode, event, true );
-                               }
-                       }
-               },
-
-               teardown: function() {
-                       // Only need this for delegated form submit events
-                       if ( jQuery.nodeName( this, "form" ) ) {
-                               return false;
-                       }
-
-                       // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
-                       jQuery.event.remove( this, "._submit" );
-               }
-       };
-}
-
-// IE change delegation and checkbox/radio fix
-if ( !jQuery.support.changeBubbles ) {
-
-       jQuery.event.special.change = {
-
-               setup: function() {
-
-                       if ( rformElems.test( this.nodeName ) ) {
-                               // IE doesn't fire change on a check/radio until blur; trigger it on click
-                               // after a propertychange. Eat the blur-change in special.change.handle.
-                               // This still fires onchange a second time for check/radio after blur.
-                               if ( this.type === "checkbox" || this.type === "radio" ) {
-                                       jQuery.event.add( this, "propertychange._change", function( event ) {
-                                               if ( event.originalEvent.propertyName === "checked" ) {
-                                                       this._just_changed = true;
-                                               }
-                                       });
-                                       jQuery.event.add( this, "click._change", function( event ) {
-                                               if ( this._just_changed && !event.isTrigger ) {
-                                                       this._just_changed = false;
-                                                       jQuery.event.simulate( "change", this, event, true );
-                                               }
-                                       });
-                               }
-                               return false;
-                       }
-                       // Delegated event; lazy-add a change handler on descendant inputs
-                       jQuery.event.add( this, "beforeactivate._change", function( e ) {
-                               var elem = e.target;
-
-                               if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) {
-                                       jQuery.event.add( elem, "change._change", function( event ) {
-                                               if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
-                                                       jQuery.event.simulate( "change", this.parentNode, event, true );
-                                               }
-                                       });
-                                       elem._change_attached = true;
-                               }
-                       });
-               },
-
-               handle: function( event ) {
-                       var elem = event.target;
-
-                       // Swallow native change events from checkbox/radio, we already triggered them above
-                       if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
-                               return event.handleObj.handler.apply( this, arguments );
-                       }
-               },
-
-               teardown: function() {
-                       jQuery.event.remove( this, "._change" );
-
-                       return rformElems.test( this.nodeName );
-               }
-       };
-}
-
-// Create "bubbling" focus and blur events
-if ( !jQuery.support.focusinBubbles ) {
-       jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
-
-               // Attach a single capturing handler while someone wants focusin/focusout
-               var attaches = 0,
-                       handler = function( event ) {
-                               jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
-                       };
-
-               jQuery.event.special[ fix ] = {
-                       setup: function() {
-                               if ( attaches++ === 0 ) {
-                                       document.addEventListener( orig, handler, true );
-                               }
-                       },
-                       teardown: function() {
-                               if ( --attaches === 0 ) {
-                                       document.removeEventListener( orig, handler, true );
-                               }
-                       }
-               };
-       });
-}
-
-jQuery.fn.extend({
-
-       on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
-               var origFn, type;
-
-               // Types can be a map of types/handlers
-               if ( typeof types === "object" ) {
-                       // ( types-Object, selector, data )
-                       if ( typeof selector !== "string" ) { // && selector != null
-                               // ( types-Object, data )
-                               data = data || selector;
-                               selector = undefined;
-                       }
-                       for ( type in types ) {
-                               this.on( type, selector, data, types[ type ], one );
-                       }
-                       return this;
-               }
-
-               if ( data == null && fn == null ) {
-                       // ( types, fn )
-                       fn = selector;
-                       data = selector = undefined;
-               } else if ( fn == null ) {
-                       if ( typeof selector === "string" ) {
-                               // ( types, selector, fn )
-                               fn = data;
-                               data = undefined;
-                       } else {
-                               // ( types, data, fn )
-                               fn = data;
-                               data = selector;
-                               selector = undefined;
-                       }
-               }
-               if ( fn === false ) {
-                       fn = returnFalse;
-               } else if ( !fn ) {
-                       return this;
-               }
-
-               if ( one === 1 ) {
-                       origFn = fn;
-                       fn = function( event ) {
-                               // Can use an empty set, since event contains the info
-                               jQuery().off( event );
-                               return origFn.apply( this, arguments );
-                       };
-                       // Use same guid so caller can remove using origFn
-                       fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
-               }
-               return this.each( function() {
-                       jQuery.event.add( this, types, fn, data, selector );
-               });
-       },
-       one: function( types, selector, data, fn ) {
-               return this.on( types, selector, data, fn, 1 );
-       },
-       off: function( types, selector, fn ) {
-               if ( types && types.preventDefault && types.handleObj ) {
-                       // ( event )  dispatched jQuery.Event
-                       var handleObj = types.handleObj;
-                       jQuery( types.delegateTarget ).off(
-                               handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
-                               handleObj.selector,
-                               handleObj.handler
-                       );
-                       return this;
-               }
-               if ( typeof types === "object" ) {
-                       // ( types-object [, selector] )
-                       for ( var type in types ) {
-                               this.off( type, selector, types[ type ] );
-                       }
-                       return this;
-               }
-               if ( selector === false || typeof selector === "function" ) {
-                       // ( types [, fn] )
-                       fn = selector;
-                       selector = undefined;
-               }
-               if ( fn === false ) {
-                       fn = returnFalse;
-               }
-               return this.each(function() {
-                       jQuery.event.remove( this, types, fn, selector );
-               });
-       },
-
-       bind: function( types, data, fn ) {
-               return this.on( types, null, data, fn );
-       },
-       unbind: function( types, fn ) {
-               return this.off( types, null, fn );
-       },
-
-       live: function( types, data, fn ) {
-               jQuery( this.context ).on( types, this.selector, data, fn );
-               return this;
-       },
-       die: function( types, fn ) {
-               jQuery( this.context ).off( types, this.selector || "**", fn );
-               return this;
-       },
-
-       delegate: function( selector, types, data, fn ) {
-               return this.on( types, selector, data, fn );
-       },
-       undelegate: function( selector, types, fn ) {
-               // ( namespace ) or ( selector, types [, fn] )
-               return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn );
-       },
-
-       trigger: function( type, data ) {
-               return this.each(function() {
-                       jQuery.event.trigger( type, data, this );
-               });
-       },
-       triggerHandler: function( type, data ) {
-               if ( this[0] ) {
-                       return jQuery.event.trigger( type, data, this[0], true );
-               }
-       },
-
-       toggle: function( fn ) {
-               // Save reference to arguments for access in closure
-               var args = arguments,
-                       guid = fn.guid || jQuery.guid++,
-                       i = 0,
-                       toggler = function( event ) {
-                               // Figure out which function to execute
-                               var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
-                               jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
-
-                               // Make sure that clicks stop
-                               event.preventDefault();
-
-                               // and execute the function
-                               return args[ lastToggle ].apply( this, arguments ) || false;
-                       };
-
-               // link all the functions, so any of them can unbind this click handler
-               toggler.guid = guid;
-               while ( i < args.length ) {
-                       args[ i++ ].guid = guid;
-               }
-
-               return this.click( toggler );
-       },
-
-       hover: function( fnOver, fnOut ) {
-               return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
-       }
-});
-
-jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
-       "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
-       "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
-
-       // Handle event binding
-       jQuery.fn[ name ] = function( data, fn ) {
-               if ( fn == null ) {
-                       fn = data;
-                       data = null;
-               }
-
-               return arguments.length > 0 ?
-                       this.on( name, null, data, fn ) :
-                       this.trigger( name );
-       };
-
-       if ( jQuery.attrFn ) {
-               jQuery.attrFn[ name ] = true;
-       }
-
-       if ( rkeyEvent.test( name ) ) {
-               jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
-       }
-
-       if ( rmouseEvent.test( name ) ) {
-               jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
-       }
-});
-
-
-
-/*!
- * Sizzle CSS Selector Engine
- *  Copyright 2011, The Dojo Foundation
- *  Released under the MIT, BSD, and GPL Licenses.
- *  More information: http://sizzlejs.com/
- */
-(function(){
-
-var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
-       expando = "sizcache" + (Math.random() + '').replace('.', ''),
-       done = 0,
-       toString = Object.prototype.toString,
-       hasDuplicate = false,
-       baseHasDuplicate = true,
-       rBackslash = /\\/g,
-       rReturn = /\r\n/g,
-       rNonWord = /\W/;
-
-// Here we check if the JavaScript engine is using some sort of
-// optimization where it does not always call our comparision
-// function. If that is the case, discard the hasDuplicate value.
-//   Thus far that includes Google Chrome.
-[0, 0].sort(function() {
-       baseHasDuplicate = false;
-       return 0;
-});
-
-var Sizzle = function( selector, context, results, seed ) {
-       results = results || [];
-       context = context || document;
-
-       var origContext = context;
-
-       if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
-               return [];
-       }
-
-       if ( !selector || typeof selector !== "string" ) {
-               return results;
-       }
-
-       var m, set, checkSet, extra, ret, cur, pop, i,
-               prune = true,
-               contextXML = Sizzle.isXML( context ),
-               parts = [],
-               soFar = selector;
-
-       // Reset the position of the chunker regexp (start from head)
-       do {
-               chunker.exec( "" );
-               m = chunker.exec( soFar );
-
-               if ( m ) {
-                       soFar = m[3];
-
-                       parts.push( m[1] );
-
-                       if ( m[2] ) {
-                               extra = m[3];
-                               break;
-                       }
-               }
-       } while ( m );
-
-       if ( parts.length > 1 && origPOS.exec( selector ) ) {
-
-               if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
-                       set = posProcess( parts[0] + parts[1], context, seed );
-
-               } else {
-                       set = Expr.relative[ parts[0] ] ?
-                               [ context ] :
-                               Sizzle( parts.shift(), context );
-
-                       while ( parts.length ) {
-                               selector = parts.shift();
-
-                               if ( Expr.relative[ selector ] ) {
-                                       selector += parts.shift();
-                               }
-
-                               set = posProcess( selector, set, seed );
-                       }
-               }
-
-       } else {
-               // Take a shortcut and set the context if the root selector is an ID
-               // (but not if it'll be faster if the inner selector is an ID)
-               if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
-                               Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
-
-                       ret = Sizzle.find( parts.shift(), context, contextXML );
-                       context = ret.expr ?
-                               Sizzle.filter( ret.expr, ret.set )[0] :
-                               ret.set[0];
-               }
-
-               if ( context ) {
-                       ret = seed ?
-                               { expr: parts.pop(), set: makeArray(seed) } :
-                               Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
-
-                       set = ret.expr ?
-                               Sizzle.filter( ret.expr, ret.set ) :
-                               ret.set;
-
-                       if ( parts.length > 0 ) {
-                               checkSet = makeArray( set );
-
-                       } else {
-                               prune = false;
-                       }
-
-                       while ( parts.length ) {
-                               cur = parts.pop();
-                               pop = cur;
-
-                               if ( !Expr.relative[ cur ] ) {
-                                       cur = "";
-                               } else {
-                                       pop = parts.pop();
-                               }
-
-                               if ( pop == null ) {
-                                       pop = context;
-                               }
-
-                               Expr.relative[ cur ]( checkSet, pop, contextXML );
-                       }
-
-               } else {
-                       checkSet = parts = [];
-               }
-       }
-
-       if ( !checkSet ) {
-               checkSet = set;
-       }
-
-       if ( !checkSet ) {
-               Sizzle.error( cur || selector );
-       }
-
-       if ( toString.call(checkSet) === "[object Array]" ) {
-               if ( !prune ) {
-                       results.push.apply( results, checkSet );
-
-               } else if ( context && context.nodeType === 1 ) {
-                       for ( i = 0; checkSet[i] != null; i++ ) {
-                               if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
-                                       results.push( set[i] );
-                               }
-                       }
-
-               } else {
-                       for ( i = 0; checkSet[i] != null; i++ ) {
-                               if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
-                                       results.push( set[i] );
-                               }
-                       }
-               }
-
-       } else {
-               makeArray( checkSet, results );
-       }
-
-       if ( extra ) {
-               Sizzle( extra, origContext, results, seed );
-               Sizzle.uniqueSort( results );
-       }
-
-       return results;
-};
-
-Sizzle.uniqueSort = function( results ) {
-       if ( sortOrder ) {
-               hasDuplicate = baseHasDuplicate;
-               results.sort( sortOrder );
-
-               if ( hasDuplicate ) {
-                       for ( var i = 1; i < results.length; i++ ) {
-                               if ( results[i] === results[ i - 1 ] ) {
-                                       results.splice( i--, 1 );
-                               }
-                       }
-               }
-       }
-
-       return results;
-};
-
-Sizzle.matches = function( expr, set ) {
-       return Sizzle( expr, null, null, set );
-};
-
-Sizzle.matchesSelector = function( node, expr ) {
-       return Sizzle( expr, null, null, [node] ).length > 0;
-};
-
-Sizzle.find = function( expr, context, isXML ) {
-       var set, i, len, match, type, left;
-
-       if ( !expr ) {
-               return [];
-       }
-
-       for ( i = 0, len = Expr.order.length; i < len; i++ ) {
-               type = Expr.order[i];
-
-               if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
-                       left = match[1];
-                       match.splice( 1, 1 );
-
-                       if ( left.substr( left.length - 1 ) !== "\\" ) {
-                               match[1] = (match[1] || "").replace( rBackslash, "" );
-                               set = Expr.find[ type ]( match, context, isXML );
-
-                               if ( set != null ) {
-                                       expr = expr.replace( Expr.match[ type ], "" );
-                                       break;
-                               }
-                       }
-               }
-       }
-
-       if ( !set ) {
-               set = typeof context.getElementsByTagName !== "undefined" ?
-                       context.getElementsByTagName( "*" ) :
-                       [];
-       }
-
-       return { set: set, expr: expr };
-};
-
-Sizzle.filter = function( expr, set, inplace, not ) {
-       var match, anyFound,
-               type, found, item, filter, left,
-               i, pass,
-               old = expr,
-               result = [],
-               curLoop = set,
-               isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
-
-       while ( expr && set.length ) {
-               for ( type in Expr.filter ) {
-                       if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
-                               filter = Expr.filter[ type ];
-                               left = match[1];
-
-                               anyFound = false;
-
-                               match.splice(1,1);
-
-                               if ( left.substr( left.length - 1 ) === "\\" ) {
-                                       continue;
-                               }
-
-                               if ( curLoop === result ) {
-                                       result = [];
-                               }
-
-                               if ( Expr.preFilter[ type ] ) {
-                                       match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
-
-                                       if ( !match ) {
-                                               anyFound = found = true;
-
-                                       } else if ( match === true ) {
-                                               continue;
-                                       }
-                               }
-
-                               if ( match ) {
-                                       for ( i = 0; (item = curLoop[i]) != null; i++ ) {
-                                               if ( item ) {
-                                                       found = filter( item, match, i, curLoop );
-                                                       pass = not ^ found;
-
-                                                       if ( inplace && found != null ) {
-                                                               if ( pass ) {
-                                                                       anyFound = true;
-
-                                                               } else {
-                                                                       curLoop[i] = false;
-                                                               }
-
-                                                       } else if ( pass ) {
-                                                               result.push( item );
-                                                               anyFound = true;
-                                                       }
-                                               }
-                                       }
-                               }
-
-                               if ( found !== undefined ) {
-                                       if ( !inplace ) {
-                                               curLoop = result;
-                                       }
-
-                                       expr = expr.replace( Expr.match[ type ], "" );
-
-                                       if ( !anyFound ) {
-                                               return [];
-                                       }
-
-                                       break;
-                               }
-                       }
-               }
-
-               // Improper expression
-               if ( expr === old ) {
-                       if ( anyFound == null ) {
-                               Sizzle.error( expr );
-
-                       } else {
-                               break;
-                       }
-               }
-
-               old = expr;
-       }
-
-       return curLoop;
-};
-
-Sizzle.error = function( msg ) {
-       throw new Error( "Syntax error, unrecognized expression: " + msg );
-};
-
-/**
- * Utility function for retreiving the text value of an array of DOM nodes
- * @param {Array|Element} elem
- */
-var getText = Sizzle.getText = function( elem ) {
-    var i, node,
-               nodeType = elem.nodeType,
-               ret = "";
-
-       if ( nodeType ) {
-               if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
-                       // Use textContent || innerText for elements
-                       if ( typeof elem.textContent === 'string' ) {
-                               return elem.textContent;
-                       } else if ( typeof elem.innerText === 'string' ) {
-                               // Replace IE's carriage returns
-                               return elem.innerText.replace( rReturn, '' );
-                       } else {
-                               // Traverse it's children
-                               for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
-                                       ret += getText( elem );
-                               }
-                       }
-               } else if ( nodeType === 3 || nodeType === 4 ) {
-                       return elem.nodeValue;
-               }
-       } else {
-
-               // If no nodeType, this is expected to be an array
-               for ( i = 0; (node = elem[i]); i++ ) {
-                       // Do not traverse comment nodes
-                       if ( node.nodeType !== 8 ) {
-                               ret += getText( node );
-                       }
-               }
-       }
-       return ret;
-};
-
-var Expr = Sizzle.selectors = {
-       order: [ "ID", "NAME", "TAG" ],
-
-       match: {
-               ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
-               CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
-               NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
-               ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
-               TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
-               CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
-               POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
-               PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
-       },
-
-       leftMatch: {},
-
-       attrMap: {
-               "class": "className",
-               "for": "htmlFor"
-       },
-
-       attrHandle: {
-               href: function( elem ) {
-                       return elem.getAttribute( "href" );
-               },
-               type: function( elem ) {
-                       return elem.getAttribute( "type" );
-               }
-       },
-
-       relative: {
-               "+": function(checkSet, part){
-                       var isPartStr = typeof part === "string",
-                               isTag = isPartStr && !rNonWord.test( part ),
-                               isPartStrNotTag = isPartStr && !isTag;
-
-                       if ( isTag ) {
-                               part = part.toLowerCase();
-                       }
-
-                       for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
-                               if ( (elem = checkSet[i]) ) {
-                                       while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
-
-                                       checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
-                                               elem || false :
-                                               elem === part;
-                               }
-                       }
-
-                       if ( isPartStrNotTag ) {
-                               Sizzle.filter( part, checkSet, true );
-                       }
-               },
-
-               ">": function( checkSet, part ) {
-                       var elem,
-                               isPartStr = typeof part === "string",
-                               i = 0,
-                               l = checkSet.length;
-
-                       if ( isPartStr && !rNonWord.test( part ) ) {
-                               part = part.toLowerCase();
-
-                               for ( ; i < l; i++ ) {
-                                       elem = checkSet[i];
-
-                                       if ( elem ) {
-                                               var parent = elem.parentNode;
-                                               checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
-                                       }
-                               }
-
-                       } else {
-                               for ( ; i < l; i++ ) {
-                                       elem = checkSet[i];
-
-                                       if ( elem ) {
-                                               checkSet[i] = isPartStr ?
-                                                       elem.parentNode :
-                                                       elem.parentNode === part;
-                                       }
-                               }
-
-                               if ( isPartStr ) {
-                                       Sizzle.filter( part, checkSet, true );
-                               }
-                       }
-               },
-
-               "": function(checkSet, part, isXML){
-                       var nodeCheck,
-                               doneName = done++,
-                               checkFn = dirCheck;
-
-                       if ( typeof part === "string" && !rNonWord.test( part ) ) {
-                               part = part.toLowerCase();
-                               nodeCheck = part;
-                               checkFn = dirNodeCheck;
-                       }
-
-                       checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
-               },
-
-               "~": function( checkSet, part, isXML ) {
-                       var nodeCheck,
-                               doneName = done++,
-                               checkFn = dirCheck;
-
-                       if ( typeof part === "string" && !rNonWord.test( part ) ) {
-                               part = part.toLowerCase();
-                               nodeCheck = part;
-                               checkFn = dirNodeCheck;
-                       }
-
-                       checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
-               }
-       },
-
-       find: {
-               ID: function( match, context, isXML ) {
-                       if ( typeof context.getElementById !== "undefined" && !isXML ) {
-                               var m = context.getElementById(match[1]);
-                               // Check parentNode to catch when Blackberry 4.6 returns
-                               // nodes that are no longer in the document #6963
-                               return m && m.parentNode ? [m] : [];
-                       }
-               },
-
-               NAME: function( match, context ) {
-                       if ( typeof context.getElementsByName !== "undefined" ) {
-                               var ret = [],
-                                       results = context.getElementsByName( match[1] );
-
-                               for ( var i = 0, l = results.length; i < l; i++ ) {
-                                       if ( results[i].getAttribute("name") === match[1] ) {
-                                               ret.push( results[i] );
-                                       }
-                               }
-
-                               return ret.length === 0 ? null : ret;
-                       }
-               },
-
-               TAG: function( match, context ) {
-                       if ( typeof context.getElementsByTagName !== "undefined" ) {
-                               return context.getElementsByTagName( match[1] );
-                       }
-               }
-       },
-       preFilter: {
-               CLASS: function( match, curLoop, inplace, result, not, isXML ) {
-                       match = " " + match[1].replace( rBackslash, "" ) + " ";
-
-                       if ( isXML ) {
-                               return match;
-                       }
-
-                       for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
-                               if ( elem ) {
-                                       if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
-                                               if ( !inplace ) {
-                                                       result.push( elem );
-                                               }
-
-                                       } else if ( inplace ) {
-                                               curLoop[i] = false;
-                                       }
-                               }
-                       }
-
-                       return false;
-               },
-
-               ID: function( match ) {
-                       return match[1].replace( rBackslash, "" );
-               },
-
-               TAG: function( match, curLoop ) {
-                       return match[1].replace( rBackslash, "" ).toLowerCase();
-               },
-
-               CHILD: function( match ) {
-                       if ( match[1] === "nth" ) {
-                               if ( !match[2] ) {
-                                       Sizzle.error( match[0] );
-                               }
-
-                               match[2] = match[2].replace(/^\+|\s*/g, '');
-
-                               // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
-                               var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
-                                       match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
-                                       !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
-
-                               // calculate the numbers (first)n+(last) including if they are negative
-                               match[2] = (test[1] + (test[2] || 1)) - 0;
-                               match[3] = test[3] - 0;
-                       }
-                       else if ( match[2] ) {
-                               Sizzle.error( match[0] );
-                       }
-
-                       // TODO: Move to normal caching system
-                       match[0] = done++;
-
-                       return match;
-               },
-
-               ATTR: function( match, curLoop, inplace, result, not, isXML ) {
-                       var name = match[1] = match[1].replace( rBackslash, "" );
-
-                       if ( !isXML && Expr.attrMap[name] ) {
-                               match[1] = Expr.attrMap[name];
-                       }
-
-                       // Handle if an un-quoted value was used
-                       match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
-
-                       if ( match[2] === "~=" ) {
-                               match[4] = " " + match[4] + " ";
-                       }
-
-                       return match;
-               },
-
-               PSEUDO: function( match, curLoop, inplace, result, not ) {
-                       if ( match[1] === "not" ) {
-                               // If we're dealing with a complex expression, or a simple one
-                               if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
-                                       match[3] = Sizzle(match[3], null, null, curLoop);
-
-                               } else {
-                                       var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
-
-                                       if ( !inplace ) {
-                                               result.push.apply( result, ret );
-                                       }
-
-                                       return false;
-                               }
-
-                       } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
-                               return true;
-                       }
-
-                       return match;
-               },
-
-               POS: function( match ) {
-                       match.unshift( true );
-
-                       return match;
-               }
-       },
-
-       filters: {
-               enabled: function( elem ) {
-                       return elem.disabled === false && elem.type !== "hidden";
-               },
-
-               disabled: function( elem ) {
-                       return elem.disabled === true;
-               },
-
-               checked: function( elem ) {
-                       return elem.checked === true;
-               },
-
-               selected: function( elem ) {
-                       // Accessing this property makes selected-by-default
-                       // options in Safari work properly
-                       if ( elem.parentNode ) {
-                               elem.parentNode.selectedIndex;
-                       }
-
-                       return elem.selected === true;
-               },
-
-               parent: function( elem ) {
-                       return !!elem.firstChild;
-               },
-
-               empty: function( elem ) {
-                       return !elem.firstChild;
-               },
-
-               has: function( elem, i, match ) {
-                       return !!Sizzle( match[3], elem ).length;
-               },
-
-               header: function( elem ) {
-                       return (/h\d/i).test( elem.nodeName );
-               },
-
-               text: function( elem ) {
-                       var attr = elem.getAttribute( "type" ), type = elem.type;
-                       // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
-                       // use getAttribute instead to test this case
-                       return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
-               },
-
-               radio: function( elem ) {
-                       return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
-               },
-
-               checkbox: function( elem ) {
-                       return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
-               },
-
-               file: function( elem ) {
-                       return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
-               },
-
-               password: function( elem ) {
-                       return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
-               },
-
-               submit: function( elem ) {
-                       var name = elem.nodeName.toLowerCase();
-                       return (name === "input" || name === "button") && "submit" === elem.type;
-               },
-
-               image: function( elem ) {
-                       return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
-               },
-
-               reset: function( elem ) {
-                       var name = elem.nodeName.toLowerCase();
-                       return (name === "input" || name === "button") && "reset" === elem.type;
-               },
-
-               button: function( elem ) {
-                       var name = elem.nodeName.toLowerCase();
-                       return name === "input" && "button" === elem.type || name === "button";
-               },
-
-               input: function( elem ) {
-                       return (/input|select|textarea|button/i).test( elem.nodeName );
-               },
-
-               focus: function( elem ) {
-                       return elem === elem.ownerDocument.activeElement;
-               }
-       },
-       setFilters: {
-               first: function( elem, i ) {
-                       return i === 0;
-               },
-
-               last: function( elem, i, match, array ) {
-                       return i === array.length - 1;
-               },
-
-               even: function( elem, i ) {
-                       return i % 2 === 0;
-               },
-
-               odd: function( elem, i ) {
-                       return i % 2 === 1;
-               },
-
-               lt: function( elem, i, match ) {
-                       return i < match[3] - 0;
-               },
-
-               gt: function( elem, i, match ) {
-                       return i > match[3] - 0;
-               },
-
-               nth: function( elem, i, match ) {
-                       return match[3] - 0 === i;
-               },
-
-               eq: function( elem, i, match ) {
-                       return match[3] - 0 === i;
-               }
-       },
-       filter: {
-               PSEUDO: function( elem, match, i, array ) {
-                       var name = match[1],
-                               filter = Expr.filters[ name ];
-
-                       if ( filter ) {
-                               return filter( elem, i, match, array );
-
-                       } else if ( name === "contains" ) {
-                               return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
-
-                       } else if ( name === "not" ) {
-                               var not = match[3];
-
-                               for ( var j = 0, l = not.length; j < l; j++ ) {
-                                       if ( not[j] === elem ) {
-                                               return false;
-                                       }
-                               }
-
-                               return true;
-
-                       } else {
-                               Sizzle.error( name );
-                       }
-               },
-
-               CHILD: function( elem, match ) {
-                       var first, last,
-                               doneName, parent, cache,
-                               count, diff,
-                               type = match[1],
-                               node = elem;
-
-                       switch ( type ) {
-                               case "only":
-                               case "first":
-                                       while ( (node = node.previousSibling) ) {
-                                               if ( node.nodeType === 1 ) {
-                                                       return false;
-                                               }
-                                       }
-
-                                       if ( type === "first" ) {
-                                               return true;
-                                       }
-
-                                       node = elem;
-
-                                       /* falls through */
-                               case "last":
-                                       while ( (node = node.nextSibling) ) {
-                                               if ( node.nodeType === 1 ) {
-                                                       return false;
-                                               }
-                                       }
-
-                                       return true;
-
-                               case "nth":
-                                       first = match[2];
-                                       last = match[3];
-
-                                       if ( first === 1 && last === 0 ) {
-                                               return true;
-                                       }
-
-                                       doneName = match[0];
-                                       parent = elem.parentNode;
-
-                                       if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
-                                               count = 0;
-
-                                               for ( node = parent.firstChild; node; node = node.nextSibling ) {
-                                                       if ( node.nodeType === 1 ) {
-                                                               node.nodeIndex = ++count;
-                                                       }
-                                               }
-
-                                               parent[ expando ] = doneName;
-                                       }
-
-                                       diff = elem.nodeIndex - last;
-
-                                       if ( first === 0 ) {
-                                               return diff === 0;
-
-                                       } else {
-                                               return ( diff % first === 0 && diff / first >= 0 );
-                                       }
-                       }
-               },
-
-               ID: function( elem, match ) {
-                       return elem.nodeType === 1 && elem.getAttribute("id") === match;
-               },
-
-               TAG: function( elem, match ) {
-                       return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
-               },
-
-               CLASS: function( elem, match ) {
-                       return (" " + (elem.className || elem.getAttribute("class")) + " ")
-                               .indexOf( match ) > -1;
-               },
-
-               ATTR: function( elem, match ) {
-                       var name = match[1],
-                               result = Sizzle.attr ?
-                                       Sizzle.attr( elem, name ) :
-                                       Expr.attrHandle[ name ] ?
-                                       Expr.attrHandle[ name ]( elem ) :
-                                       elem[ name ] != null ?
-                                               elem[ name ] :
-                                               elem.getAttribute( name ),
-                               value = result + "",
-                               type = match[2],
-                               check = match[4];
-
-                       return result == null ?
-                               type === "!=" :
-                               !type && Sizzle.attr ?
-                               result != null :
-                               type === "=" ?
-                               value === check :
-                               type === "*=" ?
-                               value.indexOf(check) >= 0 :
-                               type === "~=" ?
-                               (" " + value + " ").indexOf(check) >= 0 :
-                               !check ?
-                               value && result !== false :
-                               type === "!=" ?
-                               value !== check :
-                               type === "^=" ?
-                               value.indexOf(check) === 0 :
-                               type === "$=" ?
-                               value.substr(value.length - check.length) === check :
-                               type === "|=" ?
-                               value === check || value.substr(0, check.length + 1) === check + "-" :
-                               false;
-               },
-
-               POS: function( elem, match, i, array ) {
-                       var name = match[2],
-                               filter = Expr.setFilters[ name ];
-
-                       if ( filter ) {
-                               return filter( elem, i, match, array );
-                       }
-               }
-       }
-};
-
-var origPOS = Expr.match.POS,
-       fescape = function(all, num){
-               return "\\" + (num - 0 + 1);
-       };
-
-for ( var type in Expr.match ) {
-       Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
-       Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
-}
-// Expose origPOS
-// "global" as in regardless of relation to brackets/parens
-Expr.match.globalPOS = origPOS;
-
-var makeArray = function( array, results ) {
-       array = Array.prototype.slice.call( array, 0 );
-
-       if ( results ) {
-               results.push.apply( results, array );
-               return results;
-       }
-
-       return array;
-};
-
-// Perform a simple check to determine if the browser is capable of
-// converting a NodeList to an array using builtin methods.
-// Also verifies that the returned array holds DOM nodes
-// (which is not the case in the Blackberry browser)
-try {
-       Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
-
-// Provide a fallback method if it does not work
-} catch( e ) {
-       makeArray = function( array, results ) {
-               var i = 0,
-                       ret = results || [];
-
-               if ( toString.call(array) === "[object Array]" ) {
-                       Array.prototype.push.apply( ret, array );
-
-               } else {
-                       if ( typeof array.length === "number" ) {
-                               for ( var l = array.length; i < l; i++ ) {
-                                       ret.push( array[i] );
-                               }
-
-                       } else {
-                               for ( ; array[i]; i++ ) {
-                                       ret.push( array[i] );
-                               }
-                       }
-               }
-
-               return ret;
-       };
-}
-
-var sortOrder, siblingCheck;
-
-if ( document.documentElement.compareDocumentPosition ) {
-       sortOrder = function( a, b ) {
-               if ( a === b ) {
-                       hasDuplicate = true;
-                       return 0;
-               }
-
-               if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
-                       return a.compareDocumentPosition ? -1 : 1;
-               }
-
-               return a.compareDocumentPosition(b) & 4 ? -1 : 1;
-       };
-
-} else {
-       sortOrder = function( a, b ) {
-               // The nodes are identical, we can exit early
-               if ( a === b ) {
-                       hasDuplicate = true;
-                       return 0;
-
-               // Fallback to using sourceIndex (in IE) if it's available on both nodes
-               } else if ( a.sourceIndex && b.sourceIndex ) {
-                       return a.sourceIndex - b.sourceIndex;
-               }
-
-               var al, bl,
-                       ap = [],
-                       bp = [],
-                       aup = a.parentNode,
-                       bup = b.parentNode,
-                       cur = aup;
-
-               // If the nodes are siblings (or identical) we can do a quick check
-               if ( aup === bup ) {
-                       return siblingCheck( a, b );
-
-               // If no parents were found then the nodes are disconnected
-               } else if ( !aup ) {
-                       return -1;
-
-               } else if ( !bup ) {
-                       return 1;
-               }
-
-               // Otherwise they're somewhere else in the tree so we need
-               // to build up a full list of the parentNodes for comparison
-               while ( cur ) {
-                       ap.unshift( cur );
-                       cur = cur.parentNode;
-               }
-
-               cur = bup;
-
-               while ( cur ) {
-                       bp.unshift( cur );
-                       cur = cur.parentNode;
-               }
-
-               al = ap.length;
-               bl = bp.length;
-
-               // Start walking down the tree looking for a discrepancy
-               for ( var i = 0; i < al && i < bl; i++ ) {
-                       if ( ap[i] !== bp[i] ) {
-                               return siblingCheck( ap[i], bp[i] );
-                       }
-               }
-
-               // We ended someplace up the tree so do a sibling check
-               return i === al ?
-                       siblingCheck( a, bp[i], -1 ) :
-                       siblingCheck( ap[i], b, 1 );
-       };
-
-       siblingCheck = function( a, b, ret ) {
-               if ( a === b ) {
-                       return ret;
-               }
-
-               var cur = a.nextSibling;
-
-               while ( cur ) {
-                       if ( cur === b ) {
-                               return -1;
-                       }
-
-                       cur = cur.nextSibling;
-               }
-
-               return 1;
-       };
-}
-
-// Check to see if the browser returns elements by name when
-// querying by getElementById (and provide a workaround)
-(function(){
-       // We're going to inject a fake input element with a specified name
-       var form = document.createElement("div"),
-               id = "script" + (new Date()).getTime(),
-               root = document.documentElement;
-
-       form.innerHTML = "<a name='" + id + "'/>";
-
-       // Inject it into the root element, check its status, and remove it quickly
-       root.insertBefore( form, root.firstChild );
-
-       // The workaround has to do additional checks after a getElementById
-       // Which slows things down for other browsers (hence the branching)
-       if ( document.getElementById( id ) ) {
-               Expr.find.ID = function( match, context, isXML ) {
-                       if ( typeof context.getElementById !== "undefined" && !isXML ) {
-                               var m = context.getElementById(match[1]);
-
-                               return m ?
-                                       m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
-                                               [m] :
-                                               undefined :
-                                       [];
-                       }
-               };
-
-               Expr.filter.ID = function( elem, match ) {
-                       var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
-
-                       return elem.nodeType === 1 && node && node.nodeValue === match;
-               };
-       }
-
-       root.removeChild( form );
-
-       // release memory in IE
-       root = form = null;
-})();
-
-(function(){
-       // Check to see if the browser returns only elements
-       // when doing getElementsByTagName("*")
-
-       // Create a fake element
-       var div = document.createElement("div");
-       div.appendChild( document.createComment("") );
-
-       // Make sure no comments are found
-       if ( div.getElementsByTagName("*").length > 0 ) {
-               Expr.find.TAG = function( match, context ) {
-                       var results = context.getElementsByTagName( match[1] );
-
-                       // Filter out possible comments
-                       if ( match[1] === "*" ) {
-                               var tmp = [];
-
-                               for ( var i = 0; results[i]; i++ ) {
-                                       if ( results[i].nodeType === 1 ) {
-                                               tmp.push( results[i] );
-                                       }
-                               }
-
-                               results = tmp;
-                       }
-
-                       return results;
-               };
-       }
-
-       // Check to see if an attribute returns normalized href attributes
-       div.innerHTML = "<a href='#'></a>";
-
-       if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
-                       div.firstChild.getAttribute("href") !== "#" ) {
-
-               Expr.attrHandle.href = function( elem ) {
-                       return elem.getAttribute( "href", 2 );
-               };
-       }
-
-       // release memory in IE
-       div = null;
-})();
-
-if ( document.querySelectorAll ) {
-       (function(){
-               var oldSizzle = Sizzle,
-                       div = document.createElement("div"),
-                       id = "__sizzle__";
-
-               div.innerHTML = "<p class='TEST'></p>";
-
-               // Safari can't handle uppercase or unicode characters when
-               // in quirks mode.
-               if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
-                       return;
-               }
-
-               Sizzle = function( query, context, extra, seed ) {
-                       context = context || document;
-
-                       // Only use querySelectorAll on non-XML documents
-                       // (ID selectors don't work in non-HTML documents)
-                       if ( !seed && !Sizzle.isXML(context) ) {
-                               // See if we find a selector to speed up
-                               var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
-
-                               if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
-                                       // Speed-up: Sizzle("TAG")
-                                       if ( match[1] ) {
-                                               return makeArray( context.getElementsByTagName( query ), extra );
-
-                                       // Speed-up: Sizzle(".CLASS")
-                                       } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
-                                               return makeArray( context.getElementsByClassName( match[2] ), extra );
-                                       }
-                               }
-
-                               if ( context.nodeType === 9 ) {
-                                       // Speed-up: Sizzle("body")
-                                       // The body element only exists once, optimize finding it
-                                       if ( query === "body" && context.body ) {
-                                               return makeArray( [ context.body ], extra );
-
-                                       // Speed-up: Sizzle("#ID")
-                                       } else if ( match && match[3] ) {
-                                               var elem = context.getElementById( match[3] );
-
-                                               // Check parentNode to catch when Blackberry 4.6 returns
-                                               // nodes that are no longer in the document #6963
-                                               if ( elem && elem.parentNode ) {
-                                                       // Handle the case where IE and Opera return items
-                                                       // by name instead of ID
-                                                       if ( elem.id === match[3] ) {
-                                                               return makeArray( [ elem ], extra );
-                                                       }
-
-                                               } else {
-                                                       return makeArray( [], extra );
-                                               }
-                                       }
-
-                                       try {
-                                               return makeArray( context.querySelectorAll(query), extra );
-                                       } catch(qsaError) {}
-
-                               // qSA works strangely on Element-rooted queries
-                               // We can work around this by specifying an extra ID on the root
-                               // and working up from there (Thanks to Andrew Dupont for the technique)
-                               // IE 8 doesn't work on object elements
-                               } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
-                                       var oldContext = context,
-                                               old = context.getAttribute( "id" ),
-                                               nid = old || id,
-                                               hasParent = context.parentNode,
-                                               relativeHierarchySelector = /^\s*[+~]/.test( query );
-
-                                       if ( !old ) {
-                                               context.setAttribute( "id", nid );
-                                       } else {
-                                               nid = nid.replace( /'/g, "\\$&" );
-                                       }
-                                       if ( relativeHierarchySelector && hasParent ) {
-                                               context = context.parentNode;
-                                       }
-
-                                       try {
-                                               if ( !relativeHierarchySelector || hasParent ) {
-                                                       return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
-                                               }
-
-                                       } catch(pseudoError) {
-                                       } finally {
-                                               if ( !old ) {
-                                                       oldContext.removeAttribute( "id" );
-                                               }
-                                       }
-                               }
-                       }
-
-                       return oldSizzle(query, context, extra, seed);
-               };
-
-               for ( var prop in oldSizzle ) {
-                       Sizzle[ prop ] = oldSizzle[ prop ];
-               }
-
-               // release memory in IE
-               div = null;
-       })();
-}
-
-(function(){
-       var html = document.documentElement,
-               matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
-
-       if ( matches ) {
-               // Check to see if it's possible to do matchesSelector
-               // on a disconnected node (IE 9 fails this)
-               var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
-                       pseudoWorks = false;
-
-               try {
-                       // This should fail with an exception
-                       // Gecko does not error, returns false instead
-                       matches.call( document.documentElement, "[test!='']:sizzle" );
-
-               } catch( pseudoError ) {
-                       pseudoWorks = true;
-               }
-
-               Sizzle.matchesSelector = function( node, expr ) {
-                       // Make sure that attribute selectors are quoted
-                       expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
-
-                       if ( !Sizzle.isXML( node ) ) {
-                               try {
-                                       if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
-                                               var ret = matches.call( node, expr );
-
-                                               // IE 9's matchesSelector returns false on disconnected nodes
-                                               if ( ret || !disconnectedMatch ||
-                                                               // As well, disconnected nodes are said to be in a document
-                                                               // fragment in IE 9, so check for that
-                                                               node.document && node.document.nodeType !== 11 ) {
-                                                       return ret;
-                                               }
-                                       }
-                               } catch(e) {}
-                       }
-
-                       return Sizzle(expr, null, null, [node]).length > 0;
-               };
-       }
-})();
-
-(function(){
-       var div = document.createElement("div");
-
-       div.innerHTML = "<div class='test e'></div><div class='test'></div>";
-
-       // Opera can't find a second classname (in 9.6)
-       // Also, make sure that getElementsByClassName actually exists
-       if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
-               return;
-       }
-
-       // Safari caches class attributes, doesn't catch changes (in 3.2)
-       div.lastChild.className = "e";
-
-       if ( div.getElementsByClassName("e").length === 1 ) {
-               return;
-       }
-
-       Expr.order.splice(1, 0, "CLASS");
-       Expr.find.CLASS = function( match, context, isXML ) {
-               if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
-                       return context.getElementsByClassName(match[1]);
-               }
-       };
-
-       // release memory in IE
-       div = null;
-})();
-
-function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
-       for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-               var elem = checkSet[i];
-
-               if ( elem ) {
-                       var match = false;
-
-                       elem = elem[dir];
-
-                       while ( elem ) {
-                               if ( elem[ expando ] === doneName ) {
-                                       match = checkSet[elem.sizset];
-                                       break;
-                               }
-
-                               if ( elem.nodeType === 1 && !isXML ){
-                                       elem[ expando ] = doneName;
-                                       elem.sizset = i;
-                               }
-
-                               if ( elem.nodeName.toLowerCase() === cur ) {
-                                       match = elem;
-                                       break;
-                               }
-
-                               elem = elem[dir];
-                       }
-
-                       checkSet[i] = match;
-               }
-       }
-}
-
-function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
-       for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-               var elem = checkSet[i];
-
-               if ( elem ) {
-                       var match = false;
-
-                       elem = elem[dir];
-
-                       while ( elem ) {
-                               if ( elem[ expando ] === doneName ) {
-                                       match = checkSet[elem.sizset];
-                                       break;
-                               }
-
-                               if ( elem.nodeType === 1 ) {
-                                       if ( !isXML ) {
-                                               elem[ expando ] = doneName;
-                                               elem.sizset = i;
-                                       }
-
-                                       if ( typeof cur !== "string" ) {
-                                               if ( elem === cur ) {
-                                                       match = true;
-                                                       break;
-                                               }
-
-                                       } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
-                                               match = elem;
-                                               break;
-                                       }
-                               }
-
-                               elem = elem[dir];
-                       }
-
-                       checkSet[i] = match;
-               }
-       }
-}
-
-if ( document.documentElement.contains ) {
-       Sizzle.contains = function( a, b ) {
-               return a !== b && (a.contains ? a.contains(b) : true);
-       };
-
-} else if ( document.documentElement.compareDocumentPosition ) {
-       Sizzle.contains = function( a, b ) {
-               return !!(a.compareDocumentPosition(b) & 16);
-       };
-
-} else {
-       Sizzle.contains = function() {
-               return false;
-       };
-}
-
-Sizzle.isXML = function( elem ) {
-       // documentElement is verified for cases where it doesn't yet exist
-       // (such as loading iframes in IE - #4833)
-       var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
-
-       return documentElement ? documentElement.nodeName !== "HTML" : false;
-};
-
-var posProcess = function( selector, context, seed ) {
-       var match,
-               tmpSet = [],
-               later = "",
-               root = context.nodeType ? [context] : context;
-
-       // Position selectors must be done after the filter
-       // And so must :not(positional) so we move all PSEUDOs to the end
-       while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
-               later += match[0];
-               selector = selector.replace( Expr.match.PSEUDO, "" );
-       }
-
-       selector = Expr.relative[selector] ? selector + "*" : selector;
-
-       for ( var i = 0, l = root.length; i < l; i++ ) {
-               Sizzle( selector, root[i], tmpSet, seed );
-       }
-
-       return Sizzle.filter( later, tmpSet );
-};
-
-// EXPOSE
-// Override sizzle attribute retrieval
-Sizzle.attr = jQuery.attr;
-Sizzle.selectors.attrMap = {};
-jQuery.find = Sizzle;
-jQuery.expr = Sizzle.selectors;
-jQuery.expr[":"] = jQuery.expr.filters;
-jQuery.unique = Sizzle.uniqueSort;
-jQuery.text = Sizzle.getText;
-jQuery.isXMLDoc = Sizzle.isXML;
-jQuery.contains = Sizzle.contains;
-
-
-})();
-
-
-var runtil = /Until$/,
-       rparentsprev = /^(?:parents|prevUntil|prevAll)/,
-       // Note: This RegExp should be improved, or likely pulled from Sizzle
-       rmultiselector = /,/,
-       isSimple = /^.[^:#\[\.,]*$/,
-       slice = Array.prototype.slice,
-       POS = jQuery.expr.match.globalPOS,
-       // methods guaranteed to produce a unique set when starting from a unique set
-       guaranteedUnique = {
-               children: true,
-               contents: true,
-               next: true,
-               prev: true
-       };
-
-jQuery.fn.extend({
-       find: function( selector ) {
-               var self = this,
-                       i, l;
-
-               if ( typeof selector !== "string" ) {
-                       return jQuery( selector ).filter(function() {
-                               for ( i = 0, l = self.length; i < l; i++ ) {
-                                       if ( jQuery.contains( self[ i ], this ) ) {
-                                               return true;
-                                       }
-                               }
-                       });
-               }
-
-               var ret = this.pushStack( "", "find", selector ),
-                       length, n, r;
-
-               for ( i = 0, l = this.length; i < l; i++ ) {
-                       length = ret.length;
-                       jQuery.find( selector, this[i], ret );
-
-                       if ( i > 0 ) {
-                               // Make sure that the results are unique
-                               for ( n = length; n < ret.length; n++ ) {
-                                       for ( r = 0; r < length; r++ ) {
-                                               if ( ret[r] === ret[n] ) {
-                                                       ret.splice(n--, 1);
-                                                       break;
-                                               }
-                                       }
-                               }
-                       }
-               }
-
-               return ret;
-       },
-
-       has: function( target ) {
-               var targets = jQuery( target );
-               return this.filter(function() {
-                       for ( var i = 0, l = targets.length; i < l; i++ ) {
-                               if ( jQuery.contains( this, targets[i] ) ) {
-                                       return true;
-                               }
-                       }
-               });
-       },
-
-       not: function( selector ) {
-               return this.pushStack( winnow(this, selector, false), "not", selector);
-       },
-
-       filter: function( selector ) {
-               return this.pushStack( winnow(this, selector, true), "filter", selector );
-       },
-
-       is: function( selector ) {
-               return !!selector && (
-                       typeof selector === "string" ?
-                               // If this is a positional selector, check membership in the returned set
-                               // so $("p:first").is("p:last") won't return true for a doc with two "p".
-                               POS.test( selector ) ?
-                                       jQuery( selector, this.context ).index( this[0] ) >= 0 :
-                                       jQuery.filter( selector, this ).length > 0 :
-                               this.filter( selector ).length > 0 );
-       },
-
-       closest: function( selectors, context ) {
-               var ret = [], i, l, cur = this[0];
-
-               // Array (deprecated as of jQuery 1.7)
-               if ( jQuery.isArray( selectors ) ) {
-                       var level = 1;
-
-                       while ( cur && cur.ownerDocument && cur !== context ) {
-                               for ( i = 0; i < selectors.length; i++ ) {
-
-                                       if ( jQuery( cur ).is( selectors[ i ] ) ) {
-                                               ret.push({ selector: selectors[ i ], elem: cur, level: level });
-                                       }
-                               }
-
-                               cur = cur.parentNode;
-                               level++;
-                       }
-
-                       return ret;
-               }
-
-               // String
-               var pos = POS.test( selectors ) || typeof selectors !== "string" ?
-                               jQuery( selectors, context || this.context ) :
-                               0;
-
-               for ( i = 0, l = this.length; i < l; i++ ) {
-                       cur = this[i];
-
-                       while ( cur ) {
-                               if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
-                                       ret.push( cur );
-                                       break;
-
-                               } else {
-                                       cur = cur.parentNode;
-                                       if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
-                                               break;
-                                       }
-                               }
-                       }
-               }
-
-               ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
-
-               return this.pushStack( ret, "closest", selectors );
-       },
-
-       // Determine the position of an element within
-       // the matched set of elements
-       index: function( elem ) {
-
-               // No argument, return index in parent
-               if ( !elem ) {
-                       return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
-               }
-
-               // index in selector
-               if ( typeof elem === "string" ) {
-                       return jQuery.inArray( this[0], jQuery( elem ) );
-               }
-
-               // Locate the position of the desired element
-               return jQuery.inArray(
-                       // If it receives a jQuery object, the first element is used
-                       elem.jquery ? elem[0] : elem, this );
-       },
-
-       add: function( selector, context ) {
-               var set = typeof selector === "string" ?
-                               jQuery( selector, context ) :
-                               jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
-                       all = jQuery.merge( this.get(), set );
-
-               return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
-                       all :
-                       jQuery.unique( all ) );
-       },
-
-       andSelf: function() {
-               return this.add( this.prevObject );
-       }
-});
-
-// A painfully simple check to see if an element is disconnected
-// from a document (should be improved, where feasible).
-function isDisconnected( node ) {
-       return !node || !node.parentNode || node.parentNode.nodeType === 11;
-}
-
-jQuery.each({
-       parent: function( elem ) {
-               var parent = elem.parentNode;
-               return parent && parent.nodeType !== 11 ? parent : null;
-       },
-       parents: function( elem ) {
-               return jQuery.dir( elem, "parentNode" );
-       },
-       parentsUntil: function( elem, i, until ) {
-               return jQuery.dir( elem, "parentNode", until );
-       },
-       next: function( elem ) {
-               return jQuery.nth( elem, 2, "nextSibling" );
-       },
-       prev: function( elem ) {
-               return jQuery.nth( elem, 2, "previousSibling" );
-       },
-       nextAll: function( elem ) {
-               return jQuery.dir( elem, "nextSibling" );
-       },
-       prevAll: function( elem ) {
-               return jQuery.dir( elem, "previousSibling" );
-       },
-       nextUntil: function( elem, i, until ) {
-               return jQuery.dir( elem, "nextSibling", until );
-       },
-       prevUntil: function( elem, i, until ) {
-               return jQuery.dir( elem, "previousSibling", until );
-       },
-       siblings: function( elem ) {
-               return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
-       },
-       children: function( elem ) {
-               return jQuery.sibling( elem.firstChild );
-       },
-       contents: function( elem ) {
-               return jQuery.nodeName( elem, "iframe" ) ?
-                       elem.contentDocument || elem.contentWindow.document :
-                       jQuery.makeArray( elem.childNodes );
-       }
-}, function( name, fn ) {
-       jQuery.fn[ name ] = function( until, selector ) {
-               var ret = jQuery.map( this, fn, until );
-
-               if ( !runtil.test( name ) ) {
-                       selector = until;
-               }
-
-               if ( selector && typeof selector === "string" ) {
-                       ret = jQuery.filter( selector, ret );
-               }
-
-               ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
-
-               if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
-                       ret = ret.reverse();
-               }
-
-               return this.pushStack( ret, name, slice.call( arguments ).join(",") );
-       };
-});
-
-jQuery.extend({
-       filter: function( expr, elems, not ) {
-               if ( not ) {
-                       expr = ":not(" + expr + ")";
-               }
-
-               return elems.length === 1 ?
-                       jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
-                       jQuery.find.matches(expr, elems);
-       },
-
-       dir: function( elem, dir, until ) {
-               var matched = [],
-                       cur = elem[ dir ];
-
-               while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
-                       if ( cur.nodeType === 1 ) {
-                               matched.push( cur );
-                       }
-                       cur = cur[dir];
-               }
-               return matched;
-       },
-
-       nth: function( cur, result, dir, elem ) {
-               result = result || 1;
-               var num = 0;
-
-               for ( ; cur; cur = cur[dir] ) {
-                       if ( cur.nodeType === 1 && ++num === result ) {
-                               break;
-                       }
-               }
-
-               return cur;
-       },
-
-       sibling: function( n, elem ) {
-               var r = [];
-
-               for ( ; n; n = n.nextSibling ) {
-                       if ( n.nodeType === 1 && n !== elem ) {
-                               r.push( n );
-                       }
-               }
-
-               return r;
-       }
-});
-
-// Implement the identical functionality for filter and not
-function winnow( elements, qualifier, keep ) {
-
-       // Can't pass null or undefined to indexOf in Firefox 4
-       // Set to 0 to skip string check
-       qualifier = qualifier || 0;
-
-       if ( jQuery.isFunction( qualifier ) ) {
-               return jQuery.grep(elements, function( elem, i ) {
-                       var retVal = !!qualifier.call( elem, i, elem );
-                       return retVal === keep;
-               });
-
-       } else if ( qualifier.nodeType ) {
-               return jQuery.grep(elements, function( elem, i ) {
-                       return ( elem === qualifier ) === keep;
-               });
-
-       } else if ( typeof qualifier === "string" ) {
-               var filtered = jQuery.grep(elements, function( elem ) {
-                       return elem.nodeType === 1;
-               });
-
-               if ( isSimple.test( qualifier ) ) {
-                       return jQuery.filter(qualifier, filtered, !keep);
-               } else {
-                       qualifier = jQuery.filter( qualifier, filtered );
-               }
-       }
-
-       return jQuery.grep(elements, function( elem, i ) {
-               return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
-       });
-}
-
-
-
-
-function createSafeFragment( document ) {
-       var list = nodeNames.split( "|" ),
-       safeFrag = document.createDocumentFragment();
-
-       if ( safeFrag.createElement ) {
-               while ( list.length ) {
-                       safeFrag.createElement(
-                               list.pop()
-                       );
-               }
-       }
-       return safeFrag;
-}
-
-var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
-               "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
-       rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
-       rleadingWhitespace = /^\s+/,
-       rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
-       rtagName = /<([\w:]+)/,
-       rtbody = /<tbody/i,
-       rhtml = /<|&#?\w+;/,
-       rnoInnerhtml = /<(?:script|style)/i,
-       rnocache = /<(?:script|object|embed|option|style)/i,
-       rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
-       // checked="checked" or checked
-       rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
-       rscriptType = /\/(java|ecma)script/i,
-       rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
-       wrapMap = {
-               option: [ 1, "<select multiple='multiple'>", "</select>" ],
-               legend: [ 1, "<fieldset>", "</fieldset>" ],
-               thead: [ 1, "<table>", "</table>" ],
-               tr: [ 2, "<table><tbody>", "</tbody></table>" ],
-               td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
-               col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
-               area: [ 1, "<map>", "</map>" ],
-               _default: [ 0, "", "" ]
-       },
-       safeFragment = createSafeFragment( document );
-
-wrapMap.optgroup = wrapMap.option;
-wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
-wrapMap.th = wrapMap.td;
-
-// IE can't serialize <link> and <script> tags normally
-if ( !jQuery.support.htmlSerialize ) {
-       wrapMap._default = [ 1, "div<div>", "</div>" ];
-}
-
-jQuery.fn.extend({
-       text: function( value ) {
-               return jQuery.access( this, function( value ) {
-                       return value === undefined ?
-                               jQuery.text( this ) :
-                               this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
-               }, null, value, arguments.length );
-       },
-
-       wrapAll: function( html ) {
-               if ( jQuery.isFunction( html ) ) {
-                       return this.each(function(i) {
-                               jQuery(this).wrapAll( html.call(this, i) );
-                       });
-               }
-
-               if ( this[0] ) {
-                       // The elements to wrap the target around
-                       var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
-
-                       if ( this[0].parentNode ) {
-                               wrap.insertBefore( this[0] );
-                       }
-
-                       wrap.map(function() {
-                               var elem = this;
-
-                               while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
-                                       elem = elem.firstChild;
-                               }
-
-                               return elem;
-                       }).append( this );
-               }
-
-               return this;
-       },
-
-       wrapInner: function( html ) {
-               if ( jQuery.isFunction( html ) ) {
-                       return this.each(function(i) {
-                               jQuery(this).wrapInner( html.call(this, i) );
-                       });
-               }
-
-               return this.each(function() {
-                       var self = jQuery( this ),
-                               contents = self.contents();
-
-                       if ( contents.length ) {
-                               contents.wrapAll( html );
-
-                       } else {
-                               self.append( html );
-                       }
-               });
-       },
-
-       wrap: function( html ) {
-               var isFunction = jQuery.isFunction( html );
-
-               return this.each(function(i) {
-                       jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
-               });
-       },
-
-       unwrap: function() {
-               return this.parent().each(function() {
-                       if ( !jQuery.nodeName( this, "body" ) ) {
-                               jQuery( this ).replaceWith( this.childNodes );
-                       }
-               }).end();
-       },
-
-       append: function() {
-               return this.domManip(arguments, true, function( elem ) {
-                       if ( this.nodeType === 1 ) {
-                               this.appendChild( elem );
-                       }
-               });
-       },
-
-       prepend: function() {
-               return this.domManip(arguments, true, function( elem ) {
-                       if ( this.nodeType === 1 ) {
-                               this.insertBefore( elem, this.firstChild );
-                       }
-               });
-       },
-
-       before: function() {
-               if ( this[0] && this[0].parentNode ) {
-                       return this.domManip(arguments, false, function( elem ) {
-                               this.parentNode.insertBefore( elem, this );
-                       });
-               } else if ( arguments.length ) {
-                       var set = jQuery.clean( arguments );
-                       set.push.apply( set, this.toArray() );
-                       return this.pushStack( set, "before", arguments );
-               }
-       },
-
-       after: function() {
-               if ( this[0] && this[0].parentNode ) {
-                       return this.domManip(arguments, false, function( elem ) {
-                               this.parentNode.insertBefore( elem, this.nextSibling );
-                       });
-               } else if ( arguments.length ) {
-                       var set = this.pushStack( this, "after", arguments );
-                       set.push.apply( set, jQuery.clean(arguments) );
-                       return set;
-               }
-       },
-
-       // keepData is for internal use only--do not document
-       remove: function( selector, keepData ) {
-               for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
-                       if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
-                               if ( !keepData && elem.nodeType === 1 ) {
-                                       jQuery.cleanData( elem.getElementsByTagName("*") );
-                                       jQuery.cleanData( [ elem ] );
-                               }
-
-                               if ( elem.parentNode ) {
-                                       elem.parentNode.removeChild( elem );
-                               }
-                       }
-               }
-
-               return this;
-       },
-
-       empty: function() {
-               for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
-                       // Remove element nodes and prevent memory leaks
-                       if ( elem.nodeType === 1 ) {
-                               jQuery.cleanData( elem.getElementsByTagName("*") );
-                       }
-
-                       // Remove any remaining nodes
-                       while ( elem.firstChild ) {
-                               elem.removeChild( elem.firstChild );
-                       }
-               }
-
-               return this;
-       },
-
-       clone: function( dataAndEvents, deepDataAndEvents ) {
-               dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
-               deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
-
-               return this.map( function () {
-                       return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
-               });
-       },
-
-       html: function( value ) {
-               return jQuery.access( this, function( value ) {
-                       var elem = this[0] || {},
-                               i = 0,
-                               l = this.length;
-
-                       if ( value === undefined ) {
-                               return elem.nodeType === 1 ?
-                                       elem.innerHTML.replace( rinlinejQuery, "" ) :
-                                       null;
-                       }
-
-
-                       if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
-                               ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
-                               !wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
-
-                               value = value.replace( rxhtmlTag, "<$1></$2>" );
-
-                               try {
-                                       for (; i < l; i++ ) {
-                                               // Remove element nodes and prevent memory leaks
-                                               elem = this[i] || {};
-                                               if ( elem.nodeType === 1 ) {
-                                                       jQuery.cleanData( elem.getElementsByTagName( "*" ) );
-                                                       elem.innerHTML = value;
-                                               }
-                                       }
-
-                                       elem = 0;
-
-                               // If using innerHTML throws an exception, use the fallback method
-                               } catch(e) {}
-                       }
-
-                       if ( elem ) {
-                               this.empty().append( value );
-                       }
-               }, null, value, arguments.length );
-       },
-
-       replaceWith: function( value ) {
-               if ( this[0] && this[0].parentNode ) {
-                       // Make sure that the elements are removed from the DOM before they are inserted
-                       // this can help fix replacing a parent with child elements
-                       if ( jQuery.isFunction( value ) ) {
-                               return this.each(function(i) {
-                                       var self = jQuery(this), old = self.html();
-                                       self.replaceWith( value.call( this, i, old ) );
-                               });
-                       }
-
-                       if ( typeof value !== "string" ) {
-                               value = jQuery( value ).detach();
-                       }
-
-                       return this.each(function() {
-                               var next = this.nextSibling,
-                                       parent = this.parentNode;
-
-                               jQuery( this ).remove();
-
-                               if ( next ) {
-                                       jQuery(next).before( value );
-                               } else {
-                                       jQuery(parent).append( value );
-                               }
-                       });
-               } else {
-                       return this.length ?
-                               this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
-                               this;
-               }
-       },
-
-       detach: function( selector ) {
-               return this.remove( selector, true );
-       },
-
-       domManip: function( args, table, callback ) {
-               var results, first, fragment, parent,
-                       value = args[0],
-                       scripts = [];
-
-               // We can't cloneNode fragments that contain checked, in WebKit
-               if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
-                       return this.each(function() {
-                               jQuery(this).domManip( args, table, callback, true );
-                       });
-               }
-
-               if ( jQuery.isFunction(value) ) {
-                       return this.each(function(i) {
-                               var self = jQuery(this);
-                               args[0] = value.call(this, i, table ? self.html() : undefined);
-                               self.domManip( args, table, callback );
-                       });
-               }
-
-               if ( this[0] ) {
-                       parent = value && value.parentNode;
-
-                       // If we're in a fragment, just use that instead of building a new one
-                       if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
-                               results = { fragment: parent };
-
-                       } else {
-                               results = jQuery.buildFragment( args, this, scripts );
-                       }
-
-                       fragment = results.fragment;
-
-                       if ( fragment.childNodes.length === 1 ) {
-                               first = fragment = fragment.firstChild;
-                       } else {
-                               first = fragment.firstChild;
-                       }
-
-                       if ( first ) {
-                               table = table && jQuery.nodeName( first, "tr" );
-
-                               for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
-                                       callback.call(
-                                               table ?
-                                                       root(this[i], first) :
-                                                       this[i],
-                                               // Make sure that we do not leak memory by inadvertently discarding
-                                               // the original fragment (which might have attached data) instead of
-                                               // using it; in addition, use the original fragment object for the last
-                                               // item instead of first because it can end up being emptied incorrectly
-                                               // in certain situations (Bug #8070).
-                                               // Fragments from the fragment cache must always be cloned and never used
-                                               // in place.
-                                               results.cacheable || ( l > 1 && i < lastIndex ) ?
-                                                       jQuery.clone( fragment, true, true ) :
-                                                       fragment
-                                       );
-                               }
-                       }
-
-                       if ( scripts.length ) {
-                               jQuery.each( scripts, function( i, elem ) {
-                                       if ( elem.src ) {
-                                               jQuery.ajax({
-                                                       type: "GET",
-                                                       global: false,
-                                                       url: elem.src,
-                                                       async: false,
-                                                       dataType: "script"
-                                               });
-                                       } else {
-                                               jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
-                                       }
-
-                                       if ( elem.parentNode ) {
-                                               elem.parentNode.removeChild( elem );
-                                       }
-                               });
-                       }
-               }
-
-               return this;
-       }
-});
-
-function root( elem, cur ) {
-       return jQuery.nodeName(elem, "table") ?
-               (elem.getElementsByTagName("tbody")[0] ||
-               elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
-               elem;
-}
-
-function cloneCopyEvent( src, dest ) {
-
-       if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
-               return;
-       }
-
-       var type, i, l,
-               oldData = jQuery._data( src ),
-               curData = jQuery._data( dest, oldData ),
-               events = oldData.events;
-
-       if ( events ) {
-               delete curData.handle;
-               curData.events = {};
-
-               for ( type in events ) {
-                       for ( i = 0, l = events[ type ].length; i < l; i++ ) {
-                               jQuery.event.add( dest, type, events[ type ][ i ] );
-                       }
-               }
-       }
-
-       // make the cloned public data object a copy from the original
-       if ( curData.data ) {
-               curData.data = jQuery.extend( {}, curData.data );
-       }
-}
-
-function cloneFixAttributes( src, dest ) {
-       var nodeName;
-
-       // We do not need to do anything for non-Elements
-       if ( dest.nodeType !== 1 ) {
-               return;
-       }
-
-       // clearAttributes removes the attributes, which we don't want,
-       // but also removes the attachEvent events, which we *do* want
-       if ( dest.clearAttributes ) {
-               dest.clearAttributes();
-       }
-
-       // mergeAttributes, in contrast, only merges back on the
-       // original attributes, not the events
-       if ( dest.mergeAttributes ) {
-               dest.mergeAttributes( src );
-       }
-
-       nodeName = dest.nodeName.toLowerCase();
-
-       // IE6-8 fail to clone children inside object elements that use
-       // the proprietary classid attribute value (rather than the type
-       // attribute) to identify the type of content to display
-       if ( nodeName === "object" ) {
-               dest.outerHTML = src.outerHTML;
-
-       } else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
-               // IE6-8 fails to persist the checked state of a cloned checkbox
-               // or radio button. Worse, IE6-7 fail to give the cloned element
-               // a checked appearance if the defaultChecked value isn't also set
-               if ( src.checked ) {
-                       dest.defaultChecked = dest.checked = src.checked;
-               }
-
-               // IE6-7 get confused and end up setting the value of a cloned
-               // checkbox/radio button to an empty string instead of "on"
-               if ( dest.value !== src.value ) {
-                       dest.value = src.value;
-               }
-
-       // IE6-8 fails to return the selected option to the default selected
-       // state when cloning options
-       } else if ( nodeName === "option" ) {
-               dest.selected = src.defaultSelected;
-
-       // IE6-8 fails to set the defaultValue to the correct value when
-       // cloning other types of input fields
-       } else if ( nodeName === "input" || nodeName === "textarea" ) {
-               dest.defaultValue = src.defaultValue;
-
-       // IE blanks contents when cloning scripts
-       } else if ( nodeName === "script" && dest.text !== src.text ) {
-               dest.text = src.text;
-       }
-
-       // Event data gets referenced instead of copied if the expando
-       // gets copied too
-       dest.removeAttribute( jQuery.expando );
-
-       // Clear flags for bubbling special change/submit events, they must
-       // be reattached when the newly cloned events are first activated
-       dest.removeAttribute( "_submit_attached" );
-       dest.removeAttribute( "_change_attached" );
-}
-
-jQuery.buildFragment = function( args, nodes, scripts ) {
-       var fragment, cacheable, cacheresults, doc,
-       first = args[ 0 ];
-
-       // nodes may contain either an explicit document object,
-       // a jQuery collection or context object.
-       // If nodes[0] contains a valid object to assign to doc
-       if ( nodes && nodes[0] ) {
-               doc = nodes[0].ownerDocument || nodes[0];
-       }
-
-       // Ensure that an attr object doesn't incorrectly stand in as a document object
-       // Chrome and Firefox seem to allow this to occur and will throw exception
-       // Fixes #8950
-       if ( !doc.createDocumentFragment ) {
-               doc = document;
-       }
-
-       // Only cache "small" (1/2 KB) HTML strings that are associated with the main document
-       // Cloning options loses the selected state, so don't cache them
-       // IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
-       // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
-       // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
-       if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document &&
-               first.charAt(0) === "<" && !rnocache.test( first ) &&
-               (jQuery.support.checkClone || !rchecked.test( first )) &&
-               (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
-
-               cacheable = true;
-
-               cacheresults = jQuery.fragments[ first ];
-               if ( cacheresults && cacheresults !== 1 ) {
-                       fragment = cacheresults;
-               }
-       }
-
-       if ( !fragment ) {
-               fragment = doc.createDocumentFragment();
-               jQuery.clean( args, doc, fragment, scripts );
-       }
-
-       if ( cacheable ) {
-               jQuery.fragments[ first ] = cacheresults ? fragment : 1;
-       }
-
-       return { fragment: fragment, cacheable: cacheable };
-};
-
-jQuery.fragments = {};
-
-jQuery.each({
-       appendTo: "append",
-       prependTo: "prepend",
-       insertBefore: "before",
-       insertAfter: "after",
-       replaceAll: "replaceWith"
-}, function( name, original ) {
-       jQuery.fn[ name ] = function( selector ) {
-               var ret = [],
-                       insert = jQuery( selector ),
-                       parent = this.length === 1 && this[0].parentNode;
-
-               if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
-                       insert[ original ]( this[0] );
-                       return this;
-
-               } else {
-                       for ( var i = 0, l = insert.length; i < l; i++ ) {
-                               var elems = ( i > 0 ? this.clone(true) : this ).get();
-                               jQuery( insert[i] )[ original ]( elems );
-                               ret = ret.concat( elems );
-                       }
-
-                       return this.pushStack( ret, name, insert.selector );
-               }
-       };
-});
-
-function getAll( elem ) {
-       if ( typeof elem.getElementsByTagName !== "undefined" ) {
-               return elem.getElementsByTagName( "*" );
-
-       } else if ( typeof elem.querySelectorAll !== "undefined" ) {
-               return elem.querySelectorAll( "*" );
-
-       } else {
-               return [];
-       }
-}
-
-// Used in clean, fixes the defaultChecked property
-function fixDefaultChecked( elem ) {
-       if ( elem.type === "checkbox" || elem.type === "radio" ) {
-               elem.defaultChecked = elem.checked;
-       }
-}
-// Finds all inputs and passes them to fixDefaultChecked
-function findInputs( elem ) {
-       var nodeName = ( elem.nodeName || "" ).toLowerCase();
-       if ( nodeName === "input" ) {
-               fixDefaultChecked( elem );
-       // Skip scripts, get other children
-       } else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
-               jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
-       }
-}
-
-// Derived From: http://www.iecss.com/shimprove/javascript/shimprove.1-0-1.js
-function shimCloneNode( elem ) {
-       var div = document.createElement( "div" );
-       safeFragment.appendChild( div );
-
-       div.innerHTML = elem.outerHTML;
-       return div.firstChild;
-}
-
-jQuery.extend({
-       clone: function( elem, dataAndEvents, deepDataAndEvents ) {
-               var srcElements,
-                       destElements,
-                       i,
-                       // IE<=8 does not properly clone detached, unknown element nodes
-                       clone = jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ?
-                               elem.cloneNode( true ) :
-                               shimCloneNode( elem );
-
-               if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
-                               (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
-                       // IE copies events bound via attachEvent when using cloneNode.
-                       // Calling detachEvent on the clone will also remove the events
-                       // from the original. In order to get around this, we use some
-                       // proprietary methods to clear the events. Thanks to MooTools
-                       // guys for this hotness.
-
-                       cloneFixAttributes( elem, clone );
-
-                       // Using Sizzle here is crazy slow, so we use getElementsByTagName instead
-                       srcElements = getAll( elem );
-                       destElements = getAll( clone );
-
-                       // Weird iteration because IE will replace the length property
-                       // with an element if you are cloning the body and one of the
-                       // elements on the page has a name or id of "length"
-                       for ( i = 0; srcElements[i]; ++i ) {
-                               // Ensure that the destination node is not null; Fixes #9587
-                               if ( destElements[i] ) {
-                                       cloneFixAttributes( srcElements[i], destElements[i] );
-                               }
-                       }
-               }
-
-               // Copy the events from the original to the clone
-               if ( dataAndEvents ) {
-                       cloneCopyEvent( elem, clone );
-
-                       if ( deepDataAndEvents ) {
-                               srcElements = getAll( elem );
-                               destElements = getAll( clone );
-
-                               for ( i = 0; srcElements[i]; ++i ) {
-                                       cloneCopyEvent( srcElements[i], destElements[i] );
-                               }
-                       }
-               }
-
-               srcElements = destElements = null;
-
-               // Return the cloned set
-               return clone;
-       },
-
-       clean: function( elems, context, fragment, scripts ) {
-               var checkScriptType, script, j,
-                               ret = [];
-
-               context = context || document;
-
-               // !context.createElement fails in IE with an error but returns typeof 'object'
-               if ( typeof context.createElement === "undefined" ) {
-                       context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
-               }
-
-               for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
-                       if ( typeof elem === "number" ) {
-                               elem += "";
-                       }
-
-                       if ( !elem ) {
-                               continue;
-                       }
-
-                       // Convert html string into DOM nodes
-                       if ( typeof elem === "string" ) {
-                               if ( !rhtml.test( elem ) ) {
-                                       elem = context.createTextNode( elem );
-                               } else {
-                                       // Fix "XHTML"-style tags in all browsers
-                                       elem = elem.replace(rxhtmlTag, "<$1></$2>");
-
-                                       // Trim whitespace, otherwise indexOf won't work as expected
-                                       var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(),
-                                               wrap = wrapMap[ tag ] || wrapMap._default,
-                                               depth = wrap[0],
-                                               div = context.createElement("div"),
-                                               safeChildNodes = safeFragment.childNodes,
-                                               remove;
-
-                                       // Append wrapper element to unknown element safe doc fragment
-                                       if ( context === document ) {
-                                               // Use the fragment we've already created for this document
-                                               safeFragment.appendChild( div );
-                                       } else {
-                                               // Use a fragment created with the owner document
-                                               createSafeFragment( context ).appendChild( div );
-                                       }
-
-                                       // Go to html and back, then peel off extra wrappers
-                                       div.innerHTML = wrap[1] + elem + wrap[2];
-
-                                       // Move to the right depth
-                                       while ( depth-- ) {
-                                               div = div.lastChild;
-                                       }
-
-                                       // Remove IE's autoinserted <tbody> from table fragments
-                                       if ( !jQuery.support.tbody ) {
-
-                                               // String was a <table>, *may* have spurious <tbody>
-                                               var hasBody = rtbody.test(elem),
-                                                       tbody = tag === "table" && !hasBody ?
-                                                               div.firstChild && div.firstChild.childNodes :
-
-                                                               // String was a bare <thead> or <tfoot>
-                                                               wrap[1] === "<table>" && !hasBody ?
-                                                                       div.childNodes :
-                                                                       [];
-
-                                               for ( j = tbody.length - 1; j >= 0 ; --j ) {
-                                                       if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
-                                                               tbody[ j ].parentNode.removeChild( tbody[ j ] );
-                                                       }
-                                               }
-                                       }
-
-                                       // IE completely kills leading whitespace when innerHTML is used
-                                       if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
-                                               div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
-                                       }
-
-                                       elem = div.childNodes;
-
-                                       // Clear elements from DocumentFragment (safeFragment or otherwise)
-                                       // to avoid hoarding elements. Fixes #11356
-                                       if ( div ) {
-                                               div.parentNode.removeChild( div );
-
-                                               // Guard against -1 index exceptions in FF3.6
-                                               if ( safeChildNodes.length > 0 ) {
-                                                       remove = safeChildNodes[ safeChildNodes.length - 1 ];
-
-                                                       if ( remove && remove.parentNode ) {
-                                                               remove.parentNode.removeChild( remove );
-                                                       }
-                                               }
-                                       }
-                               }
-                       }
-
-                       // Resets defaultChecked for any radios and checkboxes
-                       // about to be appended to the DOM in IE 6/7 (#8060)
-                       var len;
-                       if ( !jQuery.support.appendChecked ) {
-                               if ( elem[0] && typeof (len = elem.length) === "number" ) {
-                                       for ( j = 0; j < len; j++ ) {
-                                               findInputs( elem[j] );
-                                       }
-                               } else {
-                                       findInputs( elem );
-                               }
-                       }
-
-                       if ( elem.nodeType ) {
-                               ret.push( elem );
-                       } else {
-                               ret = jQuery.merge( ret, elem );
-                       }
-               }
-
-               if ( fragment ) {
-                       checkScriptType = function( elem ) {
-                               return !elem.type || rscriptType.test( elem.type );
-                       };
-                       for ( i = 0; ret[i]; i++ ) {
-                               script = ret[i];
-                               if ( scripts && jQuery.nodeName( script, "script" ) && (!script.type || rscriptType.test( script.type )) ) {
-                                       scripts.push( script.parentNode ? script.parentNode.removeChild( script ) : script );
-
-                               } else {
-                                       if ( script.nodeType === 1 ) {
-                                               var jsTags = jQuery.grep( script.getElementsByTagName( "script" ), checkScriptType );
-
-                                               ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
-                                       }
-                                       fragment.appendChild( script );
-                               }
-                       }
-               }
-
-               return ret;
-       },
-
-       cleanData: function( elems ) {
-               var data, id,
-                       cache = jQuery.cache,
-                       special = jQuery.event.special,
-                       deleteExpando = jQuery.support.deleteExpando;
-
-               for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
-                       if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
-                               continue;
-                       }
-
-                       id = elem[ jQuery.expando ];
-
-                       if ( id ) {
-                               data = cache[ id ];
-
-                               if ( data && data.events ) {
-                                       for ( var type in data.events ) {
-                                               if ( special[ type ] ) {
-                                                       jQuery.event.remove( elem, type );
-
-                                               // This is a shortcut to avoid jQuery.event.remove's overhead
-                                               } else {
-                                                       jQuery.removeEvent( elem, type, data.handle );
-                                               }
-                                       }
-
-                                       // Null the DOM reference to avoid IE6/7/8 leak (#7054)
-                                       if ( data.handle ) {
-                                               data.handle.elem = null;
-                                       }
-                               }
-
-                               if ( deleteExpando ) {
-                                       delete elem[ jQuery.expando ];
-
-                               } else if ( elem.removeAttribute ) {
-                                       elem.removeAttribute( jQuery.expando );
-                               }
-
-                               delete cache[ id ];
-                       }
-               }
-       }
-});
-
-
-
-
-var ralpha = /alpha\([^)]*\)/i,
-       ropacity = /opacity=([^)]*)/,
-       // fixed for IE9, see #8346
-       rupper = /([A-Z]|^ms)/g,
-       rnum = /^[\-+]?(?:\d*\.)?\d+$/i,
-       rnumnonpx = /^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,
-       rrelNum = /^([\-+])=([\-+.\de]+)/,
-       rmargin = /^margin/,
-
-       cssShow = { position: "absolute", visibility: "hidden", display: "block" },
-
-       // order is important!
-       cssExpand = [ "Top", "Right", "Bottom", "Left" ],
-
-       curCSS,
-
-       getComputedStyle,
-       currentStyle;
-
-jQuery.fn.css = function( name, value ) {
-       return jQuery.access( this, function( elem, name, value ) {
-               return value !== undefined ?
-                       jQuery.style( elem, name, value ) :
-                       jQuery.css( elem, name );
-       }, name, value, arguments.length > 1 );
-};
-
-jQuery.extend({
-       // Add in style property hooks for overriding the default
-       // behavior of getting and setting a style property
-       cssHooks: {
-               opacity: {
-                       get: function( elem, computed ) {
-                               if ( computed ) {
-                                       // We should always get a number back from opacity
-                                       var ret = curCSS( elem, "opacity" );
-                                       return ret === "" ? "1" : ret;
-
-                               } else {
-                                       return elem.style.opacity;
-                               }
-                       }
-               }
-       },
-
-       // Exclude the following css properties to add px
-       cssNumber: {
-               "fillOpacity": true,
-               "fontWeight": true,
-               "lineHeight": true,
-               "opacity": true,
-               "orphans": true,
-               "widows": true,
-               "zIndex": true,
-               "zoom": true
-       },
-
-       // Add in properties whose names you wish to fix before
-       // setting or getting the value
-       cssProps: {
-               // normalize float css property
-               "float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
-       },
-
-       // Get and set the style property on a DOM Node
-       style: function( elem, name, value, extra ) {
-               // Don't set styles on text and comment nodes
-               if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
-                       return;
-               }
-
-               // Make sure that we're working with the right name
-               var ret, type, origName = jQuery.camelCase( name ),
-                       style = elem.style, hooks = jQuery.cssHooks[ origName ];
-
-               name = jQuery.cssProps[ origName ] || origName;
-
-               // Check if we're setting a value
-               if ( value !== undefined ) {
-                       type = typeof value;
-
-                       // convert relative number strings (+= or -=) to relative numbers. #7345
-                       if ( type === "string" && (ret = rrelNum.exec( value )) ) {
-                               value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
-                               // Fixes bug #9237
-                               type = "number";
-                       }
-
-                       // Make sure that NaN and null values aren't set. See: #7116
-                       if ( value == null || type === "number" && isNaN( value ) ) {
-                               return;
-                       }
-
-                       // If a number was passed in, add 'px' to the (except for certain CSS properties)
-                       if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
-                               value += "px";
-                       }
-
-                       // If a hook was provided, use that value, otherwise just set the specified value
-                       if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
-                               // Wrapped to prevent IE from throwing errors when 'invalid' values are provided
-                               // Fixes bug #5509
-                               try {
-                                       style[ name ] = value;
-                               } catch(e) {}
-                       }
-
-               } else {
-                       // If a hook was provided get the non-computed value from there
-                       if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
-                               return ret;
-                       }
-
-                       // Otherwise just get the value from the style object
-                       return style[ name ];
-               }
-       },
-
-       css: function( elem, name, extra ) {
-               var ret, hooks;
-
-               // Make sure that we're working with the right name
-               name = jQuery.camelCase( name );
-               hooks = jQuery.cssHooks[ name ];
-               name = jQuery.cssProps[ name ] || name;
-
-               // cssFloat needs a special treatment
-               if ( name === "cssFloat" ) {
-                       name = "float";
-               }
-
-               // If a hook was provided get the computed value from there
-               if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
-                       return ret;
-
-               // Otherwise, if a way to get the computed value exists, use that
-               } else if ( curCSS ) {
-                       return curCSS( elem, name );
-               }
-       },
-
-       // A method for quickly swapping in/out CSS properties to get correct calculations
-       swap: function( elem, options, callback ) {
-               var old = {},
-                       ret, name;
-
-               // Remember the old values, and insert the new ones
-               for ( name in options ) {
-                       old[ name ] = elem.style[ name ];
-                       elem.style[ name ] = options[ name ];
-               }
-
-               ret = callback.call( elem );
-
-               // Revert the old values
-               for ( name in options ) {
-                       elem.style[ name ] = old[ name ];
-               }
-
-               return ret;
-       }
-});
-
-// DEPRECATED in 1.3, Use jQuery.css() instead
-jQuery.curCSS = jQuery.css;
-
-if ( document.defaultView && document.defaultView.getComputedStyle ) {
-       getComputedStyle = function( elem, name ) {
-               var ret, defaultView, computedStyle, width,
-                       style = elem.style;
-
-               name = name.replace( rupper, "-$1" ).toLowerCase();
-
-               if ( (defaultView = elem.ownerDocument.defaultView) &&
-                               (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
-
-                       ret = computedStyle.getPropertyValue( name );
-                       if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
-                               ret = jQuery.style( elem, name );
-                       }
-               }
-
-               // A tribute to the "awesome hack by Dean Edwards"
-               // WebKit uses "computed value (percentage if specified)" instead of "used value" for margins
-               // which is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
-               if ( !jQuery.support.pixelMargin && computedStyle && rmargin.test( name ) && rnumnonpx.test( ret ) ) {
-                       width = style.width;
-                       style.width = ret;
-                       ret = computedStyle.width;
-                       style.width = width;
-               }
-
-               return ret;
-       };
-}
-
-if ( document.documentElement.currentStyle ) {
-       currentStyle = function( elem, name ) {
-               var left, rsLeft, uncomputed,
-                       ret = elem.currentStyle && elem.currentStyle[ name ],
-                       style = elem.style;
-
-               // Avoid setting ret to empty string here
-               // so we don't default to auto
-               if ( ret == null && style && (uncomputed = style[ name ]) ) {
-                       ret = uncomputed;
-               }
-
-               // From the awesome hack by Dean Edwards
-               // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
-
-               // If we're not dealing with a regular pixel number
-               // but a number that has a weird ending, we need to convert it to pixels
-               if ( rnumnonpx.test( ret ) ) {
-
-                       // Remember the original values
-                       left = style.left;
-                       rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
-
-                       // Put in the new values to get a computed value out
-                       if ( rsLeft ) {
-                               elem.runtimeStyle.left = elem.currentStyle.left;
-                       }
-                       style.left = name === "fontSize" ? "1em" : ret;
-                       ret = style.pixelLeft + "px";
-
-                       // Revert the changed values
-                       style.left = left;
-                       if ( rsLeft ) {
-                               elem.runtimeStyle.left = rsLeft;
-                       }
-               }
-
-               return ret === "" ? "auto" : ret;
-       };
-}
-
-curCSS = getComputedStyle || currentStyle;
-
-function getWidthOrHeight( elem, name, extra ) {
-
-       // Start with offset property
-       var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
-               i = name === "width" ? 1 : 0,
-               len = 4;
-
-       if ( val > 0 ) {
-               if ( extra !== "border" ) {
-                       for ( ; i < len; i += 2 ) {
-                               if ( !extra ) {
-                                       val -= parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0;
-                               }
-                               if ( extra === "margin" ) {
-                                       val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ] ) ) || 0;
-                               } else {
-                                       val -= parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
-                               }
-                       }
-               }
-
-               return val + "px";
-       }
-
-       // Fall back to computed then uncomputed css if necessary
-       val = curCSS( elem, name );
-       if ( val < 0 || val == null ) {
-               val = elem.style[ name ];
-       }
-
-       // Computed unit is not pixels. Stop here and return.
-       if ( rnumnonpx.test(val) ) {
-               return val;
-       }
-
-       // Normalize "", auto, and prepare for extra
-       val = parseFloat( val ) || 0;
-
-       // Add padding, border, margin
-       if ( extra ) {
-               for ( ; i < len; i += 2 ) {
-                       val += parseFloat( jQuery.css( elem, "padding" + cssExpand[ i ] ) ) || 0;
-                       if ( extra !== "padding" ) {
-                               val += parseFloat( jQuery.css( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
-                       }
-                       if ( extra === "margin" ) {
-                               val += parseFloat( jQuery.css( elem, extra + cssExpand[ i ]) ) || 0;
-                       }
-               }
-       }
-
-       return val + "px";
-}
-
-jQuery.each([ "height", "width" ], function( i, name ) {
-       jQuery.cssHooks[ name ] = {
-               get: function( elem, computed, extra ) {
-                       if ( computed ) {
-                               if ( elem.offsetWidth !== 0 ) {
-                                       return getWidthOrHeight( elem, name, extra );
-                               } else {
-                                       return jQuery.swap( elem, cssShow, function() {
-                                               return getWidthOrHeight( elem, name, extra );
-                                       });
-                               }
-                       }
-               },
-
-               set: function( elem, value ) {
-                       return rnum.test( value ) ?
-                               value + "px" :
-                               value;
-               }
-       };
-});
-
-if ( !jQuery.support.opacity ) {
-       jQuery.cssHooks.opacity = {
-               get: function( elem, computed ) {
-                       // IE uses filters for opacity
-                       return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
-                               ( parseFloat( RegExp.$1 ) / 100 ) + "" :
-                               computed ? "1" : "";
-               },
-
-               set: function( elem, value ) {
-                       var style = elem.style,
-                               currentStyle = elem.currentStyle,
-                               opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
-                               filter = currentStyle && currentStyle.filter || style.filter || "";
-
-                       // IE has trouble with opacity if it does not have layout
-                       // Force it by setting the zoom level
-                       style.zoom = 1;
-
-                       // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
-                       if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
-
-                               // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
-                               // if "filter:" is present at all, clearType is disabled, we want to avoid this
-                               // style.removeAttribute is IE Only, but so apparently is this code path...
-                               style.removeAttribute( "filter" );
-
-                               // if there there is no filter style applied in a css rule, we are done
-                               if ( currentStyle && !currentStyle.filter ) {
-                                       return;
-                               }
-                       }
-
-                       // otherwise, set new filter values
-                       style.filter = ralpha.test( filter ) ?
-                               filter.replace( ralpha, opacity ) :
-                               filter + " " + opacity;
-               }
-       };
-}
-
-jQuery(function() {
-       // This hook cannot be added until DOM ready because the support test
-       // for it is not run until after DOM ready
-       if ( !jQuery.support.reliableMarginRight ) {
-               jQuery.cssHooks.marginRight = {
-                       get: function( elem, computed ) {
-                               // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
-                               // Work around by temporarily setting element display to inline-block
-                               return jQuery.swap( elem, { "display": "inline-block" }, function() {
-                                       if ( computed ) {
-                                               return curCSS( elem, "margin-right" );
-                                       } else {
-                                               return elem.style.marginRight;
-                                       }
-                               });
-                       }
-               };
-       }
-});
-
-if ( jQuery.expr && jQuery.expr.filters ) {
-       jQuery.expr.filters.hidden = function( elem ) {
-               var width = elem.offsetWidth,
-                       height = elem.offsetHeight;
-
-               return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
-       };
-
-       jQuery.expr.filters.visible = function( elem ) {
-               return !jQuery.expr.filters.hidden( elem );
-       };
-}
-
-// These hooks are used by animate to expand properties
-jQuery.each({
-       margin: "",
-       padding: "",
-       border: "Width"
-}, function( prefix, suffix ) {
-
-       jQuery.cssHooks[ prefix + suffix ] = {
-               expand: function( value ) {
-                       var i,
-
-                               // assumes a single number if not a string
-                               parts = typeof value === "string" ? value.split(" ") : [ value ],
-                               expanded = {};
-
-                       for ( i = 0; i < 4; i++ ) {
-                               expanded[ prefix + cssExpand[ i ] + suffix ] =
-                                       parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
-                       }
-
-                       return expanded;
-               }
-       };
-});
-
-
-
-
-var r20 = /%20/g,
-       rbracket = /\[\]$/,
-       rCRLF = /\r?\n/g,
-       rhash = /#.*$/,
-       rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
-       rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
-       // #7653, #8125, #8152: local protocol detection
-       rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
-       rnoContent = /^(?:GET|HEAD)$/,
-       rprotocol = /^\/\//,
-       rquery = /\?/,
-       rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
-       rselectTextarea = /^(?:select|textarea)/i,
-       rspacesAjax = /\s+/,
-       rts = /([?&])_=[^&]*/,
-       rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
-
-       // Keep a copy of the old load method
-       _load = jQuery.fn.load,
-
-       /* Prefilters
-        * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
-        * 2) These are called:
-        *    - BEFORE asking for a transport
-        *    - AFTER param serialization (s.data is a string if s.processData is true)
-        * 3) key is the dataType
-        * 4) the catchall symbol "*" can be used
-        * 5) execution will start with transport dataType and THEN continue down to "*" if needed
-        */
-       prefilters = {},
-
-       /* Transports bindings
-        * 1) key is the dataType
-        * 2) the catchall symbol "*" can be used
-        * 3) selection will start with transport dataType and THEN go to "*" if needed
-        */
-       transports = {},
-
-       // Document location
-       ajaxLocation,
-
-       // Document location segments
-       ajaxLocParts,
-
-       // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
-       allTypes = ["*/"] + ["*"];
-
-// #8138, IE may throw an exception when accessing
-// a field from window.location if document.domain has been set
-try {
-       ajaxLocation = location.href;
-} catch( e ) {
-       // Use the href attribute of an A element
-       // since IE will modify it given document.location
-       ajaxLocation = document.createElement( "a" );
-       ajaxLocation.href = "";
-       ajaxLocation = ajaxLocation.href;
-}
-
-// Segment location into parts
-ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
-
-// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
-function addToPrefiltersOrTransports( structure ) {
-
-       // dataTypeExpression is optional and defaults to "*"
-       return function( dataTypeExpression, func ) {
-
-               if ( typeof dataTypeExpression !== "string" ) {
-                       func = dataTypeExpression;
-                       dataTypeExpression = "*";
-               }
-
-               if ( jQuery.isFunction( func ) ) {
-                       var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
-                               i = 0,
-                               length = dataTypes.length,
-                               dataType,
-                               list,
-                               placeBefore;
-
-                       // For each dataType in the dataTypeExpression
-                       for ( ; i < length; i++ ) {
-                               dataType = dataTypes[ i ];
-                               // We control if we're asked to add before
-                               // any existing element
-                               placeBefore = /^\+/.test( dataType );
-                               if ( placeBefore ) {
-                                       dataType = dataType.substr( 1 ) || "*";
-                               }
-                               list = structure[ dataType ] = structure[ dataType ] || [];
-                               // then we add to the structure accordingly
-                               list[ placeBefore ? "unshift" : "push" ]( func );
-                       }
-               }
-       };
-}
-
-// Base inspection function for prefilters and transports
-function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
-               dataType /* internal */, inspected /* internal */ ) {
-
-       dataType = dataType || options.dataTypes[ 0 ];
-       inspected = inspected || {};
-
-       inspected[ dataType ] = true;
-
-       var list = structure[ dataType ],
-               i = 0,
-               length = list ? list.length : 0,
-               executeOnly = ( structure === prefilters ),
-               selection;
-
-       for ( ; i < length && ( executeOnly || !selection ); i++ ) {
-               selection = list[ i ]( options, originalOptions, jqXHR );
-               // If we got redirected to another dataType
-               // we try there if executing only and not done already
-               if ( typeof selection === "string" ) {
-                       if ( !executeOnly || inspected[ selection ] ) {
-                               selection = undefined;
-                       } else {
-                               options.dataTypes.unshift( selection );
-                               selection = inspectPrefiltersOrTransports(
-                                               structure, options, originalOptions, jqXHR, selection, inspected );
-                       }
-               }
-       }
-       // If we're only executing or nothing was selected
-       // we try the catchall dataType if not done already
-       if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
-               selection = inspectPrefiltersOrTransports(
-                               structure, options, originalOptions, jqXHR, "*", inspected );
-       }
-       // unnecessary when only executing (prefilters)
-       // but it'll be ignored by the caller in that case
-       return selection;
-}
-
-// A special extend for ajax options
-// that takes "flat" options (not to be deep extended)
-// Fixes #9887
-function ajaxExtend( target, src ) {
-       var key, deep,
-               flatOptions = jQuery.ajaxSettings.flatOptions || {};
-       for ( key in src ) {
-               if ( src[ key ] !== undefined ) {
-                       ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
-               }
-       }
-       if ( deep ) {
-               jQuery.extend( true, target, deep );
-       }
-}
-
-jQuery.fn.extend({
-       load: function( url, params, callback ) {
-               if ( typeof url !== "string" && _load ) {
-                       return _load.apply( this, arguments );
-
-               // Don't do a request if no elements are being requested
-               } else if ( !this.length ) {
-                       return this;
-               }
-
-               var off = url.indexOf( " " );
-               if ( off >= 0 ) {
-                       var selector = url.slice( off, url.length );
-                       url = url.slice( 0, off );
-               }
-
-               // Default to a GET request
-               var type = "GET";
-
-               // If the second parameter was provided
-               if ( params ) {
-                       // If it's a function
-                       if ( jQuery.isFunction( params ) ) {
-                               // We assume that it's the callback
-                               callback = params;
-                               params = undefined;
-
-                       // Otherwise, build a param string
-                       } else if ( typeof params === "object" ) {
-                               params = jQuery.param( params, jQuery.ajaxSettings.traditional );
-                               type = "POST";
-                       }
-               }
-
-               var self = this;
-
-               // Request the remote document
-               jQuery.ajax({
-                       url: url,
-                       type: type,
-                       dataType: "html",
-                       data: params,
-                       // Complete callback (responseText is used internally)
-                       complete: function( jqXHR, status, responseText ) {
-                               // Store the response as specified by the jqXHR object
-                               responseText = jqXHR.responseText;
-                               // If successful, inject the HTML into all the matched elements
-                               if ( jqXHR.isResolved() ) {
-                                       // #4825: Get the actual response in case
-                                       // a dataFilter is present in ajaxSettings
-                                       jqXHR.done(function( r ) {
-                                               responseText = r;
-                                       });
-                                       // See if a selector was specified
-                                       self.html( selector ?
-                                               // Create a dummy div to hold the results
-                                               jQuery("<div>")
-                                                       // inject the contents of the document in, removing the scripts
-                                                       // to avoid any 'Permission Denied' errors in IE
-                                                       .append(responseText.replace(rscript, ""))
-
-                                                       // Locate the specified elements
-                                                       .find(selector) :
-
-                                               // If not, just inject the full result
-                                               responseText );
-                               }
-
-                               if ( callback ) {
-                                       self.each( callback, [ responseText, status, jqXHR ] );
-                               }
-                       }
-               });
-
-               return this;
-       },
-
-       serialize: function() {
-               return jQuery.param( this.serializeArray() );
-       },
-
-       serializeArray: function() {
-               return this.map(function(){
-                       return this.elements ? jQuery.makeArray( this.elements ) : this;
-               })
-               .filter(function(){
-                       return this.name && !this.disabled &&
-                               ( this.checked || rselectTextarea.test( this.nodeName ) ||
-                                       rinput.test( this.type ) );
-               })
-               .map(function( i, elem ){
-                       var val = jQuery( this ).val();
-
-                       return val == null ?
-                               null :
-                               jQuery.isArray( val ) ?
-                                       jQuery.map( val, function( val, i ){
-                                               return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
-                                       }) :
-                                       { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
-               }).get();
-       }
-});
-
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
-       jQuery.fn[ o ] = function( f ){
-               return this.on( o, f );
-       };
-});
-
-jQuery.each( [ "get", "post" ], function( i, method ) {
-       jQuery[ method ] = function( url, data, callback, type ) {
-               // shift arguments if data argument was omitted
-               if ( jQuery.isFunction( data ) ) {
-                       type = type || callback;
-                       callback = data;
-                       data = undefined;
-               }
-
-               return jQuery.ajax({
-                       type: method,
-                       url: url,
-                       data: data,
-                       success: callback,
-                       dataType: type
-               });
-       };
-});
-
-jQuery.extend({
-
-       getScript: function( url, callback ) {
-               return jQuery.get( url, undefined, callback, "script" );
-       },
-
-       getJSON: function( url, data, callback ) {
-               return jQuery.get( url, data, callback, "json" );
-       },
-
-       // Creates a full fledged settings object into target
-       // with both ajaxSettings and settings fields.
-       // If target is omitted, writes into ajaxSettings.
-       ajaxSetup: function( target, settings ) {
-               if ( settings ) {
-                       // Building a settings object
-                       ajaxExtend( target, jQuery.ajaxSettings );
-               } else {
-                       // Extending ajaxSettings
-                       settings = target;
-                       target = jQuery.ajaxSettings;
-               }
-               ajaxExtend( target, settings );
-               return target;
-       },
-
-       ajaxSettings: {
-               url: ajaxLocation,
-               isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
-               global: true,
-               type: "GET",
-               contentType: "application/x-www-form-urlencoded; charset=UTF-8",
-               processData: true,
-               async: true,
-               /*
-               timeout: 0,
-               data: null,
-               dataType: null,
-               username: null,
-               password: null,
-               cache: null,
-               traditional: false,
-               headers: {},
-               */
-
-               accepts: {
-                       xml: "application/xml, text/xml",
-                       html: "text/html",
-                       text: "text/plain",
-                       json: "application/json, text/javascript",
-                       "*": allTypes
-               },
-
-               contents: {
-                       xml: /xml/,
-                       html: /html/,
-                       json: /json/
-               },
-
-               responseFields: {
-                       xml: "responseXML",
-                       text: "responseText"
-               },
-
-               // List of data converters
-               // 1) key format is "source_type destination_type" (a single space in-between)
-               // 2) the catchall symbol "*" can be used for source_type
-               converters: {
-
-                       // Convert anything to text
-                       "* text": window.String,
-
-                       // Text to html (true = no transformation)
-                       "text html": true,
-
-                       // Evaluate text as a json expression
-                       "text json": jQuery.parseJSON,
-
-                       // Parse text as xml
-                       "text xml": jQuery.parseXML
-               },
-
-               // For options that shouldn't be deep extended:
-               // you can add your own custom options here if
-               // and when you create one that shouldn't be
-               // deep extended (see ajaxExtend)
-               flatOptions: {
-                       context: true,
-                       url: true
-               }
-       },
-
-       ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
-       ajaxTransport: addToPrefiltersOrTransports( transports ),
-
-       // Main method
-       ajax: function( url, options ) {
-
-               // If url is an object, simulate pre-1.5 signature
-               if ( typeof url === "object" ) {
-                       options = url;
-                       url = undefined;
-               }
-
-               // Force options to be an object
-               options = options || {};
-
-               var // Create the final options object
-                       s = jQuery.ajaxSetup( {}, options ),
-                       // Callbacks context
-                       callbackContext = s.context || s,
-                       // Context for global events
-                       // It's the callbackContext if one was provided in the options
-                       // and if it's a DOM node or a jQuery collection
-                       globalEventContext = callbackContext !== s &&
-                               ( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
-                                               jQuery( callbackContext ) : jQuery.event,
-                       // Deferreds
-                       deferred = jQuery.Deferred(),
-                       completeDeferred = jQuery.Callbacks( "once memory" ),
-                       // Status-dependent callbacks
-                       statusCode = s.statusCode || {},
-                       // ifModified key
-                       ifModifiedKey,
-                       // Headers (they are sent all at once)
-                       requestHeaders = {},
-                       requestHeadersNames = {},
-                       // Response headers
-                       responseHeadersString,
-                       responseHeaders,
-                       // transport
-                       transport,
-                       // timeout handle
-                       timeoutTimer,
-                       // Cross-domain detection vars
-                       parts,
-                       // The jqXHR state
-                       state = 0,
-                       // To know if global events are to be dispatched
-                       fireGlobals,
-                       // Loop variable
-                       i,
-                       // Fake xhr
-                       jqXHR = {
-
-                               readyState: 0,
-
-                               // Caches the header
-                               setRequestHeader: function( name, value ) {
-                                       if ( !state ) {
-                                               var lname = name.toLowerCase();
-                                               name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
-                                               requestHeaders[ name ] = value;
-                                       }
-                                       return this;
-                               },
-
-                               // Raw string
-                               getAllResponseHeaders: function() {
-                                       return state === 2 ? responseHeadersString : null;
-                               },
-
-                               // Builds headers hashtable if needed
-                               getResponseHeader: function( key ) {
-                                       var match;
-                                       if ( state === 2 ) {
-                                               if ( !responseHeaders ) {
-                                                       responseHeaders = {};
-                                                       while( ( match = rheaders.exec( responseHeadersString ) ) ) {
-                                                               responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
-                                                       }
-                                               }
-                                               match = responseHeaders[ key.toLowerCase() ];
-                                       }
-                                       return match === undefined ? null : match;
-                               },
-
-                               // Overrides response content-type header
-                               overrideMimeType: function( type ) {
-                                       if ( !state ) {
-                                               s.mimeType = type;
-                                       }
-                                       return this;
-                               },
-
-                               // Cancel the request
-                               abort: function( statusText ) {
-                                       statusText = statusText || "abort";
-                                       if ( transport ) {
-                                               transport.abort( statusText );
-                                       }
-                                       done( 0, statusText );
-                                       return this;
-                               }
-                       };
-
-               // Callback for when everything is done
-               // It is defined here because jslint complains if it is declared
-               // at the end of the function (which would be more logical and readable)
-               function done( status, nativeStatusText, responses, headers ) {
-
-                       // Called once
-                       if ( state === 2 ) {
-                               return;
-                       }
-
-                       // State is "done" now
-                       state = 2;
-
-                       // Clear timeout if it exists
-                       if ( timeoutTimer ) {
-                               clearTimeout( timeoutTimer );
-                       }
-
-                       // Dereference transport for early garbage collection
-                       // (no matter how long the jqXHR object will be used)
-                       transport = undefined;
-
-                       // Cache response headers
-                       responseHeadersString = headers || "";
-
-                       // Set readyState
-                       jqXHR.readyState = status > 0 ? 4 : 0;
-
-                       var isSuccess,
-                               success,
-                               error,
-                               statusText = nativeStatusText,
-                               response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
-                               lastModified,
-                               etag;
-
-                       // If successful, handle type chaining
-                       if ( status >= 200 && status < 300 || status === 304 ) {
-
-                               // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
-                               if ( s.ifModified ) {
-
-                                       if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
-                                               jQuery.lastModified[ ifModifiedKey ] = lastModified;
-                                       }
-                                       if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
-                                               jQuery.etag[ ifModifiedKey ] = etag;
-                                       }
-                               }
-
-                               // If not modified
-                               if ( status === 304 ) {
-
-                                       statusText = "notmodified";
-                                       isSuccess = true;
-
-                               // If we have data
-                               } else {
-
-                                       try {
-                                               success = ajaxConvert( s, response );
-                                               statusText = "success";
-                                               isSuccess = true;
-                                       } catch(e) {
-                                               // We have a parsererror
-                                               statusText = "parsererror";
-                                               error = e;
-                                       }
-                               }
-                       } else {
-                               // We extract error from statusText
-                               // then normalize statusText and status for non-aborts
-                               error = statusText;
-                               if ( !statusText || status ) {
-                                       statusText = "error";
-                                       if ( status < 0 ) {
-                                               status = 0;
-                                       }
-                               }
-                       }
-
-                       // Set data for the fake xhr object
-                       jqXHR.status = status;
-                       jqXHR.statusText = "" + ( nativeStatusText || statusText );
-
-                       // Success/Error
-                       if ( isSuccess ) {
-                               deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
-                       } else {
-                               deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
-                       }
-
-                       // Status-dependent callbacks
-                       jqXHR.statusCode( statusCode );
-                       statusCode = undefined;
-
-                       if ( fireGlobals ) {
-                               globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
-                                               [ jqXHR, s, isSuccess ? success : error ] );
-                       }
-
-                       // Complete
-                       completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
-
-                       if ( fireGlobals ) {
-                               globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
-                               // Handle the global AJAX counter
-                               if ( !( --jQuery.active ) ) {
-                                       jQuery.event.trigger( "ajaxStop" );
-                               }
-                       }
-               }
-
-               // Attach deferreds
-               deferred.promise( jqXHR );
-               jqXHR.success = jqXHR.done;
-               jqXHR.error = jqXHR.fail;
-               jqXHR.complete = completeDeferred.add;
-
-               // Status-dependent callbacks
-               jqXHR.statusCode = function( map ) {
-                       if ( map ) {
-                               var tmp;
-                               if ( state < 2 ) {
-                                       for ( tmp in map ) {
-                                               statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
-                                       }
-                               } else {
-                                       tmp = map[ jqXHR.status ];
-                                       jqXHR.then( tmp, tmp );
-                               }
-                       }
-                       return this;
-               };
-
-               // Remove hash character (#7531: and string promotion)
-               // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
-               // We also use the url parameter if available
-               s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
-
-               // Extract dataTypes list
-               s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
-
-               // Determine if a cross-domain request is in order
-               if ( s.crossDomain == null ) {
-                       parts = rurl.exec( s.url.toLowerCase() );
-                       s.crossDomain = !!( parts &&
-                               ( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
-                                       ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
-                                               ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
-                       );
-               }
-
-               // Convert data if not already a string
-               if ( s.data && s.processData && typeof s.data !== "string" ) {
-                       s.data = jQuery.param( s.data, s.traditional );
-               }
-
-               // Apply prefilters
-               inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
-
-               // If request was aborted inside a prefilter, stop there
-               if ( state === 2 ) {
-                       return false;
-               }
-
-               // We can fire global events as of now if asked to
-               fireGlobals = s.global;
-
-               // Uppercase the type
-               s.type = s.type.toUpperCase();
-
-               // Determine if request has content
-               s.hasContent = !rnoContent.test( s.type );
-
-               // Watch for a new set of requests
-               if ( fireGlobals && jQuery.active++ === 0 ) {
-                       jQuery.event.trigger( "ajaxStart" );
-               }
-
-               // More options handling for requests with no content
-               if ( !s.hasContent ) {
-
-                       // If data is available, append data to url
-                       if ( s.data ) {
-                               s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
-                               // #9682: remove data so that it's not used in an eventual retry
-                               delete s.data;
-                       }
-
-                       // Get ifModifiedKey before adding the anti-cache parameter
-                       ifModifiedKey = s.url;
-
-                       // Add anti-cache in url if needed
-                       if ( s.cache === false ) {
-
-                               var ts = jQuery.now(),
-                                       // try replacing _= if it is there
-                                       ret = s.url.replace( rts, "$1_=" + ts );
-
-                               // if nothing was replaced, add timestamp to the end
-                               s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
-                       }
-               }
-
-               // Set the correct header, if data is being sent
-               if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
-                       jqXHR.setRequestHeader( "Content-Type", s.contentType );
-               }
-
-               // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
-               if ( s.ifModified ) {
-                       ifModifiedKey = ifModifiedKey || s.url;
-                       if ( jQuery.lastModified[ ifModifiedKey ] ) {
-                               jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
-                       }
-                       if ( jQuery.etag[ ifModifiedKey ] ) {
-                               jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
-                       }
-               }
-
-               // Set the Accepts header for the server, depending on the dataType
-               jqXHR.setRequestHeader(
-                       "Accept",
-                       s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
-                               s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
-                               s.accepts[ "*" ]
-               );
-
-               // Check for headers option
-               for ( i in s.headers ) {
-                       jqXHR.setRequestHeader( i, s.headers[ i ] );
-               }
-
-               // Allow custom headers/mimetypes and early abort
-               if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
-                               // Abort if not done already
-                               jqXHR.abort();
-                               return false;
-
-               }
-
-               // Install callbacks on deferreds
-               for ( i in { success: 1, error: 1, complete: 1 } ) {
-                       jqXHR[ i ]( s[ i ] );
-               }
-
-               // Get transport
-               transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
-
-               // If no transport, we auto-abort
-               if ( !transport ) {
-                       done( -1, "No Transport" );
-               } else {
-                       jqXHR.readyState = 1;
-                       // Send global event
-                       if ( fireGlobals ) {
-                               globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
-                       }
-                       // Timeout
-                       if ( s.async && s.timeout > 0 ) {
-                               timeoutTimer = setTimeout( function(){
-                                       jqXHR.abort( "timeout" );
-                               }, s.timeout );
-                       }
-
-                       try {
-                               state = 1;
-                               transport.send( requestHeaders, done );
-                       } catch (e) {
-                               // Propagate exception as error if not done
-                               if ( state < 2 ) {
-                                       done( -1, e );
-                               // Simply rethrow otherwise
-                               } else {
-                                       throw e;
-                               }
-                       }
-               }
-
-               return jqXHR;
-       },
-
-       // Serialize an array of form elements or a set of
-       // key/values into a query string
-       param: function( a, traditional ) {
-               var s = [],
-                       add = function( key, value ) {
-                               // If value is a function, invoke it and return its value
-                               value = jQuery.isFunction( value ) ? value() : value;
-                               s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
-                       };
-
-               // Set traditional to true for jQuery <= 1.3.2 behavior.
-               if ( traditional === undefined ) {
-                       traditional = jQuery.ajaxSettings.traditional;
-               }
-
-               // If an array was passed in, assume that it is an array of form elements.
-               if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
-                       // Serialize the form elements
-                       jQuery.each( a, function() {
-                               add( this.name, this.value );
-                       });
-
-               } else {
-                       // If traditional, encode the "old" way (the way 1.3.2 or older
-                       // did it), otherwise encode params recursively.
-                       for ( var prefix in a ) {
-                               buildParams( prefix, a[ prefix ], traditional, add );
-                       }
-               }
-
-               // Return the resulting serialization
-               return s.join( "&" ).replace( r20, "+" );
-       }
-});
-
-function buildParams( prefix, obj, traditional, add ) {
-       if ( jQuery.isArray( obj ) ) {
-               // Serialize array item.
-               jQuery.each( obj, function( i, v ) {
-                       if ( traditional || rbracket.test( prefix ) ) {
-                               // Treat each array item as a scalar.
-                               add( prefix, v );
-
-                       } else {
-                               // If array item is non-scalar (array or object), encode its
-                               // numeric index to resolve deserialization ambiguity issues.
-                               // Note that rack (as of 1.0.0) can't currently deserialize
-                               // nested arrays properly, and attempting to do so may cause
-                               // a server error. Possible fixes are to modify rack's
-                               // deserialization algorithm or to provide an option or flag
-                               // to force array serialization to be shallow.
-                               buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
-                       }
-               });
-
-       } else if ( !traditional && jQuery.type( obj ) === "object" ) {
-               // Serialize object item.
-               for ( var name in obj ) {
-                       buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
-               }
-
-       } else {
-               // Serialize scalar item.
-               add( prefix, obj );
-       }
-}
-
-// This is still on the jQuery object... for now
-// Want to move this to jQuery.ajax some day
-jQuery.extend({
-
-       // Counter for holding the number of active queries
-       active: 0,
-
-       // Last-Modified header cache for next request
-       lastModified: {},
-       etag: {}
-
-});
-
-/* Handles responses to an ajax request:
- * - sets all responseXXX fields accordingly
- * - finds the right dataType (mediates between content-type and expected dataType)
- * - returns the corresponding response
- */
-function ajaxHandleResponses( s, jqXHR, responses ) {
-
-       var contents = s.contents,
-               dataTypes = s.dataTypes,
-               responseFields = s.responseFields,
-               ct,
-               type,
-               finalDataType,
-               firstDataType;
-
-       // Fill responseXXX fields
-       for ( type in responseFields ) {
-               if ( type in responses ) {
-                       jqXHR[ responseFields[type] ] = responses[ type ];
-               }
-       }
-
-       // Remove auto dataType and get content-type in the process
-       while( dataTypes[ 0 ] === "*" ) {
-               dataTypes.shift();
-               if ( ct === undefined ) {
-                       ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
-               }
-       }
-
-       // Check if we're dealing with a known content-type
-       if ( ct ) {
-               for ( type in contents ) {
-                       if ( contents[ type ] && contents[ type ].test( ct ) ) {
-                               dataTypes.unshift( type );
-                               break;
-                       }
-               }
-       }
-
-       // Check to see if we have a response for the expected dataType
-       if ( dataTypes[ 0 ] in responses ) {
-               finalDataType = dataTypes[ 0 ];
-       } else {
-               // Try convertible dataTypes
-               for ( type in responses ) {
-                       if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
-                               finalDataType = type;
-                               break;
-                       }
-                       if ( !firstDataType ) {
-                               firstDataType = type;
-                       }
-               }
-               // Or just use first one
-               finalDataType = finalDataType || firstDataType;
-       }
-
-       // If we found a dataType
-       // We add the dataType to the list if needed
-       // and return the corresponding response
-       if ( finalDataType ) {
-               if ( finalDataType !== dataTypes[ 0 ] ) {
-                       dataTypes.unshift( finalDataType );
-               }
-               return responses[ finalDataType ];
-       }
-}
-
-// Chain conversions given the request and the original response
-function ajaxConvert( s, response ) {
-
-       // Apply the dataFilter if provided
-       if ( s.dataFilter ) {
-               response = s.dataFilter( response, s.dataType );
-       }
-
-       var dataTypes = s.dataTypes,
-               converters = {},
-               i,
-               key,
-               length = dataTypes.length,
-               tmp,
-               // Current and previous dataTypes
-               current = dataTypes[ 0 ],
-               prev,
-               // Conversion expression
-               conversion,
-               // Conversion function
-               conv,
-               // Conversion functions (transitive conversion)
-               conv1,
-               conv2;
-
-       // For each dataType in the chain
-       for ( i = 1; i < length; i++ ) {
-
-               // Create converters map
-               // with lowercased keys
-               if ( i === 1 ) {
-                       for ( key in s.converters ) {
-                               if ( typeof key === "string" ) {
-                                       converters[ key.toLowerCase() ] = s.converters[ key ];
-                               }
-                       }
-               }
-
-               // Get the dataTypes
-               prev = current;
-               current = dataTypes[ i ];
-
-               // If current is auto dataType, update it to prev
-               if ( current === "*" ) {
-                       current = prev;
-               // If no auto and dataTypes are actually different
-               } else if ( prev !== "*" && prev !== current ) {
-
-                       // Get the converter
-                       conversion = prev + " " + current;
-                       conv = converters[ conversion ] || converters[ "* " + current ];
-
-                       // If there is no direct converter, search transitively
-                       if ( !conv ) {
-                               conv2 = undefined;
-                               for ( conv1 in converters ) {
-                                       tmp = conv1.split( " " );
-                                       if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
-                                               conv2 = converters[ tmp[1] + " " + current ];
-                                               if ( conv2 ) {
-                                                       conv1 = converters[ conv1 ];
-                                                       if ( conv1 === true ) {
-                                                               conv = conv2;
-                                                       } else if ( conv2 === true ) {
-                                                               conv = conv1;
-                                                       }
-                                                       break;
-                                               }
-                                       }
-                               }
-                       }
-                       // If we found no converter, dispatch an error
-                       if ( !( conv || conv2 ) ) {
-                               jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
-                       }
-                       // If found converter is not an equivalence
-                       if ( conv !== true ) {
-                               // Convert with 1 or 2 converters accordingly
-                               response = conv ? conv( response ) : conv2( conv1(response) );
-                       }
-               }
-       }
-       return response;
-}
-
-
-
-
-var jsc = jQuery.now(),
-       jsre = /(\=)\?(&|$)|\?\?/i;
-
-// Default jsonp settings
-jQuery.ajaxSetup({
-       jsonp: "callback",
-       jsonpCallback: function() {
-               return jQuery.expando + "_" + ( jsc++ );
-       }
-});
-
-// Detect, normalize options and install callbacks for jsonp requests
-jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
-
-       var inspectData = ( typeof s.data === "string" ) && /^application\/x\-www\-form\-urlencoded/.test( s.contentType );
-
-       if ( s.dataTypes[ 0 ] === "jsonp" ||
-               s.jsonp !== false && ( jsre.test( s.url ) ||
-                               inspectData && jsre.test( s.data ) ) ) {
-
-               var responseContainer,
-                       jsonpCallback = s.jsonpCallback =
-                               jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
-                       previous = window[ jsonpCallback ],
-                       url = s.url,
-                       data = s.data,
-                       replace = "$1" + jsonpCallback + "$2";
-
-               if ( s.jsonp !== false ) {
-                       url = url.replace( jsre, replace );
-                       if ( s.url === url ) {
-                               if ( inspectData ) {
-                                       data = data.replace( jsre, replace );
-                               }
-                               if ( s.data === data ) {
-                                       // Add callback manually
-                                       url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
-                               }
-                       }
-               }
-
-               s.url = url;
-               s.data = data;
-
-               // Install callback
-               window[ jsonpCallback ] = function( response ) {
-                       responseContainer = [ response ];
-               };
-
-               // Clean-up function
-               jqXHR.always(function() {
-                       // Set callback back to previous value
-                       window[ jsonpCallback ] = previous;
-                       // Call if it was a function and we have a response
-                       if ( responseContainer && jQuery.isFunction( previous ) ) {
-                               window[ jsonpCallback ]( responseContainer[ 0 ] );
-                       }
-               });
-
-               // Use data converter to retrieve json after script execution
-               s.converters["script json"] = function() {
-                       if ( !responseContainer ) {
-                               jQuery.error( jsonpCallback + " was not called" );
-                       }
-                       return responseContainer[ 0 ];
-               };
-
-               // force json dataType
-               s.dataTypes[ 0 ] = "json";
-
-               // Delegate to script
-               return "script";
-       }
-});
-
-
-
-
-// Install script dataType
-jQuery.ajaxSetup({
-       accepts: {
-               script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
-       },
-       contents: {
-               script: /javascript|ecmascript/
-       },
-       converters: {
-               "text script": function( text ) {
-                       jQuery.globalEval( text );
-                       return text;
-               }
-       }
-});
-
-// Handle cache's special case and global
-jQuery.ajaxPrefilter( "script", function( s ) {
-       if ( s.cache === undefined ) {
-               s.cache = false;
-       }
-       if ( s.crossDomain ) {
-               s.type = "GET";
-               s.global = false;
-       }
-});
-
-// Bind script tag hack transport
-jQuery.ajaxTransport( "script", function(s) {
-
-       // This transport only deals with cross domain requests
-       if ( s.crossDomain ) {
-
-               var script,
-                       head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
-
-               return {
-
-                       send: function( _, callback ) {
-
-                               script = document.createElement( "script" );
-
-                               script.async = "async";
-
-                               if ( s.scriptCharset ) {
-                                       script.charset = s.scriptCharset;
-                               }
-
-                               script.src = s.url;
-
-                               // Attach handlers for all browsers
-                               script.onload = script.onreadystatechange = function( _, isAbort ) {
-
-                                       if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
-
-                                               // Handle memory leak in IE
-                                               script.onload = script.onreadystatechange = null;
-
-                                               // Remove the script
-                                               if ( head && script.parentNode ) {
-                                                       head.removeChild( script );
-                                               }
-
-                                               // Dereference the script
-                                               script = undefined;
-
-                                               // Callback if not abort
-                                               if ( !isAbort ) {
-                                                       callback( 200, "success" );
-                                               }
-                                       }
-                               };
-                               // Use insertBefore instead of appendChild  to circumvent an IE6 bug.
-                               // This arises when a base node is used (#2709 and #4378).
-                               head.insertBefore( script, head.firstChild );
-                       },
-
-                       abort: function() {
-                               if ( script ) {
-                                       script.onload( 0, 1 );
-                               }
-                       }
-               };
-       }
-});
-
-
-
-
-var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
-       xhrOnUnloadAbort = window.ActiveXObject ? function() {
-               // Abort all pending requests
-               for ( var key in xhrCallbacks ) {
-                       xhrCallbacks[ key ]( 0, 1 );
-               }
-       } : false,
-       xhrId = 0,
-       xhrCallbacks;
-
-// Functions to create xhrs
-function createStandardXHR() {
-       try {
-               return new window.XMLHttpRequest();
-       } catch( e ) {}
-}
-
-function createActiveXHR() {
-       try {
-               return new window.ActiveXObject( "Microsoft.XMLHTTP" );
-       } catch( e ) {}
-}
-
-// Create the request object
-// (This is still attached to ajaxSettings for backward compatibility)
-jQuery.ajaxSettings.xhr = window.ActiveXObject ?
-       /* Microsoft failed to properly
-        * implement the XMLHttpRequest in IE7 (can't request local files),
-        * so we use the ActiveXObject when it is available
-        * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
-        * we need a fallback.
-        */
-       function() {
-               return !this.isLocal && createStandardXHR() || createActiveXHR();
-       } :
-       // For all other browsers, use the standard XMLHttpRequest object
-       createStandardXHR;
-
-// Determine support properties
-(function( xhr ) {
-       jQuery.extend( jQuery.support, {
-               ajax: !!xhr,
-               cors: !!xhr && ( "withCredentials" in xhr )
-       });
-})( jQuery.ajaxSettings.xhr() );
-
-// Create transport if the browser can provide an xhr
-if ( jQuery.support.ajax ) {
-
-       jQuery.ajaxTransport(function( s ) {
-               // Cross domain only allowed if supported through XMLHttpRequest
-               if ( !s.crossDomain || jQuery.support.cors ) {
-
-                       var callback;
-
-                       return {
-                               send: function( headers, complete ) {
-
-                                       // Get a new xhr
-                                       var xhr = s.xhr(),
-                                               handle,
-                                               i;
-
-                                       // Open the socket
-                                       // Passing null username, generates a login popup on Opera (#2865)
-                                       if ( s.username ) {
-                                               xhr.open( s.type, s.url, s.async, s.username, s.password );
-                                       } else {
-                                               xhr.open( s.type, s.url, s.async );
-                                       }
-
-                                       // Apply custom fields if provided
-                                       if ( s.xhrFields ) {
-                                               for ( i in s.xhrFields ) {
-                                                       xhr[ i ] = s.xhrFields[ i ];
-                                               }
-                                       }
-
-                                       // Override mime type if needed
-                                       if ( s.mimeType && xhr.overrideMimeType ) {
-                                               xhr.overrideMimeType( s.mimeType );
-                                       }
-
-                                       // X-Requested-With header
-                                       // For cross-domain requests, seeing as conditions for a preflight are
-                                       // akin to a jigsaw puzzle, we simply never set it to be sure.
-                                       // (it can always be set on a per-request basis or even using ajaxSetup)
-                                       // For same-domain requests, won't change header if already provided.
-                                       if ( !s.crossDomain && !headers["X-Requested-With"] ) {
-                                               headers[ "X-Requested-With" ] = "XMLHttpRequest";
-                                       }
-
-                                       // Need an extra try/catch for cross domain requests in Firefox 3
-                                       try {
-                                               for ( i in headers ) {
-                                                       xhr.setRequestHeader( i, headers[ i ] );
-                                               }
-                                       } catch( _ ) {}
-
-                                       // Do send the request
-                                       // This may raise an exception which is actually
-                                       // handled in jQuery.ajax (so no try/catch here)
-                                       xhr.send( ( s.hasContent && s.data ) || null );
-
-                                       // Listener
-                                       callback = function( _, isAbort ) {
-
-                                               var status,
-                                                       statusText,
-                                                       responseHeaders,
-                                                       responses,
-                                                       xml;
-
-                                               // Firefox throws exceptions when accessing properties
-                                               // of an xhr when a network error occured
-                                               // http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
-                                               try {
-
-                                                       // Was never called and is aborted or complete
-                                                       if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
-
-                                                               // Only called once
-                                                               callback = undefined;
-
-                                                               // Do not keep as active anymore
-                                                               if ( handle ) {
-                                                                       xhr.onreadystatechange = jQuery.noop;
-                                                                       if ( xhrOnUnloadAbort ) {
-                                                                               delete xhrCallbacks[ handle ];
-                                                                       }
-                                                               }
-
-                                                               // If it's an abort
-                                                               if ( isAbort ) {
-                                                                       // Abort it manually if needed
-                                                                       if ( xhr.readyState !== 4 ) {
-                                                                               xhr.abort();
-                                                                       }
-                                                               } else {
-                                                                       status = xhr.status;
-                                                                       responseHeaders = xhr.getAllResponseHeaders();
-                                                                       responses = {};
-                                                                       xml = xhr.responseXML;
-
-                                                                       // Construct response list
-                                                                       if ( xml && xml.documentElement /* #4958 */ ) {
-                                                                               responses.xml = xml;
-                                                                       }
-
-                                                                       // When requesting binary data, IE6-9 will throw an exception
-                                                                       // on any attempt to access responseText (#11426)
-                                                                       try {
-                                                                               responses.text = xhr.responseText;
-                                                                       } catch( _ ) {
-                                                                       }
-
-                                                                       // Firefox throws an exception when accessing
-                                                                       // statusText for faulty cross-domain requests
-                                                                       try {
-                                                                               statusText = xhr.statusText;
-                                                                       } catch( e ) {
-                                                                               // We normalize with Webkit giving an empty statusText
-                                                                               statusText = "";
-                                                                       }
-
-                                                                       // Filter status for non standard behaviors
-
-                                                                       // If the request is local and we have data: assume a success
-                                                                       // (success with no data won't get notified, that's the best we
-                                                                       // can do given current implementations)
-                                                                       if ( !status && s.isLocal && !s.crossDomain ) {
-                                                                               status = responses.text ? 200 : 404;
-                                                                       // IE - #1450: sometimes returns 1223 when it should be 204
-                                                                       } else if ( status === 1223 ) {
-                                                                               status = 204;
-                                                                       }
-                                                               }
-                                                       }
-                                               } catch( firefoxAccessException ) {
-                                                       if ( !isAbort ) {
-                                                               complete( -1, firefoxAccessException );
-                                                       }
-                                               }
-
-                                               // Call complete if needed
-                                               if ( responses ) {
-                                                       complete( status, statusText, responses, responseHeaders );
-                                               }
-                                       };
-
-                                       // if we're in sync mode or it's in cache
-                                       // and has been retrieved directly (IE6 & IE7)
-                                       // we need to manually fire the callback
-                                       if ( !s.async || xhr.readyState === 4 ) {
-                                               callback();
-                                       } else {
-                                               handle = ++xhrId;
-                                               if ( xhrOnUnloadAbort ) {
-                                                       // Create the active xhrs callbacks list if needed
-                                                       // and attach the unload handler
-                                                       if ( !xhrCallbacks ) {
-                                                               xhrCallbacks = {};
-                                                               jQuery( window ).unload( xhrOnUnloadAbort );
-                                                       }
-                                                       // Add to list of active xhrs callbacks
-                                                       xhrCallbacks[ handle ] = callback;
-                                               }
-                                               xhr.onreadystatechange = callback;
-                                       }
-                               },
-
-                               abort: function() {
-                                       if ( callback ) {
-                                               callback(0,1);
-                                       }
-                               }
-                       };
-               }
-       });
-}
-
-
-
-
-var elemdisplay = {},
-       iframe, iframeDoc,
-       rfxtypes = /^(?:toggle|show|hide)$/,
-       rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
-       timerId,
-       fxAttrs = [
-               // height animations
-               [ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
-               // width animations
-               [ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
-               // opacity animations
-               [ "opacity" ]
-       ],
-       fxNow;
-
-jQuery.fn.extend({
-       show: function( speed, easing, callback ) {
-               var elem, display;
-
-               if ( speed || speed === 0 ) {
-                       return this.animate( genFx("show", 3), speed, easing, callback );
-
-               } else {
-                       for ( var i = 0, j = this.length; i < j; i++ ) {
-                               elem = this[ i ];
-
-                               if ( elem.style ) {
-                                       display = elem.style.display;
-
-                                       // Reset the inline display of this element to learn if it is
-                                       // being hidden by cascaded rules or not
-                                       if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
-                                               display = elem.style.display = "";
-                                       }
-
-                                       // Set elements which have been overridden with display: none
-                                       // in a stylesheet to whatever the default browser style is
-                                       // for such an element
-                                       if ( (display === "" && jQuery.css(elem, "display") === "none") ||
-                                               !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
-                                               jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
-                                       }
-                               }
-                       }
-
-                       // Set the display of most of the elements in a second loop
-                       // to avoid the constant reflow
-                       for ( i = 0; i < j; i++ ) {
-                               elem = this[ i ];
-
-                               if ( elem.style ) {
-                                       display = elem.style.display;
-
-                                       if ( display === "" || display === "none" ) {
-                                               elem.style.display = jQuery._data( elem, "olddisplay" ) || "";
-                                       }
-                               }
-                       }
-
-                       return this;
-               }
-       },
-
-       hide: function( speed, easing, callback ) {
-               if ( speed || speed === 0 ) {
-                       return this.animate( genFx("hide", 3), speed, easing, callback);
-
-               } else {
-                       var elem, display,
-                               i = 0,
-                               j = this.length;
-
-                       for ( ; i < j; i++ ) {
-                               elem = this[i];
-                               if ( elem.style ) {
-                                       display = jQuery.css( elem, "display" );
-
-                                       if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) {
-                                               jQuery._data( elem, "olddisplay", display );
-                                       }
-                               }
-                       }
-
-                       // Set the display of the elements in a second loop
-                       // to avoid the constant reflow
-                       for ( i = 0; i < j; i++ ) {
-                               if ( this[i].style ) {
-                                       this[i].style.display = "none";
-                               }
-                       }
-
-                       return this;
-               }
-       },
-
-       // Save the old toggle function
-       _toggle: jQuery.fn.toggle,
-
-       toggle: function( fn, fn2, callback ) {
-               var bool = typeof fn === "boolean";
-
-               if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
-                       this._toggle.apply( this, arguments );
-
-               } else if ( fn == null || bool ) {
-                       this.each(function() {
-                               var state = bool ? fn : jQuery(this).is(":hidden");
-                               jQuery(this)[ state ? "show" : "hide" ]();
-                       });
-
-               } else {
-                       this.animate(genFx("toggle", 3), fn, fn2, callback);
-               }
-
-               return this;
-       },
-
-       fadeTo: function( speed, to, easing, callback ) {
-               return this.filter(":hidden").css("opacity", 0).show().end()
-                                       .animate({opacity: to}, speed, easing, callback);
-       },
-
-       animate: function( prop, speed, easing, callback ) {
-               var optall = jQuery.speed( speed, easing, callback );
-
-               if ( jQuery.isEmptyObject( prop ) ) {
-                       return this.each( optall.complete, [ false ] );
-               }
-
-               // Do not change referenced properties as per-property easing will be lost
-               prop = jQuery.extend( {}, prop );
-
-               function doAnimation() {
-                       // XXX 'this' does not always have a nodeName when running the
-                       // test suite
-
-                       if ( optall.queue === false ) {
-                               jQuery._mark( this );
-                       }
-
-                       var opt = jQuery.extend( {}, optall ),
-                               isElement = this.nodeType === 1,
-                               hidden = isElement && jQuery(this).is(":hidden"),
-                               name, val, p, e, hooks, replace,
-                               parts, start, end, unit,
-                               method;
-
-                       // will store per property easing and be used to determine when an animation is complete
-                       opt.animatedProperties = {};
-
-                       // first pass over propertys to expand / normalize
-                       for ( p in prop ) {
-                               name = jQuery.camelCase( p );
-                               if ( p !== name ) {
-                                       prop[ name ] = prop[ p ];
-                                       delete prop[ p ];
-                               }
-
-                               if ( ( hooks = jQuery.cssHooks[ name ] ) && "expand" in hooks ) {
-                                       replace = hooks.expand( prop[ name ] );
-                                       delete prop[ name ];
-
-                                       // not quite $.extend, this wont overwrite keys already present.
-                                       // also - reusing 'p' from above because we have the correct "name"
-                                       for ( p in replace ) {
-                                               if ( ! ( p in prop ) ) {
-                                                       prop[ p ] = replace[ p ];
-                                               }
-                                       }
-                               }
-                       }
-
-                       for ( name in prop ) {
-                               val = prop[ name ];
-                               // easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
-                               if ( jQuery.isArray( val ) ) {
-                                       opt.animatedProperties[ name ] = val[ 1 ];
-                                       val = prop[ name ] = val[ 0 ];
-                               } else {
-                                       opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
-                               }
-
-                               if ( val === "hide" && hidden || val === "show" && !hidden ) {
-                                       return opt.complete.call( this );
-                               }
-
-                               if ( isElement && ( name === "height" || name === "width" ) ) {
-                                       // Make sure that nothing sneaks out
-                                       // Record all 3 overflow attributes because IE does not
-                                       // change the overflow attribute when overflowX and
-                                       // overflowY are set to the same value
-                                       opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
-
-                                       // Set display property to inline-block for height/width
-                                       // animations on inline elements that are having width/height animated
-                                       if ( jQuery.css( this, "display" ) === "inline" &&
-                                                       jQuery.css( this, "float" ) === "none" ) {
-
-                                               // inline-level elements accept inline-block;
-                                               // block-level elements need to be inline with layout
-                                               if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {
-                                                       this.style.display = "inline-block";
-
-                                               } else {
-                                                       this.style.zoom = 1;
-                                               }
-                                       }
-                               }
-                       }
-
-                       if ( opt.overflow != null ) {
-                               this.style.overflow = "hidden";
-                       }
-
-                       for ( p in prop ) {
-                               e = new jQuery.fx( this, opt, p );
-                               val = prop[ p ];
-
-                               if ( rfxtypes.test( val ) ) {
-
-                                       // Tracks whether to show or hide based on private
-                                       // data attached to the element
-                                       method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 );
-                                       if ( method ) {
-                                               jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" );
-                                               e[ method ]();
-                                       } else {
-                                               e[ val ]();
-                                       }
-
-                               } else {
-                                       parts = rfxnum.exec( val );
-                                       start = e.cur();
-
-                                       if ( parts ) {
-                                               end = parseFloat( parts[2] );
-                                               unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
-
-                                               // We need to compute starting value
-                                               if ( unit !== "px" ) {
-                                                       jQuery.style( this, p, (end || 1) + unit);
-                                                       start = ( (end || 1) / e.cur() ) * start;
-                                                       jQuery.style( this, p, start + unit);
-                                               }
-
-                                               // If a +=/-= token was provided, we're doing a relative animation
-                                               if ( parts[1] ) {
-                                                       end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
-                                               }
-
-                                               e.custom( start, end, unit );
-
-                                       } else {
-                                               e.custom( start, val, "" );
-                                       }
-                               }
-                       }
-
-                       // For JS strict compliance
-                       return true;
-               }
-
-               return optall.queue === false ?
-                       this.each( doAnimation ) :
-                       this.queue( optall.queue, doAnimation );
-       },
-
-       stop: function( type, clearQueue, gotoEnd ) {
-               if ( typeof type !== "string" ) {
-                       gotoEnd = clearQueue;
-                       clearQueue = type;
-                       type = undefined;
-               }
-               if ( clearQueue && type !== false ) {
-                       this.queue( type || "fx", [] );
-               }
-
-               return this.each(function() {
-                       var index,
-                               hadTimers = false,
-                               timers = jQuery.timers,
-                               data = jQuery._data( this );
-
-                       // clear marker counters if we know they won't be
-                       if ( !gotoEnd ) {
-                               jQuery._unmark( true, this );
-                       }
-
-                       function stopQueue( elem, data, index ) {
-                               var hooks = data[ index ];
-                               jQuery.removeData( elem, index, true );
-                               hooks.stop( gotoEnd );
-                       }
-
-                       if ( type == null ) {
-                               for ( index in data ) {
-                                       if ( data[ index ] && data[ index ].stop && index.indexOf(".run") === index.length - 4 ) {
-                                               stopQueue( this, data, index );
-                                       }
-                               }
-                       } else if ( data[ index = type + ".run" ] && data[ index ].stop ){
-                               stopQueue( this, data, index );
-                       }
-
-                       for ( index = timers.length; index--; ) {
-                               if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
-                                       if ( gotoEnd ) {
-
-                                               // force the next step to be the last
-                                               timers[ index ]( true );
-                                       } else {
-                                               timers[ index ].saveState();
-                                       }
-                                       hadTimers = true;
-                                       timers.splice( index, 1 );
-                               }
-                       }
-
-                       // start the next in the queue if the last step wasn't forced
-                       // timers currently will call their complete callbacks, which will dequeue
-                       // but only if they were gotoEnd
-                       if ( !( gotoEnd && hadTimers ) ) {
-                               jQuery.dequeue( this, type );
-                       }
-               });
-       }
-
-});
-
-// Animations created synchronously will run synchronously
-function createFxNow() {
-       setTimeout( clearFxNow, 0 );
-       return ( fxNow = jQuery.now() );
-}
-
-function clearFxNow() {
-       fxNow = undefined;
-}
-
-// Generate parameters to create a standard animation
-function genFx( type, num ) {
-       var obj = {};
-
-       jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() {
-               obj[ this ] = type;
-       });
-
-       return obj;
-}
-
-// Generate shortcuts for custom animations
-jQuery.each({
-       slideDown: genFx( "show", 1 ),
-       slideUp: genFx( "hide", 1 ),
-       slideToggle: genFx( "toggle", 1 ),
-       fadeIn: { opacity: "show" },
-       fadeOut: { opacity: "hide" },
-       fadeToggle: { opacity: "toggle" }
-}, function( name, props ) {
-       jQuery.fn[ name ] = function( speed, easing, callback ) {
-               return this.animate( props, speed, easing, callback );
-       };
-});
-
-jQuery.extend({
-       speed: function( speed, easing, fn ) {
-               var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
-                       complete: fn || !fn && easing ||
-                               jQuery.isFunction( speed ) && speed,
-                       duration: speed,
-                       easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
-               };
-
-               opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
-                       opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
-
-               // normalize opt.queue - true/undefined/null -> "fx"
-               if ( opt.queue == null || opt.queue === true ) {
-                       opt.queue = "fx";
-               }
-
-               // Queueing
-               opt.old = opt.complete;
-
-               opt.complete = function( noUnmark ) {
-                       if ( jQuery.isFunction( opt.old ) ) {
-                               opt.old.call( this );
-                       }
-
-                       if ( opt.queue ) {
-                               jQuery.dequeue( this, opt.queue );
-                       } else if ( noUnmark !== false ) {
-                               jQuery._unmark( this );
-                       }
-               };
-
-               return opt;
-       },
-
-       easing: {
-               linear: function( p ) {
-                       return p;
-               },
-               swing: function( p ) {
-                       return ( -Math.cos( p*Math.PI ) / 2 ) + 0.5;
-               }
-       },
-
-       timers: [],
-
-       fx: function( elem, options, prop ) {
-               this.options = options;
-               this.elem = elem;
-               this.prop = prop;
-
-               options.orig = options.orig || {};
-       }
-
-});
-
-jQuery.fx.prototype = {
-       // Simple function for setting a style value
-       update: function() {
-               if ( this.options.step ) {
-                       this.options.step.call( this.elem, this.now, this );
-               }
-
-               ( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this );
-       },
-
-       // Get the current size
-       cur: function() {
-               if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) {
-                       return this.elem[ this.prop ];
-               }
-
-               var parsed,
-                       r = jQuery.css( this.elem, this.prop );
-               // Empty strings, null, undefined and "auto" are converted to 0,
-               // complex values such as "rotate(1rad)" are returned as is,
-               // simple values such as "10px" are parsed to Float.
-               return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
-       },
-
-       // Start an animation from one number to another
-       custom: function( from, to, unit ) {
-               var self = this,
-                       fx = jQuery.fx;
-
-               this.startTime = fxNow || createFxNow();
-               this.end = to;
-               this.now = this.start = from;
-               this.pos = this.state = 0;
-               this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
-
-               function t( gotoEnd ) {
-                       return self.step( gotoEnd );
-               }
-
-               t.queue = this.options.queue;
-               t.elem = this.elem;
-               t.saveState = function() {
-                       if ( jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) {
-                               if ( self.options.hide ) {
-                                       jQuery._data( self.elem, "fxshow" + self.prop, self.start );
-                               } else if ( self.options.show ) {
-                                       jQuery._data( self.elem, "fxshow" + self.prop, self.end );
-                               }
-                       }
-               };
-
-               if ( t() && jQuery.timers.push(t) && !timerId ) {
-                       timerId = setInterval( fx.tick, fx.interval );
-               }
-       },
-
-       // Simple 'show' function
-       show: function() {
-               var dataShow = jQuery._data( this.elem, "fxshow" + this.prop );
-
-               // Remember where we started, so that we can go back to it later
-               this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop );
-               this.options.show = true;
-
-               // Begin the animation
-               // Make sure that we start at a small width/height to avoid any flash of content
-               if ( dataShow !== undefined ) {
-                       // This show is picking up where a previous hide or show left off
-                       this.custom( this.cur(), dataShow );
-               } else {
-                       this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() );
-               }
-
-               // Start by showing the element
-               jQuery( this.elem ).show();
-       },
-
-       // Simple 'hide' function
-       hide: function() {
-               // Remember where we started, so that we can go back to it later
-               this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop );
-               this.options.hide = true;
-
-               // Begin the animation
-               this.custom( this.cur(), 0 );
-       },
-
-       // Each step of an animation
-       step: function( gotoEnd ) {
-               var p, n, complete,
-                       t = fxNow || createFxNow(),
-                       done = true,
-                       elem = this.elem,
-                       options = this.options;
-
-               if ( gotoEnd || t >= options.duration + this.startTime ) {
-                       this.now = this.end;
-                       this.pos = this.state = 1;
-                       this.update();
-
-                       options.animatedProperties[ this.prop ] = true;
-
-                       for ( p in options.animatedProperties ) {
-                               if ( options.animatedProperties[ p ] !== true ) {
-                                       done = false;
-                               }
-                       }
-
-                       if ( done ) {
-                               // Reset the overflow
-                               if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
-
-                                       jQuery.each( [ "", "X", "Y" ], function( index, value ) {
-                                               elem.style[ "overflow" + value ] = options.overflow[ index ];
-                                       });
-                               }
-
-                               // Hide the element if the "hide" operation was done
-                               if ( options.hide ) {
-                                       jQuery( elem ).hide();
-                               }
-
-                               // Reset the properties, if the item has been hidden or shown
-                               if ( options.hide || options.show ) {
-                                       for ( p in options.animatedProperties ) {
-                                               jQuery.style( elem, p, options.orig[ p ] );
-                                               jQuery.removeData( elem, "fxshow" + p, true );
-                                               // Toggle data is no longer needed
-                                               jQuery.removeData( elem, "toggle" + p, true );
-                                       }
-                               }
-
-                               // Execute the complete function
-                               // in the event that the complete function throws an exception
-                               // we must ensure it won't be called twice. #5684
-
-                               complete = options.complete;
-                               if ( complete ) {
-
-                                       options.complete = false;
-                                       complete.call( elem );
-                               }
-                       }
-
-                       return false;
-
-               } else {
-                       // classical easing cannot be used with an Infinity duration
-                       if ( options.duration == Infinity ) {
-                               this.now = t;
-                       } else {
-                               n = t - this.startTime;
-                               this.state = n / options.duration;
-
-                               // Perform the easing function, defaults to swing
-                               this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration );
-                               this.now = this.start + ( (this.end - this.start) * this.pos );
-                       }
-                       // Perform the next step of the animation
-                       this.update();
-               }
-
-               return true;
-       }
-};
-
-jQuery.extend( jQuery.fx, {
-       tick: function() {
-               var timer,
-                       timers = jQuery.timers,
-                       i = 0;
-
-               for ( ; i < timers.length; i++ ) {
-                       timer = timers[ i ];
-                       // Checks the timer has not already been removed
-                       if ( !timer() && timers[ i ] === timer ) {
-                               timers.splice( i--, 1 );
-                       }
-               }
-
-               if ( !timers.length ) {
-                       jQuery.fx.stop();
-               }
-       },
-
-       interval: 13,
-
-       stop: function() {
-               clearInterval( timerId );
-               timerId = null;
-       },
-
-       speeds: {
-               slow: 600,
-               fast: 200,
-               // Default speed
-               _default: 400
-       },
-
-       step: {
-               opacity: function( fx ) {
-                       jQuery.style( fx.elem, "opacity", fx.now );
-               },
-
-               _default: function( fx ) {
-                       if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
-                               fx.elem.style[ fx.prop ] = fx.now + fx.unit;
-                       } else {
-                               fx.elem[ fx.prop ] = fx.now;
-                       }
-               }
-       }
-});
-
-// Ensure props that can't be negative don't go there on undershoot easing
-jQuery.each( fxAttrs.concat.apply( [], fxAttrs ), function( i, prop ) {
-       // exclude marginTop, marginLeft, marginBottom and marginRight from this list
-       if ( prop.indexOf( "margin" ) ) {
-               jQuery.fx.step[ prop ] = function( fx ) {
-                       jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit );
-               };
-       }
-});
-
-if ( jQuery.expr && jQuery.expr.filters ) {
-       jQuery.expr.filters.animated = function( elem ) {
-               return jQuery.grep(jQuery.timers, function( fn ) {
-                       return elem === fn.elem;
-               }).length;
-       };
-}
-
-// Try to restore the default display value of an element
-function defaultDisplay( nodeName ) {
-
-       if ( !elemdisplay[ nodeName ] ) {
-
-               var body = document.body,
-                       elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
-                       display = elem.css( "display" );
-               elem.remove();
-
-               // If the simple way fails,
-               // get element's real default display by attaching it to a temp iframe
-               if ( display === "none" || display === "" ) {
-                       // No iframe to use yet, so create it
-                       if ( !iframe ) {
-                               iframe = document.createElement( "iframe" );
-                               iframe.frameBorder = iframe.width = iframe.height = 0;
-                       }
-
-                       body.appendChild( iframe );
-
-                       // Create a cacheable copy of the iframe document on first call.
-                       // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
-                       // document to it; WebKit & Firefox won't allow reusing the iframe document.
-                       if ( !iframeDoc || !iframe.createElement ) {
-                               iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
-                               iframeDoc.write( ( jQuery.support.boxModel ? "<!doctype html>" : "" ) + "<html><body>" );
-                               iframeDoc.close();
-                       }
-
-                       elem = iframeDoc.createElement( nodeName );
-
-                       iframeDoc.body.appendChild( elem );
-
-                       display = jQuery.css( elem, "display" );
-                       body.removeChild( iframe );
-               }
-
-               // Store the correct default display
-               elemdisplay[ nodeName ] = display;
-       }
-
-       return elemdisplay[ nodeName ];
-}
-
-
-
-
-var getOffset,
-       rtable = /^t(?:able|d|h)$/i,
-       rroot = /^(?:body|html)$/i;
-
-if ( "getBoundingClientRect" in document.documentElement ) {
-       getOffset = function( elem, doc, docElem, box ) {
-               try {
-                       box = elem.getBoundingClientRect();
-               } catch(e) {}
-
-               // Make sure we're not dealing with a disconnected DOM node
-               if ( !box || !jQuery.contains( docElem, elem ) ) {
-                       return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
-               }
-
-               var body = doc.body,
-                       win = getWindow( doc ),
-                       clientTop  = docElem.clientTop  || body.clientTop  || 0,
-                       clientLeft = docElem.clientLeft || body.clientLeft || 0,
-                       scrollTop  = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop  || body.scrollTop,
-                       scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
-                       top  = box.top  + scrollTop  - clientTop,
-                       left = box.left + scrollLeft - clientLeft;
-
-               return { top: top, left: left };
-       };
-
-} else {
-       getOffset = function( elem, doc, docElem ) {
-               var computedStyle,
-                       offsetParent = elem.offsetParent,
-                       prevOffsetParent = elem,
-                       body = doc.body,
-                       defaultView = doc.defaultView,
-                       prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
-                       top = elem.offsetTop,
-                       left = elem.offsetLeft;
-
-               while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
-                       if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
-                               break;
-                       }
-
-                       computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
-                       top  -= elem.scrollTop;
-                       left -= elem.scrollLeft;
-
-                       if ( elem === offsetParent ) {
-                               top  += elem.offsetTop;
-                               left += elem.offsetLeft;
-
-                               if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
-                                       top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
-                                       left += parseFloat( computedStyle.borderLeftWidth ) || 0;
-                               }
-
-                               prevOffsetParent = offsetParent;
-                               offsetParent = elem.offsetParent;
-                       }
-
-                       if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
-                               top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
-                               left += parseFloat( computedStyle.borderLeftWidth ) || 0;
-                       }
-
-                       prevComputedStyle = computedStyle;
-               }
-
-               if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
-                       top  += body.offsetTop;
-                       left += body.offsetLeft;
-               }
-
-               if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
-                       top  += Math.max( docElem.scrollTop, body.scrollTop );
-                       left += Math.max( docElem.scrollLeft, body.scrollLeft );
-               }
-
-               return { top: top, left: left };
-       };
-}
-
-jQuery.fn.offset = function( options ) {
-       if ( arguments.length ) {
-               return options === undefined ?
-                       this :
-                       this.each(function( i ) {
-                               jQuery.offset.setOffset( this, options, i );
-                       });
-       }
-
-       var elem = this[0],
-               doc = elem && elem.ownerDocument;
-
-       if ( !doc ) {
-               return null;
-       }
-
-       if ( elem === doc.body ) {
-               return jQuery.offset.bodyOffset( elem );
-       }
-
-       return getOffset( elem, doc, doc.documentElement );
-};
-
-jQuery.offset = {
-
-       bodyOffset: function( body ) {
-               var top = body.offsetTop,
-                       left = body.offsetLeft;
-
-               if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
-                       top  += parseFloat( jQuery.css(body, "marginTop") ) || 0;
-                       left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
-               }
-
-               return { top: top, left: left };
-       },
-
-       setOffset: function( elem, options, i ) {
-               var position = jQuery.css( elem, "position" );
-
-               // set position first, in-case top/left are set even on static elem
-               if ( position === "static" ) {
-                       elem.style.position = "relative";
-               }
-
-               var curElem = jQuery( elem ),
-                       curOffset = curElem.offset(),
-                       curCSSTop = jQuery.css( elem, "top" ),
-                       curCSSLeft = jQuery.css( elem, "left" ),
-                       calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
-                       props = {}, curPosition = {}, curTop, curLeft;
-
-               // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
-               if ( calculatePosition ) {
-                       curPosition = curElem.position();
-                       curTop = curPosition.top;
-                       curLeft = curPosition.left;
-               } else {
-                       curTop = parseFloat( curCSSTop ) || 0;
-                       curLeft = parseFloat( curCSSLeft ) || 0;
-               }
-
-               if ( jQuery.isFunction( options ) ) {
-                       options = options.call( elem, i, curOffset );
-               }
-
-               if ( options.top != null ) {
-                       props.top = ( options.top - curOffset.top ) + curTop;
-               }
-               if ( options.left != null ) {
-                       props.left = ( options.left - curOffset.left ) + curLeft;
-               }
-
-               if ( "using" in options ) {
-                       options.using.call( elem, props );
-               } else {
-                       curElem.css( props );
-               }
-       }
-};
-
-
-jQuery.fn.extend({
-
-       position: function() {
-               if ( !this[0] ) {
-                       return null;
-               }
-
-               var elem = this[0],
-
-               // Get *real* offsetParent
-               offsetParent = this.offsetParent(),
-
-               // Get correct offsets
-               offset       = this.offset(),
-               parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
-
-               // Subtract element margins
-               // note: when an element has margin: auto the offsetLeft and marginLeft
-               // are the same in Safari causing offset.left to incorrectly be 0
-               offset.top  -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
-               offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
-
-               // Add offsetParent borders
-               parentOffset.top  += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
-               parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
-
-               // Subtract the two offsets
-               return {
-                       top:  offset.top  - parentOffset.top,
-                       left: offset.left - parentOffset.left
-               };
-       },
-
-       offsetParent: function() {
-               return this.map(function() {
-                       var offsetParent = this.offsetParent || document.body;
-                       while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
-                               offsetParent = offsetParent.offsetParent;
-                       }
-                       return offsetParent;
-               });
-       }
-});
-
-
-// Create scrollLeft and scrollTop methods
-jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
-       var top = /Y/.test( prop );
-
-       jQuery.fn[ method ] = function( val ) {
-               return jQuery.access( this, function( elem, method, val ) {
-                       var win = getWindow( elem );
-
-                       if ( val === undefined ) {
-                               return win ? (prop in win) ? win[ prop ] :
-                                       jQuery.support.boxModel && win.document.documentElement[ method ] ||
-                                               win.document.body[ method ] :
-                                       elem[ method ];
-                       }
-
-                       if ( win ) {
-                               win.scrollTo(
-                                       !top ? val : jQuery( win ).scrollLeft(),
-                                        top ? val : jQuery( win ).scrollTop()
-                               );
-
-                       } else {
-                               elem[ method ] = val;
-                       }
-               }, method, val, arguments.length, null );
-       };
-});
-
-function getWindow( elem ) {
-       return jQuery.isWindow( elem ) ?
-               elem :
-               elem.nodeType === 9 ?
-                       elem.defaultView || elem.parentWindow :
-                       false;
-}
-
-
-
-
-// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
-jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
-       var clientProp = "client" + name,
-               scrollProp = "scroll" + name,
-               offsetProp = "offset" + name;
-
-       // innerHeight and innerWidth
-       jQuery.fn[ "inner" + name ] = function() {
-               var elem = this[0];
-               return elem ?
-                       elem.style ?
-                       parseFloat( jQuery.css( elem, type, "padding" ) ) :
-                       this[ type ]() :
-                       null;
-       };
-
-       // outerHeight and outerWidth
-       jQuery.fn[ "outer" + name ] = function( margin ) {
-               var elem = this[0];
-               return elem ?
-                       elem.style ?
-                       parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
-                       this[ type ]() :
-                       null;
-       };
-
-       jQuery.fn[ type ] = function( value ) {
-               return jQuery.access( this, function( elem, type, value ) {
-                       var doc, docElemProp, orig, ret;
-
-                       if ( jQuery.isWindow( elem ) ) {
-                               // 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
-                               doc = elem.document;
-                               docElemProp = doc.documentElement[ clientProp ];
-                               return jQuery.support.boxModel && docElemProp ||
-                                       doc.body && doc.body[ clientProp ] || docElemProp;
-                       }
-
-                       // Get document width or height
-                       if ( elem.nodeType === 9 ) {
-                               // Either scroll[Width/Height] or offset[Width/Height], whichever is greater
-                               doc = elem.documentElement;
-
-                               // when a window > document, IE6 reports a offset[Width/Height] > client[Width/Height]
-                               // so we can't use max, as it'll choose the incorrect offset[Width/Height]
-                               // instead we use the correct client[Width/Height]
-                               // support:IE6
-                               if ( doc[ clientProp ] >= doc[ scrollProp ] ) {
-                                       return doc[ clientProp ];
-                               }
-
-                               return Math.max(
-                                       elem.body[ scrollProp ], doc[ scrollProp ],
-                                       elem.body[ offsetProp ], doc[ offsetProp ]
-                               );
-                       }
-
-                       // Get width or height on the element
-                       if ( value === undefined ) {
-                               orig = jQuery.css( elem, type );
-                               ret = parseFloat( orig );
-                               return jQuery.isNumeric( ret ) ? ret : orig;
-                       }
-
-                       // Set the width or height on the element
-                       jQuery( elem ).css( type, value );
-               }, type, value, arguments.length, null );
-       };
-});
-
-
-
-
-// Expose jQuery to the global object
-window.jQuery = window.$ = jQuery;
-
-// Expose jQuery as an AMD module, but only for AMD loaders that
-// understand the issues with loading multiple versions of jQuery
-// in a page that all might call define(). The loader will indicate
-// they have special allowances for multiple jQuery versions by
-// specifying define.amd.jQuery = true. Register as a named module,
-// since jQuery can be concatenated with other files that may use define,
-// but not use a proper concatenation script that understands anonymous
-// AMD modules. A named AMD is safest and most robust way to register.
-// Lowercase jquery is used because AMD module names are derived from
-// file names, and jQuery is normally delivered in a lowercase file name.
-// Do this after creating the global so that if an AMD module wants to call
-// noConflict to hide this version of jQuery, it will work.
-if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
-       define( "jquery", [], function () { return jQuery; } );
-}
-
-
-
-})( window );
diff --git a/libs/js/jquery-geo-1.0b2/libs/qunit/qunit.css b/libs/js/jquery-geo-1.0b2/libs/qunit/qunit.css
deleted file mode 100755 (executable)
index 4be7e36..0000000
+++ /dev/null
@@ -1,232 +0,0 @@
-/**
- * QUnit v1.4.0 - A JavaScript Unit Testing Framework
- *
- * http://docs.jquery.com/QUnit
- *
- * Copyright (c) 2012 John Resig, Jörn Zaefferer
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * or GPL (GPL-LICENSE.txt) licenses.
- */
-
-/** Font Family and Sizes */
-
-#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
-       font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
-}
-
-#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
-#qunit-tests { font-size: smaller; }
-
-
-/** Resets */
-
-#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult {
-       margin: 0;
-       padding: 0;
-}
-
-
-/** Header */
-
-#qunit-header {
-       padding: 0.5em 0 0.5em 1em;
-
-       color: #8699a4;
-       background-color: #0d3349;
-
-       font-size: 1.5em;
-       line-height: 1em;
-       font-weight: normal;
-
-       border-radius: 15px 15px 0 0;
-       -moz-border-radius: 15px 15px 0 0;
-       -webkit-border-top-right-radius: 15px;
-       -webkit-border-top-left-radius: 15px;
-}
-
-#qunit-header a {
-       text-decoration: none;
-       color: #c2ccd1;
-}
-
-#qunit-header a:hover,
-#qunit-header a:focus {
-       color: #fff;
-}
-
-#qunit-header label {
-       display: inline-block;
-}
-
-#qunit-banner {
-       height: 5px;
-}
-
-#qunit-testrunner-toolbar {
-       padding: 0.5em 0 0.5em 2em;
-       color: #5E740B;
-       background-color: #eee;
-}
-
-#qunit-userAgent {
-       padding: 0.5em 0 0.5em 2.5em;
-       background-color: #2b81af;
-       color: #fff;
-       text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
-}
-
-
-/** Tests: Pass/Fail */
-
-#qunit-tests {
-       list-style-position: inside;
-}
-
-#qunit-tests li {
-       padding: 0.4em 0.5em 0.4em 2.5em;
-       border-bottom: 1px solid #fff;
-       list-style-position: inside;
-}
-
-#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running  {
-       display: none;
-}
-
-#qunit-tests li strong {
-       cursor: pointer;
-}
-
-#qunit-tests li a {
-       padding: 0.5em;
-       color: #c2ccd1;
-       text-decoration: none;
-}
-#qunit-tests li a:hover,
-#qunit-tests li a:focus {
-       color: #000;
-}
-
-#qunit-tests ol {
-       margin-top: 0.5em;
-       padding: 0.5em;
-
-       background-color: #fff;
-
-       border-radius: 15px;
-       -moz-border-radius: 15px;
-       -webkit-border-radius: 15px;
-
-       box-shadow: inset 0px 2px 13px #999;
-       -moz-box-shadow: inset 0px 2px 13px #999;
-       -webkit-box-shadow: inset 0px 2px 13px #999;
-}
-
-#qunit-tests table {
-       border-collapse: collapse;
-       margin-top: .2em;
-}
-
-#qunit-tests th {
-       text-align: right;
-       vertical-align: top;
-       padding: 0 .5em 0 0;
-}
-
-#qunit-tests td {
-       vertical-align: top;
-}
-
-#qunit-tests pre {
-       margin: 0;
-       white-space: pre-wrap;
-       word-wrap: break-word;
-}
-
-#qunit-tests del {
-       background-color: #e0f2be;
-       color: #374e0c;
-       text-decoration: none;
-}
-
-#qunit-tests ins {
-       background-color: #ffcaca;
-       color: #500;
-       text-decoration: none;
-}
-
-/*** Test Counts */
-
-#qunit-tests b.counts                       { color: black; }
-#qunit-tests b.passed                       { color: #5E740B; }
-#qunit-tests b.failed                       { color: #710909; }
-
-#qunit-tests li li {
-       margin: 0.5em;
-       padding: 0.4em 0.5em 0.4em 0.5em;
-       background-color: #fff;
-       border-bottom: none;
-       list-style-position: inside;
-}
-
-/*** Passing Styles */
-
-#qunit-tests li li.pass {
-       color: #5E740B;
-       background-color: #fff;
-       border-left: 26px solid #C6E746;
-}
-
-#qunit-tests .pass                          { color: #528CE0; background-color: #D2E0E6; }
-#qunit-tests .pass .test-name               { color: #366097; }
-
-#qunit-tests .pass .test-actual,
-#qunit-tests .pass .test-expected           { color: #999999; }
-
-#qunit-banner.qunit-pass                    { background-color: #C6E746; }
-
-/*** Failing Styles */
-
-#qunit-tests li li.fail {
-       color: #710909;
-       background-color: #fff;
-       border-left: 26px solid #EE5757;
-       white-space: pre;
-}
-
-#qunit-tests > li:last-child {
-       border-radius: 0 0 15px 15px;
-       -moz-border-radius: 0 0 15px 15px;
-       -webkit-border-bottom-right-radius: 15px;
-       -webkit-border-bottom-left-radius: 15px;
-}
-
-#qunit-tests .fail                          { color: #000000; background-color: #EE5757; }
-#qunit-tests .fail .test-name,
-#qunit-tests .fail .module-name             { color: #000000; }
-
-#qunit-tests .fail .test-actual             { color: #EE5757; }
-#qunit-tests .fail .test-expected           { color: green;   }
-
-#qunit-banner.qunit-fail                    { background-color: #EE5757; }
-
-
-/** Result */
-
-#qunit-testresult {
-       padding: 0.5em 0.5em 0.5em 2.5em;
-
-       color: #2b81af;
-       background-color: #D2E0E6;
-
-       border-bottom: 1px solid white;
-}
-
-/** Fixture */
-
-#qunit-fixture {
-       position: absolute;
-       top: -10000px;
-       left: -10000px;
-       width: 1000px;
-       height: 1000px;
-}
diff --git a/libs/js/jquery-geo-1.0b2/libs/qunit/qunit.js b/libs/js/jquery-geo-1.0b2/libs/qunit/qunit.js
deleted file mode 100755 (executable)
index f50407a..0000000
+++ /dev/null
@@ -1,1659 +0,0 @@
-/**
- * QUnit v1.4.0 - A JavaScript Unit Testing Framework
- *
- * http://docs.jquery.com/QUnit
- *
- * Copyright (c) 2012 John Resig, Jörn Zaefferer
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * or GPL (GPL-LICENSE.txt) licenses.
- */
-
-(function(window) {
-
-var defined = {
-       setTimeout: typeof window.setTimeout !== "undefined",
-       sessionStorage: (function() {
-               var x = "qunit-test-string";
-               try {
-                       sessionStorage.setItem(x, x);
-                       sessionStorage.removeItem(x);
-                       return true;
-               } catch(e) {
-                       return false;
-               }
-       }())
-};
-
-var    testId = 0,
-       toString = Object.prototype.toString,
-       hasOwn = Object.prototype.hasOwnProperty;
-
-var Test = function(name, testName, expected, async, callback) {
-       this.name = name;
-       this.testName = testName;
-       this.expected = expected;
-       this.async = async;
-       this.callback = callback;
-       this.assertions = [];
-};
-Test.prototype = {
-       init: function() {
-               var tests = id("qunit-tests");
-               if (tests) {
-                       var b = document.createElement("strong");
-                               b.innerHTML = "Running " + this.name;
-                       var li = document.createElement("li");
-                               li.appendChild( b );
-                               li.className = "running";
-                               li.id = this.id = "test-output" + testId++;
-                       tests.appendChild( li );
-               }
-       },
-       setup: function() {
-               if (this.module != config.previousModule) {
-                       if ( config.previousModule ) {
-                               runLoggingCallbacks('moduleDone', QUnit, {
-                                       name: config.previousModule,
-                                       failed: config.moduleStats.bad,
-                                       passed: config.moduleStats.all - config.moduleStats.bad,
-                                       total: config.moduleStats.all
-                               } );
-                       }
-                       config.previousModule = this.module;
-                       config.moduleStats = { all: 0, bad: 0 };
-                       runLoggingCallbacks( 'moduleStart', QUnit, {
-                               name: this.module
-                       } );
-               } else if (config.autorun) {
-                       runLoggingCallbacks( 'moduleStart', QUnit, {
-                               name: this.module
-                       } );
-               }
-
-               config.current = this;
-               this.testEnvironment = extend({
-                       setup: function() {},
-                       teardown: function() {}
-               }, this.moduleTestEnvironment);
-
-               runLoggingCallbacks( 'testStart', QUnit, {
-                       name: this.testName,
-                       module: this.module
-               });
-
-               // allow utility functions to access the current test environment
-               // TODO why??
-               QUnit.current_testEnvironment = this.testEnvironment;
-
-               if ( !config.pollution ) {
-                       saveGlobal();
-               }
-               if ( config.notrycatch ) {
-                       this.testEnvironment.setup.call(this.testEnvironment);
-                       return;
-               }
-               try {
-                       this.testEnvironment.setup.call(this.testEnvironment);
-               } catch(e) {
-                       QUnit.pushFailure( "Setup failed on " + this.testName + ": " + e.message, extractStacktrace( e, 1 ) );
-               }
-       },
-       run: function() {
-               config.current = this;
-               if ( this.async ) {
-                       QUnit.stop();
-               }
-
-               if ( config.notrycatch ) {
-                       this.callback.call(this.testEnvironment);
-                       return;
-               }
-               try {
-                       this.callback.call(this.testEnvironment);
-               } catch(e) {
-                       QUnit.pushFailure( "Died on test #" + (this.assertions.length + 1) + ": " + e.message, extractStacktrace( e, 1 ) );
-                       // else next test will carry the responsibility
-                       saveGlobal();
-
-                       // Restart the tests if they're blocking
-                       if ( config.blocking ) {
-                               QUnit.start();
-                       }
-               }
-       },
-       teardown: function() {
-               config.current = this;
-               if ( config.notrycatch ) {
-                       this.testEnvironment.teardown.call(this.testEnvironment);
-                       return;
-               } else {
-                       try {
-                               this.testEnvironment.teardown.call(this.testEnvironment);
-                       } catch(e) {
-                               QUnit.pushFailure( "Teardown failed on " + this.testName + ": " + e.message, extractStacktrace( e, 1 ) );
-                       }
-               }
-               checkPollution();
-       },
-       finish: function() {
-               config.current = this;
-               if ( this.expected != null && this.expected != this.assertions.length ) {
-                       QUnit.pushFailure( "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run" );
-               } else if ( this.expected == null && !this.assertions.length ) {
-                       QUnit.pushFailure( "Expected at least one assertion, but none were run - call expect(0) to accept zero assertions." );
-               }
-
-               var good = 0, bad = 0,
-                       li, i,
-                       tests = id("qunit-tests");
-
-               config.stats.all += this.assertions.length;
-               config.moduleStats.all += this.assertions.length;
-
-               if ( tests ) {
-                       var ol = document.createElement("ol");
-
-                       for ( i = 0; i < this.assertions.length; i++ ) {
-                               var assertion = this.assertions[i];
-
-                               li = document.createElement("li");
-                               li.className = assertion.result ? "pass" : "fail";
-                               li.innerHTML = assertion.message || (assertion.result ? "okay" : "failed");
-                               ol.appendChild( li );
-
-                               if ( assertion.result ) {
-                                       good++;
-                               } else {
-                                       bad++;
-                                       config.stats.bad++;
-                                       config.moduleStats.bad++;
-                               }
-                       }
-
-                       // store result when possible
-                       if ( QUnit.config.reorder && defined.sessionStorage ) {
-                               if (bad) {
-                                       sessionStorage.setItem("qunit-test-" + this.module + "-" + this.testName, bad);
-                               } else {
-                                       sessionStorage.removeItem("qunit-test-" + this.module + "-" + this.testName);
-                               }
-                       }
-
-                       if (bad === 0) {
-                               ol.style.display = "none";
-                       }
-
-                       var b = document.createElement("strong");
-                       b.innerHTML = this.name + " <b class='counts'>(<b class='failed'>" + bad + "</b>, <b class='passed'>" + good + "</b>, " + this.assertions.length + ")</b>";
-
-                       var a = document.createElement("a");
-                       a.innerHTML = "Rerun";
-                       a.href = QUnit.url({ filter: getText([b]).replace(/\([^)]+\)$/, "").replace(/(^\s*|\s*$)/g, "") });
-
-                       addEvent(b, "click", function() {
-                               var next = b.nextSibling.nextSibling,
-                                       display = next.style.display;
-                               next.style.display = display === "none" ? "block" : "none";
-                       });
-
-                       addEvent(b, "dblclick", function(e) {
-                               var target = e && e.target ? e.target : window.event.srcElement;
-                               if ( target.nodeName.toLowerCase() == "span" || target.nodeName.toLowerCase() == "b" ) {
-                                       target = target.parentNode;
-                               }
-                               if ( window.location && target.nodeName.toLowerCase() === "strong" ) {
-                                       window.location = QUnit.url({ filter: getText([target]).replace(/\([^)]+\)$/, "").replace(/(^\s*|\s*$)/g, "") });
-                               }
-                       });
-
-                       li = id(this.id);
-                       li.className = bad ? "fail" : "pass";
-                       li.removeChild( li.firstChild );
-                       li.appendChild( b );
-                       li.appendChild( a );
-                       li.appendChild( ol );
-
-               } else {
-                       for ( i = 0; i < this.assertions.length; i++ ) {
-                               if ( !this.assertions[i].result ) {
-                                       bad++;
-                                       config.stats.bad++;
-                                       config.moduleStats.bad++;
-                               }
-                       }
-               }
-
-               QUnit.reset();
-
-               runLoggingCallbacks( 'testDone', QUnit, {
-                       name: this.testName,
-                       module: this.module,
-                       failed: bad,
-                       passed: this.assertions.length - bad,
-                       total: this.assertions.length
-               } );
-       },
-
-       queue: function() {
-               var test = this;
-               synchronize(function() {
-                       test.init();
-               });
-               function run() {
-                       // each of these can by async
-                       synchronize(function() {
-                               test.setup();
-                       });
-                       synchronize(function() {
-                               test.run();
-                       });
-                       synchronize(function() {
-                               test.teardown();
-                       });
-                       synchronize(function() {
-                               test.finish();
-                       });
-               }
-               // defer when previous test run passed, if storage is available
-               var bad = QUnit.config.reorder && defined.sessionStorage && +sessionStorage.getItem("qunit-test-" + this.module + "-" + this.testName);
-               if (bad) {
-                       run();
-               } else {
-                       synchronize(run, true);
-               }
-       }
-
-};
-
-var QUnit = {
-
-       // call on start of module test to prepend name to all tests
-       module: function(name, testEnvironment) {
-               config.currentModule = name;
-               config.currentModuleTestEnviroment = testEnvironment;
-       },
-
-       asyncTest: function(testName, expected, callback) {
-               if ( arguments.length === 2 ) {
-                       callback = expected;
-                       expected = null;
-               }
-
-               QUnit.test(testName, expected, callback, true);
-       },
-
-       test: function(testName, expected, callback, async) {
-               var name = '<span class="test-name">' + escapeInnerText(testName) + '</span>';
-
-               if ( arguments.length === 2 ) {
-                       callback = expected;
-                       expected = null;
-               }
-
-               if ( config.currentModule ) {
-                       name = '<span class="module-name">' + config.currentModule + "</span>: " + name;
-               }
-
-               if ( !validTest(config.currentModule + ": " + testName) ) {
-                       return;
-               }
-
-               var test = new Test(name, testName, expected, async, callback);
-               test.module = config.currentModule;
-               test.moduleTestEnvironment = config.currentModuleTestEnviroment;
-               test.queue();
-       },
-
-       // Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through.
-       expect: function(asserts) {
-               config.current.expected = asserts;
-       },
-
-       // Asserts true.
-       // @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" );
-       ok: function(result, msg) {
-               if (!config.current) {
-                       throw new Error("ok() assertion outside test context, was " + sourceFromStacktrace(2));
-               }
-               result = !!result;
-               var details = {
-                       result: result,
-                       message: msg
-               };
-               msg = escapeInnerText(msg || (result ? "okay" : "failed"));
-               if ( !result ) {
-                       var source = sourceFromStacktrace(2);
-                       if (source) {
-                               details.source = source;
-                               msg += '<table><tr class="test-source"><th>Source: </th><td><pre>' + escapeInnerText(source) + '</pre></td></tr></table>';
-                       }
-               }
-               runLoggingCallbacks( 'log', QUnit, details );
-               config.current.assertions.push({
-                       result: result,
-                       message: msg
-               });
-       },
-
-       // Checks that the first two arguments are equal, with an optional message. Prints out both actual and expected values.
-       // @example equal( format("Received {0} bytes.", 2), "Received 2 bytes." );
-       equal: function(actual, expected, message) {
-               QUnit.push(expected == actual, actual, expected, message);
-       },
-
-       notEqual: function(actual, expected, message) {
-               QUnit.push(expected != actual, actual, expected, message);
-       },
-
-       deepEqual: function(actual, expected, message) {
-               QUnit.push(QUnit.equiv(actual, expected), actual, expected, message);
-       },
-
-       notDeepEqual: function(actual, expected, message) {
-               QUnit.push(!QUnit.equiv(actual, expected), actual, expected, message);
-       },
-
-       strictEqual: function(actual, expected, message) {
-               QUnit.push(expected === actual, actual, expected, message);
-       },
-
-       notStrictEqual: function(actual, expected, message) {
-               QUnit.push(expected !== actual, actual, expected, message);
-       },
-
-       raises: function(block, expected, message) {
-               var actual, ok = false;
-
-               if (typeof expected === 'string') {
-                       message = expected;
-                       expected = null;
-               }
-
-               try {
-                       block();
-               } catch (e) {
-                       actual = e;
-               }
-
-               if (actual) {
-                       // we don't want to validate thrown error
-                       if (!expected) {
-                               ok = true;
-                       // expected is a regexp
-                       } else if (QUnit.objectType(expected) === "regexp") {
-                               ok = expected.test(actual);
-                       // expected is a constructor
-                       } else if (actual instanceof expected) {
-                               ok = true;
-                       // expected is a validation function which returns true is validation passed
-                       } else if (expected.call({}, actual) === true) {
-                               ok = true;
-                       }
-               }
-
-               QUnit.ok(ok, message);
-       },
-
-       start: function(count) {
-               config.semaphore -= count || 1;
-               if (config.semaphore > 0) {
-                       // don't start until equal number of stop-calls
-                       return;
-               }
-               if (config.semaphore < 0) {
-                       // ignore if start is called more often then stop
-                       config.semaphore = 0;
-               }
-               // A slight delay, to avoid any current callbacks
-               if ( defined.setTimeout ) {
-                       window.setTimeout(function() {
-                               if (config.semaphore > 0) {
-                                       return;
-                               }
-                               if ( config.timeout ) {
-                                       clearTimeout(config.timeout);
-                               }
-
-                               config.blocking = false;
-                               process(true);
-                       }, 13);
-               } else {
-                       config.blocking = false;
-                       process(true);
-               }
-       },
-
-       stop: function(count) {
-               config.semaphore += count || 1;
-               config.blocking = true;
-
-               if ( config.testTimeout && defined.setTimeout ) {
-                       clearTimeout(config.timeout);
-                       config.timeout = window.setTimeout(function() {
-                               QUnit.ok( false, "Test timed out" );
-                               config.semaphore = 1;
-                               QUnit.start();
-                       }, config.testTimeout);
-               }
-       }
-};
-
-//We want access to the constructor's prototype
-(function() {
-       function F(){}
-       F.prototype = QUnit;
-       QUnit = new F();
-       //Make F QUnit's constructor so that we can add to the prototype later
-       QUnit.constructor = F;
-}());
-
-// deprecated; still export them to window to provide clear error messages
-// next step: remove entirely
-QUnit.equals = function() {
-       QUnit.push(false, false, false, "QUnit.equals has been deprecated since 2009 (e88049a0), use QUnit.equal instead");
-};
-QUnit.same = function() {
-       QUnit.push(false, false, false, "QUnit.same has been deprecated since 2009 (e88049a0), use QUnit.deepEqual instead");
-};
-
-// Maintain internal state
-var config = {
-       // The queue of tests to run
-       queue: [],
-
-       // block until document ready
-       blocking: true,
-
-       // when enabled, show only failing tests
-       // gets persisted through sessionStorage and can be changed in UI via checkbox
-       hidepassed: false,
-
-       // by default, run previously failed tests first
-       // very useful in combination with "Hide passed tests" checked
-       reorder: true,
-
-       // by default, modify document.title when suite is done
-       altertitle: true,
-
-       urlConfig: ['noglobals', 'notrycatch'],
-
-       //logging callback queues
-       begin: [],
-       done: [],
-       log: [],
-       testStart: [],
-       testDone: [],
-       moduleStart: [],
-       moduleDone: []
-};
-
-// Load paramaters
-(function() {
-       var location = window.location || { search: "", protocol: "file:" },
-               params = location.search.slice( 1 ).split( "&" ),
-               length = params.length,
-               urlParams = {},
-               current;
-
-       if ( params[ 0 ] ) {
-               for ( var i = 0; i < length; i++ ) {
-                       current = params[ i ].split( "=" );
-                       current[ 0 ] = decodeURIComponent( current[ 0 ] );
-                       // allow just a key to turn on a flag, e.g., test.html?noglobals
-                       current[ 1 ] = current[ 1 ] ? decodeURIComponent( current[ 1 ] ) : true;
-                       urlParams[ current[ 0 ] ] = current[ 1 ];
-               }
-       }
-
-       QUnit.urlParams = urlParams;
-       config.filter = urlParams.filter;
-
-       // Figure out if we're running the tests from a server or not
-       QUnit.isLocal = location.protocol === 'file:';
-}());
-
-// Expose the API as global variables, unless an 'exports'
-// object exists, in that case we assume we're in CommonJS - export everything at the end
-if ( typeof exports === "undefined" || typeof require === "undefined" ) {
-       extend(window, QUnit);
-       window.QUnit = QUnit;
-}
-
-// define these after exposing globals to keep them in these QUnit namespace only
-extend(QUnit, {
-       config: config,
-
-       // Initialize the configuration options
-       init: function() {
-               extend(config, {
-                       stats: { all: 0, bad: 0 },
-                       moduleStats: { all: 0, bad: 0 },
-                       started: +new Date(),
-                       updateRate: 1000,
-                       blocking: false,
-                       autostart: true,
-                       autorun: false,
-                       filter: "",
-                       queue: [],
-                       semaphore: 0
-               });
-
-               var qunit = id( "qunit" );
-               if ( qunit ) {
-                       qunit.innerHTML =
-                               '<h1 id="qunit-header">' + escapeInnerText( document.title ) + '</h1>' +
-                               '<h2 id="qunit-banner"></h2>' +
-                               '<div id="qunit-testrunner-toolbar"></div>' +
-                               '<h2 id="qunit-userAgent"></h2>' +
-                               '<ol id="qunit-tests"></ol>';
-               }
-
-               var tests = id( "qunit-tests" ),
-                       banner = id( "qunit-banner" ),
-                       result = id( "qunit-testresult" );
-
-               if ( tests ) {
-                       tests.innerHTML = "";
-               }
-
-               if ( banner ) {
-                       banner.className = "";
-               }
-
-               if ( result ) {
-                       result.parentNode.removeChild( result );
-               }
-
-               if ( tests ) {
-                       result = document.createElement( "p" );
-                       result.id = "qunit-testresult";
-                       result.className = "result";
-                       tests.parentNode.insertBefore( result, tests );
-                       result.innerHTML = 'Running...<br/>&nbsp;';
-               }
-       },
-
-       // Resets the test setup. Useful for tests that modify the DOM.
-       // If jQuery is available, uses jQuery's html(), otherwise just innerHTML.
-       reset: function() {
-               if ( window.jQuery ) {
-                       jQuery( "#qunit-fixture" ).html( config.fixture );
-               } else {
-                       var main = id( 'qunit-fixture' );
-                       if ( main ) {
-                               main.innerHTML = config.fixture;
-                       }
-               }
-       },
-
-       // Trigger an event on an element.
-       // @example triggerEvent( document.body, "click" );
-       triggerEvent: function( elem, type, event ) {
-               if ( document.createEvent ) {
-                       event = document.createEvent("MouseEvents");
-                       event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView,
-                               0, 0, 0, 0, 0, false, false, false, false, 0, null);
-                       elem.dispatchEvent( event );
-
-               } else if ( elem.fireEvent ) {
-                       elem.fireEvent("on"+type);
-               }
-       },
-
-       // Safe object type checking
-       is: function( type, obj ) {
-               return QUnit.objectType( obj ) == type;
-       },
-
-       objectType: function( obj ) {
-               if (typeof obj === "undefined") {
-                               return "undefined";
-
-               // consider: typeof null === object
-               }
-               if (obj === null) {
-                               return "null";
-               }
-
-               var type = toString.call( obj ).match(/^\[object\s(.*)\]$/)[1] || '';
-
-               switch (type) {
-                       case 'Number':
-                               if (isNaN(obj)) {
-                                       return "nan";
-                               }
-                               return "number";
-                       case 'String':
-                       case 'Boolean':
-                       case 'Array':
-                       case 'Date':
-                       case 'RegExp':
-                       case 'Function':
-                                       return type.toLowerCase();
-               }
-               if (typeof obj === "object") {
-                               return "object";
-               }
-               return undefined;
-       },
-
-       push: function(result, actual, expected, message) {
-               if (!config.current) {
-                       throw new Error("assertion outside test context, was " + sourceFromStacktrace());
-               }
-               var details = {
-                       result: result,
-                       message: message,
-                       actual: actual,
-                       expected: expected
-               };
-
-               message = escapeInnerText(message) || (result ? "okay" : "failed");
-               message = '<span class="test-message">' + message + "</span>";
-               var output = message;
-               if (!result) {
-                       expected = escapeInnerText(QUnit.jsDump.parse(expected));
-                       actual = escapeInnerText(QUnit.jsDump.parse(actual));
-                       output += '<table><tr class="test-expected"><th>Expected: </th><td><pre>' + expected + '</pre></td></tr>';
-                       if (actual != expected) {
-                               output += '<tr class="test-actual"><th>Result: </th><td><pre>' + actual + '</pre></td></tr>';
-                               output += '<tr class="test-diff"><th>Diff: </th><td><pre>' + QUnit.diff(expected, actual) +'</pre></td></tr>';
-                       }
-                       var source = sourceFromStacktrace();
-                       if (source) {
-                               details.source = source;
-                               output += '<tr class="test-source"><th>Source: </th><td><pre>' + escapeInnerText(source) + '</pre></td></tr>';
-                       }
-                       output += "</table>";
-               }
-
-               runLoggingCallbacks( 'log', QUnit, details );
-
-               config.current.assertions.push({
-                       result: !!result,
-                       message: output
-               });
-       },
-
-       pushFailure: function(message, source) {
-               var details = {
-                       result: false,
-                       message: message
-               };
-               var output = escapeInnerText(message);
-               if (source) {
-                       details.source = source;
-                       output += '<table><tr class="test-source"><th>Source: </th><td><pre>' + escapeInnerText(source) + '</pre></td></tr></table>';
-               }
-               runLoggingCallbacks( 'log', QUnit, details );
-               config.current.assertions.push({
-                       result: false,
-                       message: output
-               });
-       },
-
-       url: function( params ) {
-               params = extend( extend( {}, QUnit.urlParams ), params );
-               var querystring = "?",
-                       key;
-               for ( key in params ) {
-                       if ( !hasOwn.call( params, key ) ) {
-                               continue;
-                       }
-                       querystring += encodeURIComponent( key ) + "=" +
-                               encodeURIComponent( params[ key ] ) + "&";
-               }
-               return window.location.pathname + querystring.slice( 0, -1 );
-       },
-
-       extend: extend,
-       id: id,
-       addEvent: addEvent
-});
-
-//QUnit.constructor is set to the empty F() above so that we can add to it's prototype later
-//Doing this allows us to tell if the following methods have been overwritten on the actual
-//QUnit object, which is a deprecated way of using the callbacks.
-extend(QUnit.constructor.prototype, {
-       // Logging callbacks; all receive a single argument with the listed properties
-       // run test/logs.html for any related changes
-       begin: registerLoggingCallback('begin'),
-       // done: { failed, passed, total, runtime }
-       done: registerLoggingCallback('done'),
-       // log: { result, actual, expected, message }
-       log: registerLoggingCallback('log'),
-       // testStart: { name }
-       testStart: registerLoggingCallback('testStart'),
-       // testDone: { name, failed, passed, total }
-       testDone: registerLoggingCallback('testDone'),
-       // moduleStart: { name }
-       moduleStart: registerLoggingCallback('moduleStart'),
-       // moduleDone: { name, failed, passed, total }
-       moduleDone: registerLoggingCallback('moduleDone')
-});
-
-if ( typeof document === "undefined" || document.readyState === "complete" ) {
-       config.autorun = true;
-}
-
-QUnit.load = function() {
-       runLoggingCallbacks( 'begin', QUnit, {} );
-
-       // Initialize the config, saving the execution queue
-       var oldconfig = extend({}, config);
-       QUnit.init();
-       extend(config, oldconfig);
-
-       config.blocking = false;
-
-       var urlConfigHtml = '', len = config.urlConfig.length;
-       for ( var i = 0, val; i < len; i++ ) {
-               val = config.urlConfig[i];
-               config[val] = QUnit.urlParams[val];
-               urlConfigHtml += '<label><input name="' + val + '" type="checkbox"' + ( config[val] ? ' checked="checked"' : '' ) + '>' + val + '</label>';
-       }
-
-       var userAgent = id("qunit-userAgent");
-       if ( userAgent ) {
-               userAgent.innerHTML = navigator.userAgent;
-       }
-       var banner = id("qunit-header");
-       if ( banner ) {
-               banner.innerHTML = '<a href="' + QUnit.url({ filter: undefined }) + '"> ' + banner.innerHTML + '</a> ' + urlConfigHtml;
-               addEvent( banner, "change", function( event ) {
-                       var params = {};
-                       params[ event.target.name ] = event.target.checked ? true : undefined;
-                       window.location = QUnit.url( params );
-               });
-       }
-
-       var toolbar = id("qunit-testrunner-toolbar");
-       if ( toolbar ) {
-               var filter = document.createElement("input");
-               filter.type = "checkbox";
-               filter.id = "qunit-filter-pass";
-               addEvent( filter, "click", function() {
-                       var ol = document.getElementById("qunit-tests");
-                       if ( filter.checked ) {
-                               ol.className = ol.className + " hidepass";
-                       } else {
-                               var tmp = " " + ol.className.replace( /[\n\t\r]/g, " " ) + " ";
-                               ol.className = tmp.replace(/ hidepass /, " ");
-                       }
-                       if ( defined.sessionStorage ) {
-                               if (filter.checked) {
-                                       sessionStorage.setItem("qunit-filter-passed-tests", "true");
-                               } else {
-                                       sessionStorage.removeItem("qunit-filter-passed-tests");
-                               }
-                       }
-               });
-               if ( config.hidepassed || defined.sessionStorage && sessionStorage.getItem("qunit-filter-passed-tests") ) {
-                       filter.checked = true;
-                       var ol = document.getElementById("qunit-tests");
-                       ol.className = ol.className + " hidepass";
-               }
-               toolbar.appendChild( filter );
-
-               var label = document.createElement("label");
-               label.setAttribute("for", "qunit-filter-pass");
-               label.innerHTML = "Hide passed tests";
-               toolbar.appendChild( label );
-       }
-
-       var main = id('qunit-fixture');
-       if ( main ) {
-               config.fixture = main.innerHTML;
-       }
-
-       if (config.autostart) {
-               QUnit.start();
-       }
-};
-
-addEvent(window, "load", QUnit.load);
-
-// addEvent(window, "error") gives us a useless event object
-window.onerror = function( message, file, line ) {
-       if ( QUnit.config.current ) {
-               QUnit.pushFailure( message, file + ":" + line );
-       } else {
-               QUnit.test( "global failure", function() {
-                       QUnit.pushFailure( message, file + ":" + line );
-               });
-       }
-};
-
-function done() {
-       config.autorun = true;
-
-       // Log the last module results
-       if ( config.currentModule ) {
-               runLoggingCallbacks( 'moduleDone', QUnit, {
-                       name: config.currentModule,
-                       failed: config.moduleStats.bad,
-                       passed: config.moduleStats.all - config.moduleStats.bad,
-                       total: config.moduleStats.all
-               } );
-       }
-
-       var banner = id("qunit-banner"),
-               tests = id("qunit-tests"),
-               runtime = +new Date() - config.started,
-               passed = config.stats.all - config.stats.bad,
-               html = [
-                       'Tests completed in ',
-                       runtime,
-                       ' milliseconds.<br/>',
-                       '<span class="passed">',
-                       passed,
-                       '</span> tests of <span class="total">',
-                       config.stats.all,
-                       '</span> passed, <span class="failed">',
-                       config.stats.bad,
-                       '</span> failed.'
-               ].join('');
-
-       if ( banner ) {
-               banner.className = (config.stats.bad ? "qunit-fail" : "qunit-pass");
-       }
-
-       if ( tests ) {
-               id( "qunit-testresult" ).innerHTML = html;
-       }
-
-       if ( config.altertitle && typeof document !== "undefined" && document.title ) {
-               // show âœ– for good, âœ” for bad suite result in title
-               // use escape sequences in case file gets loaded with non-utf-8-charset
-               document.title = [
-                       (config.stats.bad ? "\u2716" : "\u2714"),
-                       document.title.replace(/^[\u2714\u2716] /i, "")
-               ].join(" ");
-       }
-
-       // clear own sessionStorage items if all tests passed
-       if ( config.reorder && defined.sessionStorage && config.stats.bad === 0 ) {
-               for (var key in sessionStorage) {
-                       if (sessionStorage.hasOwnProperty(key) && key.indexOf("qunit-test-") === 0 ) {
-                               sessionStorage.removeItem(key);
-                       }
-               }
-       }
-
-       runLoggingCallbacks( 'done', QUnit, {
-               failed: config.stats.bad,
-               passed: passed,
-               total: config.stats.all,
-               runtime: runtime
-       } );
-}
-
-function validTest( name ) {
-       var filter = config.filter,
-               run = false;
-
-       if ( !filter ) {
-               return true;
-       }
-
-       var not = filter.charAt( 0 ) === "!";
-       if ( not ) {
-               filter = filter.slice( 1 );
-       }
-
-       if ( name.indexOf( filter ) !== -1 ) {
-               return !not;
-       }
-
-       if ( not ) {
-               run = true;
-       }
-
-       return run;
-}
-
-// so far supports only Firefox, Chrome and Opera (buggy)
-// could be extended in the future to use something like https://github.com/csnover/TraceKit
-function extractStacktrace( e, offset ) {
-       offset = offset || 3;
-       if (e.stacktrace) {
-               // Opera
-               return e.stacktrace.split("\n")[offset + 3];
-       } else if (e.stack) {
-               // Firefox, Chrome
-               var stack = e.stack.split("\n");
-               if (/^error$/i.test(stack[0])) {
-                       stack.shift();
-               }
-               return stack[offset];
-       } else if (e.sourceURL) {
-               // Safari, PhantomJS
-               // hopefully one day Safari provides actual stacktraces
-               // exclude useless self-reference for generated Error objects
-               if ( /qunit.js$/.test( e.sourceURL ) ) {
-                       return;
-               }
-               // for actual exceptions, this is useful
-               return e.sourceURL + ":" + e.line;
-       }
-}
-function sourceFromStacktrace(offset) {
-       try {
-               throw new Error();
-       } catch ( e ) {
-               return extractStacktrace( e, offset );
-       }
-}
-
-function escapeInnerText(s) {
-       if (!s) {
-               return "";
-       }
-       s = s + "";
-       return s.replace(/[\&<>]/g, function(s) {
-               switch(s) {
-                       case "&": return "&amp;";
-                       case "<": return "&lt;";
-                       case ">": return "&gt;";
-                       default: return s;
-               }
-       });
-}
-
-function synchronize( callback, last ) {
-       config.queue.push( callback );
-
-       if ( config.autorun && !config.blocking ) {
-               process(last);
-       }
-}
-
-function process( last ) {
-       function next() {
-               process( last );
-       }
-       var start = new Date().getTime();
-       config.depth = config.depth ? config.depth + 1 : 1;
-
-       while ( config.queue.length && !config.blocking ) {
-               if ( !defined.setTimeout || config.updateRate <= 0 || ( ( new Date().getTime() - start ) < config.updateRate ) ) {
-                       config.queue.shift()();
-               } else {
-                       window.setTimeout( next, 13 );
-                       break;
-               }
-       }
-       config.depth--;
-       if ( last && !config.blocking && !config.queue.length && config.depth === 0 ) {
-               done();
-       }
-}
-
-function saveGlobal() {
-       config.pollution = [];
-
-       if ( config.noglobals ) {
-               for ( var key in window ) {
-                       if ( !hasOwn.call( window, key ) ) {
-                               continue;
-                       }
-                       config.pollution.push( key );
-               }
-       }
-}
-
-function checkPollution( name ) {
-       var old = config.pollution;
-       saveGlobal();
-
-       var newGlobals = diff( config.pollution, old );
-       if ( newGlobals.length > 0 ) {
-               QUnit.pushFailure( "Introduced global variable(s): " + newGlobals.join(", ") );
-       }
-
-       var deletedGlobals = diff( old, config.pollution );
-       if ( deletedGlobals.length > 0 ) {
-               QUnit.pushFailure( "Deleted global variable(s): " + deletedGlobals.join(", ") );
-       }
-}
-
-// returns a new Array with the elements that are in a but not in b
-function diff( a, b ) {
-       var result = a.slice();
-       for ( var i = 0; i < result.length; i++ ) {
-               for ( var j = 0; j < b.length; j++ ) {
-                       if ( result[i] === b[j] ) {
-                               result.splice(i, 1);
-                               i--;
-                               break;
-                       }
-               }
-       }
-       return result;
-}
-
-function extend(a, b) {
-       for ( var prop in b ) {
-               if ( b[prop] === undefined ) {
-                       delete a[prop];
-
-               // Avoid "Member not found" error in IE8 caused by setting window.constructor
-               } else if ( prop !== "constructor" || a !== window ) {
-                       a[prop] = b[prop];
-               }
-       }
-
-       return a;
-}
-
-function addEvent(elem, type, fn) {
-       if ( elem.addEventListener ) {
-               elem.addEventListener( type, fn, false );
-       } else if ( elem.attachEvent ) {
-               elem.attachEvent( "on" + type, fn );
-       } else {
-               fn();
-       }
-}
-
-function id(name) {
-       return !!(typeof document !== "undefined" && document && document.getElementById) &&
-               document.getElementById( name );
-}
-
-function registerLoggingCallback(key){
-       return function(callback){
-               config[key].push( callback );
-       };
-}
-
-// Supports deprecated method of completely overwriting logging callbacks
-function runLoggingCallbacks(key, scope, args) {
-       //debugger;
-       var callbacks;
-       if ( QUnit.hasOwnProperty(key) ) {
-               QUnit[key].call(scope, args);
-       } else {
-               callbacks = config[key];
-               for( var i = 0; i < callbacks.length; i++ ) {
-                       callbacks[i].call( scope, args );
-               }
-       }
-}
-
-// Test for equality any JavaScript type.
-// Author: Philippe Rathé <prathe@gmail.com>
-QUnit.equiv = (function() {
-
-       var innerEquiv; // the real equiv function
-       var callers = []; // stack to decide between skip/abort functions
-       var parents = []; // stack to avoiding loops from circular referencing
-
-       // Call the o related callback with the given arguments.
-       function bindCallbacks(o, callbacks, args) {
-               var prop = QUnit.objectType(o);
-               if (prop) {
-                       if (QUnit.objectType(callbacks[prop]) === "function") {
-                               return callbacks[prop].apply(callbacks, args);
-                       } else {
-                               return callbacks[prop]; // or undefined
-                       }
-               }
-       }
-
-       var getProto = Object.getPrototypeOf || function (obj) {
-               return obj.__proto__;
-       };
-
-       var callbacks = (function () {
-
-               // for string, boolean, number and null
-               function useStrictEquality(b, a) {
-                       if (b instanceof a.constructor || a instanceof b.constructor) {
-                               // to catch short annotaion VS 'new' annotation of a
-                               // declaration
-                               // e.g. var i = 1;
-                               // var j = new Number(1);
-                               return a == b;
-                       } else {
-                               return a === b;
-                       }
-               }
-
-               return {
-                       "string" : useStrictEquality,
-                       "boolean" : useStrictEquality,
-                       "number" : useStrictEquality,
-                       "null" : useStrictEquality,
-                       "undefined" : useStrictEquality,
-
-                       "nan" : function(b) {
-                               return isNaN(b);
-                       },
-
-                       "date" : function(b, a) {
-                               return QUnit.objectType(b) === "date" && a.valueOf() === b.valueOf();
-                       },
-
-                       "regexp" : function(b, a) {
-                               return QUnit.objectType(b) === "regexp" &&
-                                       // the regex itself
-                                       a.source === b.source &&
-                                       // and its modifers
-                                       a.global === b.global &&
-                                       // (gmi) ...
-                                       a.ignoreCase === b.ignoreCase &&
-                                       a.multiline === b.multiline;
-                       },
-
-                       // - skip when the property is a method of an instance (OOP)
-                       // - abort otherwise,
-                       // initial === would have catch identical references anyway
-                       "function" : function() {
-                               var caller = callers[callers.length - 1];
-                               return caller !== Object && typeof caller !== "undefined";
-                       },
-
-                       "array" : function(b, a) {
-                               var i, j, loop;
-                               var len;
-
-                               // b could be an object literal here
-                               if (QUnit.objectType(b) !== "array") {
-                                       return false;
-                               }
-
-                               len = a.length;
-                               if (len !== b.length) { // safe and faster
-                                       return false;
-                               }
-
-                               // track reference to avoid circular references
-                               parents.push(a);
-                               for (i = 0; i < len; i++) {
-                                       loop = false;
-                                       for (j = 0; j < parents.length; j++) {
-                                               if (parents[j] === a[i]) {
-                                                       loop = true;// dont rewalk array
-                                               }
-                                       }
-                                       if (!loop && !innerEquiv(a[i], b[i])) {
-                                               parents.pop();
-                                               return false;
-                                       }
-                               }
-                               parents.pop();
-                               return true;
-                       },
-
-                       "object" : function(b, a) {
-                               var i, j, loop;
-                               var eq = true; // unless we can proove it
-                               var aProperties = [], bProperties = []; // collection of
-                                                                                                               // strings
-
-                               // comparing constructors is more strict than using
-                               // instanceof
-                               if (a.constructor !== b.constructor) {
-                                       // Allow objects with no prototype to be equivalent to
-                                       // objects with Object as their constructor.
-                                       if (!((getProto(a) === null && getProto(b) === Object.prototype) ||
-                                               (getProto(b) === null && getProto(a) === Object.prototype)))
-                                       {
-                                               return false;
-                                       }
-                               }
-
-                               // stack constructor before traversing properties
-                               callers.push(a.constructor);
-                               // track reference to avoid circular references
-                               parents.push(a);
-
-                               for (i in a) { // be strict: don't ensures hasOwnProperty
-                                                               // and go deep
-                                       loop = false;
-                                       for (j = 0; j < parents.length; j++) {
-                                               if (parents[j] === a[i]) {
-                                                       // don't go down the same path twice
-                                                       loop = true;
-                                               }
-                                       }
-                                       aProperties.push(i); // collect a's properties
-
-                                       if (!loop && !innerEquiv(a[i], b[i])) {
-                                               eq = false;
-                                               break;
-                                       }
-                               }
-
-                               callers.pop(); // unstack, we are done
-                               parents.pop();
-
-                               for (i in b) {
-                                       bProperties.push(i); // collect b's properties
-                               }
-
-                               // Ensures identical properties name
-                               return eq && innerEquiv(aProperties.sort(), bProperties.sort());
-                       }
-               };
-       }());
-
-       innerEquiv = function() { // can take multiple arguments
-               var args = Array.prototype.slice.apply(arguments);
-               if (args.length < 2) {
-                       return true; // end transition
-               }
-
-               return (function(a, b) {
-                       if (a === b) {
-                               return true; // catch the most you can
-                       } else if (a === null || b === null || typeof a === "undefined" ||
-                                       typeof b === "undefined" ||
-                                       QUnit.objectType(a) !== QUnit.objectType(b)) {
-                               return false; // don't lose time with error prone cases
-                       } else {
-                               return bindCallbacks(a, callbacks, [ b, a ]);
-                       }
-
-                       // apply transition with (1..n) arguments
-               }(args[0], args[1]) && arguments.callee.apply(this, args.splice(1, args.length - 1)));
-       };
-
-       return innerEquiv;
-
-}());
-
-/**
- * jsDump Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com |
- * http://flesler.blogspot.com Licensed under BSD
- * (http://www.opensource.org/licenses/bsd-license.php) Date: 5/15/2008
- *
- * @projectDescription Advanced and extensible data dumping for Javascript.
- * @version 1.0.0
- * @author Ariel Flesler
- * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html}
- */
-QUnit.jsDump = (function() {
-       function quote( str ) {
-               return '"' + str.toString().replace(/"/g, '\\"') + '"';
-       }
-       function literal( o ) {
-               return o + '';
-       }
-       function join( pre, arr, post ) {
-               var s = jsDump.separator(),
-                       base = jsDump.indent(),
-                       inner = jsDump.indent(1);
-               if ( arr.join ) {
-                       arr = arr.join( ',' + s + inner );
-               }
-               if ( !arr ) {
-                       return pre + post;
-               }
-               return [ pre, inner + arr, base + post ].join(s);
-       }
-       function array( arr, stack ) {
-               var i = arr.length, ret = new Array(i);
-               this.up();
-               while ( i-- ) {
-                       ret[i] = this.parse( arr[i] , undefined , stack);
-               }
-               this.down();
-               return join( '[', ret, ']' );
-       }
-
-       var reName = /^function (\w+)/;
-
-       var jsDump = {
-               parse: function( obj, type, stack ) { //type is used mostly internally, you can fix a (custom)type in advance
-                       stack = stack || [ ];
-                       var parser = this.parsers[ type || this.typeOf(obj) ];
-                       type = typeof parser;
-                       var inStack = inArray(obj, stack);
-                       if (inStack != -1) {
-                               return 'recursion('+(inStack - stack.length)+')';
-                       }
-                       //else
-                       if (type == 'function')  {
-                                       stack.push(obj);
-                                       var res = parser.call( this, obj, stack );
-                                       stack.pop();
-                                       return res;
-                       }
-                       // else
-                       return (type == 'string') ? parser : this.parsers.error;
-               },
-               typeOf: function( obj ) {
-                       var type;
-                       if ( obj === null ) {
-                               type = "null";
-                       } else if (typeof obj === "undefined") {
-                               type = "undefined";
-                       } else if (QUnit.is("RegExp", obj)) {
-                               type = "regexp";
-                       } else if (QUnit.is("Date", obj)) {
-                               type = "date";
-                       } else if (QUnit.is("Function", obj)) {
-                               type = "function";
-                       } else if (typeof obj.setInterval !== undefined && typeof obj.document !== "undefined" && typeof obj.nodeType === "undefined") {
-                               type = "window";
-                       } else if (obj.nodeType === 9) {
-                               type = "document";
-                       } else if (obj.nodeType) {
-                               type = "node";
-                       } else if (
-                               // native arrays
-                               toString.call( obj ) === "[object Array]" ||
-                               // NodeList objects
-                               ( typeof obj.length === "number" && typeof obj.item !== "undefined" && ( obj.length ? obj.item(0) === obj[0] : ( obj.item( 0 ) === null && typeof obj[0] === "undefined" ) ) )
-                       ) {
-                               type = "array";
-                       } else {
-                               type = typeof obj;
-                       }
-                       return type;
-               },
-               separator: function() {
-                       return this.multiline ? this.HTML ? '<br />' : '\n' : this.HTML ? '&nbsp;' : ' ';
-               },
-               indent: function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing
-                       if ( !this.multiline ) {
-                               return '';
-                       }
-                       var chr = this.indentChar;
-                       if ( this.HTML ) {
-                               chr = chr.replace(/\t/g,'   ').replace(/ /g,'&nbsp;');
-                       }
-                       return new Array( this._depth_ + (extra||0) ).join(chr);
-               },
-               up: function( a ) {
-                       this._depth_ += a || 1;
-               },
-               down: function( a ) {
-                       this._depth_ -= a || 1;
-               },
-               setParser: function( name, parser ) {
-                       this.parsers[name] = parser;
-               },
-               // The next 3 are exposed so you can use them
-               quote: quote,
-               literal: literal,
-               join: join,
-               //
-               _depth_: 1,
-               // This is the list of parsers, to modify them, use jsDump.setParser
-               parsers: {
-                       window: '[Window]',
-                       document: '[Document]',
-                       error: '[ERROR]', //when no parser is found, shouldn't happen
-                       unknown: '[Unknown]',
-                       'null': 'null',
-                       'undefined': 'undefined',
-                       'function': function( fn ) {
-                               var ret = 'function',
-                                       name = 'name' in fn ? fn.name : (reName.exec(fn)||[])[1];//functions never have name in IE
-                               if ( name ) {
-                                       ret += ' ' + name;
-                               }
-                               ret += '(';
-
-                               ret = [ ret, QUnit.jsDump.parse( fn, 'functionArgs' ), '){'].join('');
-                               return join( ret, QUnit.jsDump.parse(fn,'functionCode'), '}' );
-                       },
-                       array: array,
-                       nodelist: array,
-                       'arguments': array,
-                       object: function( map, stack ) {
-                               var ret = [ ], keys, key, val, i;
-                               QUnit.jsDump.up();
-                               if (Object.keys) {
-                                       keys = Object.keys( map );
-                               } else {
-                                       keys = [];
-                                       for (key in map) { keys.push( key ); }
-                               }
-                               keys.sort();
-                               for (i = 0; i < keys.length; i++) {
-                                       key = keys[ i ];
-                                       val = map[ key ];
-                                       ret.push( QUnit.jsDump.parse( key, 'key' ) + ': ' + QUnit.jsDump.parse( val, undefined, stack ) );
-                               }
-                               QUnit.jsDump.down();
-                               return join( '{', ret, '}' );
-                       },
-                       node: function( node ) {
-                               var open = QUnit.jsDump.HTML ? '&lt;' : '<',
-                                       close = QUnit.jsDump.HTML ? '&gt;' : '>';
-
-                               var tag = node.nodeName.toLowerCase(),
-                                       ret = open + tag;
-
-                               for ( var a in QUnit.jsDump.DOMAttrs ) {
-                                       var val = node[QUnit.jsDump.DOMAttrs[a]];
-                                       if ( val ) {
-                                               ret += ' ' + a + '=' + QUnit.jsDump.parse( val, 'attribute' );
-                                       }
-                               }
-                               return ret + close + open + '/' + tag + close;
-                       },
-                       functionArgs: function( fn ) {//function calls it internally, it's the arguments part of the function
-                               var l = fn.length;
-                               if ( !l ) {
-                                       return '';
-                               }
-
-                               var args = new Array(l);
-                               while ( l-- ) {
-                                       args[l] = String.fromCharCode(97+l);//97 is 'a'
-                               }
-                               return ' ' + args.join(', ') + ' ';
-                       },
-                       key: quote, //object calls it internally, the key part of an item in a map
-                       functionCode: '[code]', //function calls it internally, it's the content of the function
-                       attribute: quote, //node calls it internally, it's an html attribute value
-                       string: quote,
-                       date: quote,
-                       regexp: literal, //regex
-                       number: literal,
-                       'boolean': literal
-               },
-               DOMAttrs:{//attributes to dump from nodes, name=>realName
-                       id:'id',
-                       name:'name',
-                       'class':'className'
-               },
-               HTML:false,//if true, entities are escaped ( <, >, \t, space and \n )
-               indentChar:'  ',//indentation unit
-               multiline:true //if true, items in a collection, are separated by a \n, else just a space.
-       };
-
-       return jsDump;
-}());
-
-// from Sizzle.js
-function getText( elems ) {
-       var ret = "", elem;
-
-       for ( var i = 0; elems[i]; i++ ) {
-               elem = elems[i];
-
-               // Get the text from text nodes and CDATA nodes
-               if ( elem.nodeType === 3 || elem.nodeType === 4 ) {
-                       ret += elem.nodeValue;
-
-               // Traverse everything else, except comment nodes
-               } else if ( elem.nodeType !== 8 ) {
-                       ret += getText( elem.childNodes );
-               }
-       }
-
-       return ret;
-}
-
-//from jquery.js
-function inArray( elem, array ) {
-       if ( array.indexOf ) {
-               return array.indexOf( elem );
-       }
-
-       for ( var i = 0, length = array.length; i < length; i++ ) {
-               if ( array[ i ] === elem ) {
-                       return i;
-               }
-       }
-
-       return -1;
-}
-
-/*
- * Javascript Diff Algorithm
- *  By John Resig (http://ejohn.org/)
- *  Modified by Chu Alan "sprite"
- *
- * Released under the MIT license.
- *
- * More Info:
- *  http://ejohn.org/projects/javascript-diff-algorithm/
- *
- * Usage: QUnit.diff(expected, actual)
- *
- * QUnit.diff("the quick brown fox jumped over", "the quick fox jumps over") == "the  quick <del>brown </del> fox <del>jumped </del><ins>jumps </ins> over"
- */
-QUnit.diff = (function() {
-       function diff(o, n) {
-               var ns = {};
-               var os = {};
-               var i;
-
-               for (i = 0; i < n.length; i++) {
-                       if (ns[n[i]] == null) {
-                               ns[n[i]] = {
-                                       rows: [],
-                                       o: null
-                               };
-                       }
-                       ns[n[i]].rows.push(i);
-               }
-
-               for (i = 0; i < o.length; i++) {
-                       if (os[o[i]] == null) {
-                               os[o[i]] = {
-                                       rows: [],
-                                       n: null
-                               };
-                       }
-                       os[o[i]].rows.push(i);
-               }
-
-               for (i in ns) {
-                       if ( !hasOwn.call( ns, i ) ) {
-                               continue;
-                       }
-                       if (ns[i].rows.length == 1 && typeof(os[i]) != "undefined" && os[i].rows.length == 1) {
-                               n[ns[i].rows[0]] = {
-                                       text: n[ns[i].rows[0]],
-                                       row: os[i].rows[0]
-                               };
-                               o[os[i].rows[0]] = {
-                                       text: o[os[i].rows[0]],
-                                       row: ns[i].rows[0]
-                               };
-                       }
-               }
-
-               for (i = 0; i < n.length - 1; i++) {
-                       if (n[i].text != null && n[i + 1].text == null && n[i].row + 1 < o.length && o[n[i].row + 1].text == null &&
-                       n[i + 1] == o[n[i].row + 1]) {
-                               n[i + 1] = {
-                                       text: n[i + 1],
-                                       row: n[i].row + 1
-                               };
-                               o[n[i].row + 1] = {
-                                       text: o[n[i].row + 1],
-                                       row: i + 1
-                               };
-                       }
-               }
-
-               for (i = n.length - 1; i > 0; i--) {
-                       if (n[i].text != null && n[i - 1].text == null && n[i].row > 0 && o[n[i].row - 1].text == null &&
-                       n[i - 1] == o[n[i].row - 1]) {
-                               n[i - 1] = {
-                                       text: n[i - 1],
-                                       row: n[i].row - 1
-                               };
-                               o[n[i].row - 1] = {
-                                       text: o[n[i].row - 1],
-                                       row: i - 1
-                               };
-                       }
-               }
-
-               return {
-                       o: o,
-                       n: n
-               };
-       }
-
-       return function(o, n) {
-               o = o.replace(/\s+$/, '');
-               n = n.replace(/\s+$/, '');
-               var out = diff(o === "" ? [] : o.split(/\s+/), n === "" ? [] : n.split(/\s+/));
-
-               var str = "";
-               var i;
-
-               var oSpace = o.match(/\s+/g);
-               if (oSpace == null) {
-                       oSpace = [" "];
-               }
-               else {
-                       oSpace.push(" ");
-               }
-               var nSpace = n.match(/\s+/g);
-               if (nSpace == null) {
-                       nSpace = [" "];
-               }
-               else {
-                       nSpace.push(" ");
-               }
-
-               if (out.n.length === 0) {
-                       for (i = 0; i < out.o.length; i++) {
-                               str += '<del>' + out.o[i] + oSpace[i] + "</del>";
-                       }
-               }
-               else {
-                       if (out.n[0].text == null) {
-                               for (n = 0; n < out.o.length && out.o[n].text == null; n++) {
-                                       str += '<del>' + out.o[n] + oSpace[n] + "</del>";
-                               }
-                       }
-
-                       for (i = 0; i < out.n.length; i++) {
-                               if (out.n[i].text == null) {
-                                       str += '<ins>' + out.n[i] + nSpace[i] + "</ins>";
-                               }
-                               else {
-                                       var pre = "";
-
-                                       for (n = out.n[i].row + 1; n < out.o.length && out.o[n].text == null; n++) {
-                                               pre += '<del>' + out.o[n] + oSpace[n] + "</del>";
-                                       }
-                                       str += " " + out.n[i].text + nSpace[i] + pre;
-                               }
-                       }
-               }
-
-               return str;
-       };
-}());
-
-// for CommonJS enviroments, export everything
-if ( typeof exports !== "undefined" || typeof require !== "undefined" ) {
-       extend(exports, QUnit);
-}
-
-// get at whatever the global object is, like window in browsers
-}( (function() {return this;}.call()) ));
diff --git a/libs/js/jquery-geo-1.0b2/package.json b/libs/js/jquery-geo-1.0b2/package.json
deleted file mode 100755 (executable)
index 9e31797..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-{
-  "name": "jquery.geo",
-  "title": "jQuery Geo",
-  "description": "An interactive mapping and spatial analysis plugin.",
-  "version": "test",
-  "homepage": "http://jquerygeo.com",
-  "author": {
-    "name": "Ryan Westphal",
-    "company": "Applied Geographics, Inc.",
-    "email": "ryan@trippingthebits.com",
-    "url": "http://trippingthebits.com"
-  },
-  "repository": {
-    "type": "git",
-    "url": "git://github.com/AppGeo/geo.git"
-  },
-  "bugs": {
-    "url": "https://github.com/AppGeo/geo/issues"
-  },
-  "licenses": [
-    {
-      "type": "MIT",
-      "url": "http://jquerygeo.com/blob/master/LICENSE-MIT"
-    },
-    {
-      "type": "GPL",
-      "url": "http://jquerygeo.com/blob/master/LICENSE-GPL"
-    }
-  ],
-  "dependencies": {
-    "jquery": "~1.7"
-  },
-  "keywords": []
-}
diff --git a/libs/js/jquery-geo-1.0b2/test/jquery.geo.html b/libs/js/jquery-geo-1.0b2/test/jquery.geo.html
deleted file mode 100755 (executable)
index 8c2dc18..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>jQuery Geo Test Suite</title>
-  <!-- Load local jQuery, removing access to $ (use jQuery, not $). -->
-  <script src="../libs/jquery/jquery.js"></script>
-  <script>jQuery.noConflict()</script>
-  <!-- Load local QUnit (grunt requires v1.0.0 or newer). -->
-  <link rel="stylesheet" href="../libs/qunit/qunit.css" media="screen">
-  <script src="../libs/qunit/qunit.js"></script>
-  <!-- Load local lib and tests. -->
-  <script src="../src/jquery.geo.js"></script>
-  <script src="jquery.geo_test.js"></script>
-</head>
-<body>
-  <h1 id="qunit-header">jQuery Geo Test Suite</h1>
-  <h2 id="qunit-banner"></h2>
-  <div id="qunit-testrunner-toolbar"></div>
-  <h2 id="qunit-userAgent"></h2>
-  <ol id="qunit-tests"></ol>
-  <div id="qunit-fixture">
-    <span>lame test markup</span>
-    <span>normal test markup</span>
-    <span>awesome test markup</span>
-  </div>
-</body>
-</html>
diff --git a/libs/js/jquery-geo-1.0b2/test/jquery.geo_test.js b/libs/js/jquery-geo-1.0b2/test/jquery.geo_test.js
deleted file mode 100755 (executable)
index a679d73..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*global QUnit:false, module:false, test:false, asyncTest:false, expect:false*/
-/*global start:false, stop:false ok:false, equal:false, notEqual:false, deepEqual:false*/
-/*global notDeepEqual:false, strictEqual:false, notStrictEqual:false, raises:false*/
-(function($) {
-
-  module('jQuery#awesome', {
-    setup: function() {
-      this.elems = $('#qunit-fixture').children();
-    }
-  });
-
-  test('is chainable', 1, function() {
-    // Not a bad test to run on collection methods.
-    strictEqual(this.elems.awesome(), this.elems, 'should be chaninable');
-  });
-
-  test('is awesome', 1, function() {
-    strictEqual(this.elems.awesome().text(), 'awesomeawesomeawesome', 'should be thoroughly awesome');
-  });
-
-  module('jQuery.awesome');
-
-  test('is awesome', 1, function() {
-    strictEqual($.awesome(), 'awesome', 'should be thoroughly awesome');
-  });
-
-  module(':awesome selector', {
-    setup: function() {
-      this.elems = $('#qunit-fixture').children();
-    }
-  });
-
-  test('is awesome', 1, function() {
-    // Use deepEqual & .get() when comparing jQuery objects.
-    deepEqual(this.elems.filter(':awesome').get(), this.elems.last().get(), 'knows awesome when it sees it');
-  });
-
-}(jQuery));